The 'body' of seamless IFrames should default to 'margin: 0'
https://bugs.webkit.org/show_bug.cgi?id=90834
Reviewed by Antti Koivisto.
Source/WebCore:
Documents displayed in seamless iframes should override the 'body'
element's normal 8px default margins with 0px, in order to ensure that
contents are displayed flush with the boundries of the seamless box.[1]
This patch does so by adding a new pseudoclass to allow the user agent
stylesheet to specify a different margin for seamless documents.
[1]: http://lists.w3.org/Archives/Public/public-whatwg-archive/2012Jul/0039.html
Test: fast/frames/seamless/seamless-body-margin.html
* css/CSSSelector.cpp:
(WebCore::CSSSelector::pseudoId):
(WebCore::nameToPseudoTypeMap):
(WebCore::CSSSelector::extractPseudoType):
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOneSelector):
* css/html.css:
(body:-webkit-seamless-document):
* rendering/style/RenderStyleConstants.h:
Define a new pseudoclass: '-webkit-seamless-document', which
matches for any element in a document that's rendered in a
seamless IFrame.
LayoutTests:
* fast/frames/seamless/seamless-body-margin-expected.txt: Added.
* fast/frames/seamless/seamless-body-margin.html: Added.
New test to explicitly check 'body' margins.
* fast/frames/seamless/resources/nested-seamless.html:
* fast/frames/seamless/resources/quirks-square.html:
* fast/frames/seamless/resources/two-inline-blocks.html:
* fast/frames/seamless/seamless-inherited-origin-expected.txt:
* fast/frames/seamless/seamless-inherited-origin.html:
Updated these tests to remove the assumption that the body had an
8px margin.
git-svn-id: svn://svn.chromium.org/blink/trunk@138709 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/Source/WebCore/css/html.css b/Source/WebCore/css/html.css
index 002ce3a..0d1b1e9 100644
--- a/Source/WebCore/css/html.css
+++ b/Source/WebCore/css/html.css
@@ -59,6 +59,12 @@
margin: 8px
}
+#if defined(ENABLE_IFRAME_SEAMLESS) && ENABLE_IFRAME_SEAMLESS
+body:-webkit-seamless-document {
+ margin: 0px;
+}
+#endif
+
p {
display: block;
-webkit-margin-before: 1__qem;