diff options
Diffstat (limited to 'WebCore/html/HTMLElement.cpp')
-rw-r--r-- | WebCore/html/HTMLElement.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp index c50e6ba..b310cad 100644 --- a/WebCore/html/HTMLElement.cpp +++ b/WebCore/html/HTMLElement.cpp @@ -79,7 +79,7 @@ HTMLTagStatus HTMLElement::endTagRequirement() const { if (hasLocalName(wbrTag)) return TagStatusForbidden; - if (hasLocalName(dtTag) || hasLocalName(ddTag)) + if (hasLocalName(dtTag) || hasLocalName(ddTag) || hasLocalName(rpTag) || hasLocalName(rtTag)) return TagStatusOptional; // Same values as <span>. This way custom tag name elements will behave like inline spans. @@ -90,9 +90,9 @@ int HTMLElement::tagPriority() const { if (hasLocalName(wbrTag)) return 0; - if (hasLocalName(addressTag) || hasLocalName(ddTag) || hasLocalName(dtTag) || hasLocalName(noscriptTag)) + if (hasLocalName(addressTag) || hasLocalName(ddTag) || hasLocalName(dtTag) || hasLocalName(noscriptTag) || hasLocalName(rpTag) || hasLocalName(rtTag)) return 3; - if (hasLocalName(centerTag) || hasLocalName(nobrTag)) + if (hasLocalName(centerTag) || hasLocalName(nobrTag) || hasLocalName(rubyTag)) return 5; if (hasLocalName(noembedTag) || hasLocalName(noframesTag)) return 10; @@ -143,6 +143,13 @@ void HTMLElement::parseMappedAttribute(MappedAttribute *attr) } else if (attr->name() == dirAttr) { addCSSProperty(attr, CSSPropertyDirection, attr->value()); addCSSProperty(attr, CSSPropertyUnicodeBidi, hasLocalName(bdoTag) ? CSSValueBidiOverride : CSSValueEmbed); + } else if (attr->name() == draggableAttr) { + const AtomicString& value = attr->value(); + if (equalIgnoringCase(value, "true")) { + addCSSProperty(attr, CSSPropertyWebkitUserDrag, CSSValueElement); + addCSSProperty(attr, CSSPropertyWebkitUserSelect, CSSValueNone); + } else if (equalIgnoringCase(value, "false")) + addCSSProperty(attr, CSSPropertyWebkitUserDrag, CSSValueNone); } // standard events else if (attr->name() == onclickAttr) { @@ -225,6 +232,8 @@ void HTMLElement::parseMappedAttribute(MappedAttribute *attr) } else if (attr->name() == ontouchcancelAttr) { setAttributeEventListener(eventNames().touchcancelEvent, createAttributeEventListener(this, attr)); #endif + } else if (attr->name() == oninputAttr) { + setAttributeEventListener(eventNames().inputEvent, createAttributeEventListener(this, attr)); } } @@ -700,6 +709,16 @@ void HTMLElement::setContentEditable(const String &enabled) setAttribute(contenteditableAttr, enabled.isEmpty() ? "true" : enabled); } +bool HTMLElement::draggable() const +{ + return equalIgnoringCase(getAttribute(draggableAttr), "true"); +} + +void HTMLElement::setDraggable(bool value) +{ + setAttribute(draggableAttr, value ? "true" : "false"); +} + void HTMLElement::click() { dispatchSimulatedClick(0, false, false); @@ -871,6 +890,7 @@ static HashSet<AtomicStringImpl*>* inlineTagList() tagList.add(inputTag.localName().impl()); tagList.add(keygenTag.localName().impl()); tagList.add(selectTag.localName().impl()); + tagList.add(datagridTag.localName().impl()); tagList.add(textareaTag.localName().impl()); tagList.add(labelTag.localName().impl()); tagList.add(buttonTag.localName().impl()); @@ -882,6 +902,9 @@ static HashSet<AtomicStringImpl*>* inlineTagList() tagList.add(audioTag.localName().impl()); tagList.add(videoTag.localName().impl()); #endif + tagList.add(rpTag.localName().impl()); + tagList.add(rtTag.localName().impl()); + tagList.add(rubyTag.localName().impl()); } return &tagList; } |