[Webkit-unassigned] [Bug 21440] CSS 2.1 failure: bidi-override ignored

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 15 16:56:57 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=21440


Xiaomei Ji <xji at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hyatt at apple.com




--- Comment #4 from Xiaomei Ji <xji at chromium.org>  2011-03-15 16:56:56 PST ---
>From CSS spec on unicode-bidi 
http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi:
"bidi-override:
For inline-level elements this creates an override. For block container elements this creates an override for inline-level descendants not within another block-level, table-cell, table-caption, or inline-block element. "

Given the example <div style="direction:rtl; unicode-bidi:bidi-override">abc <div>def</div></div>. The (rtl unicode bidi override) style is not populated to the text "abc" due to such non-inherited style is lost when creating anonymous block (for "abc") in RenderBlock::createAnonymousBlock().

The following change seems fix the issue:
Index: Source/WebCore/rendering/RenderBlock.cpp
===================================================================
--- Source/WebCore/rendering/RenderBlock.cpp    (revision 81184)
+++ Source/WebCore/rendering/RenderBlock.cpp    (working copy)
@@ -241,6 +241,7 @@
         if (child->isAnonymousBlock()) {
             RefPtr<RenderStyle> newStyle = RenderStyle::create();
             newStyle->inheritFrom(style());
+newStyle->setUnicodeBidi(style()->unicodeBidi());
             if (style()->specifiesColumns()) {
                 if (child->style()->specifiesColumns())
                     newStyle->inheritColumnPropertiesFrom(style());
@@ -5848,6 +5849,7 @@
 {
     RefPtr<RenderStyle> newStyle = RenderStyle::create();
     newStyle->inheritFrom(style());
+newStyle->setUnicodeBidi(style()->unicodeBidi());

     RenderBlock* newBox = 0;
     if (isFlexibleBox) {


The first change is inside RenderBlock::styleDidChange(), and it renders the page correctly when reload (recalc style).

The 2nd change is inside RenderBlock::createAnonymousBlock(), and it renders the page correctly when page first load.

But I am not sure whether these are the correct places to change, and whether we need to change other places (such as RenderRubyRun::createRubyBase() and RenderInline::addChildIgnoringContinuation()) where anonymous blocks are created as well (if so, some codes might need cleanup to call RenderBlock::createAnonymousBlock() instead of creating anonymous block in place).

Looks like we created several types of anonymous blocks in the code (display type is BOX, BLOCK, INLINE_BLOCK), what are the difference among them? Which should inherit unicode-bidi, which should not? I read http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level and http://www.w3.org/TR/CSS21/visuren.html#anonymous, but did not get much idea.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list