Changeset 151647 in webkit


Ignore:
Timestamp:
Jun 17, 2013 11:05:19 AM (11 years ago)
Author:
igor.o@sisa.samsung.com
Message:

[CSS Regions] ::before and ::after pseudo-elements are not displayed for regions
https://bugs.webkit.org/show_bug.cgi?id=80163

Source/WebCore:

When the implementation of the before/after was moved to the DOM, before/after generated
content stoppped to work with css regions. The problem happens when:

  1. RenderRegion can not have children and when the PseudoElement::attach tries to create a renderer for the

generated content, it fails.

  1. RenderRegion::canHaveGeneratedChildren should not be false because regions can have generated content.

Reviewed by David Hyatt.

Tests: fast/regions/region-dynamic-after-before.html

fast/regions/region-generated-content-before-after.html

  • dom/NodeRenderingContext.cpp:

(WebCore::NodeRenderingContext::shouldCreateRenderer):

  • rendering/RenderRegion.h:

LayoutTests:

Add two simple tests verifying if region works with before/after generated content.

Reviewed by David Hyatt.

  • fast/regions/region-dynamic-after-before.html: Added.
  • fast/regions/region-generated-content-before-after.html: Added.
  • platform/mac/fast/regions/region-dynamic-after-before-expected.png: Added.
  • platform/mac/fast/regions/region-dynamic-after-before-expected.txt: Added.
  • platform/mac/fast/regions/region-generated-content-before-after-expected.png: Added.
  • platform/mac/fast/regions/region-generated-content-before-after-expected.txt: Added.
Location:
trunk
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r151641 r151647  
     12013-06-17  Igor Oliveira  <igor.o@sisa.samsung.com>
     2
     3        [CSS Regions] ::before and ::after pseudo-elements are not displayed for regions
     4        https://bugs.webkit.org/show_bug.cgi?id=80163
     5
     6        Add two simple tests verifying if region works with before/after generated content.
     7
     8        Reviewed by David Hyatt.
     9
     10        * fast/regions/region-dynamic-after-before.html: Added.
     11        * fast/regions/region-generated-content-before-after.html: Added.
     12        * platform/mac/fast/regions/region-dynamic-after-before-expected.png: Added.
     13        * platform/mac/fast/regions/region-dynamic-after-before-expected.txt: Added.
     14        * platform/mac/fast/regions/region-generated-content-before-after-expected.png: Added.
     15        * platform/mac/fast/regions/region-generated-content-before-after-expected.txt: Added.
     16
    1172013-06-17  Sergio Villar Senin  <svillar@igalia.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r151643 r151647  
     12013-06-17  Igor Oliveira  <igor.o@sisa.samsung.com>
     2
     3        [CSS Regions] ::before and ::after pseudo-elements are not displayed for regions
     4        https://bugs.webkit.org/show_bug.cgi?id=80163
     5
     6        When the implementation of the before/after was moved to the DOM, before/after generated
     7        content stoppped to work with css regions. The problem happens when:
     8        1. RenderRegion can not have children and when the PseudoElement::attach tries to create a renderer for the
     9        generated content, it fails.
     10        2. RenderRegion::canHaveGeneratedChildren should not be false because regions can have generated content.
     11
     12        Reviewed by David Hyatt.
     13
     14        Tests: fast/regions/region-dynamic-after-before.html
     15               fast/regions/region-generated-content-before-after.html
     16
     17        * dom/NodeRenderingContext.cpp:
     18        (WebCore::NodeRenderingContext::shouldCreateRenderer):
     19        * rendering/RenderRegion.h:
     20
    1212013-06-17  Michael Brüning  <michael.bruning@digia.com>
    222
  • trunk/Source/WebCore/dom/NodeRenderingContext.cpp

    r151282 r151647  
    195195    if (!parentRenderer)
    196196        return false;
    197     if (!parentRenderer->canHaveChildren()) {
     197    if (!parentRenderer->canHaveChildren()
     198        && !(m_node->isPseudoElement() && parentRenderer->isRenderRegion())) {
    198199        if (parentRenderer->canDOMChildrenHaveRenderParent()) {
    199200            // In a region, only the children that need to be in a flow thread should have a renderer.
  • trunk/Source/WebCore/rendering/RenderRegion.h

    r150761 r151647  
    148148    virtual bool canHaveChildren() const OVERRIDE { return false; }
    149149    virtual bool canDOMChildrenHaveRenderParent() const OVERRIDE { return true; }
     150    virtual bool canHaveGeneratedChildren() const OVERRIDE { return true; }
    150151
    151152    virtual void insertedIntoTree() OVERRIDE;
Note: See TracChangeset for help on using the changeset viewer.