Add a borderless mode to <attachment>, and make it respect its layout size
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jun 2017 18:08:48 +0000 (18:08 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jun 2017 18:08:48 +0000 (18:08 +0000)
commit695be181f318c4d6f26ac7e1c0bda0056df21372
treea45dc8a89e3d9ebf58657295973655fda82f8f22
parentc40e9c711ad10f42ad844f4edc69f2dfac240eb9
Add a borderless mode to <attachment>, and make it respect its layout size
https://bugs.webkit.org/show_bug.cgi?id=173079
<rdar://problem/32491584>

Reviewed by Simon Fraser.

Source/WebCore:

Tests: fast/attachment/attachment-borderless.html
       fast/attachment/attachment-respects-css-size.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSValueKeywords.in:
* platform/ThemeTypes.h:
* rendering/RenderAttachment.cpp:
(WebCore::RenderAttachment::shouldDrawBorder):
* rendering/RenderAttachment.h:
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
(WebCore::RenderTheme::paint):
Add "-webkit-appearance: borderless-attachment;" in addition to "attachment",
so clients can specify the borderless appearance. This isn't specified as a
CSS border because it's a very custom appearance that isn't achievable that way.

* rendering/RenderThemeIOS.mm:
(WebCore::AttachmentInfo::AttachmentInfo):
Use the layout size of the attachment, not the fixed size; we use the fixed
size as our intrinsic size, so most attachments will still be that size,
but if a client specifies a different size, we'll lay out correctly.

LayoutTests:

* TestExpectations:
* platform/ios/TestExpectations:
* fast/attachment/attachment-borderless-expected-mismatch.html: Added.
* fast/attachment/attachment-borderless.html: Added.
* fast/attachment/attachment-respects-css-size-expected-mismatch.html: Added.
* fast/attachment/attachment-respects-css-size.html: Added.
Add mismatch tests ensuring that CSS width/height and borderless-attachment
have *some* kind of impact on rendering.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/attachment/attachment-borderless-expected-mismatch.html [new file with mode: 0644]
LayoutTests/fast/attachment/attachment-borderless.html [new file with mode: 0644]
LayoutTests/fast/attachment/attachment-respects-css-size-expected-mismatch.html [new file with mode: 0644]
LayoutTests/fast/attachment/attachment-respects-css-size.html [new file with mode: 0644]
LayoutTests/platform/ios/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/platform/ThemeTypes.h
Source/WebCore/rendering/RenderAttachment.cpp
Source/WebCore/rendering/RenderAttachment.h
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderThemeIOS.mm