Title: [124364] trunk/Source/WebCore
Revision
124364
Author
[email protected]
Date
2012-08-01 13:47:09 -0700 (Wed, 01 Aug 2012)

Log Message

Remove code duplication in determining if display is inline or replaced
https://bugs.webkit.org/show_bug.cgi?id=92880

Reviewed by Julien Chaffraix.

Deduplicate lists of display types by using private helpers.

No new tests. No change in behavior.

* rendering/style/RenderStyle.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124363 => 124364)


--- trunk/Source/WebCore/ChangeLog	2012-08-01 20:35:58 UTC (rev 124363)
+++ trunk/Source/WebCore/ChangeLog	2012-08-01 20:47:09 UTC (rev 124364)
@@ -1,3 +1,16 @@
+2012-08-01  Ojan Vafai  <[email protected]>
+
+        Remove code duplication in determining if display is inline or replaced
+        https://bugs.webkit.org/show_bug.cgi?id=92880
+
+        Reviewed by Julien Chaffraix.
+
+        Deduplicate lists of display types by using private helpers.
+
+        No new tests. No change in behavior.
+
+        * rendering/style/RenderStyle.h:
+
 2012-08-01  Tommy Widenflycht  <[email protected]>
 
         MediaStream API: Add ExtraData capability to MediaStreamSource

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (124363 => 124364)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-08-01 20:35:58 UTC (rev 124363)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-08-01 20:47:09 UTC (rev 124364)
@@ -1483,22 +1483,9 @@
 
     StyleDifference diff(const RenderStyle*, unsigned& changedContextSensitiveProperties) const;
 
-    bool isDisplayReplacedType() const
-    {
-        return display() == INLINE_BLOCK || display() == INLINE_BOX || display() == INLINE_TABLE || display() == INLINE_GRID;
-    }
-
-    bool isDisplayInlineType() const
-    {
-        return display() == INLINE || isDisplayReplacedType();
-    }
-
-    bool isOriginalDisplayInlineType() const
-    {
-        return originalDisplay() == INLINE || originalDisplay() == INLINE_BLOCK
-            || originalDisplay() == INLINE_BOX || originalDisplay() == INLINE_TABLE || originalDisplay() == INLINE_GRID;
-    }
-
+    bool isDisplayReplacedType() const { return isDisplayReplacedType(display()); }
+    bool isDisplayInlineType() const { return isDisplayInlineType(display()); }
+    bool isOriginalDisplayInlineType() const { return isDisplayInlineType(originalDisplay()); }
     bool isDisplayRegionType() const
     {
         return display() == BLOCK || display() == INLINE_BLOCK
@@ -1748,6 +1735,16 @@
         return isHorizontalWritingMode() ? getShadowVerticalExtent(shadow, logicalTop, logicalBottom) : getShadowHorizontalExtent(shadow, logicalTop, logicalBottom);
     }
 
+    bool isDisplayReplacedType(EDisplay display) const
+    {
+        return display == INLINE_BLOCK || display == INLINE_BOX || display == INLINE_TABLE || display == INLINE_GRID;
+    }
+
+    bool isDisplayInlineType(EDisplay display) const
+    {
+        return display == INLINE || isDisplayReplacedType(display);
+    }
+
     // Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
     Color invalidColor() const { static Color invalid; return invalid; }
     Color borderLeftColor() const { return surround->border.left().color(); }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to