Title: [143010] trunk
- Revision
- 143010
- Author
- [email protected]
- Date
- 2013-02-15 09:31:39 -0800 (Fri, 15 Feb 2013)
Log Message
[CSS Exclusions] Enable shape-inside support for circles
https://bugs.webkit.org/show_bug.cgi?id=109713
Patch by Hans Muller <[email protected]> on 2013-02-15
Reviewed by Dirk Schulze.
Source/WebCore:
Removed the test that disabled circle values for shape-inside.
The remaining support for circles, which is based on rounded rectangles
whose width/height is equal to their radiusX/radiusY, has not changed.
Test: fast/exclusions/shape-inside/shape-inside-circle.html
* rendering/ExclusionShapeInsideInfo.h:
(WebCore::ExclusionShapeInsideInfo::isEnabledFor): Now only disallows ellipse.
LayoutTests:
Added a test for circle shape-inside values.
* fast/exclusions/shape-inside/shape-inside-circle-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-circle.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (143009 => 143010)
--- trunk/LayoutTests/ChangeLog 2013-02-15 17:09:46 UTC (rev 143009)
+++ trunk/LayoutTests/ChangeLog 2013-02-15 17:31:39 UTC (rev 143010)
@@ -1,3 +1,15 @@
+2013-02-15 Hans Muller <[email protected]>
+
+ [CSS Exclusions] Enable shape-inside support for circles
+ https://bugs.webkit.org/show_bug.cgi?id=109713
+
+ Reviewed by Dirk Schulze.
+
+ Added a test for circle shape-inside values.
+
+ * fast/exclusions/shape-inside/shape-inside-circle-expected.html: Added.
+ * fast/exclusions/shape-inside/shape-inside-circle.html: Added.
+
2013-02-15 Vsevolod Vlasov <[email protected]>
Web Inspector: Several consecutive Backspace or Delete strikes should not be marked as undoable state.
Added: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-circle-expected.html (0 => 143010)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-circle-expected.html (rev 0)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-circle-expected.html 2013-02-15 17:31:39 UTC (rev 143010)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ #shape-inside {
+ position: relative;
+ }
+
+ #shape-outline {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 400px;
+ height: 400px;
+ }
+
+ /* The size of a square that just fits within a circle of radius r is r * sqrt(2). In this
+ case that's the size of one Ahem character: 100 * sqrt(2) == 141.42.
+
+ The left and top edges of a square that just fits within a circle of radius r are offset
+ by r - (r * sqrt(2)) / 2, which is 29.289 for r = 100. The center of the circle is at 200,200
+ so the top and left edges of the square are 129.289.
+ */
+ #shape-content {
+ position: absolute;
+ top: 129.289px;
+ left: 129.289px;
+ font: 141.42px/1 Ahem, sans-serif;
+ color: green;
+ }
+</style>
+</head>
+<body>
+ <div id="shape-inside">
+ <div id="shape-content">X</div>
+ <svg id="shape-outline" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="200" cy="200" r="100" stroke="blue" fill="none"/>
+ </svg>
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-circle.html (0 => 143010)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-circle.html (rev 0)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-circle.html 2013-02-15 17:31:39 UTC (rev 143010)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+ if (window.internals)
+ window.internals.settings.setCSSExclusionsEnabled(true);
+</script>
+<style>
+ /* The size of a square that just fits within a circle of radius r is r * sqrt(2). In this
+ case that's the size of one Ahem character: 100 * sqrt(2) == 141.42.
+ */
+ #shape-inside {
+ position: relative;
+ width: 400px;
+ height: 400px;
+ -webkit-shape-inside: circle(200px, 200px, 100px);
+ font: 141.42px/1 Ahem, sans-serif;
+
+ color: green;
+ }
+
+ #shape-outline {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 400px;
+ height: 400px;
+ }
+</style>
+</head>
+<body>
+ <div id="shape-inside">
+ <svg id="shape-outline" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="200" cy="200" r="100" stroke="blue" fill="none"/>
+ </svg>
+ X
+ </div>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (143009 => 143010)
--- trunk/Source/WebCore/ChangeLog 2013-02-15 17:09:46 UTC (rev 143009)
+++ trunk/Source/WebCore/ChangeLog 2013-02-15 17:31:39 UTC (rev 143010)
@@ -1,3 +1,19 @@
+2013-02-15 Hans Muller <[email protected]>
+
+ [CSS Exclusions] Enable shape-inside support for circles
+ https://bugs.webkit.org/show_bug.cgi?id=109713
+
+ Reviewed by Dirk Schulze.
+
+ Removed the test that disabled circle values for shape-inside.
+ The remaining support for circles, which is based on rounded rectangles
+ whose width/height is equal to their radiusX/radiusY, has not changed.
+
+ Test: fast/exclusions/shape-inside/shape-inside-circle.html
+
+ * rendering/ExclusionShapeInsideInfo.h:
+ (WebCore::ExclusionShapeInsideInfo::isEnabledFor): Now only disallows ellipse.
+
2013-02-15 Christophe Dumez <[email protected]>
[Soup] Leverage new soup_cookie_jar_get_cookie_list() API
Modified: trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.h (143009 => 143010)
--- trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.h 2013-02-15 17:09:46 UTC (rev 143009)
+++ trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.h 2013-02-15 17:31:39 UTC (rev 143010)
@@ -61,7 +61,7 @@
// FIXME: Bug 89707: Enable shape inside for non-rectangular shapes
ExclusionShapeValue* shapeValue = renderer->style()->shapeInside();
BasicShape* shape = (shapeValue && shapeValue->type() == ExclusionShapeValue::SHAPE) ? shapeValue->shape() : 0;
- return shape && (shape->type() == BasicShape::BASIC_SHAPE_RECTANGLE || shape->type() == BasicShape::BASIC_SHAPE_POLYGON);
+ return shape && shape->type() != BasicShape::BASIC_SHAPE_ELLIPSE;
}
bool lineOverlapsShapeBounds() const { return logicalLineTop() < shapeLogicalBottom() && logicalLineBottom() >= shapeLogicalTop(); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes