if (document().documentElement() != this) {
if (RenderBox* rend = renderBox())
- rend->setScrollLeft(roundf(newLeft * rend->style()->effectiveZoom()));
+ rend->setScrollLeft(LayoutUnit::fromFloatRound(newLeft * rend->style()->effectiveZoom()));
return;
}
if (document().documentElement() != this) {
if (RenderBox* rend = renderBox())
- rend->setScrollTop(roundf(newTop * rend->style()->effectiveZoom()));
+ rend->setScrollTop(LayoutUnit::fromFloatRound(newTop * rend->style()->effectiveZoom()));
return;
}
{
if (!hasAttributes())
return;
- // attributeCount() cannot be cached before the loop because the attributes
- // list is altered while iterating.
- for (unsigned i = 0; i < attributeCount(); ++i) {
- if (RefPtrWillBeRawPtr<Attr> attr = attrIfExists(attributeAt(i).name()))
- attr->normalize();
- }
+ WillBeHeapVector<RefPtrWillBeMember<Attr> >* attrNodes = attrNodeList();
+ if (!attrNodes)
+ return;
+ // Copy the Attr Vector because Node::normalize() can fire synchronous JS
+ // events (e.g. DOMSubtreeModified) and a JS listener could add / remove
+ // attributes while we are iterating.
+ WillBeHeapVector<RefPtrWillBeMember<Attr> > attrNodesCopy(*attrNodes);
+ for (size_t i = 0; i < attrNodesCopy.size(); ++i)
+ attrNodesCopy[i]->normalize();
}
void Element::updatePseudoElement(PseudoId pseudoId, StyleRecalcChange change)
return true;
}
-bool Element::setInlineStyleProperty(CSSPropertyID propertyID, CSSPropertyID identifier, bool important)
-{
- ASSERT(isStyledElement());
- ensureMutableInlineStyle().setProperty(propertyID, cssValuePool().createIdentifierValue(identifier), important);
- inlineStyleChanged();
- return true;
-}
-
bool Element::setInlineStyleProperty(CSSPropertyID propertyID, double value, CSSPrimitiveValue::UnitType unit, bool important)
{
ASSERT(isStyledElement());