| Differences between
and this patch
- a/LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-zoom-expected.html +42 lines
Line 0 a/LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-zoom-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<style>
5
    #shape-inside {
6
        position: relative;
7
    }
8
9
    #shape-outline {
10
        position: absolute;
11
        top: 0px;
12
        left: 0px;
13
        width: 500px;
14
        height: 500px;
15
    }
16
17
    #shape-content {
18
        position: absolute;
19
        top: 50px;
20
        left: 50px;
21
        font: 50px/1 Ahem, sans-serif;
22
        color: green;
23
    }
24
</style>
25
</head>
26
<body>
27
    <p>The green rectangles should lie within the inner blue outline.</p>
28
    <div id="shape-inside">
29
        <div id="shape-content">
30
            XXX<br/><br/>XX<br/><br/>XXX
31
        </div>
32
        <svg id="shape-outline" xmlns="http://www.w3.org/2000/svg">
33
            <polygon points="0,0 400,0 400,350 0,350" stroke="blue" fill="none"/>
34
            <polygon points="50,50 350,50 350,300 50,300" stroke="blue" fill="none"/>
35
        </svg>
36
    </div>
37
</body>
38
<script>
39
document.body.style.zoom = 1.2
40
</script>
41
</html>
42
- a/LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-zoom.html +40 lines
Line 0 a/LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-zoom.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script>
5
    if (window.internals)
6
        window.internals.settings.setCSSExclusionsEnabled(true);
7
</script>
8
<style>
9
    #shape-inside {
10
        position: relative;
11
        font: 50px/1 Ahem, sans-serif;
12
        color: green;
13
        -webkit-shape-inside: polygon(0px 0px, 400px 0px, 400px 350px, 0px 350px);
14
        -webkit-shape-padding: 50px;
15
    }
16
17
    #shape-outline {
18
        position: absolute;
19
        top: 0px;
20
        left: 0px;
21
        width: 500px;
22
        height: 500px;
23
    }
24
</style>
25
</head>
26
<body>
27
    <p>The green rectangles should lie within the inner blue outline.</p>
28
    <div id="shape-inside">
29
        <svg id="shape-outline" xmlns="http://www.w3.org/2000/svg">
30
            <polygon points="0,0 400,0 400,350 0,350" stroke="blue" fill="none"/>
31
            <polygon points="50,50 350,50 350,300 50,300" stroke="blue" fill="none"/>
32
        </svg>
33
        XXX<br/><br/>XX<br/><br/>XXX
34
    </div>
35
</body>
36
<script>
37
document.body.style.zoom = 1.2
38
</script>
39
</html>
40
- a/Source/WebCore/rendering/ExclusionPolygon.cpp +8 lines
Lines 129-134 static inline void appendArc(Vector<FloatPoint>& vertices, const FloatPoint& arc a/Source/WebCore/rendering/ExclusionPolygon.cpp_sec1
129
    vertices.append(endArcVertex);
129
    vertices.append(endArcVertex);
130
}
130
}
131
131
132
static inline void snapVerticesToLayoutUnitGrid(Vector<FloatPoint>& vertices)
133
{
134
    for (unsigned i = 0; i < vertices.size(); ++i)
135
        vertices[i].set(LayoutUnit(vertices[i].x()).toFloat(), LayoutUnit(vertices[i].y()).toFloat());
136
}
137
132
static inline FloatPolygon *computeShapePaddingBounds(const FloatPolygon& polygon, float padding, WindRule fillRule)
138
static inline FloatPolygon *computeShapePaddingBounds(const FloatPolygon& polygon, float padding, WindRule fillRule)
133
{
139
{
134
    Vector<FloatPoint>* paddedVertices = new Vector<FloatPoint>();
140
    Vector<FloatPoint>* paddedVertices = new Vector<FloatPoint>();
Lines 146-151 static inline FloatPolygon *computeShapePaddingBounds(const FloatPolygon& polygo a/Source/WebCore/rendering/ExclusionPolygon.cpp_sec2
146
            appendArc(*paddedVertices, thisEdge.vertex1(), padding, prevOffsetEdge.vertex2(), thisOffsetEdge.vertex1(), true);
152
            appendArc(*paddedVertices, thisEdge.vertex1(), padding, prevOffsetEdge.vertex2(), thisOffsetEdge.vertex1(), true);
147
    }
153
    }
148
154
155
    snapVerticesToLayoutUnitGrid(*paddedVertices);
149
    return new FloatPolygon(adoptPtr(paddedVertices), fillRule);
156
    return new FloatPolygon(adoptPtr(paddedVertices), fillRule);
150
}
157
}
151
158
Lines 166-171 static inline FloatPolygon *computeShapeMarginBounds(const FloatPolygon& polygon a/Source/WebCore/rendering/ExclusionPolygon.cpp_sec3
166
            appendArc(*marginVertices, thisEdge.vertex1(), margin, prevOffsetEdge.vertex2(), thisOffsetEdge.vertex1(), false);
173
            appendArc(*marginVertices, thisEdge.vertex1(), margin, prevOffsetEdge.vertex2(), thisOffsetEdge.vertex1(), false);
167
    }
174
    }
168
175
176
    snapVerticesToLayoutUnitGrid(*marginVertices);
169
    return new FloatPolygon(adoptPtr(marginVertices), fillRule);
177
    return new FloatPolygon(adoptPtr(marginVertices), fillRule);
170
}
178
}
171
179

Return to Bug 113730