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

Unified Diff: Source/WebCore/html/HTMLElement.cpp

Issue 14028014: Remove MicroData implementation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Also delete all the tests Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/html/HTMLElement.h ('k') | Source/WebCore/html/HTMLElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/html/HTMLElement.cpp
diff --git a/Source/WebCore/html/HTMLElement.cpp b/Source/WebCore/html/HTMLElement.cpp
index a9c682f6a3cf67a17eee66f46f8a9c4c390a22f9..24f78b329f0fa2fc5769766a6440908793fdacea 100644
--- a/Source/WebCore/html/HTMLElement.cpp
+++ b/Source/WebCore/html/HTMLElement.cpp
@@ -59,11 +59,6 @@
#include <wtf/StdLibExtras.h>
#include <wtf/text/CString.h>
-#if ENABLE(MICRODATA)
-#include "HTMLPropertiesCollection.h"
-#include "MicroDataItemValue.h"
-#endif
-
namespace WebCore {
using namespace HTMLNames;
@@ -301,14 +296,6 @@ void HTMLElement::parseAttribute(const QualifiedName& name, const AtomicString&
// Clamp tabindex to the range of 'short' to match Firefox's behavior.
setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
}
-#if ENABLE(MICRODATA)
- } else if (name == itempropAttr) {
- setItemProp(value);
- } else if (name == itemrefAttr) {
- setItemRef(value);
- } else if (name == itemtypeAttr) {
- setItemType(value);
-#endif
} else {
AtomicString eventName = eventNameForAttributeName(name);
if (!eventName.isNull())
@@ -941,94 +928,6 @@ void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Node* beforeC
}
}
-bool HTMLElement::isURLAttribute(const Attribute& attribute) const
-{
-#if ENABLE(MICRODATA)
- if (attribute.name() == itemidAttr)
- return true;
-#endif
- return StyledElement::isURLAttribute(attribute);
-}
-
-#if ENABLE(MICRODATA)
-void HTMLElement::setItemValue(const String& value, ExceptionCode& ec)
-{
- if (!hasAttribute(itempropAttr) || hasAttribute(itemscopeAttr)) {
- ec = INVALID_ACCESS_ERR;
- return;
- }
-
- setItemValueText(value, ec);
-}
-
-PassRefPtr<MicroDataItemValue> HTMLElement::itemValue() const
-{
- if (!hasAttribute(itempropAttr))
- return 0;
-
- if (hasAttribute(itemscopeAttr))
- return MicroDataItemValue::createFromNode(const_cast<HTMLElement* const>(this));
-
- return MicroDataItemValue::createFromString(itemValueText());
-}
-
-String HTMLElement::itemValueText() const
-{
- return textContent(true);
-}
-
-void HTMLElement::setItemValueText(const String& value, ExceptionCode& ec)
-{
- setTextContent(value, ec);
-}
-
-PassRefPtr<HTMLPropertiesCollection> HTMLElement::properties()
-{
- return static_cast<HTMLPropertiesCollection*>(ensureCachedHTMLCollection(ItemProperties).get());
-}
-
-void HTMLElement::getItemRefElements(Vector<HTMLElement*>& itemRefElements)
-{
- if (!fastHasAttribute(itemscopeAttr))
- return;
-
- if (!fastHasAttribute(itemrefAttr) || !itemRef()->length()) {
- itemRefElements.append(this);
- return;
- }
-
- DOMSettableTokenList* itemRefs = itemRef();
- RefPtr<DOMSettableTokenList> processedItemRef = DOMSettableTokenList::create();
-
- Node* rootNode;
- if (inDocument())
- rootNode = document();
- else {
- rootNode = this;
- while (Node* parent = rootNode->parentNode())
- rootNode = parent;
- }
-
- for (Node* current = rootNode; current; current = NodeTraversal::next(current, rootNode)) {
- if (!current->isHTMLElement())
- continue;
- HTMLElement* element = toHTMLElement(current);
-
- if (element == this) {
- itemRefElements.append(element);
- continue;
- }
-
- const AtomicString& id = element->getIdAttribute();
- if (!processedItemRef->tokens().contains(id) && itemRefs->tokens().contains(id)) {
- processedItemRef->setValue(id);
- if (!element->isDescendantOf(this))
- itemRefElements.append(element);
- }
- }
-}
-#endif
-
void HTMLElement::addHTMLLengthToStyle(MutableStylePropertySet* style, CSSPropertyID propertyID, const String& value)
{
// FIXME: This function should not spin up the CSS parser, but should instead just figure out the correct
« no previous file with comments | « Source/WebCore/html/HTMLElement.h ('k') | Source/WebCore/html/HTMLElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698