| 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 * Copyright (C) 2010 Apple Inc. All rights reserved. | 4 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 #include "core/HTMLNames.h" | 25 #include "core/HTMLNames.h" |
| 26 | 26 |
| 27 namespace blink { | 27 namespace blink { |
| 28 | 28 |
| 29 using namespace HTMLNames; | 29 using namespace HTMLNames; |
| 30 | 30 |
| 31 inline HTMLMenuElement::HTMLMenuElement(Document& document) | 31 inline HTMLMenuElement::HTMLMenuElement(Document& document) |
| 32 : HTMLElement(menuTag, document) {} | 32 : HTMLElement(menuTag, document) {} |
| 33 | 33 |
| 34 const String HTMLMenuElement::type() const { | |
| 35 const AtomicString menuType = FastGetAttribute(typeAttr); | |
| 36 if (EqualIgnoringASCIICase(menuType, "context")) { | |
| 37 return "context"; | |
| 38 } | |
| 39 if (EqualIgnoringASCIICase(menuType, "toolbar")) { | |
| 40 return "toolbar"; | |
| 41 } | |
| 42 if (parentNode() && isHTMLMenuElement(parentNode()) && | |
| 43 toHTMLMenuElement(parentNode())->type() == "context") { | |
| 44 return "context"; | |
| 45 } | |
| 46 return "toolbar"; | |
| 47 } | |
| 48 | |
| 49 void HTMLMenuElement::setType(const AtomicString& type) { | |
| 50 setAttribute(typeAttr, type); | |
| 51 } | |
| 52 | |
| 53 DEFINE_NODE_FACTORY(HTMLMenuElement) | 34 DEFINE_NODE_FACTORY(HTMLMenuElement) |
| 54 | 35 |
| 55 } // namespace blink | 36 } // namespace blink |
| OLD | NEW |