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

Side by Side Diff: sky/engine/core/frame/FrameView.cpp

Issue 848483003: Simplify media query handling for stylesheets. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « sky/engine/core/dom/StyleEngine.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, fal se); 215 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, fal se);
216 216
217 if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_postLayoutTasksT imer.isActive()) { 217 if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_postLayoutTasksT imer.isActive()) {
218 // This is a new top-level layout. If there are any remaining tasks from the previous layout, finish them now. 218 // This is a new top-level layout. If there are any remaining tasks from the previous layout, finish them now.
219 m_inSynchronousPostLayout = true; 219 m_inSynchronousPostLayout = true;
220 performPostLayoutTasks(); 220 performPostLayoutTasks();
221 m_inSynchronousPostLayout = false; 221 m_inSynchronousPostLayout = false;
222 } 222 }
223 223
224 Document* document = m_frame->document(); 224 Document* document = m_frame->document();
225 if (wasViewportResized()) 225 if (wasViewportResized()) {
226 document->notifyResizeForViewportUnits(); 226 document->notifyResizeForViewportUnits();
227 document->mediaQueryAffectingValueChanged();
227 228
228 // Viewport-dependent media queries may cause us to need completely differen t style information. 229 // TODO(esprehn): This is way too much work, it rebuilds the entire shee t list
229 if (document->styleResolver().mediaQueryAffectedByViewportChange()) { 230 // and does a full document recalc.
230 document->styleResolverChanged(); 231 document->styleResolverChanged();
231 document->mediaQueryAffectingValueChanged();
232 } else {
233 document->evaluateMediaQueryList();
234 } 232 }
235 233
236 document->updateRenderTreeIfNeeded(); 234 document->updateRenderTreeIfNeeded();
237 lifecycle().advanceTo(DocumentLifecycle::StyleClean); 235 lifecycle().advanceTo(DocumentLifecycle::StyleClean);
238 } 236 }
239 237
240 void FrameView::performLayout(RenderObject* rootForThisLayout, bool inSubtreeLay out) 238 void FrameView::performLayout(RenderObject* rootForThisLayout, bool inSubtreeLay out)
241 { 239 {
242 TRACE_EVENT0("blink", "FrameView::performLayout"); 240 TRACE_EVENT0("blink", "FrameView::performLayout");
243 241
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 totalObjects = 0; 895 totalObjects = 0;
898 896
899 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) { 897 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) {
900 ++totalObjects; 898 ++totalObjects;
901 if (o->needsLayout()) 899 if (o->needsLayout())
902 ++needsLayoutObjects; 900 ++needsLayoutObjects;
903 } 901 }
904 } 902 }
905 903
906 } // namespace blink 904 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/StyleEngine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698