[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
yuzo at google.com
yuzo at google.com
Wed Dec 22 11:31:34 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2f4dc83cb5d0bcc95ce7bb58445893e9b7dd4594
Author: yuzo at google.com <yuzo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jul 28 03:48:36 2010 +0000
2010-07-26 Yuzo Fujishima <yuzo at google.com>
Reviewed by Shinichiro Hamaji.
@page rules in media queries should be tested.
Added tests for such rules.
https://bugs.webkit.org/show_bug.cgi?id=42971
* printing/page-rule-selection-expected.txt:
* printing/page-rule-selection.html:
2010-07-26 Yuzo Fujishima <yuzo at google.com>
Reviewed by Shinichiro Hamaji.
@page rules in media queries should be tested.
https://bugs.webkit.org/show_bug.cgi?id=42971
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty): Fixed to properly begin
printing. Added support for size property.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a4a1c32..c67f090 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-07-26 Yuzo Fujishima <yuzo at google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ @page rules in media queries should be tested.
+ Added tests for such rules.
+ https://bugs.webkit.org/show_bug.cgi?id=42971
+
+ * printing/page-rule-selection-expected.txt:
+ * printing/page-rule-selection.html:
+
2010-07-27 Daniel Bates <dbates at rim.com>
Reviewed by Darin Adler.
diff --git a/LayoutTests/printing/page-rule-selection-expected.txt b/LayoutTests/printing/page-rule-selection-expected.txt
index d17594f..58ef4da 100644
--- a/LayoutTests/printing/page-rule-selection-expected.txt
+++ b/LayoutTests/printing/page-rule-selection-expected.txt
@@ -49,6 +49,10 @@ Check font update and line height override.
PASS layoutTestController.pageProperty('line-height', 0) is "180"
PASS layoutTestController.pageProperty('font-family', 0) is "Arial"
PASS layoutTestController.pageProperty('font-size', 0) is "30"
+Check @media rules.
+PASS layoutTestController.pageProperty('size', 0) is "100 200"
+PASS layoutTestController.pageProperty('size', 0) is "150 250"
+PASS layoutTestController.pageProperty('size', 0) is "150 250"
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/printing/page-rule-selection.html b/LayoutTests/printing/page-rule-selection.html
index 8ffa336..e435af9 100644
--- a/LayoutTests/printing/page-rule-selection.html
+++ b/LayoutTests/printing/page-rule-selection.html
@@ -84,6 +84,15 @@
shouldBeEqualToString("layoutTestController.pageProperty('font-family', 0)", "Arial");
shouldBeEqualToString("layoutTestController.pageProperty('font-size', 0)", "30");
appendStyle("@page { zoom:100%; }");
+
+ debug("Check @media rules.");
+ appendStyle("@page { size:100px 200px; }");
+ shouldBeEqualToString("layoutTestController.pageProperty('size', 0)", "100 200");
+ appendStyle("@media print { @page { size:150px 250px; } }");
+ shouldBeEqualToString("layoutTestController.pageProperty('size', 0)", "150 250");
+ appendStyle("@media screen { @page { size:300px 500px; } }");
+ shouldBeEqualToString("layoutTestController.pageProperty('size', 0)", "150 250");
+
} else {
testFailed("This test can be run only with window.layoutTestController");
}
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5a503bc..f6c7ee4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,14 @@
+2010-07-26 Yuzo Fujishima <yuzo at google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ @page rules in media queries should be tested.
+ https://bugs.webkit.org/show_bug.cgi?id=42971
+
+ * page/PrintContext.cpp:
+ (WebCore::PrintContext::pageProperty): Fixed to properly begin
+ printing. Added support for size property.
+
2010-07-27 James Hawkins <jhawkins at chromium.org>
Reviewed by Darin Fisher.
diff --git a/WebCore/page/PrintContext.cpp b/WebCore/page/PrintContext.cpp
index a41bed3..84a4891 100644
--- a/WebCore/page/PrintContext.cpp
+++ b/WebCore/page/PrintContext.cpp
@@ -202,6 +202,8 @@ int PrintContext::pageNumberForElement(Element* element, const FloatSize& pageSi
String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pageNumber)
{
Document* document = frame->document();
+ PrintContext printContext(frame);
+ printContext.begin(800); // Any width is OK here.
document->updateLayout();
RefPtr<RenderStyle> style = document->styleForPage(pageNumber);
@@ -217,6 +219,8 @@ String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pa
return String::format("%d", style->fontDescription().computedPixelSize());
if (!strcmp(propertyName, "font-family"))
return String::format("%s", style->fontDescription().family().family().string().utf8().data());
+ if (!strcmp(propertyName, "size"))
+ return String::format("%d %d", style->pageSize().width().rawValue(), style->pageSize().height().rawValue());
return String::format("pageProperty() unimplemented for: %s", propertyName);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list