Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Dashed/dotted borders do not paint.
https://bugs.webkit.org/show_bug.cgi?id=135898 Reviewed by Simon Fraser. Source/WebCore: Remove the empty line checks for drawLines. There's no need to protect the graphics context from empty lines. Tests: fast/borders/border-painting-dashed-at-all.html fast/borders/border-painting-dashed.html fast/borders/border-painting-dotted-at-all.html fast/borders/border-painting-dotted.html fast/borders/border-painting-double-at-all.html fast/borders/border-painting-double.html fast/borders/border-painting-groove-at-all.html fast/borders/border-painting-inset-at-all.html fast/borders/border-painting-inset.html fast/borders/border-painting-outset-at-all.html fast/borders/border-painting-outset.html fast/borders/border-painting-ridge-at-all.html fast/borders/border-painting-solid-at-all.html fast/borders/border-painting-solid.html fast/borders/hidpi-border-painting-groove.html fast/borders/hidpi-border-painting-ridge.html * rendering/RenderObject.cpp: (WebCore::RenderObject::drawLineForBoxSide): (WebCore::drawBorderLineRect): Deleted. (WebCore::drawBorderLine): Deleted. LayoutTests: *-at-all files test that we always paint borders. The other set of files test that borders are painted properly. They take advantage of the fact that borders with radius use a different painting code path. * TestExpectations: * fast/borders/border-painting-dashed-at-all-expected.html: Added. * fast/borders/border-painting-dashed-at-all.html: Added. * fast/borders/border-painting-dashed-expected.html: Added. * fast/borders/border-painting-dashed.html: Added. * fast/borders/border-painting-dotted-at-all-expected.html: Added. * fast/borders/border-painting-dotted-at-all.html: Added. * fast/borders/border-painting-dotted-expected.html: Added. * fast/borders/border-painting-dotted.html: Added. * fast/borders/border-painting-double-at-all-expected.html: Added. * fast/borders/border-painting-double-at-all.html: Added. * fast/borders/border-painting-double-expected.html: Added. * fast/borders/border-painting-double.html: Added. * fast/borders/border-painting-groove-at-all-expected.html: Added. * fast/borders/border-painting-groove-at-all.html: Added. * fast/borders/border-painting-inset-at-all-expected.html: Added. * fast/borders/border-painting-inset-at-all.html: Added. * fast/borders/border-painting-inset-expected.html: Added. * fast/borders/border-painting-inset.html: Added. * fast/borders/border-painting-outset-at-all-expected.html: Added. * fast/borders/border-painting-outset-at-all.html: Added. * fast/borders/border-painting-outset-expected.html: Added. * fast/borders/border-painting-outset.html: Added. * fast/borders/border-painting-ridge-at-all-expected.html: Added. * fast/borders/border-painting-ridge-at-all.html: Added. * fast/borders/border-painting-solid-at-all-expected.html: Added. * fast/borders/border-painting-solid-at-all.html: Added. * fast/borders/border-painting-solid-expected.html: Added. * fast/borders/border-painting-solid.html: Added. * fast/borders/hidpi-border-painting-groove-expected.html: Added. * fast/borders/hidpi-border-painting-groove.html: Added. * fast/borders/hidpi-border-painting-ridge-expected.html: Added. * fast/borders/hidpi-border-painting-ridge.html: Added. Canonical link: https://commits.webkit.org/153939@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
1,950 additions
and 26 deletions.
- +45 −0 LayoutTests/ChangeLog
- +5 −0 LayoutTests/TestExpectations
- +31 −0 LayoutTests/fast/borders/border-painting-dashed-at-all-expected.html
- +46 −0 LayoutTests/fast/borders/border-painting-dashed-at-all.html
- +80 −0 LayoutTests/fast/borders/border-painting-dashed-expected.html
- +79 −0 LayoutTests/fast/borders/border-painting-dashed.html
- +31 −0 LayoutTests/fast/borders/border-painting-dotted-at-all-expected.html
- +46 −0 LayoutTests/fast/borders/border-painting-dotted-at-all.html
- +80 −0 LayoutTests/fast/borders/border-painting-dotted-expected.html
- +79 −0 LayoutTests/fast/borders/border-painting-dotted.html
- +32 −0 LayoutTests/fast/borders/border-painting-double-at-all-expected.html
- +47 −0 LayoutTests/fast/borders/border-painting-double-at-all.html
- +80 −0 LayoutTests/fast/borders/border-painting-double-expected.html
- +79 −0 LayoutTests/fast/borders/border-painting-double.html
- +32 −0 LayoutTests/fast/borders/border-painting-groove-at-all-expected.html
- +46 −0 LayoutTests/fast/borders/border-painting-groove-at-all.html
- +32 −0 LayoutTests/fast/borders/border-painting-inset-at-all-expected.html
- +34 −0 LayoutTests/fast/borders/border-painting-inset-at-all.html
- +80 −0 LayoutTests/fast/borders/border-painting-inset-expected.html
- +79 −0 LayoutTests/fast/borders/border-painting-inset.html
- +33 −0 LayoutTests/fast/borders/border-painting-outset-at-all-expected.html
- +34 −0 LayoutTests/fast/borders/border-painting-outset-at-all.html
- +80 −0 LayoutTests/fast/borders/border-painting-outset-expected.html
- +79 −0 LayoutTests/fast/borders/border-painting-outset.html
- +32 −0 LayoutTests/fast/borders/border-painting-ridge-at-all-expected.html
- +47 −0 LayoutTests/fast/borders/border-painting-ridge-at-all.html
- +32 −0 LayoutTests/fast/borders/border-painting-solid-at-all-expected.html
- +33 −0 LayoutTests/fast/borders/border-painting-solid-at-all.html
- +80 −0 LayoutTests/fast/borders/border-painting-solid-expected.html
- +79 −0 LayoutTests/fast/borders/border-painting-solid.html
- +80 −0 LayoutTests/fast/borders/hidpi-border-painting-groove-expected.html
- +79 −0 LayoutTests/fast/borders/hidpi-border-painting-groove.html
- +80 −0 LayoutTests/fast/borders/hidpi-border-painting-ridge-expected.html
- +79 −0 LayoutTests/fast/borders/hidpi-border-painting-ridge.html
- +32 −0 Source/WebCore/ChangeLog
- +8 −26 Source/WebCore/rendering/RenderObject.cpp
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>This test that dashed borders are painted at all.</title> | ||
<style> | ||
div { | ||
position: absolute; | ||
top: 0px; | ||
width: 1px; | ||
background-color: red; | ||
} | ||
|
||
</style> | ||
<head> | ||
<body> | ||
<script> | ||
var borderWidth = 1; | ||
var x = 0; | ||
for (var i = 1; i < 10; ++i) { | ||
var e = document.createElement("div"); | ||
e.style.left = x + "px"; | ||
e.style.height = borderWidth + "px"; | ||
document.body.appendChild(e); | ||
|
||
borderWidth += 1; | ||
w = 10 * i; | ||
x += (w + 2 * borderWidth); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>This test that dashed borders are painted at all.</title> | ||
<style> | ||
.borderBox { | ||
position: absolute; | ||
top: 0px; | ||
height: 10px; | ||
border-top: dashed red; | ||
} | ||
|
||
.hide { | ||
position: fixed; | ||
top: 0px; | ||
background-color: white; | ||
} | ||
</style> | ||
<head> | ||
<body> | ||
<script> | ||
var borderWidth = 1; | ||
var x = 0; | ||
for (var i = 1; i < 10; ++i) { | ||
w = 10 * i; | ||
|
||
var e = document.createElement("div"); | ||
e.className = "borderBox"; | ||
e.style.left = x + "px"; | ||
e.style.width = w + "px"; | ||
e.style.borderTopWidth = borderWidth + "px"; | ||
document.body.appendChild(e); | ||
|
||
var hideBox = document.createElement("div"); | ||
hideBox.className = "hide"; | ||
hideBox.style.left = x + 1 + "px"; | ||
hideBox.style.width = w - 1 + "px"; | ||
hideBox.style.height = borderWidth + "px"; | ||
document.body.appendChild(hideBox); | ||
|
||
borderWidth += 1; | ||
x += (w + 2 * borderWidth); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,80 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>This test that dashed borders are painted. It takes advantage of the fact that borders with radius get through a different code path (Path vs. drawLine).</title> | ||
<style> | ||
.borderBox { | ||
position: absolute; | ||
width: 30px; | ||
height: 30px; | ||
border-style: dashed; | ||
border-color: red; | ||
} | ||
|
||
.hide { | ||
position: fixed; | ||
width: 4px; | ||
height: 4px; | ||
background-color: white; | ||
} | ||
</style> | ||
<head> | ||
<body> | ||
<script> | ||
var borderWidth = 1; | ||
var x = 0; | ||
var y = 0; | ||
var cornerBoxSize = 0; | ||
for (var i = 0; i < 10; ++i) { | ||
w = 20 * i; | ||
h = 20 * i; | ||
cornerBoxSize = 2 * borderWidth; | ||
|
||
var e = document.createElement("div"); | ||
e.className = "borderBox"; | ||
e.style.top = y + "px"; | ||
e.style.left = x + "px"; | ||
e.style.width = w + "px"; | ||
e.style.height = h + "px"; | ||
e.style.borderWidth = borderWidth + "px"; | ||
e.style.borderRadius = borderWidth + 1 + "px"; | ||
document.body.appendChild(e); | ||
|
||
var hb1 = document.createElement("div"); | ||
hb1.className = "hide"; | ||
hb1.style.top = y + "px"; | ||
hb1.style.left = x + "px"; | ||
hb1.style.width = cornerBoxSize + "px"; | ||
hb1.style.height = cornerBoxSize + "px"; | ||
document.body.appendChild(hb1); | ||
|
||
var hb2 = document.createElement("div"); | ||
hb2.className = "hide"; | ||
hb2.style.top = y + "px"; | ||
hb2.style.left = x + w + "px"; | ||
hb2.style.width = cornerBoxSize + "px"; | ||
hb2.style.height = cornerBoxSize + "px"; | ||
document.body.appendChild(hb2); | ||
|
||
var hb3 = document.createElement("div"); | ||
hb3.className = "hide"; | ||
hb3.style.top = y + h + "px"; | ||
hb3.style.left = x + "px"; | ||
hb3.style.width = cornerBoxSize + "px"; | ||
hb3.style.height = cornerBoxSize + "px"; | ||
document.body.appendChild(hb3); | ||
|
||
var hb4 = document.createElement("div"); | ||
hb4.className = "hide"; | ||
hb4.style.top = y + w + "px"; | ||
hb4.style.left = x + h + "px"; | ||
hb4.style.width = cornerBoxSize + "px"; | ||
hb4.style.height = cornerBoxSize + "px"; | ||
document.body.appendChild(hb4); | ||
|
||
borderWidth += 1; | ||
x += (w + 2 * borderWidth); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,79 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>This test that dashed borders are painted.</title> | ||
<style> | ||
.borderBox { | ||
position: absolute; | ||
width: 30px; | ||
height: 30px; | ||
border-style: dashed; | ||
border-color: red; | ||
} | ||
|
||
.hide { | ||
position: fixed; | ||
width: 4px; | ||
height: 4px; | ||
background-color: white; | ||
} | ||
</style> | ||
<head> | ||
<body> | ||
<script> | ||
var borderWidth = 1; | ||
var x = 0; | ||
var y = 0; | ||
var cornerBoxSize = 0; | ||
for (var i = 0; i < 10; ++i) { | ||
w = 20 * i; | ||
h = 20 * i; | ||
cornerBoxSize = 2 * borderWidth; | ||
|
||
var e = document.createElement("div"); | ||
e.className = "borderBox"; | ||
e.style.top = y + "px"; | ||
e.style.left = x + "px"; | ||
e.style.width = w + "px"; | ||
e.style.height = h + "px"; | ||
e.style.borderWidth = borderWidth + "px"; | ||
document.body.appendChild(e); | ||
|
||
var hb1 = document.createElement("div"); | ||
hb1.className = "hide"; | ||
hb1.style.top = y + "px"; | ||
hb1.style.left = x + "px"; | ||
hb1.style.width = cornerBoxSize + "px"; | ||
hb1.style.height = cornerBoxSize + "px"; | ||
document.body.appendChild(hb1); | ||
|
||
var hb2 = document.createElement("div"); | ||
hb2.className = "hide"; | ||
hb2.style.top = y + "px"; | ||
hb2.style.left = x + w + "px"; | ||
hb2.style.width = cornerBoxSize + "px"; | ||
hb2.style.height = cornerBoxSize + "px"; | ||
document.body.appendChild(hb2); | ||
|
||
var hb3 = document.createElement("div"); | ||
hb3.className = "hide"; | ||
hb3.style.top = y + h + "px"; | ||
hb3.style.left = x + "px"; | ||
hb3.style.width = cornerBoxSize + "px"; | ||
hb3.style.height = cornerBoxSize + "px"; | ||
document.body.appendChild(hb3); | ||
|
||
var hb4 = document.createElement("div"); | ||
hb4.className = "hide"; | ||
hb4.style.top = y + w + "px"; | ||
hb4.style.left = x + h + "px"; | ||
hb4.style.width = cornerBoxSize + "px"; | ||
hb4.style.height = cornerBoxSize + "px"; | ||
document.body.appendChild(hb4); | ||
|
||
borderWidth += 1; | ||
x += (w + 2 * borderWidth); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>This test that dotted borders are painted at all.</title> | ||
<style> | ||
div { | ||
position: absolute; | ||
top: 0px; | ||
width: 1px; | ||
background-color: red; | ||
} | ||
|
||
</style> | ||
<head> | ||
<body> | ||
<script> | ||
var borderWidth = 1; | ||
var x = 0; | ||
for (var i = 1; i < 10; ++i) { | ||
var e = document.createElement("div"); | ||
e.style.left = x + "px"; | ||
e.style.height = borderWidth + "px"; | ||
document.body.appendChild(e); | ||
|
||
borderWidth += 1; | ||
w = 10 * i; | ||
x += (w + 2 * borderWidth); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>This test that dashed borders are painted at all.</title> | ||
<style> | ||
.borderBox { | ||
position: absolute; | ||
top: 0px; | ||
height: 10px; | ||
border-top: dotted red; | ||
} | ||
|
||
.hide { | ||
position: fixed; | ||
top: 0px; | ||
background-color: white; | ||
} | ||
</style> | ||
<head> | ||
<body> | ||
<script> | ||
var borderWidth = 1; | ||
var x = 0; | ||
for (var i = 1; i < 10; ++i) { | ||
w = 10 * i; | ||
|
||
var e = document.createElement("div"); | ||
e.className = "borderBox"; | ||
e.style.left = x + "px"; | ||
e.style.width = w + "px"; | ||
e.style.borderTopWidth = borderWidth + "px"; | ||
document.body.appendChild(e); | ||
|
||
var hideBox = document.createElement("div"); | ||
hideBox.className = "hide"; | ||
hideBox.style.left = x + 1 + "px"; | ||
hideBox.style.width = w - 1 + "px"; | ||
hideBox.style.height = borderWidth + "px"; | ||
document.body.appendChild(hideBox); | ||
|
||
borderWidth += 1; | ||
x += (w + 2 * borderWidth); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.