Changeset 64187 in webkit


Ignore:
Timestamp:
Jul 27, 2010 8:48:36 PM (14 years ago)
Author:
yuzo@google.com
Message:

2010-07-26 Yuzo Fujishima <yuzo@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@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.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r64186 r64187  
     12010-07-26  Yuzo Fujishima  <yuzo@google.com>
     2
     3        Reviewed by Shinichiro Hamaji.
     4
     5        @page rules in media queries should be tested.
     6        Added tests for such rules.
     7        https://bugs.webkit.org/show_bug.cgi?id=42971
     8
     9        * printing/page-rule-selection-expected.txt:
     10        * printing/page-rule-selection.html:
     11
    1122010-07-27  Daniel Bates  <dbates@rim.com>
    213
  • trunk/LayoutTests/printing/page-rule-selection-expected.txt

    r61975 r64187  
    5050PASS layoutTestController.pageProperty('font-family', 0) is "Arial"
    5151PASS layoutTestController.pageProperty('font-size', 0) is "30"
     52Check @media rules.
     53PASS layoutTestController.pageProperty('size', 0) is "100 200"
     54PASS layoutTestController.pageProperty('size', 0) is "150 250"
     55PASS layoutTestController.pageProperty('size', 0) is "150 250"
    5256PASS successfullyParsed is true
    5357
  • trunk/LayoutTests/printing/page-rule-selection.html

    r62982 r64187  
    8585        shouldBeEqualToString("layoutTestController.pageProperty('font-size', 0)", "30");
    8686        appendStyle("@page { zoom:100%; }");
     87
     88        debug("Check @media rules.");
     89        appendStyle("@page { size:100px 200px; }");
     90        shouldBeEqualToString("layoutTestController.pageProperty('size', 0)", "100 200");
     91        appendStyle("@media print { @page { size:150px 250px; } }");
     92        shouldBeEqualToString("layoutTestController.pageProperty('size', 0)", "150 250");
     93        appendStyle("@media screen { @page { size:300px 500px; } }");
     94        shouldBeEqualToString("layoutTestController.pageProperty('size', 0)", "150 250");
     95
    8796    } else {
    8897        testFailed("This test can be run only with window.layoutTestController");
  • trunk/WebCore/ChangeLog

    r64173 r64187  
     12010-07-26  Yuzo Fujishima  <yuzo@google.com>
     2
     3        Reviewed by Shinichiro Hamaji.
     4
     5        @page rules in media queries should be tested.
     6        https://bugs.webkit.org/show_bug.cgi?id=42971
     7
     8        * page/PrintContext.cpp:
     9        (WebCore::PrintContext::pageProperty): Fixed to properly begin
     10        printing. Added support for size property.
     11
    1122010-07-27  James Hawkins  <jhawkins@chromium.org>
    213
  • trunk/WebCore/page/PrintContext.cpp

    r63521 r64187  
    203203{
    204204    Document* document = frame->document();
     205    PrintContext printContext(frame);
     206    printContext.begin(800); // Any width is OK here.
    205207    document->updateLayout();
    206208    RefPtr<RenderStyle> style = document->styleForPage(pageNumber);
     
    218220    if (!strcmp(propertyName, "font-family"))
    219221        return String::format("%s", style->fontDescription().family().family().string().utf8().data());
     222    if (!strcmp(propertyName, "size"))
     223        return String::format("%d %d", style->pageSize().width().rawValue(), style->pageSize().height().rawValue());
    220224
    221225    return String::format("pageProperty() unimplemented for: %s", propertyName);
Note: See TracChangeset for help on using the changeset viewer.