Changeset 146967 in webkit


Ignore:
Timestamp:
Mar 26, 2013 11:39:36 PM (11 years ago)
Author:
tasak@google.com
Message:

[shadow] styleForText should consider the case where parent node has no style
https://bugs.webkit.org/show_bug.cgi?id=113275

Source/WebCore:

If a text node is distributed, its parent node for rendering and
styling might have no style. In the case, styleForText should return
default style.

Reviewed by Hajime Morrita.

Test: fast/dom/shadow/text-node-distributed-crash.html

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::styleForText):
Check whether a parent node has any style or not. If not, return
default style. This is the same behavior as styleForElement.

LayoutTests:

Reviewed by Hajime Morrita.

  • fast/dom/shadow/text-node-distributed-crash-expected.txt: Added.
  • fast/dom/shadow/text-node-distributed-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r146966 r146967  
     12013-03-26  Takashi Sakamoto  <tasak@google.com>
     2
     3        [shadow] styleForText should consider the case where parent node has no style
     4        https://bugs.webkit.org/show_bug.cgi?id=113275
     5
     6        Reviewed by Hajime Morrita.
     7
     8        * fast/dom/shadow/text-node-distributed-crash-expected.txt: Added.
     9        * fast/dom/shadow/text-node-distributed-crash.html: Added.
     10
    1112013-03-26  Yury Semikhatsky  <yurys@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r146965 r146967  
     12013-03-26  Takashi Sakamoto  <tasak@google.com>
     2
     3        [shadow] styleForText should consider the case where parent node has no style
     4        https://bugs.webkit.org/show_bug.cgi?id=113275
     5
     6        If a text node is distributed, its parent node for rendering and
     7        styling might have no style. In the case, styleForText should return
     8        default style.
     9
     10        Reviewed by Hajime Morrita.
     11
     12        Test: fast/dom/shadow/text-node-distributed-crash.html
     13
     14        * css/StyleResolver.cpp:
     15        (WebCore::StyleResolver::styleForText):
     16        Check whether a parent node has any style or not. If not, return
     17        default style. This is the same behavior as styleForElement.
     18
    1192013-03-26  Takeshi Yoshino  <tyoshino@chromium.org>
    220
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r146953 r146967  
    12731273    NodeRenderingContext context(textNode);
    12741274    Node* parentNode = context.parentNodeForRenderingAndStyle();
    1275     return context.resetStyleInheritance() || !parentNode ?
     1275    return context.resetStyleInheritance() || !parentNode || !parentNode->renderStyle() ?
    12761276        defaultStyleForElement() : parentNode->renderStyle();
    12771277}
Note: See TracChangeset for help on using the changeset viewer.