OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 204 } |
205 | 205 |
206 Internals::~Internals() | 206 Internals::~Internals() |
207 { | 207 { |
208 } | 208 } |
209 | 209 |
210 void Internals::resetToConsistentState(Page* page) | 210 void Internals::resetToConsistentState(Page* page) |
211 { | 211 { |
212 ASSERT(page); | 212 ASSERT(page); |
213 | 213 |
| 214 page->setDeviceScaleFactor(1); |
214 page->setPageScaleFactor(1, IntPoint(0, 0)); | 215 page->setPageScaleFactor(1, IntPoint(0, 0)); |
215 page->setPagination(Pagination()); | 216 page->setPagination(Pagination()); |
216 TextRun::setAllowsRoundingHacks(false); | 217 TextRun::setAllowsRoundingHacks(false); |
217 WebCore::overrideUserPreferredLanguages(Vector<String>()); | 218 WebCore::overrideUserPreferredLanguages(Vector<String>()); |
218 WebCore::Settings::setUsesOverlayScrollbars(false); | 219 WebCore::Settings::setUsesOverlayScrollbars(false); |
219 #if ENABLE(PAGE_POPUP) | 220 #if ENABLE(PAGE_POPUP) |
220 delete s_pagePopupDriver; | 221 delete s_pagePopupDriver; |
221 s_pagePopupDriver = 0; | 222 s_pagePopupDriver = 0; |
222 if (page->chrome()) | 223 if (page->chrome()) |
223 page->chrome()->client()->resetPagePopupDriver(); | 224 page->chrome()->client()->resetPagePopupDriver(); |
(...skipping 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1702 String Internals::pageSizeAndMarginsInPixels(int pageNumber, int width, int heig
ht, int marginTop, int marginRight, int marginBottom, int marginLeft, ExceptionC
ode& ec) const | 1703 String Internals::pageSizeAndMarginsInPixels(int pageNumber, int width, int heig
ht, int marginTop, int marginRight, int marginBottom, int marginLeft, ExceptionC
ode& ec) const |
1703 { | 1704 { |
1704 if (!frame()) { | 1705 if (!frame()) { |
1705 ec = INVALID_ACCESS_ERR; | 1706 ec = INVALID_ACCESS_ERR; |
1706 return String(); | 1707 return String(); |
1707 } | 1708 } |
1708 | 1709 |
1709 return PrintContext::pageSizeAndMarginsInPixels(frame(), pageNumber, width,
height, marginTop, marginRight, marginBottom, marginLeft); | 1710 return PrintContext::pageSizeAndMarginsInPixels(frame(), pageNumber, width,
height, marginTop, marginRight, marginBottom, marginLeft); |
1710 } | 1711 } |
1711 | 1712 |
| 1713 void Internals::setDeviceScaleFactor(float scaleFactor, ExceptionCode& ec) |
| 1714 { |
| 1715 Document* document = contextDocument(); |
| 1716 if (!document || !document->page()) { |
| 1717 ec = INVALID_ACCESS_ERR; |
| 1718 return; |
| 1719 } |
| 1720 Page* page = document->page(); |
| 1721 page->setDeviceScaleFactor(scaleFactor); |
| 1722 } |
| 1723 |
1712 void Internals::setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCod
e& ec) | 1724 void Internals::setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCod
e& ec) |
1713 { | 1725 { |
1714 Document* document = contextDocument(); | 1726 Document* document = contextDocument(); |
1715 if (!document || !document->page()) { | 1727 if (!document || !document->page()) { |
1716 ec = INVALID_ACCESS_ERR; | 1728 ec = INVALID_ACCESS_ERR; |
1717 return; | 1729 return; |
1718 } | 1730 } |
1719 Page* page = document->page(); | 1731 Page* page = document->page(); |
1720 page->setPageScaleFactor(scaleFactor, IntPoint(x, y)); | 1732 page->setPageScaleFactor(scaleFactor, IntPoint(x, y)); |
1721 } | 1733 } |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1946 | 1958 |
1947 RenderObject* renderer = select->renderer(); | 1959 RenderObject* renderer = select->renderer(); |
1948 if (!renderer->isMenuList()) | 1960 if (!renderer->isMenuList()) |
1949 return false; | 1961 return false; |
1950 | 1962 |
1951 RenderMenuList* menuList = toRenderMenuList(renderer); | 1963 RenderMenuList* menuList = toRenderMenuList(renderer); |
1952 return menuList->popupIsVisible(); | 1964 return menuList->popupIsVisible(); |
1953 } | 1965 } |
1954 | 1966 |
1955 } | 1967 } |
OLD | NEW |