Opened 15 years ago

Closed 15 years ago

#3403 closed Task (fixed)

Adding 'hasAttribute' method

Reported by: Garry Yao Owned by: Martin Kou
Priority: Normal Milestone: CKEditor 3.0
Component: General Version:
Keywords: Confirmed Review+ Cc:

Description

There's some cases where it's necessary to check whether a attributed is intrinsic OR assigned dynamically on an element.

Attachments (4)

3403.patch (2.9 KB) - added by Martin Kou 15 years ago.
test_element_hasAttribute.patch (1.9 KB) - added by Garry Yao 15 years ago.
3403_2.patch (3.5 KB) - added by Martin Kou 15 years ago.
3403_3.patch (3.7 KB) - added by Martin Kou 15 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 15 years ago by Garry Yao

Owner: set to Martin Kou

Much of our dialog fields play the role of the getter/setter of the DOM element node attribute, and we always use the following way to check the existence of a specified attribute:

if( element.getAttribute( 'maxLength' ) )
  // Assign the value to dialog fields

It works in most cases but has one problem:

  • Some attribute like 'maxLength' and 'size' has their inital value in IE, which we want to ignore instead of taking them, see #3008 for a concrete example of this.

comment:2 Changed 15 years ago by Martin Kou

Status: newassigned

Changed 15 years ago by Martin Kou

Attachment: 3403.patch added

comment:3 Changed 15 years ago by Martin Kou

Keywords: Review? added

This removes the ieDefaults hacks in the forms plugin cleanly.

Changed 15 years ago by Garry Yao

comment:4 Changed 15 years ago by Garry Yao

Keywords: Review- added; Review? removed

The new method doesn't cover certain special attributes in sense of the attached TC in IE.

Changed 15 years ago by Martin Kou

Attachment: 3403_2.patch added

comment:5 Changed 15 years ago by Martin Kou

Keywords: Review? added; Review- removed

I'm not sure if this is worth it - the core code size is being increased to check for fringe cases. But anyway this should pass the tests.

comment:6 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

You are right Martin, we don't need it by default into the core.

Let's proceed in this way... let's have a basic implementation in the core and then override it inside the forms plugin, for IE only.

Changed 15 years ago by Martin Kou

Attachment: 3403_3.patch added

comment:7 Changed 15 years ago by Martin Kou

Keywords: Review? added; Review- removed

comment:8 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

comment:9 Changed 15 years ago by Martin Kou

Resolution: fixed
Status: assignedclosed

Fixed with [3438].

Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy