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

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

Issue 2832093003: Implement screen orientation for out-of-process iframes. (Closed)
Patch Set: add comments 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
« no previous file with comments | « 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 8a160dc47ddfc162c9401120eb9ec334d57c06bb..7fb03917ec3c6f98aa5a60944472e015f82b17e5 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));
+ }
+ }
+
+ for (LocalFrame* frame : frames) {
+ frame->DomWindow()->DispatchEvent(
+ Event::Create(EventTypeNames::orientationchange));
}
}
« no previous file with comments | « content/renderer/render_widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698