Bug 122431

Summary: Move FocusController from Page to MainFrame
Product: WebKit Reporter: Darin Adler <darin>
Component: Page LoadingAssignee: Darin Adler <darin>
Status: RESOLVED INVALID    
Severity: Normal CC: buildbot, eflews.bot, gtk-ews, gyuyoung.kim, philn, rniwa, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
buildbot: commit-queue-
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2
none
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion none

Darin Adler
Reported 2013-10-06 16:50:54 PDT
Move FocusController from Page to MainFrame
Attachments
Patch (101.12 KB, patch)
2013-10-06 16:57 PDT, Darin Adler
no flags
Patch (104.30 KB, patch)
2013-10-06 18:21 PDT, Darin Adler
no flags
Patch (108.33 KB, patch)
2013-10-07 19:41 PDT, Darin Adler
buildbot: commit-queue-
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2 (288.31 KB, application/zip)
2013-10-07 20:19 PDT, Build Bot
no flags
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion (191.20 KB, application/zip)
2013-10-10 08:07 PDT, Build Bot
no flags
Darin Adler
Comment 1 2013-10-06 16:57:00 PDT
Andreas Kling
Comment 2 2013-10-06 17:16:46 PDT
Comment on attachment 213541 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=213541&action=review > Source/WebCore/dom/Element.cpp:1959 > + if (!frame->mainFrame().focus().setFocusedElement(this, *document().frame(), direction)) *document().frame() -> *frame > Source/WebCore/page/EventHandler.cpp:3319 > - bool changedFocusedFrame = m_frame.page() && &m_frame != &m_frame.page()->focusController().focusedOrMainFrame(); > + bool changedFocusedFrame = m_frame.page() && &m_frame != &m_frame.mainFrame().focus().focusedOrMainFrame(); I think we can lose the m_frame.page() check here. I suspect it was just there due to pointer paranoia. > Source/WebCore/page/EventHandler.cpp:3341 > - bool changedFocusedFrame = m_frame.page() && &m_frame != &m_frame.page()->focusController().focusedOrMainFrame(); > + bool changedFocusedFrame = m_frame.page() && &m_frame != &m_frame.mainFrame().focus().focusedOrMainFrame(); Ditto. > Source/WebCore/page/FocusController.cpp:200 > - m_focusedFrame = newFrame; > + if (oldFrame != &m_mainFrame) > + oldFrame->deref(); > + if (newFrame != &m_mainFrame) > + newFrame->ref(); > + m_focusedFrame = newFrame.get(); This could probably use a comment. > Source/WebCore/page/FocusController.cpp:357 > + document.setFocusedElement(0); nullptr > Source/WebCore/page/FocusController.cpp:429 > +// @param start The node from which to start searching. The node after this will be focused. May be null. > +// > +// @return The focus node that comes after/before start node. I know you are just moving them, but these comments sure look out-of-place in WebKit. > Source/WebCore/page/FocusController.cpp:784 > + Node* focusedNode = (m_focusedFrame && m_focusedFrame->document()) ? m_focusedFrame->document()->focusedElement() : 0; Looks like this should be an Element*. > Source/WebCore/page/FocusController.h:86 > + Frame* m_focusedFrame; Bug! This is missing from the constructor initializer list.
Darin Adler
Comment 3 2013-10-06 18:21:43 PDT
EFL EWS Bot
Comment 4 2013-10-06 18:30:17 PDT
Andreas Kling
Comment 5 2013-10-06 18:33:59 PDT
Comment on attachment 213548 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=213548&action=review EWS looks sick, so I'm just dumping some comments for now: > Source/WebCore/css/SelectorChecker.cpp:414 > + Frame* frame = element->document().frame(); > + return !frame || !frame->mainFrame().focus().isActive(); I wonder if we can really find ourselves matching selectors while Document is Frame-less. isFrameFocused(Element*) in the same file seems to indicate that we could, but I'm not sure. Our future selves can figure that out. > Source/WebCore/page/Page.cpp:421 > + if (!m_mainFrame) > + return; This should not happen. m_mainFrame is initialized by the Page constructor and never cleared. > Source/WebCore/page/Page.cpp:563 > + if (!m_mainFrame) > + return false; Same here.
EFL EWS Bot
Comment 6 2013-10-06 18:44:47 PDT
Build Bot
Comment 7 2013-10-06 18:48:20 PDT
Build Bot
Comment 8 2013-10-06 19:04:19 PDT
Build Bot
Comment 9 2013-10-06 19:05:45 PDT
kov's GTK+ EWS bot
Comment 10 2013-10-06 23:36:33 PDT
Darin Adler
Comment 11 2013-10-07 19:41:28 PDT
Build Bot
Comment 12 2013-10-07 20:18:59 PDT
Comment on attachment 213640 [details] Patch Attachment 213640 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/3746009 New failing tests: compositing/backface-visibility/backface-visibility-hierarchical-transform.html accessibility/anchor-linked-anonymous-block-crash.html compositing/absolute-inside-out-of-view-fixed.html animations/3d/matrix-transform-type-animation.html animations/3d/state-at-end-event-transform.html animations/added-while-suspended.html animations/animation-add-events-in-handler.html animations/additive-transform-animations.html animations/3d/replace-filling-transform.html accessibility/accessibility-object-detached.html compositing/backface-visibility/backface-visibility-3d.html accessibility/accessibility-node-reparent.html animations/animation-border-overflow.html http/tests/appcache/abort-cache-onchecking-resource-404.html compositing/animation/animation-compositing.html canvas/philip/tests/2d.canvas.readonly.html animations/3d/change-transform-in-end-event.html compositing/absolute-position-changed-in-composited-layer.html compositing/animation/animated-composited-inside-hidden.html http/tests/appcache/abort-cache-onchecking-manifest-404.html canvas/philip/tests/2d.canvas.reference.html canvas/philip/tests/2d.clearRect+fillRect.alpha0.5.html http/tests/appcache/404-resource.html animations/3d/transform-origin-vs-functions.html accessibility/accessibility-node-memory-management.html http/tests/appcache/abort-cache-onchecking.html accessibility/adjacent-continuations-cause-assertion-failure.html http/tests/appcache/404-manifest.html canvas/philip/tests/2d.clearRect+fillRect.basic.html canvas/philip/tests/2d.clearRect+fillRect.alpha0.html
Build Bot
Comment 13 2013-10-07 20:19:02 PDT
Created attachment 213644 [details] Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-14 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
EFL EWS Bot
Comment 14 2013-10-07 20:20:40 PDT
Build Bot
Comment 15 2013-10-07 20:24:59 PDT
EFL EWS Bot
Comment 16 2013-10-07 20:38:52 PDT
kov's GTK+ EWS bot
Comment 17 2013-10-07 21:52:39 PDT
Build Bot
Comment 18 2013-10-10 08:07:55 PDT
Comment on attachment 213640 [details] Patch Attachment 213640 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/3868020 New failing tests: compositing/backface-visibility/backface-visibility-hierarchical-transform.html compositing/absolute-inside-out-of-view-fixed.html animations/3d/matrix-transform-type-animation.html animations/3d/state-at-end-event-transform.html animations/added-while-suspended.html animations/animation-add-events-in-handler.html animations/additive-transform-animations.html animations/3d/replace-filling-transform.html accessibility/accessibility-object-detached.html compositing/backface-visibility/backface-visibility-3d.html accessibility/accessibility-node-reparent.html animations/animation-border-overflow.html http/tests/appcache/abort-cache-onchecking-resource-404.html compositing/animation/animation-compositing.html canvas/philip/tests/2d.canvas.readonly.html animations/3d/change-transform-in-end-event.html compositing/animation/busy-indicator.html compositing/absolute-position-changed-in-composited-layer.html compositing/animation/animated-composited-inside-hidden.html http/tests/appcache/abort-cache-onchecking-manifest-404.html canvas/philip/tests/2d.canvas.reference.html canvas/philip/tests/2d.clearRect+fillRect.alpha0.5.html accessibility/accessibility-node-memory-management.html compositing/backface-visibility/backface-visibility-image.html compositing/backface-visibility/backface-visibility-non3d.html accessibility/adjacent-continuations-cause-assertion-failure.html http/tests/appcache/404-manifest.html http/tests/appcache/404-resource.html compositing/absolute-position-changed-with-composited-parent-layer.html canvas/philip/tests/2d.clearRect+fillRect.alpha0.html
Build Bot
Comment 19 2013-10-10 08:07:58 PDT
Created attachment 213885 [details] Archive of layout-test-results from webkit-ews-08 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-08 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Darin Adler
Comment 20 2018-12-13 21:37:30 PST
Chris removed MainFrame so this idea doesn’t apply any more.
Note You need to log in before you can comment on or make changes to this bug.