https://bugs.webkit.org/show_bug.cgi?id=109713
Patch by Hans Muller <hmuller@adobe.com> 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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143010
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-02-15 Hans Muller <hmuller@adobe.com>
+
+ [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 <vsevik@chromium.org>
Web Inspector: Several consecutive Backspace or Delete strikes should not be marked as undoable state.
--- /dev/null
+<!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>
--- /dev/null
+<!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>
+2013-02-15 Hans Muller <hmuller@adobe.com>
+
+ [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 <ch.dumez@sisa.samsung.com>
[Soup] Leverage new soup_cookie_jar_get_cookie_list() API
// 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(); }