Changeset 81807 in webkit


Ignore:
Timestamp:
Mar 23, 2011 2:27:00 PM (13 years ago)
Author:
xji@chromium.org
Message:

2011-03-23 Xiaomei Ji <xji@chromium.org>

Reviewed by David Hyatt.

Preserve unicode-bidi:bidi-override in anonymous block.
https://bugs.webkit.org/show_bug.cgi?id=21440

unicode-bidi:bidi-override should be preserved in anonymous block
according to http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi.

Introduce a helper function RenderStyle()::createAnonymousStyle() which
creates a default RenderStyle, inherits the inherited style from parent,
and inherit unicode-bidi:bidi-override from parent.
And replace the style creation when anonymous block is created.

Note: the TABLE releated anonymous blocks are untouched, including:
TABLE, TABLE_CELL, TABLE_ROW, TABLE_ROW_GROUP anonymous blocks created in
RenderObject, RenderTable, RenderTableRow, and RenderTableSection,
due to the expected behavior is not clear.
Please refer to https://bugs.webkit.org/show_bug.cgi?id=56594.


Test: fast/css/bidi-override-in-anonymous-block.html

  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::styleDidChange): (WebCore::RenderBlock::removeChild): (WebCore::RenderBlock::createAnonymousBlock): (WebCore::RenderBlock::createAnonymousColumnsBlock): (WebCore::RenderBlock::createAnonymousColumnSpanBlock):
  • rendering/RenderInline.cpp: (WebCore::RenderInline::addChildIgnoringContinuation):
  • rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::createRubyBase): (WebCore::RenderRubyRun::staticCreateRubyRun):
  • rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::createAnonymousStyle):
  • rendering/style/RenderStyle.h:

2011-03-23 Xiaomei Ji <xji@chromium.org>

Reviewed by David Hyatt.

Preserve unicode-bidi:bidi-override in anonymous block.
https://bugs.webkit.org/show_bug.cgi?id=21440

  • fast/css/bidi-override-in-anonymous-block.html: Added.
  • platform/mac/fast/css/bidi-override-in-anonymous-block-expected.txt: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r81806 r81807  
     12011-03-23  Xiaomei Ji  <xji@chromium.org>
     2
     3        Reviewed by David Hyatt.
     4
     5        Preserve unicode-bidi:bidi-override in anonymous block.
     6        https://bugs.webkit.org/show_bug.cgi?id=21440
     7
     8        * fast/css/bidi-override-in-anonymous-block.html: Added.
     9        * platform/mac/fast/css/bidi-override-in-anonymous-block-expected.txt: Added.
     10
    1112011-03-23  Mihai Parparita  <mihaip@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r81802 r81807  
     12011-03-23  Xiaomei Ji  <xji@chromium.org>
     2
     3        Reviewed by David Hyatt.
     4
     5        Preserve unicode-bidi:bidi-override in anonymous block.
     6        https://bugs.webkit.org/show_bug.cgi?id=21440
     7
     8        unicode-bidi:bidi-override should be preserved in anonymous block
     9        according to http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi.
     10
     11        Introduce a helper function RenderStyle()::createAnonymousStyle() which
     12        creates a default RenderStyle, inherits the inherited style from parent,
     13        and inherit unicode-bidi:bidi-override from parent.
     14        And replace the style creation when anonymous block is created.
     15
     16        Note: the TABLE releated anonymous blocks are untouched, including:
     17        TABLE, TABLE_CELL, TABLE_ROW, TABLE_ROW_GROUP anonymous blocks created in
     18        RenderObject, RenderTable, RenderTableRow, and RenderTableSection,
     19        due to the expected behavior is not clear.
     20        Please refer to https://bugs.webkit.org/show_bug.cgi?id=56594.
     21       
     22        Test: fast/css/bidi-override-in-anonymous-block.html
     23
     24        * rendering/RenderBlock.cpp:
     25        (WebCore::RenderBlock::styleDidChange):
     26        (WebCore::RenderBlock::removeChild):
     27        (WebCore::RenderBlock::createAnonymousBlock):
     28        (WebCore::RenderBlock::createAnonymousColumnsBlock):
     29        (WebCore::RenderBlock::createAnonymousColumnSpanBlock):
     30        * rendering/RenderInline.cpp:
     31        (WebCore::RenderInline::addChildIgnoringContinuation):
     32        * rendering/RenderRubyRun.cpp:
     33        (WebCore::RenderRubyRun::createRubyBase):
     34        (WebCore::RenderRubyRun::staticCreateRubyRun):
     35        * rendering/style/RenderStyle.cpp:
     36        (WebCore::RenderStyle::createAnonymousStyle):
     37        * rendering/style/RenderStyle.h:
     38
    1392011-03-23  David Hyatt  <hyatt@apple.com>
    240
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r81802 r81807  
    241241    for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
    242242        if (child->isAnonymousBlock()) {
    243             RefPtr<RenderStyle> newStyle = RenderStyle::create();
    244             newStyle->inheritFrom(style());
     243            RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
    245244            if (style()->specifiesColumns()) {
    246245                if (child->style()->specifiesColumns())
     
    977976            // column span flag if it is set.
    978977            ASSERT(!inlineChildrenBlock->continuation());
    979             RefPtr<RenderStyle> newStyle = RenderStyle::create();
    980             newStyle->inheritFrom(style());
     978            RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
    981979            children()->removeChildNode(this, inlineChildrenBlock, inlineChildrenBlock->hasLayer());
    982980            inlineChildrenBlock->setStyle(newStyle);
     
    59115909RenderBlock* RenderBlock::createAnonymousBlock(bool isFlexibleBox) const
    59125910{
    5913     RefPtr<RenderStyle> newStyle = RenderStyle::create();
    5914     newStyle->inheritFrom(style());
     5911    RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
    59155912
    59165913    RenderBlock* newBox = 0;
     
    59385935RenderBlock* RenderBlock::createAnonymousColumnsBlock() const
    59395936{
    5940     RefPtr<RenderStyle> newStyle = RenderStyle::create();
    5941     newStyle->inheritFrom(style());
     5937    RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
    59425938    newStyle->inheritColumnPropertiesFrom(style());
    59435939    newStyle->setDisplay(BLOCK);
     
    59505946RenderBlock* RenderBlock::createAnonymousColumnSpanBlock() const
    59515947{
    5952     RefPtr<RenderStyle> newStyle = RenderStyle::create();
    5953     newStyle->inheritFrom(style());
     5948    RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
    59545949    newStyle->setColumnSpan(true);
    59555950    newStyle->setDisplay(BLOCK);
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r81684 r81807  
    202202        // |newChild|.  We then make that block box a continuation of this inline.  We take all of
    203203        // the children after |beforeChild| and put them in a clone of this object.
    204         RefPtr<RenderStyle> newStyle = RenderStyle::create();
    205         newStyle->inheritFrom(style());
     204        RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
    206205        newStyle->setDisplay(BLOCK);
    207206
  • trunk/Source/WebCore/rendering/RenderRubyRun.cpp

    r79629 r81807  
    195195{
    196196    RenderRubyBase* rb = new (renderArena()) RenderRubyBase(document() /* anonymous */);
    197     RefPtr<RenderStyle> newStyle = RenderStyle::create();
    198     newStyle->inheritFrom(style());
     197    RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
    199198    newStyle->setDisplay(BLOCK);
    200199    newStyle->setTextAlign(CENTER); // FIXME: use WEBKIT_CENTER?
     
    207206    ASSERT(parentRuby && parentRuby->isRuby());
    208207    RenderRubyRun* rr = new (parentRuby->renderArena()) RenderRubyRun(parentRuby->document() /* anonymous */);
    209     RefPtr<RenderStyle> newStyle = RenderStyle::create();
    210     newStyle->inheritFrom(parentRuby->style());
     208    RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parentRuby->style());
    211209    newStyle->setDisplay(INLINE_BLOCK);
    212210    rr->setStyle(newStyle.release());
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r81802 r81807  
    5555{
    5656    return adoptRef(new RenderStyle(true));
     57}
     58
     59PassRefPtr<RenderStyle> RenderStyle::createAnonymousStyle(const RenderStyle* parentStyle)
     60{
     61    RefPtr<RenderStyle> newStyle = RenderStyle::create();
     62    newStyle->inheritFrom(parentStyle);
     63    newStyle->inheritUnicodeBidiFrom(parentStyle);
     64    return newStyle;
    5765}
    5866
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r81684 r81807  
    314314    static PassRefPtr<RenderStyle> create();
    315315    static PassRefPtr<RenderStyle> createDefaultStyle();
     316    static PassRefPtr<RenderStyle> createAnonymousStyle(const RenderStyle* parentStyle);
    316317    static PassRefPtr<RenderStyle> clone(const RenderStyle*);
    317318
     
    13231324
    13241325private:
     1326    void inheritUnicodeBidiFrom(const RenderStyle* parent) { noninherited_flags._unicodeBidi = parent->noninherited_flags._unicodeBidi; }
    13251327    void getShadowExtent(const ShadowData*, int& top, int& right, int& bottom, int& left) const;
    13261328    void getShadowHorizontalExtent(const ShadowData*, int& left, int& right) const;
Note: See TracChangeset for help on using the changeset viewer.