WebKit Bugzilla
Attachment 347845 Details for
Bug 188864
: Store RefPtr in FocusNavigationScope
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Cleanup
bug-188864-20180822141531.patch (text/plain), 3.49 KB, created by
Ryosuke Niwa
on 2018-08-22 14:15:32 PDT
(
hide
)
Description:
Cleanup
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2018-08-22 14:15:32 PDT
Size:
3.49 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 235200) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2018-08-22 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Store RefPtr in FocusNavigationScope >+ https://bugs.webkit.org/show_bug.cgi?id=188864 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Use RefPtr to store the root node of a tree scope and a slot element instead of a reference and a raw pointer. >+ >+ * page/FocusController.cpp: >+ (WebCore::FocusNavigationScope::parentInScope const): >+ (WebCore::FocusNavigationScope::firstNodeInScope const): >+ (WebCore::FocusNavigationScope::lastNodeInScope const): >+ (WebCore::FocusNavigationScope::FocusNavigationScope): >+ (WebCore::FocusNavigationScope::owner const): >+ > 2018-08-22 Eric Carlson <eric.carlson@apple.com> > > Log more often during AirPlay state changes >Index: Source/WebCore/page/FocusController.cpp >=================================================================== >--- Source/WebCore/page/FocusController.cpp (revision 235199) >+++ Source/WebCore/page/FocusController.cpp (working copy) >@@ -109,8 +109,8 @@ private: > explicit FocusNavigationScope(TreeScope&); > explicit FocusNavigationScope(HTMLSlotElement&, SlotKind); > >- TreeScope* m_rootTreeScope { nullptr }; >- HTMLSlotElement* m_slotElement { nullptr }; >+ RefPtr<ContainerNode> m_treeScopeRootNode; >+ RefPtr<HTMLSlotElement> m_slotElement; > SlotKind m_slotKind { SlotKind::Assigned }; > }; > >@@ -131,7 +131,7 @@ Node* FocusNavigationScope::lastChildInS > > Node* FocusNavigationScope::parentInScope(const Node& node) const > { >- if (m_rootTreeScope && &m_rootTreeScope->rootNode() == &node) >+ if (m_treeScopeRootNode == &node) > return nullptr; > > if (UNLIKELY(m_slotElement)) { >@@ -184,8 +184,8 @@ Node* FocusNavigationScope::firstNodeInS > ASSERT(m_slotKind == SlotKind::Fallback); > return m_slotElement->firstChild(); > } >- ASSERT(m_rootTreeScope); >- return &m_rootTreeScope->rootNode(); >+ ASSERT(m_treeScopeRootNode); >+ return m_treeScopeRootNode.get(); > } > > Node* FocusNavigationScope::lastNodeInScope() const >@@ -199,8 +199,8 @@ Node* FocusNavigationScope::lastNodeInSc > ASSERT(m_slotKind == SlotKind::Fallback); > return m_slotElement->lastChild(); > } >- ASSERT(m_rootTreeScope); >- return &m_rootTreeScope->rootNode(); >+ ASSERT(m_treeScopeRootNode); >+ return m_treeScopeRootNode.get(); > } > > Node* FocusNavigationScope::nextInScope(const Node* node) const >@@ -228,7 +228,7 @@ Node* FocusNavigationScope::previousInSc > } > > FocusNavigationScope::FocusNavigationScope(TreeScope& treeScope) >- : m_rootTreeScope(&treeScope) >+ : m_treeScopeRootNode(&treeScope.rootNode()) > { > } > >@@ -241,13 +241,12 @@ FocusNavigationScope::FocusNavigationSco > Element* FocusNavigationScope::owner() const > { > if (m_slotElement) >- return m_slotElement; >+ return m_slotElement.get(); > >- ASSERT(m_rootTreeScope); >- ContainerNode& root = m_rootTreeScope->rootNode(); >- if (is<ShadowRoot>(root)) >- return downcast<ShadowRoot>(root).host(); >- if (Frame* frame = root.document().frame()) >+ ASSERT(m_treeScopeRootNode); >+ if (is<ShadowRoot>(*m_treeScopeRootNode)) >+ return downcast<ShadowRoot>(*m_treeScopeRootNode).host(); >+ if (Frame* frame = m_treeScopeRootNode->document().frame()) > return frame->ownerElement(); > return nullptr; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
simon.fraser
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188864
: 347845