Ticket #3403 (closed Task: fixed)

Opened 6 years ago

Last modified 5 years ago

Adding 'hasAttribute' method

Reported by: garry.yao Owned by: martinkou
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

3403.patch (2.9 KB) - added by martinkou 6 years ago.
test_element_hasAttribute.patch (1.9 KB) - added by garry.yao 6 years ago.
3403_2.patch (3.5 KB) - added by martinkou 6 years ago.
3403_3.patch (3.7 KB) - added by martinkou 5 years ago.

Change History

comment:1 Changed 6 years ago by garry.yao

  • Owner set to martinkou

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 6 years ago by martinkou

  • Status changed from new to assigned

Changed 6 years ago by martinkou

comment:3 Changed 6 years ago by martinkou

  • Keywords Review? added

This removes the ieDefaults hacks in the forms plugin cleanly.

Changed 6 years ago by garry.yao

comment:4 Changed 6 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 6 years ago by martinkou

comment:5 Changed 6 years ago by martinkou

  • 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 6 years ago by fredck

  • 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 5 years ago by martinkou

comment:7 Changed 5 years ago by martinkou

  • Keywords Review? added; Review- removed

comment:8 Changed 5 years ago by fredck

  • Keywords Review+ added; Review? removed

comment:9 Changed 5 years ago by martinkou

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed with [3438].

Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy