Bug 62507

Summary: REGRESSION (full screen video): Watch Again button is obscured after full screen playback ends at Apple trailers page
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch darin: review+

Description Jer Noble 2011-06-11 23:51:56 PDT
REGRESSION (full screen video): Watch Again button is obscured after full screen playback ends at Apple trailers page
Comment 1 Jer Noble 2011-06-12 01:25:20 PDT
Created attachment 96872 [details]
Patch
Comment 2 WebKit Review Bot 2011-06-12 01:27:38 PDT
Attachment 96872 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/dom/Document.h:1063:  The parameter name "method" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Jer Noble 2011-06-12 12:21:03 PDT
<rdar://problem/9594595>
Comment 4 Jer Noble 2011-06-12 12:30:07 PDT
Created attachment 96887 [details]
Patch

Fixed style errors.
Comment 5 Darin Adler 2011-06-12 20:43:29 PDT
Comment on attachment 96887 [details]
Patch

My original complaint was driven by the fact that I did not understand this function was called in a loop up the entire parent chain. I thought it was called once, and was puzzled about it. Now that I understand it, here are my two complaints about the existing function:

    - It doesn’t seem good to have a function that operates on all ancestors incorporate the word “recursively”. There’s no recursion here, just a simple loop that goes up all ancestors. In the context of nodes, “recursively” almost always means that all descendants are involved, since recursion is a common way to walk all the descendants.

    - There is no need to have this function be a member of the class Document. This could be a free function, private to Document.cpp and not in the header at all.

    - The operation of walking one step up the parent chain and crossing frame boundaries into owner elements would be clearer as a named function rather than a ? : expression.

I suggest naming this function setContainsFullScreenElementIncludingAncestorsCrossingFrameBoundaries, or a shorter similar name.

I suggest we make a function called something like parentCrossingFrameBoundaries. This can be a free function, private to Document.cpp, or could even be an Element member function. Once we have that, then we can easily just call it like this:

    setContainsFullScreenElementIncludingAncestorsCrossingFrameBoundaries(parentCrossingFrameBoundaries(m_fullScreenElement.get()), false);

Or if you really want to avoid this, you can just put that single in into a named function and use it like this:

    setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(m_fullScreenElement.get(), false);

I know those are long function names, but I think they are sufficiently clear, and this would all be private to Document.cpp.

r=me but *please* don't use the enum as you do here

Also, I suggest doing the refactoring in a separate patch that does not change behavior, and land the bug fix on its own. I assume the bug fix is adding the new code to Document::fullScreenElementRemoved.
Comment 6 Jer Noble 2011-06-12 22:16:34 PDT
Just a quick reply to a subset of your comments:

(In reply to comment #5)
> (From update of attachment 96887 [details])
>     - There is no need to have this function be a member of the class Document. This could be a free function, private to Document.cpp and not in the header at all.

Actually, the only reason it's in the Document.h header is because it's also used in Element.cpp as well.  The reason I made the enum parameter have a default was so as not to affect those call sites.

As for the rest, I'll make the simple fix here, and file & fix the rest of your comments in a new bug.

> r=me but *please* don't use the enum as you do here

Sure thing.  Thanks!
Comment 7 Jer Noble 2011-06-12 22:23:35 PDT
Filed bug #62528 to cover the refactoring of Document::setContainsFullScreenElementRecursively.
Comment 8 Jer Noble 2011-06-12 22:27:26 PDT
Also filed bug #62529 to track fixing the DRT to catch the regression causing this bug.
Comment 9 Jer Noble 2011-06-12 23:21:01 PDT
Committed r88629: <http://trac.webkit.org/changeset/88629>