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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2730573003: Moved FrameHost::m_visualViewport to Page (Closed)
Patch Set: Fixed some compile errors on mac and android Created 3 years, 9 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * (C) 2007 Eric Seidel (eric@webkit.org) 9 * (C) 2007 Eric Seidel (eric@webkit.org)
10 * 10 *
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 result.unite(quads[i].enclosingBoundingBox()); 1108 result.unite(quads[i].enclosingBoundingBox());
1109 1109
1110 return view->contentsToViewport(result); 1110 return view->contentsToViewport(result);
1111 } 1111 }
1112 1112
1113 IntRect Element::visibleBoundsInVisualViewport() const { 1113 IntRect Element::visibleBoundsInVisualViewport() const {
1114 if (!layoutObject() || !document().page()) 1114 if (!layoutObject() || !document().page())
1115 return IntRect(); 1115 return IntRect();
1116 // TODO(tkent): Can we check invisibility by scrollable non-frame elements? 1116 // TODO(tkent): Can we check invisibility by scrollable non-frame elements?
1117 1117
1118 IntSize viewportSize = document().page()->frameHost().visualViewport().size(); 1118 IntSize viewportSize = document().page()->visualViewport().size();
1119 IntRect rect(0, 0, viewportSize.width(), viewportSize.height()); 1119 IntRect rect(0, 0, viewportSize.width(), viewportSize.height());
1120 // We don't use absoluteBoundingBoxRect() because it can return an IntRect 1120 // We don't use absoluteBoundingBoxRect() because it can return an IntRect
1121 // larger the actual size by 1px. crbug.com/470503 1121 // larger the actual size by 1px. crbug.com/470503
1122 rect.intersect(document().view()->contentsToViewport( 1122 rect.intersect(document().view()->contentsToViewport(
1123 roundedIntRect(layoutObject()->absoluteBoundingBoxFloatRect()))); 1123 roundedIntRect(layoutObject()->absoluteBoundingBoxFloatRect())));
1124 return rect; 1124 return rect;
1125 } 1125 }
1126 1126
1127 void Element::clientQuads(Vector<FloatQuad>& quads) { 1127 void Element::clientQuads(Vector<FloatQuad>& quads) {
1128 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); 1128 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
(...skipping 3046 matching lines...) Expand 10 before | Expand all | Expand 10 after
4175 } 4175 }
4176 4176
4177 DEFINE_TRACE_WRAPPERS(Element) { 4177 DEFINE_TRACE_WRAPPERS(Element) {
4178 if (hasRareData()) { 4178 if (hasRareData()) {
4179 visitor->traceWrappers(elementRareData()); 4179 visitor->traceWrappers(elementRareData());
4180 } 4180 }
4181 ContainerNode::traceWrappers(visitor); 4181 ContainerNode::traceWrappers(visitor);
4182 } 4182 }
4183 4183
4184 } // namespace blink 4184 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698