[CSSRegions] Use RenderStyle::hasFlowFrom when needed
authormihnea@adobe.com <mihnea@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Oct 2013 08:28:11 +0000 (08:28 +0000)
committermihnea@adobe.com <mihnea@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Oct 2013 08:28:11 +0000 (08:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122543

Reviewed by David Hyatt.

Rename RenderStyle::hasStyleRegion -> RenderStyle::hasFlowFrom.
Use RenderStyle::hasFlowFrom() helper function instead of directly
checking the value of RenderStyle::regionThread().

No change of functionality, covered by existing tests.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::contentToCSSValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::didAttachRenderers):
* dom/PseudoElement.h:
(WebCore::pseudoElementRendererIsNeeded):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::shouldBeNormalFlowOnly):
* rendering/style/RenderStyle.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157779 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/dom/PseudoElement.cpp
Source/WebCore/dom/PseudoElement.h
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/style/RenderStyle.h

index 0317cff..26e13be 100644 (file)
@@ -1,3 +1,31 @@
+2013-10-22  Mihnea Ovidenie  <mihnea@adobe.com>
+
+        [CSSRegions] Use RenderStyle::hasFlowFrom when needed
+        https://bugs.webkit.org/show_bug.cgi?id=122543
+
+        Reviewed by David Hyatt.
+
+        Rename RenderStyle::hasStyleRegion -> RenderStyle::hasFlowFrom.
+        Use RenderStyle::hasFlowFrom() helper function instead of directly
+        checking the value of RenderStyle::regionThread().
+
+        No change of functionality, covered by existing tests.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::contentToCSSValue):
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::adjustRenderStyle):
+        * dom/PseudoElement.cpp:
+        (WebCore::PseudoElement::didAttachRenderers):
+        * dom/PseudoElement.h:
+        (WebCore::pseudoElementRendererIsNeeded):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::shouldBeNormalFlowOnly):
+        * rendering/style/RenderStyle.h:
+
 2013-10-21  Brent Fulgham  <bfulgham@apple.com>
 
         [WIN] Properly support reverse animations without needing software fallback.
index ea66e7c..88c0d7c 100644 (file)
@@ -1499,7 +1499,7 @@ static PassRefPtr<CSSValue> contentToCSSValue(const RenderStyle* style)
         } else if (contentData->isText())
             list->append(cssValuePool().createValue(static_cast<const TextContentData*>(contentData)->text(), CSSPrimitiveValue::CSS_STRING));
     }
-    if (!style->regionThread().isNull())
+    if (style->hasFlowFrom())
         list->append(cssValuePool().createValue(style->regionThread(), CSSPrimitiveValue::CSS_STRING));
     return list.release();
 }
@@ -2844,7 +2844,7 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propert
                 return cssValuePool().createIdentifierValue(CSSValueNone);
             return cssValuePool().createValue(style->flowThread(), CSSPrimitiveValue::CSS_STRING);
         case CSSPropertyWebkitFlowFrom:
-            if (style->regionThread().isNull())
+            if (!style->hasFlowFrom())
                 return cssValuePool().createIdentifierValue(CSSValueNone);
             return cssValuePool().createValue(style->regionThread(), CSSPrimitiveValue::CSS_STRING);
         case CSSPropertyWebkitRegionFragment:
index e585898..caf560b 100644 (file)
@@ -1268,7 +1268,7 @@ void StyleResolver::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty
         || style->hasBlendMode()
         || style->position() == StickyPosition
         || (style->position() == FixedPosition && e && e->document().page() && e->document().page()->settings().fixedPositionCreatesStackingContext())
-        || style->hasStyleRegion()
+        || style->hasFlowFrom()
         ))
         style->setZIndex(0);
 
index ed23eb7..a75632b 100644 (file)
@@ -80,7 +80,7 @@ PassRefPtr<RenderStyle> PseudoElement::customStyleForRenderer()
 void PseudoElement::didAttachRenderers()
 {
     RenderElement* renderer = this->renderer();
-    if (!renderer || !renderer->style()->regionThread().isEmpty())
+    if (!renderer || renderer->style()->hasFlowFrom())
         return;
 
     RenderStyle* style = renderer->style();
index dd995aa..97cf8ee 100644 (file)
@@ -74,7 +74,7 @@ const QualifiedName& pseudoElementTagName();
 
 inline bool pseudoElementRendererIsNeeded(const RenderStyle* style)
 {
-    return style && style->display() != NONE && (style->contentData() || !style->regionThread().isEmpty());
+    return style && style->display() != NONE && (style->contentData() || style->hasFlowFrom());
 }
 
 void isPseudoElement(const PseudoElement&); // Catch unnecessary runtime check of type known at compile time.
index fa8ede8..b73ec25 100644 (file)
@@ -2589,7 +2589,7 @@ void RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded()
     if (renderNamedFlowFragment() || isRenderNamedFlowFragment())
         return;
 
-    if (document().cssRegionsEnabled() && style()->isDisplayRegionType() && !style()->regionThread().isEmpty()) {
+    if (document().cssRegionsEnabled() && style()->isDisplayRegionType() && style()->hasFlowFrom()) {
         RenderNamedFlowFragment* flowFragment = new RenderNamedFlowFragment(document());
         flowFragment->setStyleForNamedFlowFragment(style());
         setRenderNamedFlowFragment(flowFragment);
index c4b2191..cfc1b8c 100644 (file)
@@ -5967,7 +5967,7 @@ bool RenderLayer::shouldBeNormalFlowOnly() const
 #endif
         && !isTransparent()
         && !needsCompositedScrolling()
-        && !renderer().style()->hasStyleRegion()
+        && !renderer().style()->hasFlowFrom()
         ;
 }
 
index 5f94cc4..e9d7be6 100644 (file)
@@ -893,7 +893,7 @@ public:
     // End CSS3 Getters
 
     const AtomicString& flowThread() const { return rareNonInheritedData->m_flowThread; }
-    bool hasStyleRegion() const { return !rareNonInheritedData->m_regionThread.isNull(); }
+    bool hasFlowFrom() const { return !rareNonInheritedData->m_regionThread.isNull(); }
     const AtomicString& regionThread() const { return rareNonInheritedData->m_regionThread; }
     RegionFragment regionFragment() const { return static_cast<RegionFragment>(rareNonInheritedData->m_regionFragment); }