| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Simon Hausmann <hausmann@kde.org> | 4 * (C) 2000 Simon Hausmann <hausmann@kde.org> |
| 5 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| 11 * | 11 * |
| 12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
| 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
| 16 * | 16 * |
| 17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
| 18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
| 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
| 21 * | 21 * |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #ifndef HTMLFrameElementBase_h | 24 #ifndef HTMLFrameElementBase_h |
| 25 #define HTMLFrameElementBase_h | 25 #define HTMLFrameElementBase_h |
| 26 | 26 |
| 27 #include "core/CoreExport.h" | 27 #include "core/CoreExport.h" |
| 28 #include "core/html/HTMLFrameOwnerElement.h" | 28 #include "core/html/HTMLFrameOwnerElement.h" |
| 29 #include "public/platform/WebFocusType.h" |
| 29 | 30 |
| 30 namespace blink { | 31 namespace blink { |
| 31 | 32 |
| 32 class CORE_EXPORT HTMLFrameElementBase : public HTMLFrameOwnerElement { | 33 class CORE_EXPORT HTMLFrameElementBase : public HTMLFrameOwnerElement { |
| 33 public: | 34 public: |
| 34 bool CanContainRangeEndPoint() const final { return false; } | 35 bool CanContainRangeEndPoint() const final { return false; } |
| 35 | 36 |
| 36 // FrameOwner overrides: | 37 // FrameOwner overrides: |
| 37 ScrollbarMode ScrollingMode() const final { return scrolling_mode_; } | 38 ScrollbarMode ScrollingMode() const final { return scrolling_mode_; } |
| 38 int MarginWidth() const final { return margin_width_; } | 39 int MarginWidth() const final { return margin_width_; } |
| 39 int MarginHeight() const final { return margin_height_; } | 40 int MarginHeight() const final { return margin_height_; } |
| 40 | 41 |
| 41 protected: | 42 protected: |
| 42 HTMLFrameElementBase(const QualifiedName&, Document&); | 43 HTMLFrameElementBase(const QualifiedName&, Document&); |
| 43 | 44 |
| 44 void ParseAttribute(const AttributeModificationParams&) override; | 45 void ParseAttribute(const AttributeModificationParams&) override; |
| 45 InsertionNotificationRequest InsertedInto(ContainerNode*) override; | 46 InsertionNotificationRequest InsertedInto(ContainerNode*) override; |
| 46 void DidNotifySubtreeInsertionsToDocument() final; | 47 void DidNotifySubtreeInsertionsToDocument() final; |
| 47 void AttachLayoutTree(const AttachContext& = AttachContext()) override; | 48 void AttachLayoutTree(const AttachContext& = AttachContext()) override; |
| 48 | 49 |
| 49 void SetScrollingMode(ScrollbarMode); | 50 void SetScrollingMode(ScrollbarMode); |
| 50 void SetMarginWidth(int); | 51 void SetMarginWidth(int); |
| 51 void SetMarginHeight(int); | 52 void SetMarginHeight(int); |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 bool SupportsFocus() const final; | 55 bool SupportsFocus() const final; |
| 55 void SetFocused(bool) final; | 56 void SetFocused(bool, WebFocusType) final; |
| 56 | 57 |
| 57 bool IsURLAttribute(const Attribute&) const final; | 58 bool IsURLAttribute(const Attribute&) const final; |
| 58 bool HasLegalLinkAttribute(const QualifiedName&) const final; | 59 bool HasLegalLinkAttribute(const QualifiedName&) const final; |
| 59 bool IsHTMLContentAttribute(const Attribute&) const final; | 60 bool IsHTMLContentAttribute(const Attribute&) const final; |
| 60 | 61 |
| 61 bool AreAuthorShadowsAllowed() const final { return false; } | 62 bool AreAuthorShadowsAllowed() const final { return false; } |
| 62 | 63 |
| 63 void SetLocation(const String&); | 64 void SetLocation(const String&); |
| 64 void SetNameAndOpenURL(); | 65 void SetNameAndOpenURL(); |
| 65 bool IsURLAllowed() const; | 66 bool IsURLAllowed() const; |
| 66 void OpenURL(bool replace_current_item = true); | 67 void OpenURL(bool replace_current_item = true); |
| 67 | 68 |
| 68 ScrollbarMode scrolling_mode_; | 69 ScrollbarMode scrolling_mode_; |
| 69 int margin_width_; | 70 int margin_width_; |
| 70 int margin_height_; | 71 int margin_height_; |
| 71 | 72 |
| 72 AtomicString url_; | 73 AtomicString url_; |
| 73 AtomicString frame_name_; | 74 AtomicString frame_name_; |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 inline bool IsHTMLFrameElementBase(const HTMLElement& element) { | 77 inline bool IsHTMLFrameElementBase(const HTMLElement& element) { |
| 77 return isHTMLFrameElement(element) || isHTMLIFrameElement(element); | 78 return isHTMLFrameElement(element) || isHTMLIFrameElement(element); |
| 78 } | 79 } |
| 79 | 80 |
| 80 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLFrameElementBase); | 81 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLFrameElementBase); |
| 81 | 82 |
| 82 } // namespace blink | 83 } // namespace blink |
| 83 | 84 |
| 84 #endif // HTMLFrameElementBase_h | 85 #endif // HTMLFrameElementBase_h |
| OLD | NEW |