| 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) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
| 8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 #include "wtf/text/CString.h" | 104 #include "wtf/text/CString.h" |
| 105 #include "wtf/text/StringBuilder.h" | 105 #include "wtf/text/StringBuilder.h" |
| 106 #include "wtf/text/TextPosition.h" | 106 #include "wtf/text/TextPosition.h" |
| 107 | 107 |
| 108 namespace WebCore { | 108 namespace WebCore { |
| 109 | 109 |
| 110 using namespace HTMLNames; | 110 using namespace HTMLNames; |
| 111 using namespace XMLNames; | 111 using namespace XMLNames; |
| 112 | 112 |
| 113 class StyleResolverParentPusher { | 113 class StyleResolverParentPusher { |
| 114 STACK_ALLOCATED(); |
| 114 public: | 115 public: |
| 115 explicit StyleResolverParentPusher(Element& parent) | 116 explicit StyleResolverParentPusher(Element& parent) |
| 116 : m_parent(parent) | 117 : m_parent(parent) |
| 117 , m_pushedStyleResolver(0) | 118 , m_pushedStyleResolver(nullptr) |
| 118 { | 119 { |
| 119 } | 120 } |
| 120 void push() | 121 void push() |
| 121 { | 122 { |
| 122 if (m_pushedStyleResolver) | 123 if (m_pushedStyleResolver) |
| 123 return; | 124 return; |
| 124 m_pushedStyleResolver = &m_parent.document().ensureStyleResolver(); | 125 m_pushedStyleResolver = &m_parent.document().ensureStyleResolver(); |
| 125 m_pushedStyleResolver->pushParentElement(m_parent); | 126 m_pushedStyleResolver->pushParentElement(m_parent); |
| 126 } | 127 } |
| 127 ~StyleResolverParentPusher() | 128 ~StyleResolverParentPusher() |
| 128 { | 129 { |
| 129 | 130 |
| 130 if (!m_pushedStyleResolver) | 131 if (!m_pushedStyleResolver) |
| 131 return; | 132 return; |
| 132 | 133 |
| 133 // This tells us that our pushed style selector is in a bad state, | 134 // This tells us that our pushed style selector is in a bad state, |
| 134 // so we should just bail out in that scenario. | 135 // so we should just bail out in that scenario. |
| 135 ASSERT(m_pushedStyleResolver == m_parent.document().styleResolver()); | 136 ASSERT(m_pushedStyleResolver == m_parent.document().styleResolver()); |
| 136 if (m_pushedStyleResolver != m_parent.document().styleResolver()) | 137 if (m_pushedStyleResolver != m_parent.document().styleResolver()) |
| 137 return; | 138 return; |
| 138 | 139 |
| 139 m_pushedStyleResolver->popParentElement(m_parent); | 140 m_pushedStyleResolver->popParentElement(m_parent); |
| 140 } | 141 } |
| 141 | 142 |
| 142 private: | 143 private: |
| 143 Element& m_parent; | 144 Element& m_parent; |
| 144 StyleResolver* m_pushedStyleResolver; | 145 RawPtrWillBeMember<StyleResolver> m_pushedStyleResolver; |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 typedef Vector<RefPtr<Attr> > AttrNodeList; | 148 typedef Vector<RefPtr<Attr> > AttrNodeList; |
| 148 typedef HashMap<Element*, OwnPtr<AttrNodeList> > AttrNodeListMap; | 149 typedef HashMap<Element*, OwnPtr<AttrNodeList> > AttrNodeListMap; |
| 149 | 150 |
| 150 static AttrNodeListMap& attrNodeListMap() | 151 static AttrNodeListMap& attrNodeListMap() |
| 151 { | 152 { |
| 152 DEFINE_STATIC_LOCAL(AttrNodeListMap, map, ()); | 153 DEFINE_STATIC_LOCAL(AttrNodeListMap, map, ()); |
| 153 return map; | 154 return map; |
| 154 } | 155 } |
| (...skipping 3250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3405 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi
stItems | 3406 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi
stItems |
| 3406 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg
i?id=88405 | 3407 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg
i?id=88405 |
| 3407 if (isHTMLOptionElement(*this) || isHTMLOptGroupElement(*this)) | 3408 if (isHTMLOptionElement(*this) || isHTMLOptGroupElement(*this)) |
| 3408 return false; | 3409 return false; |
| 3409 if (FullscreenElementStack::isActiveFullScreenElement(this)) | 3410 if (FullscreenElementStack::isActiveFullScreenElement(this)) |
| 3410 return false; | 3411 return false; |
| 3411 return true; | 3412 return true; |
| 3412 } | 3413 } |
| 3413 | 3414 |
| 3414 } // namespace WebCore | 3415 } // namespace WebCore |
| OLD | NEW |