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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h

Issue 2631233003: Avoid mutating frame owner when detaching a provisional frame. (Closed)
Patch Set: Fix test to actually test the changed behavior. Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 26 matching lines...) Expand all
37 class LayoutPart; 37 class LayoutPart;
38 class Widget; 38 class Widget;
39 39
40 class CORE_EXPORT HTMLFrameOwnerElement : public HTMLElement, 40 class CORE_EXPORT HTMLFrameOwnerElement : public HTMLElement,
41 public FrameOwner { 41 public FrameOwner {
42 USING_GARBAGE_COLLECTED_MIXIN(HTMLFrameOwnerElement); 42 USING_GARBAGE_COLLECTED_MIXIN(HTMLFrameOwnerElement);
43 43
44 public: 44 public:
45 ~HTMLFrameOwnerElement() override; 45 ~HTMLFrameOwnerElement() override;
46 46
47 Frame* contentFrame() const { return m_contentFrame; }
48 DOMWindow* contentWindow() const; 47 DOMWindow* contentWindow() const;
49 Document* contentDocument() const; 48 Document* contentDocument() const;
50 49
51 virtual void disconnectContentFrame(); 50 virtual void disconnectContentFrame();
52 51
53 // Most subclasses use LayoutPart (either LayoutEmbeddedObject or 52 // Most subclasses use LayoutPart (either LayoutEmbeddedObject or
54 // LayoutIFrame) except for HTMLObjectElement and HTMLEmbedElement which may 53 // LayoutIFrame) except for HTMLObjectElement and HTMLEmbedElement which may
55 // return any LayoutObject when using fallback content. 54 // return any LayoutObject when using fallback content.
56 LayoutPart* layoutPart() const; 55 LayoutPart* layoutPart() const;
57 56
(...skipping 11 matching lines...) Expand all
69 68
70 public: 69 public:
71 UpdateSuspendScope(); 70 UpdateSuspendScope();
72 ~UpdateSuspendScope(); 71 ~UpdateSuspendScope();
73 72
74 private: 73 private:
75 void performDeferredWidgetTreeOperations(); 74 void performDeferredWidgetTreeOperations();
76 }; 75 };
77 76
78 // FrameOwner overrides: 77 // FrameOwner overrides:
79 void setContentFrame(Frame&) override; 78 Frame* contentFrame() const final { return m_contentFrame; }
80 void clearContentFrame() override; 79 void setContentFrame(Frame&) final;
81 void dispatchLoad() override; 80 void clearContentFrame() final;
82 SandboxFlags getSandboxFlags() const override { return m_sandboxFlags; } 81 void dispatchLoad() final;
82 SandboxFlags getSandboxFlags() const final { return m_sandboxFlags; }
83 bool canRenderFallbackContent() const override { return false; } 83 bool canRenderFallbackContent() const override { return false; }
84 void renderFallbackContent() override {} 84 void renderFallbackContent() override {}
85 ScrollbarMode scrollingMode() const override { return ScrollbarAuto; } 85 ScrollbarMode scrollingMode() const override { return ScrollbarAuto; }
86 int marginWidth() const override { return -1; } 86 int marginWidth() const override { return -1; }
87 int marginHeight() const override { return -1; } 87 int marginHeight() const override { return -1; }
88 bool allowFullscreen() const override { return false; } 88 bool allowFullscreen() const override { return false; }
89 bool allowPaymentRequest() const override { return false; } 89 bool allowPaymentRequest() const override { return false; }
90 AtomicString csp() const override { return nullAtom; } 90 AtomicString csp() const override { return nullAtom; }
91 const WebVector<WebPermissionType>& delegatedPermissions() const override; 91 const WebVector<WebPermissionType>& delegatedPermissions() const override;
92 92
93 DECLARE_VIRTUAL_TRACE(); 93 DECLARE_VIRTUAL_TRACE();
94 94
95 protected: 95 protected:
96 HTMLFrameOwnerElement(const QualifiedName& tagName, Document&); 96 HTMLFrameOwnerElement(const QualifiedName& tagName, Document&);
97 void setSandboxFlags(SandboxFlags); 97 void setSandboxFlags(SandboxFlags);
98 98
99 bool loadOrRedirectSubframe(const KURL&, 99 bool loadOrRedirectSubframe(const KURL&,
100 const AtomicString& frameName, 100 const AtomicString& frameName,
101 bool replaceCurrentItem); 101 bool replaceCurrentItem);
102 bool isKeyboardFocusable() const override; 102 bool isKeyboardFocusable() const override;
103 103
104 void disposeWidgetSoon(Widget*); 104 void disposeWidgetSoon(Widget*);
105 105
106 private: 106 private:
107 // Intentionally private to prevent redundant checks when the type is 107 // Intentionally private to prevent redundant checks when the type is
108 // already HTMLFrameOwnerElement. 108 // already HTMLFrameOwnerElement.
109 bool isLocal() const override { return true; } 109 bool isLocal() const final { return true; }
110 bool isRemote() const override { return false; } 110 bool isRemote() const final { return false; }
111 111
112 bool isFrameOwnerElement() const final { return true; } 112 bool isFrameOwnerElement() const final { return true; }
113 113
114 virtual ReferrerPolicy referrerPolicyAttribute() { 114 virtual ReferrerPolicy referrerPolicyAttribute() {
115 return ReferrerPolicyDefault; 115 return ReferrerPolicyDefault;
116 } 116 }
117 117
118 Member<Frame> m_contentFrame; 118 Member<Frame> m_contentFrame;
119 Member<Widget> m_widget; 119 Member<Widget> m_widget;
120 SandboxFlags m_sandboxFlags; 120 SandboxFlags m_sandboxFlags;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 DEFINE_TYPE_CASTS(HTMLFrameOwnerElement, 158 DEFINE_TYPE_CASTS(HTMLFrameOwnerElement,
159 FrameOwner, 159 FrameOwner,
160 owner, 160 owner,
161 owner->isLocal(), 161 owner->isLocal(),
162 owner.isLocal()); 162 owner.isLocal());
163 163
164 } // namespace blink 164 } // namespace blink
165 165
166 #endif // HTMLFrameOwnerElement_h 166 #endif // HTMLFrameOwnerElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698