Changeset 138611 in webkit
- Timestamp:
- Jan 2, 2013 1:17:41 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r138608 r138611 1 2013-01-02 Mike West <mkwst@chromium.org> 2 3 The 'body' of seamless IFrames should default to 'margin: 0' 4 https://bugs.webkit.org/show_bug.cgi?id=90834 5 6 Reviewed by Eric Seidel. 7 8 * fast/frames/seamless/seamless-body-margin-expected.txt: Added. 9 * fast/frames/seamless/seamless-body-margin.html: Added. 10 New test to explicitly check 'body' margins. 11 * fast/frames/seamless/resources/nested-seamless.html: 12 * fast/frames/seamless/resources/quirks-square.html: 13 * fast/frames/seamless/resources/two-inline-blocks.html: 14 * fast/frames/seamless/seamless-inherited-origin-expected.txt: 15 * fast/frames/seamless/seamless-inherited-origin.html: 16 Updated these tests to remove the assumption that the body had an 17 8px margin. 18 1 19 2013-01-01 Christophe Dumez <christophe.dumez@intel.com> 2 20 -
trunk/LayoutTests/fast/frames/seamless/resources/nested-seamless.html
r115742 r138611 1 1 <!DOCTYPE html> 2 2 <style> 3 body { margin: 0px;line-height: 0px; }3 body { line-height: 0px; } 4 4 </style> 5 5 <iframe id="iframe" seamless src="square.html"></iframe> -
trunk/LayoutTests/fast/frames/seamless/resources/quirks-square.html
r115742 r138611 1 1 <style> 2 body { margin: 0px;line-height: 0px; }2 body { line-height: 0px; } 3 3 </style> 4 4 <div style="background-color: green; width: 100px; height: 100px;"></div> -
trunk/LayoutTests/fast/frames/seamless/resources/two-inline-blocks.html
r118291 r138611 1 1 <!DOCTYPE html> 2 2 <html><head><style> 3 body { margin: 0px;line-height: 0px; }3 body { line-height: 0px; } 4 4 /* FIXME: This vertical-align should not be needed, but without it the contentHeight() 5 5 of the document is reported as 4px too large, likely due to implied line decent? */ -
trunk/LayoutTests/fast/frames/seamless/seamless-inherited-origin-expected.txt
r118737 r138611 2 2 PASS iframe.seamless is true 3 3 PASS window.getComputedStyle(iframe).width is "200px" 4 PASS window.getComputedStyle(iframe).height is " 8px"4 PASS window.getComputedStyle(iframe).height is "0px" 5 5 PASS window.getComputedStyle(iframe).width is "200px" 6 6 PASS window.getComputedStyle(iframe).height is "100px" -
trunk/LayoutTests/fast/frames/seamless/seamless-inherited-origin.html
r118291 r138611 11 11 12 12 shouldBeEqualToString("window.getComputedStyle(iframe).width", "200px"); 13 // Initially about:blank has no content, thus no height, except the body 14 // element defaults to margin: 8px (which gets collapsed to 8px when rendered). 15 shouldBeEqualToString("window.getComputedStyle(iframe).height", "8px"); 13 // Initially about:blank has no content, thus no height. 14 shouldBeEqualToString("window.getComputedStyle(iframe).height", "0px"); 16 15 17 16 // Replace the empty document with a 100x100px square to test if it displays seamlessly. -
trunk/Source/WebCore/CMakeLists.txt
r138515 r138611 2536 2536 ${WEBCORE_DIR}/css/mediaControls.css 2537 2537 ${WEBCORE_DIR}/css/quirks.css 2538 ${WEBCORE_DIR}/css/seamless.css 2538 2539 ${WEBCORE_DIR}/css/svg.css 2539 2540 ${WEBCORE_DIR}/css/view-source.css -
trunk/Source/WebCore/ChangeLog
r138606 r138611 1 2013-01-02 Mike West <mkwst@chromium.org> 2 3 The 'body' of seamless IFrames should default to 'margin: 0' 4 https://bugs.webkit.org/show_bug.cgi?id=90834 5 6 Reviewed by Eric Seidel. 7 8 Documents displayed in seamless iframes should override the 'body' 9 element's normal 8px default margins with 0px, in order to ensure that 10 contents are displayed flush with the boundries of the seamless box.[1] 11 12 This patch does so by adding a new user agent stylesheet for seamless 13 documents, and teaching the StyleResolver how and when to apply it. 14 15 [1]: http://lists.w3.org/Archives/Public/public-whatwg-archive/2012Jul/0039.html 16 17 Test: fast/frames/seamless/seamless-body-margin.html 18 19 * DerivedSources.make: 20 * DerivedSources.pri: 21 * GNUmakefile.am: 22 * WebCore.gyp/WebCore.gyp: 23 * WebCore.vcproj/WebCore.vcproj: 24 * CMakeLists.txt: 25 Added a new CSS file! Let's tell everyone! 26 * css/StyleResolver.cpp: 27 (WebCore): 28 (WebCore::loadSeamlessStyle): 29 (WebCore::StyleResolver::matchUARules): 30 (WebCore::StyleResolver::collectFeatures): 31 (WebCore::StyleResolver::reportMemoryUsage): 32 Load the new stylesheet, and apply it to the document in 33 matchUARules iff the document should be displayed seamlessly. 34 * css/seamless.css: Added. 35 (body): 36 Stylesheet containing defaults for seamless documents. 37 1 38 2013-01-01 Dan Bernstein <mitz@apple.com> 2 39 -
trunk/Source/WebCore/DerivedSources.make
r137516 r138611 810 810 endif 811 811 812 ifeq ($(findstring ENABLE_IFRAME_SEAMLESS,$(FEATURE_DEFINES)), ENABLE_IFRAME_SEAMLESS) 813 USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/css/seamless.css 814 endif 815 812 816 UserAgentStyleSheets.h : css/make-css-file-arrays.pl bindings/scripts/preprocessor.pm $(USER_AGENT_STYLE_SHEETS) 813 817 perl -I$(WebCore)/bindings/scripts $< --defines "$(FEATURE_DEFINES)" $@ UserAgentStyleSheetsData.cpp $(USER_AGENT_STYLE_SHEETS) -
trunk/Source/WebCore/DerivedSources.pri
r137516 r138611 83 83 $$PWD/css/mediaControlsQt.css \ 84 84 $$PWD/css/mediaControlsQtFullscreen.css \ 85 $$PWD/css/seamless.css \ 85 86 $$PWD/css/themeQtNoListboxes.css \ 86 87 $$PWD/css/mobileThemeQt.css -
trunk/Source/WebCore/GNUmakefile.am
r138252 r138611 415 415 $(WebCore)/css/mediaControls.css \ 416 416 $(WebCore)/css/mediaControlsGtk.css \ 417 $(WebCore)/css/fullscreen.css 417 $(WebCore)/css/fullscreen.css \ 418 $(WebCore)/css/seamless.css 418 419 419 420 # new-style JavaScript bindings … … 790 791 Source/WebCore/css/mediaControlsGtk.css \ 791 792 Source/WebCore/css/quirks.css \ 793 Source/WebCore/css/seamless.css \ 792 794 Source/WebCore/css/svg.css \ 793 795 Source/WebCore/css/SVGCSSPropertyNames.in \ -
trunk/Source/WebCore/WebCore.gyp/WebCore.gyp
r138401 r138611 910 910 '../css/mediaControlsChromiumAndroid.css', 911 911 '../css/fullscreen.css', 912 '../css/seamless.css', 912 913 # Skip fullscreenQuickTime. 913 914 ], -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r138500 r138611 38163 38163 </File> 38164 38164 <File 38165 RelativePath="..\css\seamless.css" 38166 > 38167 </File> 38168 <File 38165 38169 RelativePath="..\css\ViewportStyleResolver.cpp" 38166 38170 > -
trunk/Source/WebCore/css/StyleResolver.cpp
r138572 r138611 207 207 static RuleSet* defaultQuirksStyle; 208 208 static RuleSet* defaultPrintStyle; 209 static RuleSet* defaultSeamlessStyle; 209 210 static RuleSet* defaultViewSourceStyle; 210 211 static StyleSheetContents* simpleDefaultStyleSheet; … … 543 544 defaultViewSourceStyle = RuleSet::create().leakPtr(); 544 545 defaultViewSourceStyle->addRulesFromSheet(parseUASheet(sourceUserAgentStyleSheet, sizeof(sourceUserAgentStyleSheet)), screenEval()); 546 } 547 548 static void loadSeamlessStyle() 549 { 550 ASSERT(!defaultSeamlessStyle); 551 #if ENABLE(IFRAME_SEAMLESS) 552 defaultSeamlessStyle = RuleSet::create().leakPtr(); 553 defaultSeamlessStyle->addRulesFromSheet(parseUASheet(seamlessUserAgentStyleSheet, sizeof(seamlessUserAgentStyleSheet)), screenEval()); 554 #endif 545 555 } 546 556 … … 1343 1353 loadViewSourceStyle(); 1344 1354 matchUARules(result, defaultViewSourceStyle); 1355 } 1356 1357 // If the document is loaded inside a seamless iframe, then we match rules from the seamless sheet. 1358 if (document()->shouldDisplaySeamlesslyWithParent()) { 1359 if (!defaultSeamlessStyle) 1360 loadSeamlessStyle(); 1361 matchUARules(result, defaultSeamlessStyle); 1345 1362 } 1346 1363 } … … 5282 5299 m_features.add(defaultViewSourceStyle->features()); 5283 5300 } 5301 if (document()->shouldDisplaySeamlesslyWithParent()) { 5302 if (!defaultSeamlessStyle) 5303 loadSeamlessStyle(); 5304 m_features.add(defaultSeamlessStyle->features()); 5305 } 5284 5306 5285 5307 if (m_scopeResolver) … … 5337 5359 info.addMember(defaultQuirksStyle); 5338 5360 info.addMember(defaultPrintStyle); 5361 info.addMember(defaultSeamlessStyle); 5339 5362 info.addMember(defaultViewSourceStyle); 5340 5363 }
Note: See TracChangeset
for help on using the changeset viewer.