Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 14408004: Fix incorrect evaluation of resolution media queries (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 205 }
206 206
207 Internals::~Internals() 207 Internals::~Internals()
208 { 208 {
209 } 209 }
210 210
211 void Internals::resetToConsistentState(Page* page) 211 void Internals::resetToConsistentState(Page* page)
212 { 212 {
213 ASSERT(page); 213 ASSERT(page);
214 214
215 page->setDeviceScaleFactor(1);
215 page->setPageScaleFactor(1, IntPoint(0, 0)); 216 page->setPageScaleFactor(1, IntPoint(0, 0));
216 page->setPagination(Pagination()); 217 page->setPagination(Pagination());
217 TextRun::setAllowsRoundingHacks(false); 218 TextRun::setAllowsRoundingHacks(false);
218 WebCore::overrideUserPreferredLanguages(Vector<String>()); 219 WebCore::overrideUserPreferredLanguages(Vector<String>());
219 WebCore::Settings::setUsesOverlayScrollbars(false); 220 WebCore::Settings::setUsesOverlayScrollbars(false);
220 #if ENABLE(PAGE_POPUP) 221 #if ENABLE(PAGE_POPUP)
221 delete s_pagePopupDriver; 222 delete s_pagePopupDriver;
222 s_pagePopupDriver = 0; 223 s_pagePopupDriver = 0;
223 if (page->chrome()) 224 if (page->chrome())
224 page->chrome()->client()->resetPagePopupDriver(); 225 page->chrome()->client()->resetPagePopupDriver();
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1758 String Internals::pageSizeAndMarginsInPixels(int pageNumber, int width, int heig ht, int marginTop, int marginRight, int marginBottom, int marginLeft, ExceptionC ode& ec) const 1759 String Internals::pageSizeAndMarginsInPixels(int pageNumber, int width, int heig ht, int marginTop, int marginRight, int marginBottom, int marginLeft, ExceptionC ode& ec) const
1759 { 1760 {
1760 if (!frame()) { 1761 if (!frame()) {
1761 ec = INVALID_ACCESS_ERR; 1762 ec = INVALID_ACCESS_ERR;
1762 return String(); 1763 return String();
1763 } 1764 }
1764 1765
1765 return PrintContext::pageSizeAndMarginsInPixels(frame(), pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft); 1766 return PrintContext::pageSizeAndMarginsInPixels(frame(), pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft);
1766 } 1767 }
1767 1768
1769 void Internals::setDeviceScaleFactor(float scaleFactor, ExceptionCode& ec)
1770 {
1771 Document* document = contextDocument();
1772 if (!document || !document->page()) {
1773 ec = INVALID_ACCESS_ERR;
1774 return;
1775 }
1776 Page* page = document->page();
1777 page->setDeviceScaleFactor(scaleFactor);
1778 }
1779
1768 void Internals::setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCod e& ec) 1780 void Internals::setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCod e& ec)
1769 { 1781 {
1770 Document* document = contextDocument(); 1782 Document* document = contextDocument();
1771 if (!document || !document->page()) { 1783 if (!document || !document->page()) {
1772 ec = INVALID_ACCESS_ERR; 1784 ec = INVALID_ACCESS_ERR;
1773 return; 1785 return;
1774 } 1786 }
1775 Page* page = document->page(); 1787 Page* page = document->page();
1776 page->setPageScaleFactor(scaleFactor, IntPoint(x, y)); 1788 page->setPageScaleFactor(scaleFactor, IntPoint(x, y));
1777 } 1789 }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
2002 2014
2003 RenderObject* renderer = select->renderer(); 2015 RenderObject* renderer = select->renderer();
2004 if (!renderer->isMenuList()) 2016 if (!renderer->isMenuList())
2005 return false; 2017 return false;
2006 2018
2007 RenderMenuList* menuList = toRenderMenuList(renderer); 2019 RenderMenuList* menuList = toRenderMenuList(renderer);
2008 return menuList->popupIsVisible(); 2020 return menuList->popupIsVisible();
2009 } 2021 }
2010 2022
2011 } 2023 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698