Setting an inline style property to "" shouldn't cause style recalc unless the property was present.
<http://webkit.org/b/115122>

Reviewed by Antti Koivisto.

StylePropertySet::setProperty() handles empty strings by removing the property entirely.
If there was no property to remove, it shouldn't claim that it changed something, as that
will cause the CSSOM wrapper to mark the element for style recalc.

A common idiom that triggers this is excessive use of { element.style.display = ''; }

* css/StylePropertySet.cpp:
(WebCore::MutableStylePropertySet::setProperty):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ElementData::attributeItem() should bounds-check the index.
<http://webkit.org/b/115076>

Reviewed by Antti Koivisto.

Switch the ASSERT_WITH_SECURITY_IMPLICATION to a RELEASE_ASSERT.

* dom/Element.h:
(WebCore::ElementData::attributeItem):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ElementData should use 'unsigned' attribute indices.
<http://webkit.org/b/115103>

Reviewed by Antti Koivisto.

Switch to using 'unsigned' for attribute indices. This gives consistent behavior
on 32/64-bit, and the underlying storage is already limited by Vector's 32-bit capacity.

Added an ElementData::attributeNotFound constant (-1) since we can't use WTF::notFound.

* dom/Element.cpp:
(WebCore::Element::detachAttribute):
(WebCore::Element::removeAttribute):
(WebCore::Element::setAttribute):
(WebCore::Element::setSynchronizedLazyAttribute):
(WebCore::Element::setAttributeInternal):
(WebCore::Element::setAttributeNode):
(WebCore::Element::removeAttributeNode):
(WebCore::Element::removeAttributeInternal):
(WebCore::UniqueElementData::removeAttribute):
(WebCore::ElementData::getAttributeItemIndexSlowCase):
* dom/Element.h:
(ElementData):
(UniqueElementData):
(Element):
(WebCore::Element::getAttributeItemIndex):
(WebCore::Element::attributeCount):
(WebCore::ElementData::length):
(WebCore::ElementData::getAttributeItem):
(WebCore::ElementData::getAttributeItemIndex):
* dom/NamedNodeMap.cpp:
(WebCore::NamedNodeMap::removeNamedItem):
(WebCore::NamedNodeMap::removeNamedItemNS):
(WebCore::NamedNodeMap::length):
* dom/NamedNodeMap.h:
(NamedNodeMap):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149061 268f45cc-cd09-0410-ab3c-d52691b4dbfc