Provide a local root traversal function |
|||||
Issue descriptionSendOrientationChangeEvent() only sends events to the frame and immediate local children: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp?rcl=756189476715f0585dc70426f734a46be74d585e&l=520 So if a frame, child, and grandchild are all local frames, the grandchild won't get the orientation change event. (We should probably audit other calls to FrameTree::NextSibling() as well: some of these are recursive, so it's OK, but others are not)
,
May 30 2017
As dcheng@ noted in the meeting today, it sounds like this would matter for nested same-process frames. lfg@ said he could take a look. (Thanks!)
,
May 30 2017
Ah, sorry, I misunderstood Daniel's point, I thought he was referencing a A-B-A case.
However, for the A(1)-A(2)-A(3) case, I think the code is also correct:
HeapVector<Member<LocalFrame>> frames;
frames.push_back(GetFrame()); // root frame A(1) gets added here to frames[0]
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)); // A(2) gets added while iterating over A[1]'s children; now frames.size() is bigger. A(2)'s children will be iterated over in the next iteration of the outer for loop, where we add A(3) to the array.
}
}
,
May 31 2017
This looks correct to me also.
,
May 31 2017
We probably need something a bit clearer to iterate over just things in the local root. I misread the code. =) I've retitled the bug accordingly; one (simple) solution is to just use TraverseNext(), but we could consider specializing a LocalFrame version for traversing local roots.
,
May 31 2017
I agree with you, I'll work on improving this interface.
,
Jun 16 2017
,
Sep 26 2017
Marking as WontFix. Unsure whether its worth adding this API given there's only a single use-case. WIP CL: https://chromium-review.googlesource.com/c/chromium/src/+/538258 |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by lfg@chromium.org
, May 30 2017