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

Side by Side Diff: Source/core/testing/InternalSettings.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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 InternalSettings::Backup::Backup(Settings* settings) 68 InternalSettings::Backup::Backup(Settings* settings)
69 : m_originalCSSExclusionsEnabled(RuntimeEnabledFeatures::cssExclusionsEnable d()) 69 : m_originalCSSExclusionsEnabled(RuntimeEnabledFeatures::cssExclusionsEnable d())
70 , m_originalCSSVariablesEnabled(settings->cssVariablesEnabled()) 70 , m_originalCSSVariablesEnabled(settings->cssVariablesEnabled())
71 , m_originalAuthorShadowDOMForAnyElementEnabled(RuntimeEnabledFeatures::auth orShadowDOMForAnyElementEnabled()) 71 , m_originalAuthorShadowDOMForAnyElementEnabled(RuntimeEnabledFeatures::auth orShadowDOMForAnyElementEnabled())
72 , m_originalExperimentalShadowDOMEnabled(RuntimeEnabledFeatures::experimenta lShadowDOMEnabled()) 72 , m_originalExperimentalShadowDOMEnabled(RuntimeEnabledFeatures::experimenta lShadowDOMEnabled())
73 , m_originalStyleScoped(RuntimeEnabledFeatures::styleScopedEnabled()) 73 , m_originalStyleScoped(RuntimeEnabledFeatures::styleScopedEnabled())
74 , m_originalEditingBehavior(settings->editingBehaviorType()) 74 , m_originalEditingBehavior(settings->editingBehaviorType())
75 , m_originalTextAutosizingEnabled(settings->textAutosizingEnabled()) 75 , m_originalTextAutosizingEnabled(settings->textAutosizingEnabled())
76 , m_originalTextAutosizingWindowSizeOverride(settings->textAutosizingWindowS izeOverride()) 76 , m_originalTextAutosizingWindowSizeOverride(settings->textAutosizingWindowS izeOverride())
77 , m_originalTextAutosizingFontScaleFactor(settings->textAutosizingFontScaleF actor()) 77 , m_originalTextAutosizingFontScaleFactor(settings->textAutosizingFontScaleF actor())
78 , m_originalResolutionOverride(settings->resolutionOverride())
79 , m_originalMediaTypeOverride(settings->mediaTypeOverride()) 78 , m_originalMediaTypeOverride(settings->mediaTypeOverride())
80 , m_originalDialogElementEnabled(RuntimeEnabledFeatures::dialogElementEnable d()) 79 , m_originalDialogElementEnabled(RuntimeEnabledFeatures::dialogElementEnable d())
81 , m_originalLazyLayoutEnabled(RuntimeEnabledFeatures::lazyLayoutEnabled()) 80 , m_originalLazyLayoutEnabled(RuntimeEnabledFeatures::lazyLayoutEnabled())
82 , m_originalMockScrollbarsEnabled(settings->mockScrollbarsEnabled()) 81 , m_originalMockScrollbarsEnabled(settings->mockScrollbarsEnabled())
83 , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::langAttri buteAwareFormControlUIEnabled()) 82 , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::langAttri buteAwareFormControlUIEnabled())
84 , m_imagesEnabled(settings->areImagesEnabled()) 83 , m_imagesEnabled(settings->areImagesEnabled())
85 , m_shouldDisplaySubtitles(settings->shouldDisplaySubtitles()) 84 , m_shouldDisplaySubtitles(settings->shouldDisplaySubtitles())
86 , m_shouldDisplayCaptions(settings->shouldDisplayCaptions()) 85 , m_shouldDisplayCaptions(settings->shouldDisplayCaptions())
87 , m_shouldDisplayTextDescriptions(settings->shouldDisplayTextDescriptions()) 86 , m_shouldDisplayTextDescriptions(settings->shouldDisplayTextDescriptions())
88 , m_defaultVideoPosterURL(settings->defaultVideoPosterURL()) 87 , m_defaultVideoPosterURL(settings->defaultVideoPosterURL())
89 { 88 {
90 } 89 }
91 90
92 void InternalSettings::Backup::restoreTo(Settings* settings) 91 void InternalSettings::Backup::restoreTo(Settings* settings)
93 { 92 {
94 RuntimeEnabledFeatures::setCSSExclusionsEnabled(m_originalCSSExclusionsEnabl ed); 93 RuntimeEnabledFeatures::setCSSExclusionsEnabled(m_originalCSSExclusionsEnabl ed);
95 settings->setCSSVariablesEnabled(m_originalCSSVariablesEnabled); 94 settings->setCSSVariablesEnabled(m_originalCSSVariablesEnabled);
96 RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled(m_originalAut horShadowDOMForAnyElementEnabled); 95 RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled(m_originalAut horShadowDOMForAnyElementEnabled);
97 RuntimeEnabledFeatures::setExperimentalShadowDOMEnabled(m_originalExperiment alShadowDOMEnabled); 96 RuntimeEnabledFeatures::setExperimentalShadowDOMEnabled(m_originalExperiment alShadowDOMEnabled);
98 RuntimeEnabledFeatures::setStyleScopedEnabled(m_originalStyleScoped); 97 RuntimeEnabledFeatures::setStyleScopedEnabled(m_originalStyleScoped);
99 settings->setEditingBehaviorType(m_originalEditingBehavior); 98 settings->setEditingBehaviorType(m_originalEditingBehavior);
100 settings->setTextAutosizingEnabled(m_originalTextAutosizingEnabled); 99 settings->setTextAutosizingEnabled(m_originalTextAutosizingEnabled);
101 settings->setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindow SizeOverride); 100 settings->setTextAutosizingWindowSizeOverride(m_originalTextAutosizingWindow SizeOverride);
102 settings->setTextAutosizingFontScaleFactor(m_originalTextAutosizingFontScale Factor); 101 settings->setTextAutosizingFontScaleFactor(m_originalTextAutosizingFontScale Factor);
103 settings->setResolutionOverride(m_originalResolutionOverride);
104 settings->setMediaTypeOverride(m_originalMediaTypeOverride); 102 settings->setMediaTypeOverride(m_originalMediaTypeOverride);
105 RuntimeEnabledFeatures::setDialogElementEnabled(m_originalDialogElementEnabl ed); 103 RuntimeEnabledFeatures::setDialogElementEnabled(m_originalDialogElementEnabl ed);
106 RuntimeEnabledFeatures::setLazyLayoutEnabled(m_originalLazyLayoutEnabled); 104 RuntimeEnabledFeatures::setLazyLayoutEnabled(m_originalLazyLayoutEnabled);
107 settings->setMockScrollbarsEnabled(m_originalMockScrollbarsEnabled); 105 settings->setMockScrollbarsEnabled(m_originalMockScrollbarsEnabled);
108 RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(m_langAttr ibuteAwareFormControlUIEnabled); 106 RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled(m_langAttr ibuteAwareFormControlUIEnabled);
109 settings->setImagesEnabled(m_imagesEnabled); 107 settings->setImagesEnabled(m_imagesEnabled);
110 settings->setShouldDisplaySubtitles(m_shouldDisplaySubtitles); 108 settings->setShouldDisplaySubtitles(m_shouldDisplaySubtitles);
111 settings->setShouldDisplayCaptions(m_shouldDisplayCaptions); 109 settings->setShouldDisplayCaptions(m_shouldDisplayCaptions);
112 settings->setShouldDisplayTextDescriptions(m_shouldDisplayTextDescriptions); 110 settings->setShouldDisplayTextDescriptions(m_shouldDisplayTextDescriptions);
113 settings->setDefaultVideoPosterURL(m_defaultVideoPosterURL); 111 settings->setDefaultVideoPosterURL(m_defaultVideoPosterURL);
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 InternalSettingsGuardForSettings(); 250 InternalSettingsGuardForSettings();
253 settings()->setTextAutosizingEnabled(enabled); 251 settings()->setTextAutosizingEnabled(enabled);
254 } 252 }
255 253
256 void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height , ExceptionCode& ec) 254 void InternalSettings::setTextAutosizingWindowSizeOverride(int width, int height , ExceptionCode& ec)
257 { 255 {
258 InternalSettingsGuardForSettings(); 256 InternalSettingsGuardForSettings();
259 settings()->setTextAutosizingWindowSizeOverride(IntSize(width, height)); 257 settings()->setTextAutosizingWindowSizeOverride(IntSize(width, height));
260 } 258 }
261 259
262 void InternalSettings::setResolutionOverride(int dotsPerCSSInchHorizontally, int dotsPerCSSInchVertically, ExceptionCode& ec)
263 {
264 InternalSettingsGuardForSettings();
265 // An empty size resets the override.
266 settings()->setResolutionOverride(IntSize(dotsPerCSSInchHorizontally, dotsPe rCSSInchVertically));
267 }
268
269 void InternalSettings::setMediaTypeOverride(const String& mediaType, ExceptionCo de& ec) 260 void InternalSettings::setMediaTypeOverride(const String& mediaType, ExceptionCo de& ec)
270 { 261 {
271 InternalSettingsGuardForSettings(); 262 InternalSettingsGuardForSettings();
272 settings()->setMediaTypeOverride(mediaType); 263 settings()->setMediaTypeOverride(mediaType);
273 } 264 }
274 265
275 void InternalSettings::setTextAutosizingFontScaleFactor(float fontScaleFactor, E xceptionCode& ec) 266 void InternalSettings::setTextAutosizingFontScaleFactor(float fontScaleFactor, E xceptionCode& ec)
276 { 267 {
277 InternalSettingsGuardForSettings(); 268 InternalSettingsGuardForSettings();
278 settings()->setTextAutosizingFontScaleFactor(fontScaleFactor); 269 settings()->setTextAutosizingFontScaleFactor(fontScaleFactor);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 settings()->setImagesEnabled(enabled); 359 settings()->setImagesEnabled(enabled);
369 } 360 }
370 361
371 void InternalSettings::setDefaultVideoPosterURL(const String& url, ExceptionCode & ec) 362 void InternalSettings::setDefaultVideoPosterURL(const String& url, ExceptionCode & ec)
372 { 363 {
373 InternalSettingsGuardForSettings(); 364 InternalSettingsGuardForSettings();
374 settings()->setDefaultVideoPosterURL(url); 365 settings()->setDefaultVideoPosterURL(url);
375 } 366 }
376 367
377 } 368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698