More tweaks to dashboard regions style.
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Sep 2004 20:03:35 +0000 (20:03 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Sep 2004 20:03:35 +0000 (20:03 +0000)
Move dashboard regions list into css3NonInheritedData so it will be shared
by all styles that don't modify the empty region list.

Make the initial value for dashboard region list a static to minimize allocations
of empty lists.

Unrelated to regions:  make marquee, flex box, and opacity style¬†accessor functions const.

        Reviewed by Hyatt.

        * khtml/rendering/render_style.cpp:
        (RenderStyle::diff):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::opacity):
        (khtml::RenderStyle::boxAlign):
        (khtml::RenderStyle::boxDirection):
        (khtml::RenderStyle::boxFlexGroup):
        (khtml::RenderStyle::boxOrdinalGroup):
        (khtml::RenderStyle::boxOrient):
        (khtml::RenderStyle::boxPack):
        (khtml::RenderStyle::marqueeIncrement):
        (khtml::RenderStyle::marqueeSpeed):
        (khtml::RenderStyle::marqueeLoopCount):
        (khtml::RenderStyle::marqueeBehavior):
        (khtml::RenderStyle::marqueeDirection):
        (khtml::RenderStyle::dashboardRegions):
        (khtml::RenderStyle::setDashboardRegions):
        (khtml::RenderStyle::setDashboardRegion):
        (khtml::RenderStyle::initialDashboardRegions):

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_style.cpp
WebCore/khtml/rendering/render_style.h

index 3d967b30e8fb700e9dac808d884bffca7bd2093c..5236a40d17c53bc9a7c884bbe1a13dc0ff634aed 100644 (file)
@@ -1,3 +1,37 @@
+2004-09-22  Richard Williamson   <rjw@apple.com>
+
+       More tweaks to dashboard regions.
+
+       Move dashboard regions list into css3NonInheritedData so it will be shared
+       by all styles that don't modify the empty region list.
+
+       Make the initial value for dashboard region list a static to minimize allocations
+       of empty lists.
+
+       Make marquee and flex style¬†accessor functions const.
+
+        Reviewed by Hyatt.
+
+        * khtml/rendering/render_style.cpp:
+        (RenderStyle::diff):
+        * khtml/rendering/render_style.h:
+        (khtml::RenderStyle::opacity):
+        (khtml::RenderStyle::boxAlign):
+        (khtml::RenderStyle::boxDirection):
+        (khtml::RenderStyle::boxFlexGroup):
+        (khtml::RenderStyle::boxOrdinalGroup):
+        (khtml::RenderStyle::boxOrient):
+        (khtml::RenderStyle::boxPack):
+        (khtml::RenderStyle::marqueeIncrement):
+        (khtml::RenderStyle::marqueeSpeed):
+        (khtml::RenderStyle::marqueeLoopCount):
+        (khtml::RenderStyle::marqueeBehavior):
+        (khtml::RenderStyle::marqueeDirection):
+        (khtml::RenderStyle::dashboardRegions):
+        (khtml::RenderStyle::setDashboardRegions):
+        (khtml::RenderStyle::setDashboardRegion):
+        (khtml::RenderStyle::initialDashboardRegions):
+
 2004-09-22  David Hyatt  <hyatt@apple.com>
 
        Fix for 3802766, entire view redrawn in Blot while typing.  Don't needlessly create text nodes just to find
index ae52a1d51ea0ba08feb5bb81dcdf6b5fa6f95d22..2aa8847ff5e149dccc527eedcf446e44381446cc 100644 (file)
@@ -671,7 +671,7 @@ RenderStyle::Diff RenderStyle::diff( const RenderStyle *other ) const
 
 #if APPLE_CHANGES
 // If regions change trigger a relayout to re-calc regions.
-    if (!(m_dashboardRegions == other->m_dashboardRegions))
+    if (!(css3NonInheritedData->m_dashboardRegions == other->css3NonInheritedData->m_dashboardRegions))
         return Layout;
 #endif
 
index 5f818de2c7c945b7d4315f1e7912c488f905cdec..8b75a9ab2308f5ad680fdec23b520ce8a2e9e3a0 100644 (file)
@@ -583,6 +583,7 @@ public:
     
 #if APPLE_CHANGES
     int lineClamp;         // An Apple extension.  Not really CSS3 but not worth making a new struct over.
+    QValueList<StyleDashboardRegion> m_dashboardRegions;
 #endif
     float opacity;         // Whether or not we're transparent.
     DataRef<StyleFlexibleBoxData> flexibleBox; // Flexible box properties 
@@ -880,10 +881,6 @@ protected:
     DataRef<StyleSurroundData> surround;
     DataRef<StyleCSS3NonInheritedData> css3NonInheritedData;
 
-#if APPLE_CHANGES
-    QValueList<StyleDashboardRegion> m_dashboardRegions;
-#endif
-
 // inherited attributes
     DataRef<StyleCSS3InheritedData> css3InheritedData;
     DataRef<StyleInheritedData> inherited;
@@ -1121,20 +1118,20 @@ public:
         if (background->outline.style == BNONE || background->outline.style == BHIDDEN) return 0; return background->outline._offset;
     }
     ShadowData* textShadow() const { return css3InheritedData->textShadow; }
-    float opacity() { return css3NonInheritedData->opacity; }
-    EBoxAlignment boxAlign() { return css3NonInheritedData->flexibleBox->align; }
-    EBoxDirection boxDirection() { return inherited_flags._box_direction; }
+    float opacity() const { return css3NonInheritedData->opacity; }
+    EBoxAlignment boxAlign() const { return css3NonInheritedData->flexibleBox->align; }
+    EBoxDirection boxDirection() const { return inherited_flags._box_direction; }
     float boxFlex() { return css3NonInheritedData->flexibleBox->flex; }
-    unsigned int boxFlexGroup() { return css3NonInheritedData->flexibleBox->flex_group; }
+    unsigned int boxFlexGroup() const { return css3NonInheritedData->flexibleBox->flex_group; }
     EBoxLines boxLines() { return css3NonInheritedData->flexibleBox->lines; }
-    unsigned int boxOrdinalGroup() { return css3NonInheritedData->flexibleBox->ordinal_group; }
-    EBoxOrient boxOrient() { return css3NonInheritedData->flexibleBox->orient; }
-    EBoxAlignment boxPack() { return css3NonInheritedData->flexibleBox->pack; }
-    Length marqueeIncrement() { return css3NonInheritedData->marquee->increment; }
-    int marqueeSpeed() { return css3NonInheritedData->marquee->speed; }
-    int marqueeLoopCount() { return css3NonInheritedData->marquee->loops; }
-    EMarqueeBehavior marqueeBehavior() { return css3NonInheritedData->marquee->behavior; }
-    EMarqueeDirection marqueeDirection() { return css3NonInheritedData->marquee->direction; }
+    unsigned int boxOrdinalGroup() const { return css3NonInheritedData->flexibleBox->ordinal_group; }
+    EBoxOrient boxOrient() const { return css3NonInheritedData->flexibleBox->orient; }
+    EBoxAlignment boxPack() const { return css3NonInheritedData->flexibleBox->pack; }
+    Length marqueeIncrement() const { return css3NonInheritedData->marquee->increment; }
+    int marqueeSpeed() const { return css3NonInheritedData->marquee->speed; }
+    int marqueeLoopCount() const { return css3NonInheritedData->marquee->loops; }
+    EMarqueeBehavior marqueeBehavior() const { return css3NonInheritedData->marquee->behavior; }
+    EMarqueeDirection marqueeDirection() const { return css3NonInheritedData->marquee->direction; }
     EUserModify userModify() const { return css3InheritedData->userModify; }
     EUserDrag userDrag() const { return css3NonInheritedData->userDrag; }
     EUserSelect userSelect() const { return css3NonInheritedData->userSelect; }
@@ -1170,8 +1167,8 @@ public:
     void setMaxHeight(Length v) { SET_VAR(box,max_height,v) }
 
 #if APPLE_CHANGES
-    QValueList<StyleDashboardRegion> dashboardRegions() const { return m_dashboardRegions; }
-    void setDashboardRegions(QValueList<StyleDashboardRegion> regions) { m_dashboardRegions = regions; }
+    QValueList<StyleDashboardRegion> dashboardRegions() const { return css3NonInheritedData->m_dashboardRegions; }
+    void setDashboardRegions(QValueList<StyleDashboardRegion> regions) { SET_VAR(css3NonInheritedData,m_dashboardRegions,regions); }
     void setDashboardRegion (int type, QString label, Length t, Length r, Length b, Length l, bool append) {
         StyleDashboardRegion region;
         region.label = label;
@@ -1181,9 +1178,9 @@ public:
         region.offset.left = l;
         region.type = type;
         if (!append) {
-            m_dashboardRegions.clear ();
+            css3NonInheritedData.access()->m_dashboardRegions.clear ();
         }
-        m_dashboardRegions.append (region);
+        css3NonInheritedData.access()->m_dashboardRegions.append (region);
     }
 #endif
 
@@ -1455,8 +1452,8 @@ public:
     // Keep these at the end.
     static int initialLineClamp() { return -1; }
     static bool initialTextSizeAdjust() { return true; }
-    static QValueList<StyleDashboardRegion> initialDashboardRegions() { 
-        QValueList<StyleDashboardRegion> emptyList;
+    static const QValueList<StyleDashboardRegion>& initialDashboardRegions() { 
+        static QValueList<StyleDashboardRegion> emptyList;
         return emptyList;
     }
 #endif