Changeset 52184 in webkit


Ignore:
Timestamp:
Dec 15, 2009 6:02:12 PM (14 years ago)
Author:
rolandsteiner@chromium.org
Message:

Fix crash when encountering illegal HTML within a continuation inside <ruby>.
(https://bugs.webkit.org/show_bug.cgi?id=32316)

Reviewed by Adam Barth.

Avoid having the anonymous blocks utilized in the ruby renderers being
re-used as continuation blocks.
Avoid having ruby runs collected as "leftover blocks".

Test: fast/ruby/ruby-illegal.html

WebCore:

  • rendering/RenderRuby.h:

(WebCore::RenderRubyAsInline::removeLeftoverAnonymousBlock): mustn't be called
(WebCore::RenderRubyAsInline::isRuby): made private
(WebCore::RenderRubyAsInline::renderName): made private
(WebCore::RenderRubyAsInline::createsAnonymousWrapper): return true
(WebCore::RenderRubyAsBlock::removeLeftoverAnonymousBlock): mustn't be called
(WebCore::RenderRubyAsBlock::isRuby): made private
(WebCore::RenderRubyAsBlock::renderName): made private
(WebCore::RenderRubyAsBlock::createsAnonymousWrapper): return true

  • rendering/RenderRubyRun.h:

(WebCore::RenderRubyRun::removeLeftoverAnonymousBlock): avoid
(WebCore::RenderRubyRun::isRubyRun): made private
(WebCore::RenderRubyRun::renderName): made private
(WebCore::RenderRubyRun::createsAnonymousWrapper): return true

LayoutTests:

  • fast/ruby/ruby-illegal-expected.txt: Added.
  • fast/ruby/ruby-illegal.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r52174 r52184  
     12009-12-13  Roland Steiner  <rolandsteiner@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Fix crash when encountering illegal HTML within a continuation inside <ruby>.
     6        (https://bugs.webkit.org/show_bug.cgi?id=32316)
     7
     8        Avoid having the anonymous blocks utilized in the ruby renderers being
     9        re-used as continuation blocks.
     10        Avoid having ruby runs collected as "leftover blocks".
     11
     12        * fast/ruby/ruby-illegal-expected.txt: Added.
     13        * fast/ruby/ruby-illegal.html: Added.
     14
    1152009-12-15  Dan Bernstein  <mitz@apple.com>
    216
  • trunk/WebCore/ChangeLog

    r52177 r52184  
     12009-12-13  Roland Steiner  <rolandsteiner@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Fix crash when encountering illegal HTML within a continuation inside <ruby>.
     6        (https://bugs.webkit.org/show_bug.cgi?id=32316)
     7
     8        Avoid having the anonymous blocks utilized in the ruby renderers being
     9        re-used as continuation blocks.
     10        Avoid having ruby runs collected as "leftover blocks".
     11
     12        Test: fast/ruby/ruby-illegal.html
     13
     14        * rendering/RenderRuby.h:
     15        (WebCore::RenderRubyAsInline::removeLeftoverAnonymousBlock): mustn't be called
     16        (WebCore::RenderRubyAsInline::isRuby): made private
     17        (WebCore::RenderRubyAsInline::renderName): made private
     18        (WebCore::RenderRubyAsInline::createsAnonymousWrapper): return true
     19        (WebCore::RenderRubyAsBlock::removeLeftoverAnonymousBlock): mustn't be called
     20        (WebCore::RenderRubyAsBlock::isRuby): made private
     21        (WebCore::RenderRubyAsBlock::renderName): made private
     22        (WebCore::RenderRubyAsBlock::createsAnonymousWrapper): return true
     23        * rendering/RenderRubyRun.h:
     24        (WebCore::RenderRubyRun::removeLeftoverAnonymousBlock): avoid
     25        (WebCore::RenderRubyRun::isRubyRun): made private
     26        (WebCore::RenderRubyRun::renderName): made private
     27        (WebCore::RenderRubyRun::createsAnonymousWrapper): return true
     28
    1292009-12-15  Nate Chapin  <japhet@chromium.org>
    230
  • trunk/WebCore/rendering/RenderRuby.h

    r50397 r52184  
    5555    virtual ~RenderRubyAsInline();
    5656
    57     virtual const char* renderName() const { return "RenderRuby (inline)"; }
    58 
    59     virtual bool isRuby() const { return true; }
    60 
    6157    virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
    6258    virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
    6359    virtual void removeChild(RenderObject* child);
     60
     61private:
     62    virtual bool isRuby() const { return true; }
     63    virtual const char* renderName() const { return "RenderRuby (inline)"; }
     64    virtual bool createsAnonymousWrapper() const { return true; }
     65    virtual void removeLeftoverAnonymousBlock(RenderBlock*) { ASSERT_NOT_REACHED(); }
    6466};
    6567
     
    7072    virtual ~RenderRubyAsBlock();
    7173
    72     virtual const char* renderName() const { return "RenderRuby (block)"; }
    73 
    74     virtual bool isRuby() const { return true; }
    75 
    7674    virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
    7775    virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
    7876    virtual void removeChild(RenderObject* child);
     77
     78private:
     79    virtual bool isRuby() const { return true; }
     80    virtual const char* renderName() const { return "RenderRuby (block)"; }
     81    virtual bool createsAnonymousWrapper() const { return true; }
     82    virtual void removeLeftoverAnonymousBlock(RenderBlock*) { ASSERT_NOT_REACHED(); }
    7983};
    8084
  • trunk/WebCore/rendering/RenderRubyRun.h

    r51169 r52184  
    4949    virtual void destroy();
    5050
    51     virtual const char* renderName() const { return "RenderRubyRun (anonymous)"; }
    52 
    53     virtual bool isRubyRun() const { return true; }
    54 
    5551    bool hasRubyText() const;
    5652    bool hasRubyBase() const;
     
    7167protected:
    7268    RenderRubyBase* createRubyBase() const;
    73    
     69
    7470private:
     71    virtual bool isRubyRun() const { return true; }
     72    virtual const char* renderName() const { return "RenderRubyRun (anonymous)"; }
     73    virtual bool createsAnonymousWrapper() const { return true; }
     74    virtual void removeLeftoverAnonymousBlock(RenderBlock*) { }
     75
    7576    bool m_beingDestroyed;
    7677};
Note: See TracChangeset for help on using the changeset viewer.