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

Side by Side Diff: Source/core/inspector/InspectorPageAgent.cpp

Issue 296743003: Removed RecalcStyleTime. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 1164
1165 m_deviceMetricsOverridden = enabled; 1165 m_deviceMetricsOverridden = enabled;
1166 m_emulateViewportEnabled = emulateViewport; 1166 m_emulateViewportEnabled = emulateViewport;
1167 if (enabled) 1167 if (enabled)
1168 m_client->setDeviceMetricsOverride(width, height, static_cast<float>(dev iceScaleFactor), emulateViewport, fitWindow); 1168 m_client->setDeviceMetricsOverride(width, height, static_cast<float>(dev iceScaleFactor), emulateViewport, fitWindow);
1169 else 1169 else
1170 m_client->clearDeviceMetricsOverride(); 1170 m_client->clearDeviceMetricsOverride();
1171 1171
1172 Document* document = mainFrame()->document(); 1172 Document* document = mainFrame()->document();
1173 if (document) { 1173 if (document) {
1174 document->styleResolverChanged(RecalcStyleDeferred); 1174 document->styleResolverChanged();
1175 document->mediaQueryAffectingValueChanged(); 1175 document->mediaQueryAffectingValueChanged();
1176 } 1176 }
1177 InspectorInstrumentation::mediaQueryResultChanged(document); 1177 InspectorInstrumentation::mediaQueryResultChanged(document);
1178 1178
1179 if (m_deviceMetricsOverridden) { 1179 if (m_deviceMetricsOverridden) {
1180 m_page->settings().setTextAutosizingEnabled(textAutosizingEnabled); 1180 m_page->settings().setTextAutosizingEnabled(textAutosizingEnabled);
1181 m_page->settings().setDeviceScaleAdjustment(fontScaleFactor); 1181 m_page->settings().setDeviceScaleAdjustment(fontScaleFactor);
1182 } else { 1182 } else {
1183 m_page->settings().setTextAutosizingEnabled(m_embedderTextAutosizingEnab led); 1183 m_page->settings().setTextAutosizingEnabled(m_embedderTextAutosizingEnab led);
1184 m_page->settings().setDeviceScaleAdjustment(m_embedderFontScaleFactor); 1184 m_page->settings().setDeviceScaleAdjustment(m_embedderFontScaleFactor);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 String currentMedia = m_state->getString(PageAgentState::pageAgentEmulatedMe dia); 1231 String currentMedia = m_state->getString(PageAgentState::pageAgentEmulatedMe dia);
1232 if (media == currentMedia) 1232 if (media == currentMedia)
1233 return; 1233 return;
1234 1234
1235 m_state->setString(PageAgentState::pageAgentEmulatedMedia, media); 1235 m_state->setString(PageAgentState::pageAgentEmulatedMedia, media);
1236 Document* document = 0; 1236 Document* document = 0;
1237 if (m_page->mainFrame()) 1237 if (m_page->mainFrame())
1238 document = m_page->mainFrame()->document(); 1238 document = m_page->mainFrame()->document();
1239 if (document) { 1239 if (document) {
1240 document->mediaQueryAffectingValueChanged(); 1240 document->mediaQueryAffectingValueChanged();
1241 document->styleResolverChanged(RecalcStyleDeferred); 1241 document->styleResolverChanged();
1242 document->updateLayout(); 1242 document->updateLayout();
1243 } 1243 }
1244 } 1244 }
1245 1245
1246 bool InspectorPageAgent::applyViewportStyleOverride(StyleResolver* resolver) 1246 bool InspectorPageAgent::applyViewportStyleOverride(StyleResolver* resolver)
1247 { 1247 {
1248 if (!m_deviceMetricsOverridden || !m_emulateViewportEnabled) 1248 if (!m_deviceMetricsOverridden || !m_emulateViewportEnabled)
1249 return false; 1249 return false;
1250 1250
1251 RefPtrWillBeRawPtr<StyleSheetContents> styleSheet = StyleSheetContents::crea te(CSSParserContext(UASheetMode, 0)); 1251 RefPtrWillBeRawPtr<StyleSheetContents> styleSheet = StyleSheetContents::crea te(CSSParserContext(UASheetMode, 0));
(...skipping 29 matching lines...) Expand all
1281 } 1281 }
1282 1282
1283 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid) 1283 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid)
1284 { 1284 {
1285 m_state->setBoolean(PageAgentState::showSizeOnResize, show); 1285 m_state->setBoolean(PageAgentState::showSizeOnResize, show);
1286 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ; 1286 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ;
1287 } 1287 }
1288 1288
1289 } // namespace WebCore 1289 } // namespace WebCore
1290 1290
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorCSSAgent.cpp ('k') | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698