Changeset 100040 in webkit
- Timestamp:
- Nov 11, 2011, 3:52:09 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/chromium/test_expectations.txt (modified) (3 diffs)
-
Source/WebKit/chromium/ChangeLog (modified) (1 diff)
-
Source/WebKit/chromium/public/WebFrame.h (modified) (1 diff)
-
Source/WebKit/chromium/src/WebFrameImpl.cpp (modified) (1 diff)
-
Source/WebKit/chromium/src/WebFrameImpl.h (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/DumpRenderTree/chromium/LayoutTestController.cpp (modified) (6 diffs)
-
Tools/DumpRenderTree/chromium/LayoutTestController.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r100036 r100040 1 2011-11-11 Stephen Chenney <schenney@chromium.org> 2 3 [Chromium] DRT does not have LayoutTestController.pageSizeAndMarginsInPixels 4 https://bugs.webkit.org/show_bug.cgi?id=49257 5 6 Reviewed by Darin Fisher. 7 8 * platform/chromium/test_expectations.txt: Removed expected fails for 9 printing tests that were using missing functionality in LayoutTestController. 10 1 11 2011-11-11 Joel Webber <jgw@google.com> 2 12 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r100028 r100040 2062 2062 BUGCR46603 SKIP DEBUG : fast/frames/lots-of-objects.html = TIMEOUT 2063 2063 2064 // LayoutTestController::pageProperty is not implemented for Chromium yet.2065 BUGWK35961 : printing/page-rule-selection.html = TEXT2066 2067 2064 BUGCR47035 WIN DEBUG : fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html = PASS TEXT 2068 2065 … … 2079 2076 // WebKit roll 61547:61629. Still need to investigate. 2080 2077 BUG_HCLAM : fast/js/script-line-number.html = TEXT 2081 2082 // LayoutTestController::isPageBoxVisible, pageAreaRectInPixels, and preferredPageSizeInPixels are not implemented yet for Chromium.2083 BUGWK37538 : printing/page-format-data.html = TEXT2084 2078 2085 2079 // First noticed on trybots after r61836, now in the tree. … … 2428 2422 // Added in WK r71424 2429 2423 BUGCR62138 : animations/stop-animation-on-suspend.html = PASS CRASH TEXT 2430 2431 // test_shell and DRT do not have LayoutTestController.pageSizeAndMarginsInPixels2432 BUGCR62515 : printing/page-format-data-display-none.html = TEXT2433 2424 2434 2425 BUGCR61739 DEBUG : animations/suspend-resume-animation-events.html = PASS CRASH TEXT -
trunk/Source/WebKit/chromium/ChangeLog
r100032 r100040 1 2011-11-11 Stephen Chenney <schenney@chromium.org> 2 3 [Chromium] DRT does not have LayoutTestController.pageSizeAndMarginsInPixels 4 https://bugs.webkit.org/show_bug.cgi?id=49257 5 6 Add the WebFrame::getPageProperty method for Chromium. 7 8 Reviewed by Darin Fisher. 9 10 * public/WebFrame.h: 11 * src/WebFrameImpl.cpp: 12 (WebKit::WebFrameImpl::getPageProperty): 13 * src/WebFrameImpl.h: 14 1 15 2011-11-11 Jeff Timanus <twiz@chromium.org> 2 16 -
trunk/Source/WebKit/chromium/public/WebFrame.h
r98634 r100040 480 480 int& marginLeft) = 0; 481 481 482 // Returns the value for a page property that is only defined when printing. 483 // printBegin must have been called before this method. 484 virtual WebString pageProperty(const WebString& propertyName, int pageIndex) = 0; 485 482 486 // Find-in-page -------------------------------------------------------- 483 487 -
trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp
r99659 r100040 1493 1493 } 1494 1494 1495 WebString WebFrameImpl::pageProperty(const WebString& propertyName, int pageIndex) 1496 { 1497 ASSERT(m_printContext); 1498 return m_printContext->pageProperty(m_frame, propertyName.utf8().data(), pageIndex); 1499 } 1500 1495 1501 bool WebFrameImpl::find(int identifier, 1496 1502 const WebString& searchText, -
trunk/Source/WebKit/chromium/src/WebFrameImpl.h
r98634 r100040 179 179 int& marginBottom, 180 180 int& marginLeft); 181 virtual WebString pageProperty(const WebString& propertyName, int pageIndex); 181 182 virtual void printPagesWithBoundaries(WebCanvas*, const WebSize&); 182 183 virtual bool find( -
trunk/Tools/ChangeLog
r100030 r100040 1 2011-11-11 Stephen Chenney <schenney@chromium.org> 2 3 [Chromium] DRT does not have LayoutTestController.pageSizeAndMarginsInPixels 4 https://bugs.webkit.org/show_bug.cgi?id=49257 5 6 Adds the remaining missing layout test functionality for printing. 7 8 Reviewed by Darin Fisher. 9 10 * DumpRenderTree/chromium/LayoutTestController.cpp: 11 (LayoutTestController::LayoutTestController): Add bindings for new JS methods 12 (parsePageNumber): Method to parse JS arguments for a page number 13 (parsePageNumberSizeMargins): Method to parse JS arguments for page size and margins 14 (LayoutTestController::pageSizeAndMarginsInPixels): Get the page size and margins for a given page. 15 (LayoutTestController::isPageBoxVisible): get the visibility status for printing 16 (LayoutTestController::pageProperty): get a specific CSS property when in printing mode 17 * DumpRenderTree/chromium/LayoutTestController.h: Add declarations for new methods 18 1 19 2011-11-11 Darin Adler <darin@apple.com> 2 20 -
trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
r99070 r100040 64 64 #include <cstdlib> 65 65 #include <limits> 66 #include <sstream> 66 67 #include <wtf/text/WTFString.h> 67 68 … … 123 124 bindMethod("hasSpellingMarker", &LayoutTestController::hasSpellingMarker); 124 125 bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled); 126 bindMethod("isPageBoxVisible", &LayoutTestController::isPageBoxVisible); 125 127 bindMethod("layerTreeAsText", &LayoutTestController::layerTreeAsText); 126 128 bindMethod("loseCompositorContext", &LayoutTestController::loseCompositorContext); … … 133 135 bindMethod("overridePreference", &LayoutTestController::overridePreference); 134 136 bindMethod("pageNumberForElementById", &LayoutTestController::pageNumberForElementById); 137 bindMethod("pageProperty", &LayoutTestController::pageProperty); 138 bindMethod("pageSizeAndMarginsInPixels", &LayoutTestController::pageSizeAndMarginsInPixels); 135 139 bindMethod("pathToLocalResource", &LayoutTestController::pathToLocalResource); 136 140 bindMethod("pauseAnimationAtTimeOnElementWithId", &LayoutTestController::pauseAnimationAtTimeOnElementWithId); … … 1592 1596 } 1593 1597 1598 // Parse a single argument. The method returns true if there is an argument that 1599 // is a number or if there is no argument at all. It returns false only if there 1600 // is some argument that is not a number. The value parameter is filled with the 1601 // parsed number, or given the default if there is no argument. 1602 static bool parseCppArgumentInt32(const CppArgumentList& arguments, int argIndex, int* value, int defaultValue) 1603 { 1604 if (static_cast<int>(arguments.size()) > argIndex) { 1605 if (!arguments[argIndex].isNumber()) 1606 return false; 1607 *value = arguments[argIndex].toInt32(); 1608 return true; 1609 } 1610 *value = defaultValue; 1611 return true; 1612 } 1613 1594 1614 static bool parsePageSizeParameters(const CppArgumentList& arguments, 1595 1615 int argOffset, … … 1599 1619 // WebKit is using the window width/height of DumpRenderTree as the 1600 1620 // default value of the page size. 1601 // FIXME: share these values with other ports. 1602 *pageWidthInPixels = 800; 1603 *pageHeightInPixels = 600; 1604 switch (arguments.size() - argOffset) { 1605 case 2: 1606 if (!arguments[argOffset].isNumber() || !arguments[1 + argOffset].isNumber()) 1607 return false; 1608 *pageWidthInPixels = arguments[argOffset].toInt32(); 1609 *pageHeightInPixels = arguments[1 + argOffset].toInt32(); 1610 // fall through. 1611 case 0: 1612 break; 1613 default: 1621 // FIXME: share the default values with other ports. 1622 int argCount = static_cast<int>(arguments.size()) - argOffset; 1623 if (argCount && argCount != 2) 1614 1624 return false; 1615 } 1625 if (!parseCppArgumentInt32(arguments, argOffset, pageWidthInPixels, 800) 1626 || !parseCppArgumentInt32(arguments, argOffset + 1, pageHeightInPixels, 600)) 1627 return false; 1628 return true; 1629 } 1630 1631 static bool parsePageNumber(const CppArgumentList& arguments, int argOffset, int* pageNumber) 1632 { 1633 if (static_cast<int>(arguments.size()) > argOffset + 1) 1634 return false; 1635 if (!parseCppArgumentInt32(arguments, argOffset, pageNumber, 0)) 1636 return false; 1637 return true; 1638 } 1639 1640 static bool parsePageNumberSizeMargins(const CppArgumentList& arguments, int argOffset, 1641 int* pageNumber, int* width, int* height, 1642 int* marginTop, int* marginRight, int* marginBottom, int* marginLeft) 1643 { 1644 int argCount = static_cast<int>(arguments.size()) - argOffset; 1645 if (argCount && argCount != 7) 1646 return false; 1647 if (!parseCppArgumentInt32(arguments, argOffset, pageNumber, 0) 1648 || !parseCppArgumentInt32(arguments, argOffset + 1, width, 0) 1649 || !parseCppArgumentInt32(arguments, argOffset + 2, height, 0) 1650 || !parseCppArgumentInt32(arguments, argOffset + 3, marginTop, 0) 1651 || !parseCppArgumentInt32(arguments, argOffset + 4, marginRight, 0) 1652 || !parseCppArgumentInt32(arguments, argOffset + 5, marginBottom, 0) 1653 || !parseCppArgumentInt32(arguments, argOffset + 6, marginLeft, 0)) 1654 return false; 1616 1655 return true; 1617 1656 } … … 1639 1678 static_cast<float>(pageWidthInPixels), 1640 1679 static_cast<float>(pageHeightInPixels))); 1680 } 1681 1682 void LayoutTestController::pageSizeAndMarginsInPixels(const CppArgumentList& arguments, CppVariant* result) 1683 { 1684 result->set(""); 1685 int pageNumber = 0; 1686 int width = 0; 1687 int height = 0; 1688 int marginTop = 0; 1689 int marginRight = 0; 1690 int marginBottom = 0; 1691 int marginLeft = 0; 1692 if (!parsePageNumberSizeMargins(arguments, 0, &pageNumber, &width, &height, &marginTop, &marginRight, &marginBottom, 1693 &marginLeft)) 1694 return; 1695 1696 WebFrame* frame = m_shell->webView()->mainFrame(); 1697 if (!frame) 1698 return; 1699 WebSize pageSize(width, height); 1700 frame->pageSizeAndMarginsInPixels(pageNumber, pageSize, marginTop, marginRight, marginBottom, marginLeft); 1701 stringstream resultString; 1702 resultString << "(" << pageSize.width << ", " << pageSize.height << ") " << marginTop << " " << marginRight << " " 1703 << marginBottom << " " << marginLeft; 1704 result->set(resultString.str()); 1705 } 1706 1707 void LayoutTestController::isPageBoxVisible(const CppArgumentList& arguments, CppVariant* result) 1708 { 1709 result->setNull(); 1710 int pageNumber = 0; 1711 if (!parsePageNumber(arguments, 0, &pageNumber)) 1712 return; 1713 WebFrame* frame = m_shell->webView()->mainFrame(); 1714 if (!frame) 1715 return; 1716 result->set(frame->isPageBoxVisible(pageNumber)); 1717 } 1718 1719 void LayoutTestController::pageProperty(const CppArgumentList& arguments, CppVariant* result) 1720 { 1721 result->set(""); 1722 int pageNumber = 0; 1723 if (!parsePageNumber(arguments, 1, &pageNumber)) 1724 return; 1725 if (!arguments[0].isString()) 1726 return; 1727 WebFrame* frame = m_shell->webView()->mainFrame(); 1728 if (!frame) 1729 return; 1730 WebSize pageSize(800, 800); 1731 frame->printBegin(pageSize); 1732 result->set(frame->pageProperty(cppVariantToWebString(arguments[0]), pageNumber).utf8()); 1733 frame->printEnd(); 1641 1734 } 1642 1735 -
trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h
r99070 r100040 334 334 // Gets the number of page where the specified element will be put. 335 335 void pageNumberForElementById(const CppArgumentList&, CppVariant*); 336 337 // Gets the page size and margins for a printed page. 338 void pageSizeAndMarginsInPixels(const CppArgumentList&, CppVariant*); 339 340 // Returns the visibililty status of a page box for printing 341 void isPageBoxVisible(const CppArgumentList&, CppVariant*); 342 343 // Gets the page-related property for printed content 344 void pageProperty(const CppArgumentList&, CppVariant*); 336 345 337 346 // Gets the number of pages to be printed.
Note:
See TracChangeset
for help on using the changeset viewer.