Source/WebCore/ChangeLog

 12012-03-09 Terry Anderson <tdanderson@chromium.org>
 2
 3 100% height elements to not respond to vertical browser rescaling
 4 https://bugs.webkit.org/show_bug.cgi?id=43022
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Test: fast/replaced/vertical-resize-100percent-element.html
 9
 10 * rendering/RenderBox.cpp:
 11 (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
 12
 13 For the case where a replaced element has a percentage height,
 14 we update the entries in RenderBlock::gPercentHeightDescendantsMap
 15 corresponding to all ancestors of the replaced element.
 16
1172012-03-09 Nate Chapin <japhet@chromium.org>
218
319 CachedRawResource breaks when trying to load

Source/WebCore/rendering/RenderBox.cpp

@@LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) co
23412341 availableHeight = max(availableHeight, intrinsicLogicalHeight());
23422342 return logicalHeight.calcValue(availableHeight - borderAndPaddingLogicalHeight());
23432343 }
 2344
23442345 cb = cb->containingBlock();
 2346 toRenderBlock(cb)->addPercentHeightDescendant(const_cast<RenderBox*>(this));
23452347 }
23462348 }
23472349 return computeContentBoxLogicalHeight(logicalHeight.calcValue(availableHeight));

LayoutTests/ChangeLog

 12012-03-09 Terry Anderson <tdanderson@chromium.org>
 2
 3 100% height elements to not respond to vertical browser rescaling
 4 https://bugs.webkit.org/show_bug.cgi?id=43022
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * fast/replaced/resources/vertical-resize-100percent-contents.html: Added.
 9 * fast/replaced/vertical-resize-100percent-element-expected.txt: Added.
 10 * fast/replaced/vertical-resize-100percent-element.html: Added.
 11
 12 Layout test to ensure that an image with 100% height is resized when
 13 its containing iframe is vertically resized to be larger or smaller.
 14
1152012-03-09 Adam Barth <abarth@webkit.org>
216
317 Note that fast/events/input-image-scrolled-x-y.html is flaky.

LayoutTests/fast/replaced/resources/vertical-resize-100percent-contents.html

 1<html>
 2<head>
 3<style>
 4html, body {
 5 border: 0;
 6 margin: 0;
 7 height: 100%;
 8}
 9
 10#container {
 11 position: relative;
 12 margin: 0 auto;
 13 height: auto !important;
 14 min-height: 100%;
 15}
 16
 17#footer {
 18 position: absolute;
 19 width: 100%;
 20 bottom: 0;
 21 background: gray;
 22}
 23</style>
 24</head>
 25<body>
 26<div id="container">
 27 <div><img id="img" src="compass.jpg" style="width: 100%; height: 100%;"></div>
 28 <div id="footer">
 29 Layout test for <a href="https://bugs.webkit.org/show_bug.cgi?id=43022">https://bugs.webkit.org/show_bug.cgi?id=43022</a>. Checks to see if an image having a percentage height is resized when its containing iframe is vertically resized. This test only works in DumpRenderTree since it involves accessing the internal elements of an iframe.
 30 </div>
 31</div>
 32</body>
 33</html>

LayoutTests/fast/replaced/vertical-resize-100percent-element-expected.txt

 1
 2Original frame height was 500
 3Original image height was 500
 4Vertically resizing the frame to be larger
 5New frame height is 600
 6New image height is 600
 7PASSED: Image size is correct
 8Vertically resizing the frame to be smaller
 9New frame height is 450
 10New image height is 450
 11PASSED: Image size is correct
 12

LayoutTests/fast/replaced/vertical-resize-100percent-element.html

 1<html>
 2<head>
 3<script>
 4var theFrame, theImage;
 5
 6function log(msg)
 7{
 8 var console = document.getElementById('console');
 9 console.appendChild(document.createTextNode(msg));
 10 console.appendChild(document.createElement('br'));
 11}
 12
 13function resizeAndCheck(newSize)
 14{
 15 theFrame.height = newSize;
 16
 17 log("New frame height is " + theFrame.height);
 18 log("New image height is " + theImage.height);
 19
 20 if (theImage.height == newSize)
 21 log("PASSED: Image size is correct");
 22 else
 23 log("FAILED: Image size is not correct");
 24}
 25
 26function run()
 27{
 28 if (window.layoutTestController)
 29 {
 30 layoutTestController.dumpAsText();
 31 layoutTestController.waitUntilDone();
 32 }
 33
 34 theFrame = document.getElementById('frame');
 35 var frContents = theFrame.contentWindow.document;
 36 theImage = frContents.getElementById('img');
 37
 38 log("Original frame height was " + theFrame.height);
 39 log("Original image height was " + theImage.height);
 40
 41 log("Vertically resizing the frame to be larger");
 42 resizeAndCheck(600);
 43
 44 log("Vertically resizing the frame to be smaller");
 45 resizeAndCheck(450);
 46
 47 if (window.layoutTestController)
 48 layoutTestController.notifyDone();
 49}
 50
 51</script>
 52</head>
 53
 54<body onload="run()">
 55<iframe height="500" width="500" id="frame" src="resources/vertical-resize-100percent-contents.html"></iframe>
 56<p id="console"></p>
 57</body>
 58
 59</html>