Cleanup outline-style: auto painting.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Aug 2015 22:09:27 +0000 (22:09 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Aug 2015 22:09:27 +0000 (22:09 +0000)
commit8adb9cd4ff20f427af70f9005e6aa4fb642a5137
treefd542e1af23f49de2f14b7430b8b42bb1c61eb1e
parentbb93e8cdad61c335c16341a45d2a7242d0fd1327
Cleanup outline-style: auto painting.
https://bugs.webkit.org/show_bug.cgi?id=148159

Reviewed by Simon Fraser.

Old platform style required the focus ring to be painted with an offset. (https://trac.webkit.org/r5358)
(and it has the side effect of growing outline-width adds further, unwanted offset)
Default css for :focus is adjusted to remove this offset by setting the outline-width to 5px
and the outline-offset to -2px. (https://trac.webkit.org/r13639)
This patch removes both the old logic and the workaround for getting rid of the unwanted offset.

Source/WebCore:

Test: fast/repaint/outline-auto-with-default-width-and-offset-repaint.html

* css/html.css:
(:focus):
(input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus): Deleted.
* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::GraphicsContext::drawFocusRing):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::computeMaxOutlineSize):
(WebCore::RenderElement::paintFocusRing):
(WebCore::RenderElement::paintOutline): Short circuit painting outline when painting is disabled. It
only change behaviour for non-auto outlines -which are anyway not supposed to be painted when painting is disabled.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::adjustRectForOutlineAndShadow):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::platformFocusRingWidth):
(WebCore::RenderTheme::platformFocusRingMaxWidth): Deleted.

LayoutTests:

* fast/repaint/outline-auto-with-default-width-and-offset-repaint-expected.txt: Added.
* fast/repaint/outline-auto-with-default-width-and-offset-repaint.html: Copied from LayoutTests/fast/repaint/outline-with2px-auto-repaint-rect.html.
* fast/repaint/outline-with1px-auto-repaint-rect.html:
* fast/repaint/outline-with2px-auto-repaint-rect.html:
* fast/repaint/outline-with3px-auto-repaint-rect.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/repaint/outline-auto-with-default-width-and-offset-repaint-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/outline-auto-with-default-width-and-offset-repaint.html [new file with mode: 0644]
LayoutTests/fast/repaint/outline-with1px-auto-repaint-rect.html
LayoutTests/fast/repaint/outline-with2px-auto-repaint-rect.html
LayoutTests/fast/repaint/outline-with3px-auto-repaint-rect.html
Source/WebCore/ChangeLog
Source/WebCore/css/html.css
Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderTheme.h