Opened 14 years ago
Closed 14 years ago
#6253 closed Bug (fixed)
BIDI: creating a Numbered/Bulleted list causing improper behavior on bidi
Reported by: | Satya Minnekanti | Owned by: | Tobiasz Cudnik |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.4.2 |
Component: | Core : Lists | Version: | 3.4 |
Keywords: | IBM | Cc: | Damian, joek, jamcunni@… |
Description
To reproduce the defect
- Open Language sample and select Language as Hebrew or Arabic.
- Type first line of text and press Enter.
- Click LTR icon and enter text in the second line.
- Select 1st & 2nd line of data and click on Numbers/Bullets icon.
Error: These 2 lines data all become "LTR" text.
Expected result:
The 1st line data is keeping "RTL" with bullet on the right, & 2nd line data is keeping "LTR" with bullet on the left.
Attachments (6)
Change History (25)
comment:1 Changed 14 years ago by
Component: | General → Core : Lists |
---|---|
Milestone: | → CKEditor 3.4.1 |
Status: | new → confirmed |
comment:2 Changed 14 years ago by
Owner: | set to Tobiasz Cudnik |
---|---|
Status: | confirmed → assigned |
Changed 14 years ago by
Attachment: | 6253.patch added |
---|
comment:3 Changed 14 years ago by
Status: | assigned → review |
---|
comment:4 Changed 14 years ago by
Status: | review → review_failed |
---|
Changed 14 years ago by
Attachment: | 6253_2.patch added |
---|
comment:5 Changed 14 years ago by
Maybe I'm missing one case that's targeted before but why don't we leave the list creation in ignorance of the BIDI feature?
Changed 14 years ago by
Attachment: | 6253_3.patch added |
---|
comment:6 Changed 14 years ago by
Status: | review_failed → review |
---|
I've added direction support into core/dom/element class, which handles both CSS and attribute directions.
@Garry: we need lists to smartly inherit direction from elements they are created.
comment:7 Changed 14 years ago by
Status: | review → review_failed |
---|
Basically, I don't think it's necessary to pull up direction style from list items up onto the root node, even supposing that, the following logic is incorrect in a case where there's a second parent block with a different dir that wrap the 'contentBlock'.
var itemDir = contentBlock.getDirection() || editor.config.contentsLangDirection;
comment:8 Changed 14 years ago by
- Direction is read from contentBlock, not it's parent (there's no traversal to the root)
- I don't see any problems with a 'second parent' with a different direction, can you provide a TC for this ?
comment:9 Changed 14 years ago by
Cc: | jamcunni@… added |
---|
Changed 14 years ago by
Attachment: | 6253_4.patch added |
---|
comment:10 Changed 14 years ago by
Status: | review_failed → review |
---|
This one should fix the doubts about the element being nested inside an explicit direction. Also it uses more compact dom.element extensions to save space.
comment:11 Changed 14 years ago by
Status: | review → review_failed |
---|
Still the 'getDirection' method is problematic, by mixing computed style and inline style/attribute doesn't really reflects the browser's mind (in case we have !important rule). In this case it's enough to follow the same logic of BIDI plugin that depends on 'config.useComputedStyle'.
return this.getAttribute( 'dir' ) || this.getStyle( 'direction' ) || ( includeComputedDirection && this.getComputedStyle( 'direction' ) );
comment:12 Changed 14 years ago by
Another thing for performance, we don't need a separate routine to check explicitDirection, it could be instead checked along line L281 when content blocks are collected.
Changed 14 years ago by
Attachment: | 6253_5.patch added |
---|
comment:13 Changed 14 years ago by
Status: | review_failed → review |
---|
- Computed state is used according to the config setting.
- Determining direction moved to the previous, existing loop.
comment:14 Changed 14 years ago by
Status: | review → review_failed |
---|
The 'getDirection' should be something like below?
getDirection : function( useComputed ) { return useComputed? this.getComputedStyle( 'direction' ) : this.getStyle( 'direction' ) || this.getAttribute( 'dir' ); }
Changed 14 years ago by
Attachment: | 6253_6.patch added |
---|
comment:15 follow-up: 16 Changed 14 years ago by
Does this ticket cover the following test case or should I create a new ticket?
Steps:
- Open the Ajax sample.
- Create a Bulleted list containing 4 items.
- Select any 2 of the list items & click on the RTL icon.
Expected: Only the selected list items should have RTL language direction.
Actual: The whole list has RTL language direction.
comment:16 Changed 14 years ago by
Status: | review_failed → review |
---|
Replying to james c:
Does this ticket cover the following test case or should I create a new ticket?
Steps:
- Open the Ajax sample.
- Create a Bulleted list containing 4 items.
- Select any 2 of the list items & click on the RTL icon.
Expected: Only the selected list items should have RTL language direction.
Actual: The whole list has RTL language direction.
It's related to #6235, where we have a patch for it, but in my opinion it should have a separated ticket.
comment:18 Changed 14 years ago by
Status: | review → review_passed |
---|
comment:19 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed with [5963].
The
direction
CSS property must also be taken into consideration.