[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:07:20 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit de4bb99de2e7c0929b83dbb2f9cce5bb6aa35aee
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 30 05:12:55 2003 +0000

    	Add the paged media properties to RenderStyle.  They aren't used yet, but they should now be
    	parsed and interpreted correctly.
    
            Reviewed by kocienda
    
            * khtml/css/cssstyleselector.cpp:
            (khtml::CSSStyleSelector::applyRule):
            * khtml/rendering/render_style.cpp:
            (StyleBoxData::operator==):
            (StyleFlexibleBoxData::StyleFlexibleBoxData):
            (:opacity):
            (:textShadow):
            (StyleInheritedData::StyleInheritedData):
            (StyleInheritedData::operator==):
            * khtml/rendering/render_style.h:
            (khtml::):
            (khtml::RenderStyle::NonInheritedFlags::operator==):
            (khtml::RenderStyle::setBitDefaults):
            (khtml::RenderStyle::widows):
            (khtml::RenderStyle::orphans):
            (khtml::RenderStyle::pageBreakInside):
            (khtml::RenderStyle::pageBreakBefore):
            (khtml::RenderStyle::pageBreakAfter):
            (khtml::RenderStyle::setWidows):
            (khtml::RenderStyle::setOrphans):
            (khtml::RenderStyle::setPageBreakInside):
            (khtml::RenderStyle::setPageBreakBefore):
            (khtml::RenderStyle::setPageBreakAfter):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5309 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 450b998..df93868 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,36 @@
 2003-10-29  David Hyatt  <hyatt at apple.com>
 
+	Add the paged media properties to RenderStyle.  They aren't used yet, but they should now be 
+	parsed and interpreted correctly.
+	
+        Reviewed by kocienda
+
+        * khtml/css/cssstyleselector.cpp:
+        (khtml::CSSStyleSelector::applyRule):
+        * khtml/rendering/render_style.cpp:
+        (StyleBoxData::operator==):
+        (StyleFlexibleBoxData::StyleFlexibleBoxData):
+        (:opacity):
+        (:textShadow):
+        (StyleInheritedData::StyleInheritedData):
+        (StyleInheritedData::operator==):
+        * khtml/rendering/render_style.h:
+        (khtml::):
+        (khtml::RenderStyle::NonInheritedFlags::operator==):
+        (khtml::RenderStyle::setBitDefaults):
+        (khtml::RenderStyle::widows):
+        (khtml::RenderStyle::orphans):
+        (khtml::RenderStyle::pageBreakInside):
+        (khtml::RenderStyle::pageBreakBefore):
+        (khtml::RenderStyle::pageBreakAfter):
+        (khtml::RenderStyle::setWidows):
+        (khtml::RenderStyle::setOrphans):
+        (khtml::RenderStyle::setPageBreakInside):
+        (khtml::RenderStyle::setPageBreakBefore):
+        (khtml::RenderStyle::setPageBreakAfter):
+
+2003-10-29  David Hyatt  <hyatt at apple.com>
+
 	Refine the fix to updateLayout.
 	updateStyleSelector would get called over and over again when you queried for layout properties from
 	JS.  If no stylesheets are pending, this isn't necessary (and is quite expensive, since updateStyleSelector
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index 6442a5f..d647622 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -2014,11 +2014,74 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
         style->setOverflow(o);
         return;
     }
-    break;
-    case CSS_PROP_PAGE:
-    case CSS_PROP_PAGE_BREAK_AFTER:
+
     case CSS_PROP_PAGE_BREAK_BEFORE:
-    case CSS_PROP_PAGE_BREAK_INSIDE:
+    {
+        if(value->cssValueType() == CSSValue::CSS_INHERIT)
+        {
+            if(!parentNode) return;
+            style->setPageBreakBefore(parentStyle->pageBreakBefore());
+            return;
+        }
+        if(!primitiveValue) return;
+        switch (primitiveValue->getIdent()) {
+            case CSS_VAL_AUTO:
+                style->setPageBreakBefore(PBAUTO);
+                break;
+            case CSS_VAL_LEFT:
+            case CSS_VAL_RIGHT:
+            case CSS_VAL_ALWAYS:
+                style->setPageBreakBefore(PBALWAYS); // CSS2.1: "Conforming user agents may map left/right to always."
+                break;
+            case CSS_VAL_AVOID:
+                style->setPageBreakInside(PBAVOID);
+                break;
+        }
+        break;
+    }
+
+    case CSS_PROP_PAGE_BREAK_AFTER:
+    {
+        if(value->cssValueType() == CSSValue::CSS_INHERIT)
+        {
+            if(!parentNode) return;
+            style->setPageBreakAfter(parentStyle->pageBreakAfter());
+            return;
+        }
+        if(!primitiveValue) return;
+        switch (primitiveValue->getIdent()) {
+            case CSS_VAL_AUTO:
+                style->setPageBreakAfter(PBAUTO);
+                break;
+            case CSS_VAL_LEFT:
+            case CSS_VAL_RIGHT:
+            case CSS_VAL_ALWAYS:
+                style->setPageBreakAfter(PBALWAYS); // CSS2.1: "Conforming user agents may map left/right to always."
+                break;
+            case CSS_VAL_AVOID:
+                style->setPageBreakAfter(PBAVOID);
+                break;
+        }
+        break;
+    }
+
+    case CSS_PROP_PAGE_BREAK_INSIDE: {
+        if(value->cssValueType() == CSSValue::CSS_INHERIT)
+        {
+            if(!parentNode) return;
+            style->setPageBreakInside(parentStyle->pageBreakInside());
+            return;
+        }
+        if(!primitiveValue) return;
+        if (primitiveValue->getIdent() == CSS_VAL_AUTO)
+            style->setPageBreakInside(PBAUTO);
+        else if (primitiveValue->getIdent() == CSS_VAL_AVOID)
+            style->setPageBreakInside(PBAVOID);
+        return;
+    }
+        
+    case CSS_PROP_PAGE:
+
 //    case CSS_PROP_PAUSE_AFTER:
 //    case CSS_PROP_PAUSE_BEFORE:
         break;
@@ -2845,6 +2908,32 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
         style->setZIndex(z_index);
         return;
     }
+        
+    case CSS_PROP_WIDOWS:
+    {
+        if (value->cssValueType() == CSSValue::CSS_INHERIT) {
+            if(!parentNode) return;
+            style->setWidows(parentStyle->widows());
+        } else {
+            if (!primitiveValue || primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
+                return;
+            style->setWidows((int)primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER));
+        }
+        break;
+    }
+        
+    case CSS_PROP_ORPHANS:
+    {
+        if (value->cssValueType() == CSSValue::CSS_INHERIT) {
+            if(!parentNode) return;
+            style->setOrphans(parentStyle->orphans());
+        } else {
+            if (!primitiveValue || primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
+                return;
+            style->setOrphans((int)primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER));
+        }
+        break;
+    }        
 
 // length, percent, number
     case CSS_PROP_LINE_HEIGHT:
diff --git a/WebCore/khtml/rendering/render_style.cpp b/WebCore/khtml/rendering/render_style.cpp
index 539e304..33449e6 100644
--- a/WebCore/khtml/rendering/render_style.cpp
+++ b/WebCore/khtml/rendering/render_style.cpp
@@ -38,13 +38,6 @@ StyleSurroundData::StyleSurroundData()
 {
 }
 
-StyleSurroundData::StyleSurroundData(const StyleSurroundData& o )
-    : Shared<StyleSurroundData>(),
-      offset( o.offset ), margin( o.margin ), padding( o.padding ),
-      border( o.border )
-{
-}
-
 bool StyleSurroundData::operator==(const StyleSurroundData& o) const
 {
     return offset==o.offset && margin==o.margin &&
@@ -65,15 +58,6 @@ StyleBoxData::StyleBoxData()
     max_height.value = UNDEFINED;
 }
 
-StyleBoxData::StyleBoxData(const StyleBoxData& o )
-    : Shared<StyleBoxData>(),
-      width( o.width ), height( o.height ),
-      min_width( o.min_width ), max_width( o.max_width ),
-      min_height ( o.min_height ), max_height( o.max_height ),
-      z_index( o.z_index ), z_auto( o.z_auto )
-{
-}
-
 bool StyleBoxData::operator==(const StyleBoxData& o) const
 {
     return
@@ -84,7 +68,7 @@ bool StyleBoxData::operator==(const StyleBoxData& o) const
 	    min_height == o.min_height &&
 	    max_height == o.max_height &&
 	    z_index == o.z_index &&
-        z_auto == o.z_auto;
+            z_auto == o.z_auto;
 }
 
 StyleVisualData::StyleVisualData()
@@ -93,32 +77,11 @@ StyleVisualData::StyleVisualData()
 {
 }
 
-StyleVisualData::~StyleVisualData() {
-}
-
-StyleVisualData::StyleVisualData(const StyleVisualData& o )
-    : Shared<StyleVisualData>(),
-      clip( o.clip ), hasClip( o.hasClip ), textDecoration(o.textDecoration), colspan( o.colspan ),
-      counter_increment( o.counter_increment ), counter_reset( o.counter_reset ),
-      palette( o.palette )
-{
-}
-
-
-
 StyleBackgroundData::StyleBackgroundData()
     : image( 0 )
 {
 }
 
-StyleBackgroundData::StyleBackgroundData(const StyleBackgroundData& o )
-    : Shared<StyleBackgroundData>(),
-      color( o.color ), image( o.image ),
-      x_position( o.x_position ), y_position( o.y_position ),
-      outline( o.outline )
-{
-}
-
 bool StyleBackgroundData::operator==(const StyleBackgroundData& o) const
 {
     return
@@ -146,7 +109,6 @@ bool StyleMarqueeData::operator==(const StyleMarqueeData& o) const
 }
 
 StyleFlexibleBoxData::StyleFlexibleBoxData()
-: Shared<StyleFlexibleBoxData>()
 {
     flex = 0.0f;
     flex_group = 1;
@@ -158,19 +120,6 @@ StyleFlexibleBoxData::StyleFlexibleBoxData()
     flexed_height = -1;
 }
 
-StyleFlexibleBoxData::StyleFlexibleBoxData(const StyleFlexibleBoxData& o)
-: Shared<StyleFlexibleBoxData>()
-{
-    flex = o.flex;
-    flex_group = o.flex_group;
-    ordinal_group = o.ordinal_group;
-    align = o.align;
-    pack = o.pack;
-    orient = o.orient;
-    lines = o.lines;
-    flexed_height = o.flexed_height;
-}
-
 bool StyleFlexibleBoxData::operator==(const StyleFlexibleBoxData& o) const
 {
     return flex == o.flex && flex_group == o.flex_group &&
@@ -180,7 +129,7 @@ bool StyleFlexibleBoxData::operator==(const StyleFlexibleBoxData& o) const
 }
 
 StyleCSS3NonInheritedData::StyleCSS3NonInheritedData()
-:Shared<StyleCSS3NonInheritedData>(), opacity(1.0f)
+:opacity(1.0f)
 {
 }
 
@@ -195,10 +144,8 @@ bool StyleCSS3NonInheritedData::operator==(const StyleCSS3NonInheritedData& o) c
 }
 
 StyleCSS3InheritedData::StyleCSS3InheritedData()
-:Shared<StyleCSS3InheritedData>(), textShadow(0)
-{
-
-}
+:textShadow(0)
+{}
 
 StyleCSS3InheritedData::StyleCSS3InheritedData(const StyleCSS3InheritedData& o)
 :Shared<StyleCSS3InheritedData>()
@@ -223,21 +170,8 @@ bool StyleCSS3InheritedData::shadowDataEquivalent(const StyleCSS3InheritedData&
 StyleInheritedData::StyleInheritedData()
     : indent( Fixed ), line_height( -100, Percent ), style_image( 0 ),
       cursor_image( 0 ), font(), color( Qt::black ), 
-      horizontal_border_spacing( 0 ), vertical_border_spacing( 0 )
-{
-}
-
-StyleInheritedData::~StyleInheritedData()
-{
-}
-
-StyleInheritedData::StyleInheritedData(const StyleInheritedData& o )
-    : Shared<StyleInheritedData>(),
-      indent( o.indent ), line_height( o.line_height ), style_image( o.style_image ),
-      cursor_image( o.cursor_image ), font( o.font ),
-      color( o.color ),
-      horizontal_border_spacing( o.horizontal_border_spacing ),
-      vertical_border_spacing( o.vertical_border_spacing )
+      horizontal_border_spacing( 0 ), vertical_border_spacing( 0 ), widows( 2 ), orphans( 2 ),
+      pageBreakInside( PBAUTO )
 {
 }
 
@@ -251,10 +185,10 @@ bool StyleInheritedData::operator==(const StyleInheritedData& o) const
 	font == o.font &&
 	color == o.color &&
         horizontal_border_spacing == o.horizontal_border_spacing &&
-        vertical_border_spacing == o.vertical_border_spacing;
-
-    // doesn't work because structs are not packed
-    //return memcmp(this, &o, sizeof(*this))==0;
+        vertical_border_spacing == o.vertical_border_spacing && 
+        widows == o.widows &&
+        orphans == o.orphans &&
+        pageBreakInside == o.pageBreakInside;
 }
 
 RenderStyle::RenderStyle()
diff --git a/WebCore/khtml/rendering/render_style.h b/WebCore/khtml/rendering/render_style.h
index 6e7969e..fe1595a 100644
--- a/WebCore/khtml/rendering/render_style.h
+++ b/WebCore/khtml/rendering/render_style.h
@@ -271,7 +271,6 @@ class StyleSurroundData : public Shared<StyleSurroundData>
 public:
     StyleSurroundData();
 
-    StyleSurroundData(const StyleSurroundData& o );
     bool operator==(const StyleSurroundData& o) const;
     bool operator!=(const StyleSurroundData& o) const {
         return !(*this == o);
@@ -292,13 +291,6 @@ class StyleBoxData : public Shared<StyleBoxData>
 public:
     StyleBoxData();
 
-    StyleBoxData(const StyleBoxData& o );
-
-
-    // copy and assignment
-//    StyleBoxData(const StyleBoxData &other);
-//    const StyleBoxData &operator = (const StyleBoxData &other);
-
     bool operator==(const StyleBoxData& o) const;
     bool operator!=(const StyleBoxData& o) const {
         return !(*this == o);
@@ -348,10 +340,6 @@ class StyleVisualData : public Shared<StyleVisualData>
 public:
     StyleVisualData();
 
-    ~StyleVisualData();
-
-    StyleVisualData(const StyleVisualData& o );
-
     bool operator==( const StyleVisualData &o ) const {
 	return ( clip == o.clip &&
                  hasClip == o.hasClip &&
@@ -387,8 +375,6 @@ class StyleBackgroundData : public Shared<StyleBackgroundData>
 {
 public:
     StyleBackgroundData();
-    ~StyleBackgroundData() {}
-    StyleBackgroundData(const StyleBackgroundData& o );
 
     bool operator==(const StyleBackgroundData& o) const;
     bool operator!=(const StyleBackgroundData &o) const {
@@ -440,8 +426,6 @@ class StyleFlexibleBoxData : public Shared<StyleFlexibleBoxData>
 {
 public:
     StyleFlexibleBoxData();
-    ~StyleFlexibleBoxData() {}
-    StyleFlexibleBoxData(const StyleFlexibleBoxData& o);
 
     bool operator==(const StyleFlexibleBoxData& o) const;
     bool operator!=(const StyleFlexibleBoxData &o) const {
@@ -542,12 +526,14 @@ enum ETextDecoration {
     TDNONE = 0x0 , UNDERLINE = 0x1, OVERLINE = 0x2, LINE_THROUGH= 0x4, BLINK = 0x8
 };
 
+enum EPageBreak {
+    PBAUTO, PBALWAYS, PBAVOID
+};
+
 class StyleInheritedData : public Shared<StyleInheritedData>
 {
 public:
     StyleInheritedData();
-    ~StyleInheritedData();
-    StyleInheritedData(const StyleInheritedData& o );
 
     bool operator==(const StyleInheritedData& o) const;
     bool operator != ( const StyleInheritedData &o ) const {
@@ -567,6 +553,11 @@ public:
     
     short horizontal_border_spacing;
     short vertical_border_spacing;
+    
+    // Paged media properties.
+    short widows;
+    short orphans;
+    EPageBreak pageBreakInside : 2;
 };
 
 
@@ -706,7 +697,9 @@ protected:
             (_clear == other._clear) &&
             (_position == other._position) &&
             (_floating == other._floating) &&
-            (_table_layout == other._table_layout) &&
+            (_table_layout == other._table_layout) && 
+            (_page_break_before == other._page_break_before) &&
+            (_page_break_after == other._page_break_after) &&
             (_flowAroundFloats == other._flowAroundFloats) &&
             (_styleType == other._styleType) &&
             (_affectedByHover == other._affectedByHover) &&
@@ -729,6 +722,10 @@ protected:
         EPosition _position : 2;
         EFloat _floating : 2;
         ETableLayout _table_layout : 1;
+        
+        EPageBreak _page_break_before : 2;
+        EPageBreak _page_break_after : 2;
+        
         bool _flowAroundFloats :1;
 
         PseudoId _styleType : 3;
@@ -790,6 +787,8 @@ protected:
 	noninherited_flags._position = STATIC;
 	noninherited_flags._floating = FNONE;
 	noninherited_flags._table_layout = TAUTO;
+        noninherited_flags._page_break_before = PBAUTO;
+        noninherited_flags._page_break_after = PBAUTO;
 	noninherited_flags._flowAroundFloats=false;
 	noninherited_flags._styleType = NOPSEUDO;
         noninherited_flags._affectedByHover = false;
@@ -963,6 +962,12 @@ public:
 
     CachedImage *cursorImage() const { return inherited->cursor_image; }
 
+    short widows() const { return inherited->widows; }
+    short orphans() const { return inherited->orphans; }
+    EPageBreak pageBreakInside() const { return inherited->pageBreakInside; }
+    EPageBreak pageBreakBefore() const { return noninherited_flags._page_break_before; }
+    EPageBreak pageBreakAfter() const { return noninherited_flags._page_break_after; }
+    
     // CSS3 Getter Methods
     ShadowData* textShadow() const { return css3InheritedData->textShadow; }
     float opacity() { return css3NonInheritedData->opacity; }
@@ -1125,6 +1130,12 @@ public:
     int zIndex() const { return box->z_index; }
     void setZIndex(int v) { SET_VAR(box, z_auto, false); SET_VAR(box,z_index,v) }
 
+    void setWidows(short w) { SET_VAR(inherited, widows, w); }
+    void setOrphans(short o) { SET_VAR(inherited, orphans, o); }
+    void setPageBreakInside(EPageBreak b) { SET_VAR(inherited, pageBreakInside, b); }
+    void setPageBreakBefore(EPageBreak b) { noninherited_flags._page_break_before = b; }
+    void setPageBreakAfter(EPageBreak b) { noninherited_flags._page_break_after = b; }
+    
     // CSS3 Setters
     void setTextShadow(ShadowData* val, bool add=false);
     void setOpacity(float f) { SET_VAR(css3NonInheritedData, opacity, f); }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list