[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
aestes at apple.com
aestes at apple.com
Wed Dec 22 12:40:57 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 72fc62cfaac5b5481cfc225e780959700a504ce6
Author: aestes at apple.com <aestes at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Aug 27 02:38:40 2010 +0000
Based on a patch by Mihnea Ovidenie <mihnea at adobe.com>.
Reviewed by Darin Adler.
Percentage top value on position:relative descendant not resolved
correctly if containing block height is not specified explicitly.
https://bugs.webkit.org/show_bug.cgi?id=26396
WebCore:
If the containing block height is auto and the element is positioned
relatively, and if the element's top/bottom is percent, then resolve the
top/bottom as auto.
Test: fast/css/percent-top-relative-container-height-unspecified.html
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::relativePositionOffsetY):
LayoutTests:
* fast/css/percent-top-relative-container-height-unspecified.html: Added.
* platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.checksum: Added.
* platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.png: Added.
* platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.txt: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66170 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6ebc8d3..48cc7b6 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-08-26 Andy Estes <aestes at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Based on a patch by Mihnea Ovidenie <mihnea at adobe.com>.
+
+ Percentage top value on position:relative descendant not resolved
+ correctly if containing block height is not specified explicitly.
+ https://bugs.webkit.org/show_bug.cgi?id=26396
+
+ * fast/css/percent-top-relative-container-height-unspecified.html: Added.
+ * platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.checksum: Added.
+ * platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.png: Added.
+ * platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.txt: Added.
+
2010-08-26 Brian Weinstein <bweinstein at apple.com>
Rubber-stamped by Mark Rowe.
diff --git a/LayoutTests/fast/css/percent-top-relative-container-height-unspecified.html b/LayoutTests/fast/css/percent-top-relative-container-height-unspecified.html
new file mode 100644
index 0000000..1dc1524
--- /dev/null
+++ b/LayoutTests/fast/css/percent-top-relative-container-height-unspecified.html
@@ -0,0 +1,6 @@
+<div id="DIV1" style="border: solid 1px red;">
+<div style="position: relative; top: 50%;">This text with top percent relative and containing block auto should appear inside the red border</div>
+</div>
+<div id="DIV2" style="border: solid 1px red;">
+<div style="position: relative; bottom: 50%;">This text with bottom percent relative and containing block auto should appear inside the red border</div>
+</div>
diff --git a/LayoutTests/platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.checksum b/LayoutTests/platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.checksum
new file mode 100644
index 0000000..3b7b31f
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.checksum
@@ -0,0 +1 @@
+2692344b03a1d3951553f4ea6a77e8de
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.png b/LayoutTests/platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.png
new file mode 100644
index 0000000..367c872
Binary files /dev/null and b/LayoutTests/platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.txt b/LayoutTests/platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.txt
new file mode 100644
index 0000000..6d49a76
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/css/percent-top-relative-container-height-unspecified-expected.txt
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 784x20 [border: (1px solid #FF0000)]
+ RenderBlock {DIV} at (0,20) size 784x20 [border: (1px solid #FF0000)]
+layer at (9,9) size 782x18
+ RenderBlock (relative positioned) {DIV} at (1,1) size 782x18
+ RenderText {#text} at (0,0) size 603x18
+ text run at (0,0) width 603: "This text with top percent relative and containing block auto should appear inside the red border"
+layer at (9,29) size 782x18
+ RenderBlock (relative positioned) {DIV} at (1,1) size 782x18
+ RenderText {#text} at (0,0) size 627x18
+ text run at (0,0) width 627: "This text with bottom percent relative and containing block auto should appear inside the red border"
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 76cb08b..75d3f0d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-08-26 Andy Estes <aestes at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Based on a patch by Mihnea Ovidenie <mihnea at adobe.com>.
+
+ Percentage top value on position:relative descendant not resolved
+ correctly if containing block height is not specified explicitly.
+ https://bugs.webkit.org/show_bug.cgi?id=26396
+
+ If the containing block height is auto and the element is positioned
+ relatively, and if the element's top/bottom is percent, then resolve the
+ top/bottom as auto.
+
+ Test: fast/css/percent-top-relative-container-height-unspecified.html
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::relativePositionOffsetY):
+
2010-08-26 James Robinson <jamesr at chromium.org>
Another chromium mac build fix. What a dumb version of GCC.
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index 78618d1..0fbc9f2 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -337,10 +337,25 @@ int RenderBoxModelObject::relativePositionOffsetX() const
int RenderBoxModelObject::relativePositionOffsetY() const
{
- if (!style()->top().isAuto())
- return style()->top().calcValue(containingBlock()->availableHeight());
- else if (!style()->bottom().isAuto())
- return -style()->bottom().calcValue(containingBlock()->availableHeight());
+ RenderBlock* containingBlock = this->containingBlock();
+
+ // If the containing block of a relatively positioned element does not
+ // specify a height, a percentage top or bottom offset should be resolved as
+ // auto. An exception to this is if the containing block has the WinIE quirk
+ // where <html> and <body> assume the size of the viewport. In this case,
+ // calculate the percent offset based on this height.
+ // See <https://bugs.webkit.org/show_bug.cgi?id=26396>.
+ if (!style()->top().isAuto()
+ && (!containingBlock->style()->height().isAuto()
+ || !style()->top().isPercent()
+ || containingBlock->stretchesToViewHeight()))
+ return style()->top().calcValue(containingBlock->availableHeight());
+
+ if (!style()->bottom().isAuto()
+ && (!containingBlock->style()->height().isAuto()
+ || !style()->bottom().isPercent()
+ || containingBlock->stretchesToViewHeight()))
+ return -style()->bottom().calcValue(containingBlock->availableHeight());
return 0;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list