Title: [194421] trunk
Revision
194421
Author
[email protected]
Date
2015-12-25 21:28:15 -0800 (Fri, 25 Dec 2015)

Log Message

Subpixel rendering: Add subpixel support for outline.
https://bugs.webkit.org/show_bug.cgi?id=152560

Source/WebCore:

Reviewed by Simon Fraser.

This patch adds support for subpixel outline-width/outline-offset.

Test: fast/borders/hidpi-outline-hairline-painting.html

* css/CSSPropertyNames.in:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* platform/graphics/GraphicsContext.h:
* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::GraphicsContext::drawFocusRing):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::computeMaxOutlineSize):
(WebCore::RenderElement::paintOutline):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutlineForLine):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::adjustRectForOutlineAndShadow):
* rendering/RenderView.cpp:
(WebCore::RenderView::setMaximalOutlineSize):
* rendering/RenderView.h:
* rendering/style/OutlineValue.h:
(WebCore::OutlineValue::offset):
(WebCore::OutlineValue::OutlineValue): Deleted.
* rendering/style/RenderStyle.h:

LayoutTests:

Unable to ref-test other outline types.

Reviewed by Simon Fraser.

* fast/borders/hidpi-outline-hairline-painting-expected.html: Added.
* fast/borders/hidpi-outline-hairline-painting.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (194420 => 194421)


--- trunk/LayoutTests/ChangeLog	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/LayoutTests/ChangeLog	2015-12-26 05:28:15 UTC (rev 194421)
@@ -1,3 +1,15 @@
+2015-12-25  Zalan Bujtas  <[email protected]>
+
+        Subpixel rendering: Add subpixel support for outline.
+        https://bugs.webkit.org/show_bug.cgi?id=152560
+
+        Unable to ref-test other outline types.
+
+        Reviewed by Simon Fraser.
+
+        * fast/borders/hidpi-outline-hairline-painting-expected.html: Added.
+        * fast/borders/hidpi-outline-hairline-painting.html: Added.
+
 2015-12-24  Zalan Bujtas  <[email protected]>
 
         ASSERTION FAILED: x2 >= x1 in WebCore::RenderElement::drawLineForBoxSide

Added: trunk/LayoutTests/fast/borders/hidpi-outline-hairline-painting-expected.html (0 => 194421)


--- trunk/LayoutTests/fast/borders/hidpi-outline-hairline-painting-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/borders/hidpi-outline-hairline-painting-expected.html	2015-12-26 05:28:15 UTC (rev 194421)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests hairline outline painting.</title>
+<style>
+  div {
+    position: absolute;
+    height: 5px;
+    width: 5px;
+    border: 0.5px solid green;
+  }
+</style>
+</head>
+<body>
+<div style="border-style: solid; top: 9.5px; left: 9.5px;"></div>
+<div style="border-style: solid; top: 9.5px; left: 24.5px;"></div>
+<div style="border-style: solid; top: 9.5px; left: 39.5px;"></div>
+<div style="border-style: solid; top: 9.5px; left: 54.5px;"></div>
+<div style="border-style: solid; width: 6px; height: 6px; top: 9px; left: 69px;"></div>
+<div style="border-style: solid; width: 6px; height: 6px; top: 9px; left: 84px;"></div>
+<div style="border-style: solid; width: 6px; height: 6px; top: 9px; left: 99px;"></div>
+<div style="border-style: solid; width: 6px; height: 6px; top: 9px; left: 114px;"></div>
+<div style="border-style: solid; width: 6px; height: 6px; top: 9px; left: 129px;"></div>
+<div style="border-style: solid; border-width: 1px; width: 7px; height: 7px; top: 8px; left: 143px;"></div>
+<div style="border-style: solid; border-width: 1px; width: 7px; height: 7px; top: 8px; left: 158px;"></div>
+
+<div style="border-style: double; top: 24px; left: 9px; width: 6px; height: 6px;"></div>
+<div style="border-style: double; top: 24px; left: 24px; width: 6px; height: 6px;"></div>
+<div style="border-style: double; border-width: 1px; top: 23px; left: 38px; width: 7px; height: 7px;"></div>
+<div style="border-style: double; border-width: 1px; top: 23px; left: 53px; width: 7px; height: 7px;"></div>
+<div style="border-style: double; border-width: 1px; top: 23px; left: 68px; width: 7px; height: 7px;"></div>
+<div style="border-style: double; border-width: 1px; top: 23px; left: 83px; width: 7px; height: 7px;"></div>
+<div style="border-style: double; border-width: 1px; top: 23px; left: 98px; width: 7px; height: 7px;"></div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/borders/hidpi-outline-hairline-painting.html (0 => 194421)


--- trunk/LayoutTests/fast/borders/hidpi-outline-hairline-painting.html	                        (rev 0)
+++ trunk/LayoutTests/fast/borders/hidpi-outline-hairline-painting.html	2015-12-26 05:28:15 UTC (rev 194421)
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests hairline outline painting</title>
+<style>
+  div {
+    position: absolute;
+    height: 5px;
+    width: 5px;
+    left: 10px;
+    top: 10px;
+    outline: solid 0px green;
+    outline-offset: 0px;
+  }
+</style>
+</head>
+<body>
+<p id="container"></p>
+<script>
+  var container = document.getElementById("container");
+  var leftPos = 10;
+  var width = 0.1;
+  for (var i = 0; i <= 10; ++i) {
+    var e = document.createElement("div");
+    e.style.left = leftPos + "px";
+    e.style.outlineWidth = width + "px";
+    e.style.outlineOffset = width + "px";
+    container.appendChild(e);
+    width += 0.1;
+    leftPos += 15;
+  }
+  leftPos = 10;
+  width = 0.8;
+  for (var i = 0; i <= 6; ++i) {
+    var e = document.createElement("div");
+    e.style.left = leftPos + "px";
+    e.style.top = "25px";
+    e.style.outlineWidth = width + "px";
+    e.style.outlineOffset = width + "px";
+    e.style.outlineStyle = "double";
+    container.appendChild(e);
+    width += 0.1;
+    leftPos += 15;
+  }
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (194420 => 194421)


--- trunk/Source/WebCore/ChangeLog	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/ChangeLog	2015-12-26 05:28:15 UTC (rev 194421)
@@ -1,3 +1,37 @@
+2015-12-25  Zalan Bujtas  <[email protected]>
+
+        Subpixel rendering: Add subpixel support for outline.
+        https://bugs.webkit.org/show_bug.cgi?id=152560
+
+        Reviewed by Simon Fraser.
+
+        This patch adds support for subpixel outline-width/outline-offset.
+
+        Test: fast/borders/hidpi-outline-hairline-painting.html
+
+        * css/CSSPropertyNames.in:
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/mac/GraphicsContextMac.mm:
+        (WebCore::GraphicsContext::drawFocusRing):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::computeMaxOutlineSize):
+        (WebCore::RenderElement::paintOutline):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::paintAreaElementFocusRing):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::paintOutlineForLine):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::adjustRectForOutlineAndShadow):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::setMaximalOutlineSize):
+        * rendering/RenderView.h:
+        * rendering/style/OutlineValue.h:
+        (WebCore::OutlineValue::offset):
+        (WebCore::OutlineValue::OutlineValue): Deleted.
+        * rendering/style/RenderStyle.h:
+
 2015-12-25  Alexey Proskuryakov  <[email protected]>
 
         ASSERT(m_nsResponse) in ResourceResponse::platformCertificateInfo() when running tests in iOS simulator

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (194420 => 194421)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2015-12-26 05:28:15 UTC (rev 194421)
@@ -277,9 +277,9 @@
 orphans [Inherited, AutoFunctions]
 outline [Longhands=outline-color|outline-style|outline-width]
 outline-color [VisitedLinkColorSupport, Initial=invalidColor]
-outline-offset [Converter=ComputedLength<int>]
+outline-offset [Converter=ComputedLength<float>]
 outline-style [Custom=All]
-outline-width [Converter=LineWidth<unsigned short>]
+outline-width [Converter=LineWidth<float>]
 overflow [Longhands=overflow-x|overflow-y]
 overflow-wrap
 overflow-x

Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (194420 => 194421)


--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2015-12-26 05:28:15 UTC (rev 194421)
@@ -1292,8 +1292,8 @@
         new PropertyWrapper<short>(CSSPropertyOrphans, &RenderStyle::orphans, &RenderStyle::setOrphans),
         new PropertyWrapper<short>(CSSPropertyWidows, &RenderStyle::widows, &RenderStyle::setWidows),
         new LengthPropertyWrapper<Length>(CSSPropertyLineHeight, &RenderStyle::specifiedLineHeight, &RenderStyle::setLineHeight),
-        new PropertyWrapper<int>(CSSPropertyOutlineOffset, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset),
-        new PropertyWrapper<unsigned short>(CSSPropertyOutlineWidth, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth),
+        new PropertyWrapper<float>(CSSPropertyOutlineOffset, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset),
+        new PropertyWrapper<float>(CSSPropertyOutlineWidth, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth),
         new PropertyWrapper<float>(CSSPropertyLetterSpacing, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing),
         new LengthPropertyWrapper<Length>(CSSPropertyWordSpacing, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing),
         new LengthPropertyWrapper<Length>(CSSPropertyTextIndent, &RenderStyle::textIndent, &RenderStyle::setTextIndent),

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (194420 => 194421)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2015-12-26 05:28:15 UTC (rev 194421)
@@ -389,10 +389,10 @@
     bool mustUseShadowBlur() const;
 #endif
 
-    void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Color&);
-    void drawFocusRing(const Path&, int width, int offset, const Color&);
+    void drawFocusRing(const Vector<IntRect>&, float width, float offset, const Color&);
+    void drawFocusRing(const Path&, float width, float offset, const Color&);
 #if PLATFORM(MAC)
-    void drawFocusRing(const Vector<IntRect>&, int width, int offset, double timeOffset, bool& needsRedraw);
+    void drawFocusRing(const Vector<IntRect>&, float width, float offset, double timeOffset, bool& needsRedraw);
 #endif
 
     void setLineCap(LineCap);

Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp (194420 => 194421)


--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp	2015-12-26 05:28:15 UTC (rev 194421)
@@ -522,7 +522,7 @@
 #endif
 }
 
-static inline void adjustFocusRingLineWidth(int& width)
+static inline void adjustFocusRingLineWidth(float& width)
 {
 #if PLATFORM(GTK)
     width = 2;
@@ -540,7 +540,7 @@
 #endif
 }
 
-void GraphicsContext::drawFocusRing(const Path& path, int width, int /* offset */, const Color& color)
+void GraphicsContext::drawFocusRing(const Path& path, float width, float /* offset */, const Color& color)
 {
     // FIXME: We should draw paths that describe a rectangle with rounded corners
     // so as to be consistent with how we draw rectangular focus rings.
@@ -558,7 +558,7 @@
     cairo_restore(cr);
 }
 
-void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int /* offset */, const Color& color)
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, float width, float /* offset */, const Color& color)
 {
     if (paintingDisabled())
         return;

Modified: trunk/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm (194420 => 194421)


--- trunk/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm	2015-12-26 05:28:15 UTC (rev 194421)
@@ -72,7 +72,7 @@
 }
 #endif // !PLATFORM(IOS)
 
-void GraphicsContext::drawFocusRing(const Path& path, int /* width */, int /* offset */, const Color&)
+void GraphicsContext::drawFocusRing(const Path& path, float /* width */, float /* offset */, const Color&)
 {
 #if PLATFORM(MAC)
     if (paintingDisabled() || path.isNull())
@@ -85,7 +85,7 @@
 }
 
 #if PLATFORM(MAC)
-void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int, int offset, double timeOffset, bool& needsRedraw)
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, float, float offset, double timeOffset, bool& needsRedraw)
 {
     if (paintingDisabled())
         return;
@@ -98,7 +98,7 @@
 }
 #endif
 
-void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int, int offset, const Color&)
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, float, float offset, const Color&)
 {
 #if !PLATFORM(IOS)
     if (paintingDisabled())

Modified: trunk/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp (194420 => 194421)


--- trunk/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp	2015-12-26 05:28:15 UTC (rev 194421)
@@ -130,14 +130,14 @@
     CGContextDrawImage(m_data->m_cgContext.get(), CGRectMake(point.x(), point.y(), image->size().width(), image->size().height()), cgImage.get());   
 }
 
-void GraphicsContext::drawFocusRing(const Path& path, int width, int offset, const Color& color)
+void GraphicsContext::drawFocusRing(const Path& path, float width, float offset, const Color& color)
 {
     // FIXME: implement
 }
 
 // FIXME: This is nearly identical to the GraphicsContext::drawFocusRing function in GraphicsContextMac.mm.
 // The code could move to GraphicsContextCG.cpp and be shared.
-void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int offset, const Color& color)
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, float width, float offset, const Color& color)
 {
     if (paintingDisabled())
         return;

Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (194420 => 194421)


--- trunk/Source/WebCore/rendering/RenderElement.cpp	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp	2015-12-26 05:28:15 UTC (rev 194421)
@@ -377,7 +377,7 @@
     // during styleDidChange (it's used by clippedOverflowRectForRepaint()).
     if (!style.outlineWidth())
         return;
-    int maxOutlineSize = style.outlineSize();
+    float maxOutlineSize = style.outlineSize();
     if (style.outlineStyleIsAuto())
         maxOutlineSize = std::max(theme().platformFocusRingWidth() + style.outlineOffset(), maxOutlineSize);
 
@@ -2107,10 +2107,9 @@
         return;
 
     RenderStyle& styleToUse = style();
-    LayoutUnit outlineWidth = styleToUse.outlineWidth();
+    float outlineWidth = floorToDevicePixel(styleToUse.outlineWidth(), document().deviceScaleFactor());
+    float outlineOffset = floorToDevicePixel(styleToUse.outlineOffset(), document().deviceScaleFactor());
 
-    int outlineOffset = styleToUse.outlineOffset();
-
     // Only paint the focus ring by hand if the theme isn't able to draw it.
     if (styleToUse.outlineStyleIsAuto() && !theme().supportsFocusRing(styleToUse))
         paintFocusRing(paintInfo, paintRect.location(), styleToUse);

Modified: trunk/Source/WebCore/rendering/RenderImage.cpp (194420 => 194421)


--- trunk/Source/WebCore/rendering/RenderImage.cpp	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/rendering/RenderImage.cpp	2015-12-26 05:28:15 UTC (rev 194421)
@@ -516,7 +516,7 @@
     // FIXME: Do we need additional code to clip the path to the image's bounding box?
 
     RenderStyle* areaElementStyle = areaElement.computedStyle();
-    unsigned short outlineWidth = areaElementStyle->outlineWidth();
+    float outlineWidth = areaElementStyle->outlineWidth();
     if (!outlineWidth)
         return;
 

Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (194420 => 194421)


--- trunk/Source/WebCore/rendering/RenderInline.cpp	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp	2015-12-26 05:28:15 UTC (rev 194421)
@@ -1642,12 +1642,12 @@
                                        const Color outlineColor)
 {
     const RenderStyle& styleToUse = style();
-    int outlineWidth = styleToUse.outlineWidth();
+    float outlineWidth = styleToUse.outlineWidth();
     EBorderStyle outlineStyle = styleToUse.outlineStyle();
 
     bool antialias = shouldAntialiasLines(graphicsContext);
 
-    int offset = style().outlineOffset();
+    float offset = style().outlineOffset();
 
     LayoutRect box(LayoutPoint(paintOffset.x() + thisline.x() - offset, paintOffset.y() + thisline.y() - offset),
         LayoutSize(thisline.width() + offset, thisline.height() + offset));
@@ -1686,7 +1686,7 @@
         drawLineForBoxSide(graphicsContext,
             FloatRect(FloatPoint(pixelSnappedBox.x() - outlineWidth,
             pixelSnappedBox.y() - outlineWidth),
-            FloatPoint(std::min(pixelSnappedBox.maxX() + outlineWidth, (lastline.isEmpty() ? 1000000 : pixelSnappedLastLine.x())),
+            FloatPoint(std::min<float>(pixelSnappedBox.maxX() + outlineWidth, (lastline.isEmpty() ? 1000000 : pixelSnappedLastLine.x())),
             pixelSnappedBox.y())),
             BSTop, outlineColor, outlineStyle,
             outlineWidth,
@@ -1695,7 +1695,7 @@
     
     if (lastline.maxX() < thisline.maxX())
         drawLineForBoxSide(graphicsContext,
-            FloatRect(FloatPoint(std::max(lastline.isEmpty() ? -1000000 : pixelSnappedLastLine.maxX(), pixelSnappedBox.x() - outlineWidth),
+            FloatRect(FloatPoint(std::max<float>(lastline.isEmpty() ? -1000000 : pixelSnappedLastLine.maxX(), pixelSnappedBox.x() - outlineWidth),
             pixelSnappedBox.y() - outlineWidth),
             FloatPoint(pixelSnappedBox.maxX() + outlineWidth,
             pixelSnappedBox.y())),
@@ -1719,7 +1719,7 @@
         drawLineForBoxSide(graphicsContext,
             FloatRect(FloatPoint(pixelSnappedBox.x() - outlineWidth,
             pixelSnappedBox.maxY()),
-            FloatPoint(std::min(pixelSnappedBox.maxX() + outlineWidth, !nextline.isEmpty() ? pixelSnappedNextLine.x() + 1 : 1000000),
+            FloatPoint(std::min<float>(pixelSnappedBox.maxX() + outlineWidth, !nextline.isEmpty() ? pixelSnappedNextLine.x() + 1 : 1000000),
             pixelSnappedBox.maxY() + outlineWidth)),
             BSBottom, outlineColor, outlineStyle,
             outlineWidth,
@@ -1728,7 +1728,7 @@
     
     if (nextline.maxX() < thisline.maxX())
         drawLineForBoxSide(graphicsContext,
-            FloatRect(FloatPoint(std::max(!nextline.isEmpty() ? pixelSnappedNextLine.maxX() : -1000000, pixelSnappedBox.x() - outlineWidth),
+            FloatRect(FloatPoint(std::max<float>(!nextline.isEmpty() ? pixelSnappedNextLine.maxX() : -1000000, pixelSnappedBox.x() - outlineWidth),
             pixelSnappedBox.maxY()),
             FloatPoint(pixelSnappedBox.maxX() + outlineWidth,
             pixelSnappedBox.maxY() + outlineWidth)),

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (194420 => 194421)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2015-12-26 05:28:15 UTC (rev 194421)
@@ -1943,7 +1943,7 @@
 
 void RenderObject::adjustRectForOutlineAndShadow(LayoutRect& rect) const
 {
-    int outlineSize = outlineStyleForRepaint().outlineSize();
+    float outlineSize = outlineStyleForRepaint().outlineSize();
     if (outlineStyleForRepaint().outlineStyleIsAuto())
         outlineSize = std::max(theme().platformFocusRingWidth() + outlineStyleForRepaint().outlineOffset(), outlineSize);
     if (const ShadowData* boxShadow = style().boxShadow()) {

Modified: trunk/Source/WebCore/rendering/RenderView.cpp (194420 => 194421)


--- trunk/Source/WebCore/rendering/RenderView.cpp	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/rendering/RenderView.cpp	2015-12-26 05:28:15 UTC (rev 194421)
@@ -826,7 +826,7 @@
 // Compositing layer dimensions take outline size into account, so we have to recompute layer
 // bounds when it changes.
 // FIXME: This is ugly; it would be nice to have a better way to do this.
-void RenderView::setMaximalOutlineSize(int outlineSize)
+void RenderView::setMaximalOutlineSize(float outlineSize)
 {
     if (outlineSize == m_maximalOutlineSize)
         return;

Modified: trunk/Source/WebCore/rendering/RenderView.h (194420 => 194421)


--- trunk/Source/WebCore/rendering/RenderView.h	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/rendering/RenderView.h	2015-12-26 05:28:15 UTC (rev 194421)
@@ -98,8 +98,8 @@
     virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const override;
     virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
 
-    void setMaximalOutlineSize(int);
-    int maximalOutlineSize() const { return m_maximalOutlineSize; }
+    void setMaximalOutlineSize(float);
+    float maximalOutlineSize() const { return m_maximalOutlineSize; }
 
     LayoutRect viewRect() const;
 
@@ -351,7 +351,7 @@
     // End deprecated members.
 
     // Used to inflate compositing layers and repaint rects.
-    int m_maximalOutlineSize { 0 };
+    float m_maximalOutlineSize { 0 };
 
     bool shouldUsePrintingLayout() const;
 

Modified: trunk/Source/WebCore/rendering/style/OutlineValue.h (194420 => 194421)


--- trunk/Source/WebCore/rendering/style/OutlineValue.h	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/rendering/style/OutlineValue.h	2015-12-26 05:28:15 UTC (rev 194421)
@@ -32,11 +32,6 @@
 class OutlineValue : public BorderValue {
 friend class RenderStyle;
 public:
-    OutlineValue()
-        : m_offset(0)
-    {
-    }
-    
     bool operator==(const OutlineValue& o) const
     {
         return m_width == o.m_width && m_style == o.m_style && m_color == o.m_color && m_colorIsValid == o.m_colorIsValid && m_offset == o.m_offset && m_isAuto == o.m_isAuto;
@@ -47,11 +42,11 @@
         return !(*this == o);
     }
     
-    int offset() const { return m_offset; }
+    float offset() const { return m_offset; }
     OutlineIsAuto isAuto() const { return static_cast<OutlineIsAuto>(m_isAuto); }
 
 private:
-    int m_offset;
+    float m_offset { 0 };
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (194420 => 194421)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2015-12-25 20:46:47 UTC (rev 194420)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2015-12-26 05:28:15 UTC (rev 194421)
@@ -674,8 +674,8 @@
     float borderStartWidth() const;
     float borderEndWidth() const;
 
-    unsigned short outlineSize() const { return std::max(0, outlineWidth() + outlineOffset()); }
-    unsigned short outlineWidth() const
+    float outlineSize() const { return std::max<float>(0, outlineWidth() + outlineOffset()); }
+    float outlineWidth() const
     {
         if (m_background->outline().style() == BNONE)
             return 0;
@@ -887,7 +887,7 @@
 
     // CSS3 Getter Methods
 
-    int outlineOffset() const
+    float outlineOffset() const
     {
         if (m_background->outline().style() == BNONE)
             return 0;
@@ -1325,7 +1325,7 @@
     void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_bottom.m_style, v); }
     void setBorderBottomColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_bottom, v); }
 
-    void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_width, v); }
+    void setOutlineWidth(float v) { SET_VAR(m_background, m_outline.m_width, v); }
     void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_background, m_outline.m_isAuto, isAuto); }
     void setOutlineStyle(EBorderStyle v) { SET_VAR(m_background, m_outline.m_style, v); }
     void setOutlineColor(const Color& v) { SET_BORDERVALUE_COLOR(m_background, m_outline, v); }
@@ -1499,7 +1499,7 @@
     void setPageBreakAfter(EPageBreak b) { noninherited_flags.setPageBreakAfter(b); }
 
     // CSS3 Setters
-    void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v); }
+    void setOutlineOffset(float v) { SET_VAR(m_background, m_outline.m_offset, v); }
     void setTextShadow(std::unique_ptr<ShadowData>, bool add = false);
     void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c); }
     void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w); }
@@ -1922,7 +1922,7 @@
     static StyleImage* initialListStyleImage() { return 0; }
     static float initialBorderWidth() { return 3; }
     static unsigned short initialColumnRuleWidth() { return 3; }
-    static unsigned short initialOutlineWidth() { return 3; }
+    static float initialOutlineWidth() { return 3; }
     static float initialLetterSpacing() { return 0; }
     static Length initialWordSpacing() { return Length(Fixed); }
     static Length initialSize() { return Length(); }
@@ -1955,7 +1955,7 @@
     static TextUnderlinePosition initialTextUnderlinePosition() { return TextUnderlinePositionAuto; }
     static float initialZoom() { return 1.0f; }
     static TextZoom initialTextZoom() { return TextZoomNormal; }
-    static int initialOutlineOffset() { return 0; }
+    static float initialOutlineOffset() { return 0; }
     static float initialOpacity() { return 1.0f; }
     static EBoxAlignment initialBoxAlign() { return BSTRETCH; }
     static EBoxDecorationBreak initialBoxDecorationBreak() { return DSLICE; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to