[prev in list] [next in list] [prev in thread] [next in thread]
List: webkit-changes
Subject: [webkit-changes] [31912] trunk
From: hyatt () apple ! com
Date: 2008-04-15 18:15:15
Message-ID: 20080415181515.C7A86159BE9F () beta ! macosforge ! org
[Download RAW message or body]
[Attachment #2 (text/html)]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style \
type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: \
6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: \
verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: \
bold} #msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: \
bold; } #msg pre, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; \
padding: 6px; } #msg ul { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: \
6px; } #patch { width: 100%; }
#patch h4 {font-family: \
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins \
{background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del \
{background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, \
.info {color:#888;background:#fff;}
--></style>
<title>[31912] trunk</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a \
href="http://trac.webkit.org/projects/webkit/changeset/31912">31912</a></dd> \
<dt>Author</dt> <dd>hyatt@apple.com</dd> <dt>Date</dt> <dd>2008-04-15 11:15:06 -0700 \
(Tue, 15 Apr 2008)</dd> </dl>
<h3>Log Message</h3>
<pre>WebCore:
2008-04-15 Anatoli Papirovski <apapirovski@mac.com>
Reviewed by hyatt
[CSS1, CSS3] Fixed the background-origin calculation for root elements
(background-size and background-position are affected), r10794
[CSS3] Fixed the background-size transformation where width is specified in \
percentage and height is left to auto
Test: fast/backgrounds/background-origin-root-element.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::calculateBackgroundSize):
(WebCore::RenderBox::calculateBackgroundImageGeometry):
LayoutTests:
2008-04-15 Anatoli Papirovski <apapirovski@mac.com>
Reviewed by hyatt
Added test case for background-origin calculation on root elements
(background-repeat and background-size), r10794 [CSS1 + CSS3]
* fast/backgrounds/background-origin-root-element.html: Added.
* platform/mac/fast/backgrounds/background-origin-root-element-expected.checksum: \
Added.
* platform/mac/fast/backgrounds/background-origin-root-element-expected.png: \
Added.
* platform/mac/fast/backgrounds/background-origin-root-element-expected.txt: \
Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastbackgroundssizebackgroundSize18expectedch \
ecksum">trunk/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize18-expected.checksum</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastbackgroundssizebackgroundSize18expectedp \
ng">trunk/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize18-expected.png</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorerenderingRenderBoxcpp">trunk/WebCore/rendering/RenderBox.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastbackgroundsbackgroundoriginrootelementhtml">trunk/LayoutTests/fast/backgrounds/background-origin-root-element.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastbackgroundsbackgroundoriginrootelementex \
pectedchecksum">trunk/LayoutTests/platform/mac/fast/backgrounds/background-origin-root-element-expected.checksum</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastbackgroundsbackgroundoriginrootelementex \
pectedpng">trunk/LayoutTests/platform/mac/fast/backgrounds/background-origin-root-element-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastbackgroundsbackgroundoriginrootelementex \
pectedtxt">trunk/LayoutTests/platform/mac/fast/backgrounds/background-origin-root-element-expected.txt</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (31911 => 31912)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog 2008-04-15 17:54:18 UTC (rev \
31911)
+++ trunk/LayoutTests/ChangeLog 2008-04-15 18:15:06 UTC (rev 31912)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2008-04-15 Anatoli Papirovski <apapirovski@mac.com>
+
+ Reviewed by hyatt
+
+ Added test case for background-origin calculation on root elements
+ (background-repeat and background-size), r10794 [CSS1 + CSS3]
+
+ * fast/backgrounds/background-origin-root-element.html: Added.
+ * platform/mac/fast/backgrounds/background-origin-root-element-expected.checksum: \
Added. + * platform/mac/fast/backgrounds/background-origin-root-element-expected.png: \
Added. + * platform/mac/fast/backgrounds/background-origin-root-element-expected.txt: \
Added. +
</ins><span class="cx"> 2008-04-15 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><span class="cx"> Reviewed by Anders
</span></span></pre></div>
<a id="trunkLayoutTestsfastbackgroundsbackgroundoriginrootelementhtml"></a>
<div class="addfile"><h4>Added: \
trunk/LayoutTests/fast/backgrounds/background-origin-root-element.html (0 => \
31912)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/LayoutTests/fast/backgrounds/background-origin-root-element.html \
(rev 0)
+++ trunk/LayoutTests/fast/backgrounds/background-origin-root-element.html 2008-04-15 \
18:15:06 UTC (rev 31912) </span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+<title>Root Element Background Origin</title>
+<style type="text/css">
+ body { border: solid black; background: #fff \
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAIAAAC0Ujn1AAAAGXRFWHRTb2Z0 \
d2FyZQBBZG9iZSBJ%20bWFnZVJlYWR5ccllPAAAAClJREFUeNrszEENAAAIBKDT/p21g5s/CEBl8qQTtVqtVqvVarX6agUY%20AOiTATvieSECAAAAAElFTkSuQmCC) \
no-repeat 50% 50%; color: #000; -webkit-background-size: 100% 100%;} + html { \
border: solid blue; background: transparent; color: yellow; padding: 1em;} + * \
{margin: 1em; padding: 1em;} + p {margin: 0; padding: 0 0 5em;}
+</style>
+</head>
+<body>
+<p>The HTML box, the one with a blue border should be fully filled with lime \
green. The BODY box, the one with black border, should also be fully filled with lime \
green. The lime green color should not spill out outside the blue border.</p> \
+</body> +</html>
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: \
trunk/LayoutTests/fast/backgrounds/background-origin-root-element.html </span><span \
class="cx">___________________________________________________________________ \
</span><span class="cx">Name: allow-tabs </span><span class="cx"> + true
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastbackgroundsbackgroundoriginrootelementexpectedchecksum"></a>
<div class="addfile"><h4>Added: \
trunk/LayoutTests/platform/mac/fast/backgrounds/background-origin-root-element-expected.checksum \
(0 => 31912)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/LayoutTests/platform/mac/fast/backgrounds/background-origin-root-element-expected.checksum \
(rev 0)
+++ trunk/LayoutTests/platform/mac/fast/backgrounds/background-origin-root-element-expected.checksum 2008-04-15 \
18:15:06 UTC (rev 31912) </span><span class="lines">@@ -0,0 +1 @@
</span><ins>+1759a97cc985fef5fc30fef9def8ebce
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastbackgroundsbackgroundoriginrootelementexpectedpng"></a>
<div class="binary"><h4>Added: \
trunk/LayoutTests/platform/mac/fast/backgrounds/background-origin-root-element-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: \
trunk/LayoutTests/platform/mac/fast/backgrounds/background-origin-root-element-expected.png
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:mime-type
</span><span class="cx"> + application/octet-stream
</span><a id="trunkLayoutTestsplatformmacfastbackgroundsbackgroundoriginrootelementexpectedtxt"></a>
<div class="addfile"><h4>Added: \
trunk/LayoutTests/platform/mac/fast/backgrounds/background-origin-root-element-expected.txt \
(0 => 31912)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/LayoutTests/platform/mac/fast/backgrounds/background-origin-root-element-expected.txt \
(rev 0)
+++ trunk/LayoutTests/platform/mac/fast/backgrounds/background-origin-root-element-expected.txt 2008-04-15 \
18:15:06 UTC (rev 31912) </span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (16,16) size 768x242
+ RenderBlock {HTML} at (16,16) size 768x242 [color=#FFFF00] [border: (3px solid \
#0000FF)] + RenderBody {BODY} at (35,35) size 698x172 [color=#000000] \
[bgcolor=#FFFFFF] [border: (3px solid #000000)] + RenderBlock {P} at (19,19) \
size 660x134 + RenderText {#text} at (0,0) size 651x54
+ text run at (0,0) width 651: "The HTML box, the one with a blue \
border should be fully filled with lime green. The BODY box, the" + \
text run at (0,18) width 646: "one with black border, should also be fully \
filled with lime green. The lime green color should not spill" + text \
run at (0,36) width 172: "out outside the blue border." \
</ins></span></pre></div> <a \
id="trunkLayoutTestsplatformmacfastbackgroundssizebackgroundSize18expectedchecksum"></a>
<div class="modfile"><h4>Modified: \
trunk/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize18-expected.checksum \
(31911 => 31912)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize18-expected.checksum 2008-04-15 \
17:54:18 UTC (rev 31911)
+++ trunk/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize18-expected.checksum 2008-04-15 \
18:15:06 UTC (rev 31912) </span><span class="lines">@@ -1 +1 @@
</span><del>-3fc0e927df258ed742fa657acffba46d
</del><span class="cx">\ No newline at end of file
</span><ins>+2f70b81328f41ce5c03fc1753b70d817
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastbackgroundssizebackgroundSize18expectedpng"></a>
<div class="binary"><h4>Modified: \
trunk/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize18-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (31911 => 31912)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog 2008-04-15 17:54:18 UTC (rev 31911)
+++ trunk/WebCore/ChangeLog 2008-04-15 18:15:06 UTC (rev 31912)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2008-04-15 Anatoli Papirovski <apapirovski@mac.com>
+
+ Reviewed by hyatt
+
+ [CSS1, CSS3] Fixed the background-origin calculation for root elements
+ (background-size and background-position are affected), r10794
+ [CSS3] Fixed the background-size transformation where width is specified in \
percentage and height is left to auto +
+ Test: fast/backgrounds/background-origin-root-element.html
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::calculateBackgroundSize):
+ (WebCore::RenderBox::calculateBackgroundImageGeometry):
+
</ins><span class="cx"> 2008-04-15 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><span class="cx"> Fixes the regression where the error and warning \
counts did not show up in the Resources </span></span></pre></div>
<a id="trunkWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderBox.cpp (31911 => \
31912)</h4> <pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderBox.cpp 2008-04-15 17:54:18 UTC \
(rev 31911)
+++ trunk/WebCore/rendering/RenderBox.cpp 2008-04-15 18:15:06 UTC (rev 31912)
</span><span class="lines">@@ -346,15 +346,14 @@
</span><span class="cx"> rh = view()->height();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ // CSS2 14.2:
+ // The background of the box generated by the root element covers the entire \
canvas including + // its margins.
</ins><span class="cx"> int bx = tx - marginLeft();
</span><span class="cx"> int by = ty - marginTop();
</span><span class="cx"> int bw = max(w + marginLeft() + marginRight() + \
borderLeft() + borderRight(), rw); </span><span class="cx"> int bh = max(h + \
marginTop() + marginBottom() + borderTop() + borderBottom(), rh); </span><span \
class="cx"> </span><del>- // CSS2 14.2:
- // " The background of the box generated by the root element covers the \
entire canvas."
- // hence, paint the background even in the margin areas (unlike for every other \
element!)
- // I just love these little inconsistencies .. :-( (Dirk)
</del><span class="cx"> int my = max(by, paintInfo.rect.y());
</span><span class="cx">
</span><span class="cx"> paintBackgrounds(paintInfo, bgColor, bgLayer, my, \
paintInfo.rect.height(), bx, by, bw, bh); </span><span class="lines">@@ -459,7 +458,7 \
@@ </span><span class="cx"> // If the height is auto and the width is \
not, we have to use the appropriate </span><span class="cx"> // scale to \
maintain our aspect ratio. </span><span class="cx"> if \
(bgWidth.isPercent()) </span><del>- h = \
bg->imageSize(style()->effectiveZoom()).height() * scaledWidth / \
bg->imageSize(style()->effectiveZoom()).width(); </del><ins>+ h \
= bg->imageSize(style()->effectiveZoom()).height() * w / \
bg->imageSize(style()->effectiveZoom()).width(); </ins><span class="cx"> \
else if (bgWidth.isFixed()) </span><span class="cx"> h = \
bg->imageSize(style()->effectiveZoom()).height() * bgWidth.value() / \
bg->imageSize(style()->effectiveZoom()).width(); </span><span class="cx"> \
else if (bgWidth.isAuto()) { </span><span class="lines">@@ -537,6 +536,8 @@
</span><span class="cx"> int bottom = 0;
</span><span class="cx"> int cx;
</span><span class="cx"> int cy;
</span><ins>+ int rw = 0;
+ int rh = 0;
</ins><span class="cx">
</span><span class="cx"> // CSS2 chapter 14.2.1
</span><span class="cx">
</span><span class="lines">@@ -554,6 +555,18 @@
</span><span class="cx"> bottom += paddingBottom();
</span><span class="cx"> }
</span><span class="cx"> }
</span><ins>+
+ // The background of the box generated by the root element covers the entire \
canvas including + // its margins. Since those were added in already, we have \
to factor them out when computing the + // box used by \
background-origin/size/position. + if (isRoot()) {
+ rw = width() - left - right;
+ rh = height() - top - bottom;
+ left += marginLeft();
+ right += marginRight();
+ top += marginTop();
+ bottom += marginBottom();
+ }
</ins><span class="cx"> cx = tx;
</span><span class="cx"> cy = ty;
</span><span class="cx"> pw = w - left - right;
</span><span class="lines">@@ -572,13 +585,22 @@
</span><span class="cx"> int cw;
</span><span class="cx"> int ch;
</span><span class="cx">
</span><del>- IntSize scaledImageSize = calculateBackgroundSize(bgLayer, pw, ph);
</del><ins>+ IntSize scaledImageSize;
+ if (isRoot() && bgLayer->backgroundAttachment())
+ scaledImageSize = calculateBackgroundSize(bgLayer, rw, rh);
+ else
+ scaledImageSize = calculateBackgroundSize(bgLayer, pw, ph);
+
</ins><span class="cx"> int scaledImageWidth = scaledImageSize.width();
</span><span class="cx"> int scaledImageHeight = scaledImageSize.height();
</span><span class="cx">
</span><span class="cx"> EBackgroundRepeat backgroundRepeat = \
bgLayer->backgroundRepeat(); </span><span class="cx">
</span><del>- int xPosition = bgLayer->backgroundXPosition().calcMinValue(pw - \
scaledImageWidth, true); </del><ins>+ int xPosition;
+ if (isRoot() && bgLayer->backgroundAttachment())
+ xPosition = bgLayer->backgroundXPosition().calcMinValue(rw - \
scaledImageWidth, true); + else
+ xPosition = bgLayer->backgroundXPosition().calcMinValue(pw - \
scaledImageWidth, true); </ins><span class="cx"> if (backgroundRepeat == REPEAT \
|| backgroundRepeat == REPEAT_X) { </span><span class="cx"> cw = pw + left + \
right; </span><span class="cx"> sx = scaledImageWidth ? scaledImageWidth - \
(xPosition + left) % scaledImageWidth : 0; </span><span class="lines">@@ -587,8 \
+609,12 @@ </span><span class="cx"> sx = -min(xPosition + left, 0);
</span><span class="cx"> cw = scaledImageWidth + min(xPosition + left, 0);
</span><span class="cx"> }
</span><del>-
- int yPosition = bgLayer->backgroundYPosition().calcMinValue(ph - \
scaledImageHeight, true); </del><ins>+
+ int yPosition;
+ if (isRoot() && bgLayer->backgroundAttachment())
+ yPosition = bgLayer->backgroundYPosition().calcMinValue(rh - \
scaledImageHeight, true); + else
+ yPosition = bgLayer->backgroundYPosition().calcMinValue(ph - \
scaledImageHeight, true); </ins><span class="cx"> if (backgroundRepeat == REPEAT \
|| backgroundRepeat == REPEAT_Y) { </span><span class="cx"> ch = ph + top + \
bottom; </span><span class="cx"> sy = scaledImageHeight ? scaledImageHeight - \
(yPosition + top) % scaledImageHeight : 0; </span></span></pre>
</div>
</div>
</body>
</html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic