Title: [130668] trunk
Revision
130668
Author
[email protected]
Date
2012-10-08 12:00:38 -0700 (Mon, 08 Oct 2012)

Log Message

Remove "orphaned units" quirk
https://bugs.webkit.org/show_bug.cgi?id=98553

Patch by Tab Atkins <[email protected]> on 2012-10-08
Reviewed by Eric Seidel.

This patch removes our "orphaned units" quirk.
We have an "orphaned units" quirk to match IE, which allows things like "width: 20 px;".
But FF and Opera don't have it and aren't aware of bugs for it,
and it's not in Simon Pieters' Quirks Mode spec <http://dvcs.w3.org/hg/quirks-mode/raw-file/tip/Overview.html>

No new tests, because I'm killing a quirk.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/CSSParser.h:
(CSSParser):

Modified Paths

Removed Paths

Diff

Deleted: trunk/LayoutTests/fast/css/quirk-orphaned-units.html (130667 => 130668)


--- trunk/LayoutTests/fast/css/quirk-orphaned-units.html	2012-10-08 18:57:05 UTC (rev 130667)
+++ trunk/LayoutTests/fast/css/quirk-orphaned-units.html	2012-10-08 19:00:38 UTC (rev 130668)
@@ -1,2 +0,0 @@
-<div style="border:5 em solid red">This border should be 5em thick.</div>
-<div style="width:100 px; background-color:lime">This div should be 100px wide.</div>

Modified: trunk/LayoutTests/mathml/presentation/fractions.xhtml (130667 => 130668)


--- trunk/LayoutTests/mathml/presentation/fractions.xhtml	2012-10-08 18:57:05 UTC (rev 130667)
+++ trunk/LayoutTests/mathml/presentation/fractions.xhtml	2012-10-08 19:00:38 UTC (rev 130668)
@@ -21,7 +21,7 @@
 </math>
 </p>
 <p id='t4'>line thickness by keyword:
-<math xmlns='http://www.w3.org/1998/Math/MathML' mathsize="32 px">
+<math xmlns='http://www.w3.org/1998/Math/MathML' mathsize="32px">
     <mfrac linethickness='thin'><mn>1</mn><mn>2</mn></mfrac>
     <mfrac linethickness='medium'><mn>1</mn><mn>2</mn></mfrac>
     <mfrac linethickness='thick'><mn>1</mn><mn>2</mn></mfrac>

Deleted: trunk/LayoutTests/platform/chromium-linux/fast/css/quirk-orphaned-units-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/chromium-mac/fast/css/quirk-orphaned-units-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/chromium-mac-snowleopard/fast/css/quirk-orphaned-units-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/chromium-win/fast/css/quirk-orphaned-units-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/chromium-win/fast/css/quirk-orphaned-units-expected.txt (130667 => 130668)


--- trunk/LayoutTests/platform/chromium-win/fast/css/quirk-orphaned-units-expected.txt	2012-10-08 18:57:05 UTC (rev 130667)
+++ trunk/LayoutTests/platform/chromium-win/fast/css/quirk-orphaned-units-expected.txt	2012-10-08 19:00:38 UTC (rev 130668)
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {DIV} at (0,0) size 784x180 [border: (80px solid #FF0000)]
-        RenderText {#text} at (80,80) size 199x19
-          text run at (80,80) width 199: "This border should be 5em thick."
-      RenderBlock {DIV} at (0,180) size 100x40 [bgcolor=#00FF00]
-        RenderText {#text} at (0,0) size 95x39
-          text run at (0,0) width 90: "This div should"
-          text run at (0,20) width 95: "be 100px wide."

Deleted: trunk/LayoutTests/platform/efl/fast/css/quirk-orphaned-units-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/efl/fast/css/quirk-orphaned-units-expected.txt (130667 => 130668)


--- trunk/LayoutTests/platform/efl/fast/css/quirk-orphaned-units-expected.txt	2012-10-08 18:57:05 UTC (rev 130667)
+++ trunk/LayoutTests/platform/efl/fast/css/quirk-orphaned-units-expected.txt	2012-10-08 19:00:38 UTC (rev 130668)
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {DIV} at (0,0) size 784x178 [border: (80px solid #FF0000)]
-        RenderText {#text} at (80,80) size 208x19
-          text run at (80,80) width 208: "This border should be 5em thick."
-      RenderBlock {DIV} at (0,178) size 100x36 [bgcolor=#00FF00]
-        RenderText {#text} at (0,0) size 98x37
-          text run at (0,0) width 98: "This div should"
-          text run at (0,18) width 98: "be 100px wide."

Deleted: trunk/LayoutTests/platform/gtk/fast/css/quirk-orphaned-units-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/gtk/fast/css/quirk-orphaned-units-expected.txt (130667 => 130668)


--- trunk/LayoutTests/platform/gtk/fast/css/quirk-orphaned-units-expected.txt	2012-10-08 18:57:05 UTC (rev 130667)
+++ trunk/LayoutTests/platform/gtk/fast/css/quirk-orphaned-units-expected.txt	2012-10-08 19:00:38 UTC (rev 130668)
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {DIV} at (0,0) size 784x178 [border: (80px solid #FF0000)]
-        RenderText {#text} at (80,80) size 208x19
-          text run at (80,80) width 208: "This border should be 5em thick."
-      RenderBlock {DIV} at (0,178) size 100x36 [bgcolor=#00FF00]
-        RenderText {#text} at (0,0) size 98x37
-          text run at (0,0) width 98: "This div should"
-          text run at (0,18) width 98: "be 100px wide."

Deleted: trunk/LayoutTests/platform/mac/fast/css/quirk-orphaned-units-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/mac/fast/css/quirk-orphaned-units-expected.txt (130667 => 130668)


--- trunk/LayoutTests/platform/mac/fast/css/quirk-orphaned-units-expected.txt	2012-10-08 18:57:05 UTC (rev 130667)
+++ trunk/LayoutTests/platform/mac/fast/css/quirk-orphaned-units-expected.txt	2012-10-08 19:00:38 UTC (rev 130668)
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {DIV} at (0,0) size 784x178 [border: (80px solid #FF0000)]
-        RenderText {#text} at (80,80) size 208x18
-          text run at (80,80) width 208: "This border should be 5em thick."
-      RenderBlock {DIV} at (0,178) size 100x36 [bgcolor=#00FF00]
-        RenderText {#text} at (0,0) size 98x36
-          text run at (0,0) width 98: "This div should"
-          text run at (0,18) width 98: "be 100px wide."

Deleted: trunk/LayoutTests/platform/qt/fast/css/quirk-orphaned-units-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/qt/fast/css/quirk-orphaned-units-expected.txt (130667 => 130668)


--- trunk/LayoutTests/platform/qt/fast/css/quirk-orphaned-units-expected.txt	2012-10-08 18:57:05 UTC (rev 130667)
+++ trunk/LayoutTests/platform/qt/fast/css/quirk-orphaned-units-expected.txt	2012-10-08 19:00:38 UTC (rev 130668)
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {DIV} at (0,0) size 784x179 [border: (80px solid #FF0000)]
-        RenderText {#text} at (80,80) size 199x19
-          text run at (80,80) width 199: "This border should be 5em thick."
-      RenderBlock {DIV} at (0,179) size 100x38 [bgcolor=#00FF00]
-        RenderText {#text} at (0,0) size 95x38
-          text run at (0,0) width 90: "This div should"
-          text run at (0,19) width 95: "be 100px wide."

Modified: trunk/LayoutTests/touchadjustment/zoom-fatfinger.html (130667 => 130668)


--- trunk/LayoutTests/touchadjustment/zoom-fatfinger.html	2012-10-08 18:57:05 UTC (rev 130667)
+++ trunk/LayoutTests/touchadjustment/zoom-fatfinger.html	2012-10-08 19:00:38 UTC (rev 130668)
@@ -2,8 +2,7 @@
 <head>
     <script src=""
     <style>
-        #div1 { position: absolute; left: 100px; top: 100
-px; width: 200px; height: 20px; }
+        #div1 { position: absolute; left: 100px; top: 100px; width: 200px; height: 20px; }
     </style>
 </head>
 <body _onload_="runTests()">

Modified: trunk/Source/WebCore/ChangeLog (130667 => 130668)


--- trunk/Source/WebCore/ChangeLog	2012-10-08 18:57:05 UTC (rev 130667)
+++ trunk/Source/WebCore/ChangeLog	2012-10-08 19:00:38 UTC (rev 130668)
@@ -1,3 +1,22 @@
+2012-10-08  Tab Atkins  <[email protected]>
+
+        Remove "orphaned units" quirk
+        https://bugs.webkit.org/show_bug.cgi?id=98553
+
+        Reviewed by Eric Seidel.
+
+        This patch removes our "orphaned units" quirk.
+        We have an "orphaned units" quirk to match IE, which allows things like "width: 20 px;".
+        But FF and Opera don't have it and aren't aware of bugs for it,
+        and it's not in Simon Pieters' Quirks Mode spec <http://dvcs.w3.org/hg/quirks-mode/raw-file/tip/Overview.html>
+
+        No new tests, because I'm killing a quirk.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        * css/CSSParser.h:
+        (CSSParser):
+
 2012-10-08  Robert Hogan  <[email protected]>
 
         Border, margin and padding of an inline's inline ancestors counted twice

Modified: trunk/Source/WebCore/css/CSSParser.cpp (130667 => 130668)


--- trunk/Source/WebCore/css/CSSParser.cpp	2012-10-08 18:57:05 UTC (rev 130667)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2012-10-08 19:00:38 UTC (rev 130668)
@@ -1600,63 +1600,6 @@
     return cssValuePool().createValue(value->string, CSSPrimitiveValue::CSS_STRING);
 }
 
-static int unitFromString(CSSParserValue* value)
-{
-    if (value->unit != CSSPrimitiveValue::CSS_IDENT || value->id)
-        return 0;
-
-    if (equal(value->string, "em"))
-        return CSSPrimitiveValue::CSS_EMS;
-    if (equal(value->string, "rem"))
-        return CSSPrimitiveValue::CSS_REMS;
-    if (equal(value->string, "ex"))
-        return CSSPrimitiveValue::CSS_EXS;
-    if (equal(value->string, "px"))
-        return CSSPrimitiveValue::CSS_PX;
-    if (equal(value->string, "cm"))
-        return CSSPrimitiveValue::CSS_CM;
-    if (equal(value->string, "mm"))
-        return CSSPrimitiveValue::CSS_MM;
-    if (equal(value->string, "in"))
-        return CSSPrimitiveValue::CSS_IN;
-    if (equal(value->string, "pt"))
-        return CSSPrimitiveValue::CSS_PT;
-    if (equal(value->string, "pc"))
-        return CSSPrimitiveValue::CSS_PC;
-    if (equal(value->string, "deg"))
-        return CSSPrimitiveValue::CSS_DEG;
-    if (equal(value->string, "rad"))
-        return CSSPrimitiveValue::CSS_RAD;
-    if (equal(value->string, "grad"))
-        return CSSPrimitiveValue::CSS_GRAD;
-    if (equal(value->string, "turn"))
-        return CSSPrimitiveValue::CSS_TURN;
-    if (equal(value->string, "ms"))
-        return CSSPrimitiveValue::CSS_MS;
-    if (equal(value->string, "s"))
-        return CSSPrimitiveValue::CSS_S;
-    if (equal(value->string, "Hz"))
-        return CSSPrimitiveValue::CSS_HZ;
-    if (equal(value->string, "kHz"))
-        return CSSPrimitiveValue::CSS_KHZ;
-    if (equal(value->string, "vw"))
-        return CSSPrimitiveValue::CSS_VW;
-    if (equal(value->string, "vh"))
-        return CSSPrimitiveValue::CSS_VH;
-    if (equal(value->string, "vmin"))
-        return CSSPrimitiveValue::CSS_VMIN;
-#if ENABLE(CSS_IMAGE_RESOLUTION)
-    if (equal(value->string, "dppx"))
-        return CSSPrimitiveValue::CSS_DPPX;
-    if (equal(value->string, "dpi"))
-        return CSSPrimitiveValue::CSS_DPI;
-    if (equal(value->string, "dpcm"))
-        return CSSPrimitiveValue::CSS_DPCM;
-#endif
-
-    return 0;
-}
-
 static inline bool isComma(CSSParserValue* value)
 { 
     return value && value->unit == CSSParserValue::Operator && value->iValue == ','; 
@@ -1679,37 +1622,6 @@
     return !id && validUnit(value, FLength | FPercent | FNonNeg);
 }
 
-void CSSParser::checkForOrphanedUnits()
-{
-    if (inStrictMode() || inShorthand())
-        return;
-
-    // The purpose of this code is to implement the WinIE quirk that allows unit types to be separated from their numeric values
-    // by whitespace, so e.g., width: 20 px instead of width:20px.  This is invalid CSS, so we don't do this in strict mode.
-    CSSParserValue* numericVal = 0;
-    unsigned size = m_valueList->size();
-    for (unsigned i = 0; i < size; i++) {
-        CSSParserValue* value = m_valueList->valueAt(i);
-
-        if (numericVal) {
-            // Change the unit type of the numeric val to match.
-            int unit = unitFromString(value);
-            if (unit) {
-                numericVal->unit = unit;
-                numericVal = 0;
-
-                // Now delete the bogus unit value.
-                m_valueList->deleteValueAt(i);
-                i--; // We're safe even though |i| is unsigned, since we only hit this code if we had a previous numeric value (so |i| is always > 0 here).
-                size--;
-                continue;
-            }
-        }
-
-        numericVal = (value->unit == CSSPrimitiveValue::CSS_NUMBER) ? value : 0;
-    }
-}
-
 inline PassRefPtr<CSSPrimitiveValue> CSSParser::parseValidPrimitive(int identifier, CSSParserValue* value)
 {
     if (identifier)
@@ -1754,10 +1666,6 @@
     
     int id = value->id;
 
-    // In quirks mode, we will look for units that have been incorrectly separated from the number they belong to
-    // by a space.  We go ahead and associate the unit with the number even though it is invalid CSS.
-    checkForOrphanedUnits();
-
     int num = inShorthand() ? 1 : m_valueList->size();
 
     if (id == CSSValueInherit) {

Modified: trunk/Source/WebCore/css/CSSParser.h (130667 => 130668)


--- trunk/Source/WebCore/css/CSSParser.h	2012-10-08 18:57:05 UTC (rev 130667)
+++ trunk/Source/WebCore/css/CSSParser.h	2012-10-08 19:00:38 UTC (rev 130668)
@@ -452,8 +452,6 @@
     bool validWidth(CSSParserValue*);
     bool validHeight(CSSParserValue*);
 
-    void checkForOrphanedUnits();
-
     void deleteFontFaceOnlyValues();
 
     bool isGeneratedImageValue(CSSParserValue*) const;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to