Skip to content
Permalink
Browse files
Always render at least a device pixel line when border/outline width …
…> 0.

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

This matches Firefox behaviour.

Reviewed by Simon Fraser.

Source/WebCore:

Existing test is modified to reflect the new behaviour.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLineWidth):
* rendering/BorderEdge.cpp:
(WebCore::BorderEdge::BorderEdge): Deleted.
* rendering/BorderEdge.h:

LayoutTests:

* fast/borders/hidpi-border-width-flooring-expected.html:
* fast/borders/hidpi-border-width-flooring.html:


Canonical link: https://commits.webkit.org/169442@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alanbujtas committed Nov 13, 2015
1 parent 5e4c5c4 commit 1f14c80a48dfe175ef82c49a3028ffacb7e8ee7c
Showing 12 changed files with 4,414 additions and 4,370 deletions.
@@ -1,3 +1,15 @@
2015-11-13 Zalan Bujtas <zalan@apple.com>

Always render at least a device pixel line when border/outline width > 0.
https://bugs.webkit.org/show_bug.cgi?id=151269

This matches Firefox behaviour.

Reviewed by Simon Fraser.

* fast/borders/hidpi-border-width-flooring-expected.html:
* fast/borders/hidpi-border-width-flooring.html:

2015-11-13 Carlos Alberto Lopez Perez <clopez@igalia.com>

[GTK] GTK gardening.

Large diffs are not rendered by default.

@@ -1,8 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<title>This tests that we don't paint border's smaller than 0.5px on retina displays. (border width is floored)</title>
<title>This tests that we paint at least one device pixel width border when border-width > 0.</title>
<style>
div {
height: 100px;
width: 10px;
left: 0px;
top: 0px;
position: absolute;
border: solid 0.5px green;
}
</style>
</head>
<body>
<p id="container"></p>
<script>
var container = document.getElementById("container");
var left = 0;
for (var i = 0; i < 50; ++i) {
var e = document.createElement("div");
e.style.left = left + "px";
container.appendChild(e);
left += 11;
}
</script>
</body>
</html>
@@ -1,29 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<title>This tests that we don't paint border's smaller than 0.5px on retina displays. (border width is floored)</title>
<title>This tests that we paint at least one device pixel width border when border-width > 0.</title>
<style>
div {
height: 100px;
width: 100px;
width: 10px;
position: absolute;
left: 0px;
top: 0px;
border: solid 0px green;
}

</style>
</head>
<body>
<p id="container"></p>
<script>
var container = document.getElementById("container");
adjustment = 0;
for (i = 0; i < 49; ++i) {
adjustment += 0.01;
var borderWidth = 0.1;
var left = 0;
for (var i = 0; i < 50; ++i) {
var e = document.createElement("div");
e.style.borderWidth = adjustment + "px";
e.style.borderWidth = borderWidth + "px";
e.style.left = left + "px";
container.appendChild(e);
borderWidth += 0.01;
left += 11;
}
</script>
</body>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -1,3 +1,20 @@
2015-11-13 Zalan Bujtas <zalan@apple.com>

Always render at least a device pixel line when border/outline width > 0.
https://bugs.webkit.org/show_bug.cgi?id=151269

This matches Firefox behaviour.

Reviewed by Simon Fraser.

Existing test is modified to reflect the new behaviour.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLineWidth):
* rendering/BorderEdge.cpp:
(WebCore::BorderEdge::BorderEdge): Deleted.
* rendering/BorderEdge.h:

2015-11-13 Per Arne Vollan <peavo@outlook.com>

[WinCairo][MediaFoundation] Video rendered at wrong position.
@@ -235,6 +235,9 @@ inline T StyleBuilderConverter::convertLineWidth(StyleResolver& styleResolver, C
if (originalLength >= 1.0)
return 1;
}
float minimumLineWidth = 1 / styleResolver.document().deviceScaleFactor();
if (result > 0 && result < minimumLineWidth)
return minimumLineWidth;
return result;
}
default:
@@ -180,7 +180,6 @@ Page::Page(PageConfiguration& pageConfiguration)
, m_muted(false)
, m_pageScaleFactor(1)
, m_zoomedOutPageScaleFactor(0)
, m_deviceScaleFactor(1)
, m_topContentInset(0)
#if ENABLE(IOS_TEXT_AUTOSIZING)
, m_textAutosizingWidth(0)
@@ -563,7 +563,7 @@ class Page : public Supplementable<Page> {

float m_pageScaleFactor;
float m_zoomedOutPageScaleFactor;
float m_deviceScaleFactor;
float m_deviceScaleFactor { 1 };
float m_viewScaleFactor { 1 };

float m_topContentInset;
@@ -46,16 +46,6 @@ BorderEdge::BorderEdge(LayoutUnit edgeWidth, Color edgeColor, EBorderStyle edgeS
m_flooredToDevicePixelWidth = floorToDevicePixel(edgeWidth, devicePixelRatio);
}

BorderEdge::BorderEdge()
: m_width(LayoutUnit::fromPixel(0))
, m_style(BHIDDEN)
, m_isTransparent(false)
, m_isPresent(false)
, m_flooredToDevicePixelWidth(0)
, m_devicePixelRatio(1)
{
}

void BorderEdge::getBorderEdgeInfo(BorderEdge edges[], const RenderStyle& style, float deviceScaleFactor, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
bool horizontal = style.isHorizontalWritingMode();
@@ -45,7 +45,7 @@ class BorderEdge {
AllBorderEdges = TopBorderEdge | BottomBorderEdge | LeftBorderEdge | RightBorderEdge
};

BorderEdge();
BorderEdge() = default;
BorderEdge(LayoutUnit edgeWidth, Color edgeColor, EBorderStyle edgeStyle, bool edgeIsTransparent, bool edgeIsPresent, float devicePixelRatio);

static void getBorderEdgeInfo(BorderEdge edges[], const RenderStyle&, float deviceScaleFactor, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
@@ -68,11 +68,11 @@ class BorderEdge {

LayoutUnit m_width;
Color m_color;
EBorderStyle m_style;
bool m_isTransparent;
bool m_isPresent;
float m_flooredToDevicePixelWidth;
float m_devicePixelRatio;
EBorderStyle m_style { BHIDDEN };
bool m_isTransparent { false };
bool m_isPresent { false };
float m_flooredToDevicePixelWidth { 0 };
float m_devicePixelRatio { 1 };
};

inline bool edgesShareColor(const BorderEdge& firstEdge, const BorderEdge& secondEdge) { return firstEdge.color() == secondEdge.color(); }

0 comments on commit 1f14c80

Please sign in to comment.