[CSSRegions]Parse -webkit-region-break(after, before, inside)
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Aug 2011 19:27:13 +0000 (19:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Aug 2011 19:27:13 +0000 (19:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=66559

Patch by Mihnea Ovidenie <mihnea@adobe.com> on 2011-08-19
Reviewed by David Hyatt.

Source/WebCore:

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSMutableStyleDeclaration.cpp:
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::regionBreakBefore):
(WebCore::InheritedFlags::regionBreakInside):
(WebCore::InheritedFlags::regionBreakAfter):
(WebCore::InheritedFlags::setRegionBreakBefore):
(WebCore::InheritedFlags::setRegionBreakInside):
(WebCore::InheritedFlags::setRegionBreakAfter):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

* fast/css/getComputedStyle/computed-style-expected.txt:
* platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* svg/css/getComputedStyle-basic-expected.txt:

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

13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/svg/css/getComputedStyle-basic-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSMutableStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h

index 7bf41ad7d45a2708f0ccab9a1b7f43f555ed1306..a3f45541e92e1b88e2729dcc225da09342291ac9 100644 (file)
@@ -1,3 +1,14 @@
+2011-08-19  Mihnea Ovidenie  <mihnea@adobe.com>
+
+        [CSSRegions]Parse -webkit-region-break(after, before, inside)
+        https://bugs.webkit.org/show_bug.cgi?id=66559
+
+        Reviewed by David Hyatt.
+
+        * fast/css/getComputedStyle/computed-style-expected.txt:
+        * platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
+        * svg/css/getComputedStyle-basic-expected.txt:
+
 2011-08-19  Mihnea Ovidenie  <mihnea@adobe.com>
 
         [CSSRegions]Content displayed in regions should not be scrollable
index c33597324136b3b5777e0a4d1ef7ef2c415f2855..b3d93075df48f9eb9454d7b1cfa330a6a1c40361 100644 (file)
@@ -189,6 +189,9 @@ zoom: 1;
 -webkit-flow: auto;
 -webkit-content-order: 0;
 -webkit-region-overflow: auto;
+-webkit-region-break-after: auto;
+-webkit-region-break-before: auto;
+-webkit-region-break-inside: auto;
 clip-path: none;
 clip-rule: nonzero;
 mask: none;
index c0d572ab92d4e177028aadc540753fc534ca2a81..f2f4daa9edae4ea52453712afed3c727b51a5866 100644 (file)
@@ -188,6 +188,9 @@ Computed style of an element whose parent's 'display' value is 'none':
     -webkit-flow: auto
     -webkit-content-order: 0
     -webkit-region-overflow: auto
+    -webkit-region-break-after: auto
+    -webkit-region-break-before: auto
+    -webkit-region-break-inside: auto
     clip-path: none
     clip-rule: nonzero
     mask: none
index 7a06506d817805a8847f10a48f68d367df98e576..fa525287ed579af85a573f18cb5a914fe4cf8d4c 100644 (file)
@@ -376,6 +376,12 @@ rect: style.getPropertyValue(-webkit-content-order) : 0
 rect: style.getPropertyCSSValue(-webkit-content-order) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-region-overflow) : auto
 rect: style.getPropertyCSSValue(-webkit-region-overflow) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-region-break-after) : auto
+rect: style.getPropertyCSSValue(-webkit-region-break-after) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-region-break-before) : auto
+rect: style.getPropertyCSSValue(-webkit-region-break-before) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-region-break-inside) : auto
+rect: style.getPropertyCSSValue(-webkit-region-break-inside) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(clip-path) : none
 rect: style.getPropertyCSSValue(clip-path) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(clip-rule) : nonzero
@@ -828,6 +834,12 @@ g: style.getPropertyValue(-webkit-content-order) : 0
 g: style.getPropertyCSSValue(-webkit-content-order) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-region-overflow) : auto
 g: style.getPropertyCSSValue(-webkit-region-overflow) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-region-break-after) : auto
+g: style.getPropertyCSSValue(-webkit-region-break-after) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-region-break-before) : auto
+g: style.getPropertyCSSValue(-webkit-region-break-before) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-region-break-inside) : auto
+g: style.getPropertyCSSValue(-webkit-region-break-inside) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(clip-path) : none
 g: style.getPropertyCSSValue(clip-path) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(clip-rule) : nonzero
index cfec0ab3738a8e0ead40458e145387309d16d3ac..2f389df4e3319ba8f07e58be230cb16ca4b7399f 100644 (file)
@@ -1,3 +1,30 @@
+2011-08-19  Mihnea Ovidenie  <mihnea@adobe.com>
+
+        [CSSRegions]Parse -webkit-region-break(after, before, inside)
+        https://bugs.webkit.org/show_bug.cgi?id=66559
+
+        Reviewed by David Hyatt.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSMutableStyleDeclaration.cpp:
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        * css/CSSPropertyNames.in:
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applyProperty):
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags::regionBreakBefore):
+        (WebCore::InheritedFlags::regionBreakInside):
+        (WebCore::InheritedFlags::regionBreakAfter):
+        (WebCore::InheritedFlags::setRegionBreakBefore):
+        (WebCore::InheritedFlags::setRegionBreakInside):
+        (WebCore::InheritedFlags::setRegionBreakAfter):
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator==):
+        * rendering/style/StyleRareNonInheritedData.h:
+
 2011-08-19  Emil A Eklund  <eae@chromium.org>
 
         Switch RenderLayer to to new layout types
index 971e597a300ed31a3026c1e77f3b03206fb849a6..4c70b17c47aae5922d4aa9ad2b4d1171e6b7484d 100644 (file)
@@ -251,7 +251,10 @@ static const int computedProperties[] = {
     CSSPropertyWebkitWritingMode,
     CSSPropertyWebkitFlow,
     CSSPropertyWebkitContentOrder,
-    CSSPropertyWebkitRegionOverflow
+    CSSPropertyWebkitRegionOverflow,
+    CSSPropertyWebkitRegionBreakAfter,
+    CSSPropertyWebkitRegionBreakBefore,
+    CSSPropertyWebkitRegionBreakInside
 #if ENABLE(SVG)
     ,
     CSSPropertyClipPath,
@@ -1068,6 +1071,12 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
             if (style->hasAutoColumnWidth())
                 return primitiveValueCache->createIdentifierValue(CSSValueAuto);
             return zoomAdjustedPixelValue(style->columnWidth(), style.get(), primitiveValueCache);
+        case CSSPropertyWebkitRegionBreakAfter:
+            return primitiveValueCache->createValue(style->regionBreakAfter());
+        case CSSPropertyWebkitRegionBreakBefore:
+            return primitiveValueCache->createValue(style->regionBreakBefore());
+        case CSSPropertyWebkitRegionBreakInside:
+            return primitiveValueCache->createValue(style->regionBreakInside());
         case CSSPropertyCursor: {
             RefPtr<CSSValueList> list;
             CursorList* cursors = style->cursors();
index 017dc6951c086054696f2048cb3529f6ffa5a419..1e6fe219ce90bf26bed95671e130a9d2ae878df7 100644 (file)
@@ -802,6 +802,9 @@ static const int blockProperties[] = {
     CSSPropertyPageBreakAfter,
     CSSPropertyPageBreakBefore,
     CSSPropertyPageBreakInside,
+    CSSPropertyWebkitRegionBreakAfter,
+    CSSPropertyWebkitRegionBreakBefore,
+    CSSPropertyWebkitRegionBreakInside,
     CSSPropertyTextAlign,
     CSSPropertyTextIndent,
     CSSPropertyWidows
index 5b9291fdf838e4840f399f3d14fa28865f171946..86c5f9d22f1458f143e73e477848ed66aa7df92f 100644 (file)
@@ -883,6 +883,8 @@ bool CSSParser::parseValue(int propId, bool important)
     case CSSPropertyPageBreakBefore:
     case CSSPropertyWebkitColumnBreakAfter:
     case CSSPropertyWebkitColumnBreakBefore:
+    case CSSPropertyWebkitRegionBreakAfter:
+    case CSSPropertyWebkitRegionBreakBefore:
         if (id == CSSValueAuto ||
              id == CSSValueAlways ||
              id == CSSValueAvoid ||
@@ -893,6 +895,7 @@ bool CSSParser::parseValue(int propId, bool important)
 
     case CSSPropertyPageBreakInside:    // avoid | auto | inherit
     case CSSPropertyWebkitColumnBreakInside:
+    case CSSPropertyWebkitRegionBreakInside:
         if (id == CSSValueAuto || id == CSSValueAvoid)
             validPrimitive = true;
         break;
index 61b79ffa18150f10356267b78189505187ecb6e1..5d4e94fccbeaa6c6ff13d507e4738142a8c77a41 100644 (file)
@@ -331,4 +331,7 @@ z-index
 -webkit-content-order
 -webkit-region-overflow
 -webkit-wrap-shape
+-webkit-region-break-after
+-webkit-region-break-before
+-webkit-region-break-inside
 
index 2ff6e9eb06a27c4a81a5dc3828d1a7ddfe56f957..a7d5befd3fb0bcb498132a9e66f9f9f975dc7f21 100644 (file)
@@ -4556,6 +4556,15 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
             m_style->setColumnCount(RenderStyle::initialColumnCount());
         }
         return;
+    case CSSPropertyWebkitRegionBreakBefore:
+        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE_WITH_VALUE(regionBreakBefore, RegionBreakBefore, PageBreak)
+        return;
+    case CSSPropertyWebkitRegionBreakAfter:
+        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE_WITH_VALUE(regionBreakAfter, RegionBreakAfter, PageBreak)
+        return;
+    case CSSPropertyWebkitRegionBreakInside:
+        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE_WITH_VALUE(regionBreakInside, RegionBreakInside, PageBreak)
+        return;
     case CSSPropertyWebkitMarquee:
         if (valueType != CSSValue::CSS_INHERIT || !m_parentNode) return;
         m_style->setMarqueeDirection(m_parentStyle->marqueeDirection());
index 28129ba74f86d755ac6cff027f8298af781d04ca..6fb6767768995eb2c0109c28716a37196d6844f8 100644 (file)
@@ -725,6 +725,9 @@ public:
     EPageBreak columnBreakBefore() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakBefore); }
     EPageBreak columnBreakInside() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakInside); }
     EPageBreak columnBreakAfter() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakAfter); }
+    EPageBreak regionBreakBefore() const { return static_cast<EPageBreak>(rareNonInheritedData->m_regionBreakBefore); }
+    EPageBreak regionBreakInside() const { return static_cast<EPageBreak>(rareNonInheritedData->m_regionBreakInside); }
+    EPageBreak regionBreakAfter() const { return static_cast<EPageBreak>(rareNonInheritedData->m_regionBreakAfter); }
     const TransformOperations& transform() const { return rareNonInheritedData->m_transform->m_operations; }
     Length transformOriginX() const { return rareNonInheritedData->m_transform->m_x; }
     Length transformOriginY() const { return rareNonInheritedData->m_transform->m_y; }
@@ -1097,6 +1100,9 @@ public:
     // For valid values of column-break-inside see http://www.w3.org/TR/css3-multicol/#break-before-break-after-break-inside
     void setColumnBreakInside(EPageBreak p) { ASSERT(p == PBAUTO || p == PBAVOID); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakInside, p); }
     void setColumnBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakAfter, p); }
+    void setRegionBreakBefore(EPageBreak p) { SET_VAR(rareNonInheritedData, m_regionBreakBefore, p); }
+    void setRegionBreakInside(EPageBreak p) { ASSERT(p == PBAUTO || p == PBAVOID); SET_VAR(rareNonInheritedData, m_regionBreakInside, p); }
+    void setRegionBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData, m_regionBreakAfter, p); }
     void inheritColumnPropertiesFrom(RenderStyle* parent) { rareNonInheritedData.access()->m_multiCol = parent->rareNonInheritedData->m_multiCol; }
     void setTransform(const TransformOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_transform, m_operations, ops); }
     void setTransformOriginX(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_x, l); }
index 6d4454eac715072bd2a06d9e5a57005209253697..ab6d64b6f9d5dbd4964297ddb48475af6a1f0982 100644 (file)
@@ -60,6 +60,9 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
     , m_regionIndex(RenderStyle::initialRegionIndex())
     , m_regionOverflow(RenderStyle::initialRegionOverflow())
     , m_wrapShape(RenderStyle::initialWrapShape())
+    , m_regionBreakAfter(RenderStyle::initialPageBreak())
+    , m_regionBreakBefore(RenderStyle::initialPageBreak())
+    , m_regionBreakInside(RenderStyle::initialPageBreak())
 {
 }
 
@@ -107,6 +110,9 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
     , m_regionIndex(o.m_regionIndex)
     , m_regionOverflow(o.m_regionOverflow)
     , m_wrapShape(o.m_wrapShape)
+    , m_regionBreakAfter(o.m_regionBreakAfter)
+    , m_regionBreakBefore(o.m_regionBreakBefore)
+    , m_regionBreakInside(o.m_regionBreakInside)
 {
 }
 
@@ -160,7 +166,10 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
         && (m_regionThread == o.m_regionThread)
         && (m_regionIndex == o.m_regionIndex)
         && (m_regionOverflow == o.m_regionOverflow)
-        && (m_wrapShape == o.m_wrapShape);
+        && (m_wrapShape == o.m_wrapShape)
+        && (m_regionBreakAfter == o.m_regionBreakAfter)
+        && (m_regionBreakBefore == o.m_regionBreakBefore)
+        && (m_regionBreakInside == o.m_regionBreakInside);
 }
 
 bool StyleRareNonInheritedData::contentDataEquivalent(const StyleRareNonInheritedData& o) const
index 5bb8c89ebe35c4aa57cdbb3b8670b4e8e2d9a7e5..21a4207f999d7c5aa4b03028d4a7b0d930ccd6dd 100644 (file)
@@ -143,6 +143,10 @@ public:
 
     RefPtr<CSSWrapShape> m_wrapShape;
 
+    unsigned m_regionBreakAfter : 2; // EPageBreak
+    unsigned m_regionBreakBefore : 2; // EPageBreak
+    unsigned m_regionBreakInside : 2; // EPageBreak
+
 private:
     StyleRareNonInheritedData();
     StyleRareNonInheritedData(const StyleRareNonInheritedData&);