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

Unified Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2832093003: Implement screen orientation for out-of-process iframes. (Closed)
Patch Set: fix dcheck Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« content/renderer/render_view_impl.cc ('K') | « content/renderer/render_widget.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index 7fdceb563e02fc978e8b27d8013257a931985c6e..902af0ea546eccf37ed8a945f018c81f9b3855cc 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -529,21 +529,24 @@ void LocalDOMWindow::Reset() {
void LocalDOMWindow::SendOrientationChangeEvent() {
ASSERT(RuntimeEnabledFeatures::orientationEventEnabled());
- ASSERT(GetFrame()->IsMainFrame());
+ DCHECK(GetFrame()->IsLocalRoot());
// Before dispatching the event, build a list of all frames in the page
// to send the event to, to mitigate side effects from event handlers
// potentially interfering with others.
- HeapVector<Member<Frame>> frames;
- for (Frame* f = GetFrame(); f; f = f->Tree().TraverseNext())
- frames.push_back(f);
-
- for (size_t i = 0; i < frames.size(); ++i) {
- if (!frames[i]->IsLocalFrame())
- continue;
- ToLocalFrame(frames[i].Get())
- ->DomWindow()
- ->DispatchEvent(Event::Create(EventTypeNames::orientationchange));
+ HeapVector<Member<LocalFrame>> frames;
+ frames.push_back(GetFrame());
+ for (size_t i = 0; i < frames.size(); i++) {
+ for (Frame* child = frames[i]->Tree().FirstChild(); child;
+ child = child->Tree().NextSibling()) {
+ if (child->IsLocalFrame())
+ frames.push_back(ToLocalFrame(child));
+ }
+ }
haraken 2017/04/25 12:35:39 What is this change for? Does TraverseNext not tra
lfg 2017/04/25 15:44:31 The problem with TraverseNext is that it traverses
+
+ for (LocalFrame* frame : frames) {
+ frame->DomWindow()->DispatchEvent(
haraken 2017/04/25 16:21:02 Nit: We should have renamed DomWindow to DOMWindow
+ Event::Create(EventTypeNames::orientationchange));
mlamouri (slow - plz ping) 2017/04/25 11:06:47 Note that screen orientation has two parts. One of
haraken 2017/04/25 12:35:39 Yeah , I'd also prefer not adding feature-specific
lfg 2017/04/25 15:44:31 Yes, this change is basically aligning LocalDOMWin
haraken 2017/04/25 16:21:02 Can we clean up the code a bit more so that we don
}
}
« content/renderer/render_view_impl.cc ('K') | « content/renderer/render_widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698