Title: [115953] trunk
Revision
115953
Author
[email protected]
Date
2012-05-03 03:02:54 -0700 (Thu, 03 May 2012)

Log Message

CSS clip: auto clips to box borders instead of removing clipping
https://bugs.webkit.org/show_bug.cgi?id=36772

Patch by Uday Kiran <[email protected]> on 2012-05-03
Reviewed by Andreas Kling.

Source/WebCore:

According to CSS 2.1 spec, http://www.w3.org/TR/CSS2/visufx.html#propdef-clip,
clip property with value 'auto' the element does not clip.
Also getPropertyValue for clip when auto is specified should return "auto"
and not "rect(0px 0px 0px 0px)".

Tests: css2.1/20110323/clip-001-expected.html
       css2.1/20110323/clip-001.html

* css/StyleBuilder.cpp:
(WebCore::ApplyPropertyClip::applyValue):

LayoutTests:

CSS 2.1 test case added for clip:auto

* css2.1/20110323/clip-001-expected.html: Added.
* css2.1/20110323/clip-001.html: Added.
* fast/css/getPropertyValue-clip.html: getPropertyValue for clip when auto is specified should return auto and not rect(0px 0px 0px 0px).

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (115952 => 115953)


--- trunk/LayoutTests/ChangeLog	2012-05-03 09:51:56 UTC (rev 115952)
+++ trunk/LayoutTests/ChangeLog	2012-05-03 10:02:54 UTC (rev 115953)
@@ -1,3 +1,16 @@
+2012-05-03  Uday Kiran  <[email protected]>
+
+        CSS clip: auto clips to box borders instead of removing clipping
+        https://bugs.webkit.org/show_bug.cgi?id=36772
+
+        Reviewed by Andreas Kling.
+
+        CSS 2.1 test case added for clip:auto
+
+        * css2.1/20110323/clip-001-expected.html: Added.
+        * css2.1/20110323/clip-001.html: Added.
+        * fast/css/getPropertyValue-clip.html: getPropertyValue for clip when auto is specified should return auto and not rect(0px 0px 0px 0px).
+
 2012-05-03  Nikolas Zimmermann  <[email protected]>
 
         Fix multiple begin values support - especially with seeking through setCurrentTime

Added: trunk/LayoutTests/css2.1/20110323/clip-001-expected.html (0 => 115953)


--- trunk/LayoutTests/css2.1/20110323/clip-001-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css2.1/20110323/clip-001-expected.html	2012-05-03 10:02:54 UTC (rev 115953)
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+  <title>CSS Test: clip - auto value</title>
+
+  <style>
+  #green-layer
+  {
+  background-color: green;
+  height: 300px;
+  position: absolute;
+  width: 300px;
+  }
+  </style>
+ </head>
+
+ <body>
+
+  <p>There should be a big green square and <strong>no red</strong>.</p>
+
+  <div id="green-layer"></div>
+</body></html>

Added: trunk/LayoutTests/css2.1/20110323/clip-001.html (0 => 115953)


--- trunk/LayoutTests/css2.1/20110323/clip-001.html	                        (rev 0)
+++ trunk/LayoutTests/css2.1/20110323/clip-001.html	2012-05-03 10:02:54 UTC (rev 115953)
@@ -0,0 +1,60 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!-- saved from url="" -->
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+
+  <title>CSS Test: clip - auto value</title>
+
+  <link rel="author" title="Gérard Talbot" href=""
+  <link rel="author" title="Vasil Dinkov" href=""
+  <link rel="help" href=""
+  <meta content="dom" name="flags">
+  <meta content="An element must not clip when clip is set to auto." name="assert">
+  <meta http-equiv="Content-Script-Type" content="text/_javascript_">
+
+  <style type="text/css">
+  #red-overlapped-layer
+  {
+  background-color: red;
+  height: 300px;
+  position: absolute;
+  width: 300px;
+  }
+
+  #red-parent
+  {
+  background-color: red;
+  clip: rect(0, 100px, 100px, 0);
+  height: 200px;
+  position: absolute;
+  width: 200px;
+  }
+
+  #green-child
+  {
+  background-color: green;
+  height: 300px;
+  width: 300px;
+  }
+  </style>
+
+  <script type="text/_javascript_">
+  function startTest()
+  {
+  document.getElementById("red-parent").style.clip = "auto";
+  }
+  </script>
+
+ </head>
+
+ <body _onload_="startTest();">
+
+  <p>There should be a big green square and <strong>no red</strong>.</p>
+
+  <div id="red-overlapped-layer"></div>
+
+  <div id="red-parent" style="clip: auto; ">
+   <div id="green-child"></div>
+  </div>
+
+ 
+</body></html>
\ No newline at end of file

Modified: trunk/LayoutTests/fast/css/getPropertyValue-clip.html (115952 => 115953)


--- trunk/LayoutTests/fast/css/getPropertyValue-clip.html	2012-05-03 09:51:56 UTC (rev 115952)
+++ trunk/LayoutTests/fast/css/getPropertyValue-clip.html	2012-05-03 10:02:54 UTC (rev 115953)
@@ -19,7 +19,7 @@
           return;
       }
       div = document.getElementById("clip2");
-      if (getComputedStyle(div,'').getPropertyValue("clip") != "rect(0px 0px 0px 0px)") {
+      if (getComputedStyle(div,'').getPropertyValue("clip") != "auto") {
           log("FAILED");
           return;
       }

Modified: trunk/Source/WebCore/ChangeLog (115952 => 115953)


--- trunk/Source/WebCore/ChangeLog	2012-05-03 09:51:56 UTC (rev 115952)
+++ trunk/Source/WebCore/ChangeLog	2012-05-03 10:02:54 UTC (rev 115953)
@@ -1,3 +1,21 @@
+2012-05-03  Uday Kiran  <[email protected]>
+
+        CSS clip: auto clips to box borders instead of removing clipping
+        https://bugs.webkit.org/show_bug.cgi?id=36772
+
+        Reviewed by Andreas Kling.
+
+        According to CSS 2.1 spec, http://www.w3.org/TR/CSS2/visufx.html#propdef-clip,
+        clip property with value 'auto' the element does not clip.
+        Also getPropertyValue for clip when auto is specified should return "auto"
+        and not "rect(0px 0px 0px 0px)".
+
+        Tests: css2.1/20110323/clip-001-expected.html
+               css2.1/20110323/clip-001.html
+
+        * css/StyleBuilder.cpp:
+        (WebCore::ApplyPropertyClip::applyValue):
+
 2012-05-02  Antti Koivisto  <[email protected]>
 
         Add temporary feature define for parsed stylesheet caching

Modified: trunk/Source/WebCore/css/StyleBuilder.cpp (115952 => 115953)


--- trunk/Source/WebCore/css/StyleBuilder.cpp	2012-05-03 09:51:56 UTC (rev 115952)
+++ trunk/Source/WebCore/css/StyleBuilder.cpp	2012-05-03 10:02:54 UTC (rev 115953)
@@ -255,7 +255,7 @@
             styleResolver->style()->setHasClip(true);
         } else if (primitiveValue->getIdent() == CSSValueAuto) {
             styleResolver->style()->setClip(Length(), Length(), Length(), Length());
-            styleResolver->style()->setHasClip(true);
+            styleResolver->style()->setHasClip(false);
         }
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to