Commit fda9d1d6 authored by zoltan@webkit.org's avatar zoltan@webkit.org
Browse files

[CSS Exclusions] The radius of a circle should be computed based on the shorter available dimension

https://bugs.webkit.org/show_bug.cgi?id=113255

Reviewed by Julien Chaffraix.

When we decide what should be the radius of a circle, we should choose the smallest available space. For instance when the
width or height is not resolvable for the circle we should not have a radius for it. This change modifies the behavior to
use the smaller available space, so we won't render unnecessary circle shapes.

Source/WebCore: 

Test: fast/exclusions/shape-inside/shape-inside-on-nested-container-with-unresolved-height.html

* rendering/ExclusionShape.cpp:
(WebCore::ExclusionShape::createExclusionShape):

LayoutTests: 

* fast/exclusions/shape-inside/shape-inside-on-nested-container-with-unresolved-height-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-on-nested-container-with-unresolved-height.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent da73879a
2013-03-26 Zoltan Horvath <zoltan@webkit.org>
[CSS Exclusions] The radius of a circle should be computed based on the shorter available dimension
https://bugs.webkit.org/show_bug.cgi?id=113255
Reviewed by Julien Chaffraix.
When we decide what should be the radius of a circle, we should choose the smallest available space. For instance when the
width or height is not resolvable for the circle we should not have a radius for it. This change modifies the behavior to
use the smaller available space, so we won't render unnecessary circle shapes.
* fast/exclusions/shape-inside/shape-inside-on-nested-container-with-unresolved-height-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-on-nested-container-with-unresolved-height.html: Added.
2013-03-26 James Robinson <jamesr@chromium.org>
 
Clean up last failing expectations from solid color layer patch.
<!DOCTYPE html>
<html>
<head>
<style>
.parent {
background-color: green;
width: 300px;
border: 1px solid blue;
}
.container {
background-color: yellow;
}
</style>
</head>
<body>
<div class="parent">
<div class="container">
But humane Starbuck was too late. At the instant of the dart an ulcerous jet shot from this cruel wound, and goaded by it into more than sufferable anguish,
the whale now spouting thick blood, with swift fury blindly darted at the craft, bespattering them and their glorying crews all over with showers of gore, capsizing
Flask's boat and marring the bows.
</div>
</div>
<p>We have two containers, a shape-inside: circle property is applied on the nested container. Since the nested container's height is not resolvable, we shouldn't apply the circle shape-inside on the content. <br/>We should see the content inside a 300px wide green container, the text shouldn't form any circular shape.</p>
<p>Bug <a href="http://webkit.org/b/113255 ">113255</a>: The radius of a circle should be computed based on the shorter available dimensions</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
.parent {
background-color: green;
width: 300px;
border: 1px solid blue;
}
.container {
background-color: yellow;
-webkit-shape-inside: circle(50%, 50%, 50%);
}
</style>
</head>
<body>
<div class="parent">
<div class="container">
But humane Starbuck was too late. At the instant of the dart an ulcerous jet shot from this cruel wound, and goaded by it into more than sufferable anguish,
the whale now spouting thick blood, with swift fury blindly darted at the craft, bespattering them and their glorying crews all over with showers of gore, capsizing
Flask's boat and marring the bows.
</div>
</div>
<p>We have two containers, a shape-inside: circle property is applied on the nested container. Since the nested container's height is not resolvable, we shouldn't apply the circle shape-inside on the content. <br/>We should see the content inside a 300px wide green container, the text shouldn't form any circular shape.</p>
<p>Bug <a href="http://webkit.org/b/113255 ">113255</a>: The radius of a circle should be computed based on the shorter available dimensions</p>
</body>
</html>
2013-03-26 Zoltan Horvath <zoltan@webkit.org>
[CSS Exclusions] The radius of a circle should be computed based on the shorter available dimension
https://bugs.webkit.org/show_bug.cgi?id=113255
Reviewed by Julien Chaffraix.
When we decide what should be the radius of a circle, we should choose the smallest available space. For instance when the
width or height is not resolvable for the circle we should not have a radius for it. This change modifies the behavior to
use the smaller available space, so we won't render unnecessary circle shapes.
Test: fast/exclusions/shape-inside/shape-inside-on-nested-container-with-unresolved-height.html
* rendering/ExclusionShape.cpp:
(WebCore::ExclusionShape::createExclusionShape):
2013-03-26 Timothy Hatcher <timothy@apple.com>
 
Make the Web Inspector console work in strict mode with JavaScriptCore.
......@@ -124,7 +124,7 @@ PassOwnPtr<ExclusionShape> ExclusionShape::createExclusionShape(const BasicShape
const BasicShapeCircle* circle = static_cast<const BasicShapeCircle*>(basicShape);
float centerX = floatValueForLength(circle->centerX(), boxWidth);
float centerY = floatValueForLength(circle->centerY(), boxHeight);
float radius = floatValueForLength(circle->radius(), std::max(boxHeight, boxWidth));
float radius = floatValueForLength(circle->radius(), std::min(boxHeight, boxWidth));
FloatPoint logicalCenter = physicalPointToLogical(FloatPoint(centerX, centerY), logicalBoxHeight, writingMode);
exclusionShape = createExclusionCircle(logicalCenter, radius);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment