Lines Matching refs:elem
271 const HTMLElement* elem = static_cast<const HTMLElement*>(node);
272 return elem->hasLocalName(spanAttr) && elem->getAttribute(classAttr) == styleSpanClassString();
280 const HTMLElement* elem = static_cast<const HTMLElement*>(node);
281 CSSMutableStyleDeclaration* inlineStyleDecl = elem->inlineStyleDecl();
282 return (!inlineStyleDecl || inlineStyleDecl->isEmpty()) && elem->getAttribute(classAttr) == styleSpanClassString();
290 const HTMLElement* elem = static_cast<const HTMLElement*>(node);
291 NamedNodeMap* attributes = elem->attributes(true); // readonly
303 const Element *elem = static_cast<const Element *>(node);
304 NamedNodeMap *map = elem->attributes(true); // true for read-only
307 return map->isEmpty() || (map->length() == 1 && elem->getAttribute(classAttr) == styleSpanClassString());
1137 bool ApplyStyleCommand::implicitlyStyledElementShouldBeRemovedWhenApplyingStyle(HTMLElement* elem, CSSMutableStyleDeclaration* style)
1147 if (elem->hasLocalName(bTag) || elem->hasLocalName(strongTag))
1148 return !equalIgnoringCase(property.value()->cssText(), "bold") || !elem->hasChildNodes();
1151 if (elem->hasLocalName(subTag))
1152 return !equalIgnoringCase(property.value()->cssText(), "sub") || !elem->hasChildNodes();
1153 if (elem->hasLocalName(supTag))
1154 return !equalIgnoringCase(property.value()->cssText(), "sup") || !elem->hasChildNodes();
1158 if (elem->hasLocalName(iTag) || elem->hasLocalName(emTag))
1159 return !equalIgnoringCase(property.value()->cssText(), "italic") || !elem->hasChildNodes();
1163 if (elem->hasLocalName(uTag))
1164 return shouldRemoveTextDecorationTag(style, CSSValueUnderline) || !elem->hasChildNodes();
1165 else if (elem->hasLocalName(sTag) || elem->hasTagName(strikeTag))
1166 return shouldRemoveTextDecorationTag(style,CSSValueLineThrough) || !elem->hasChildNodes();
1172 void ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes(HTMLElement*& elem)
1177 NamedNodeMap* attributes = elem->attributes(true); // readonly
1180 else if (attributes->length() == 1 && elem->hasAttribute(styleAttr)) {
1182 CSSMutableStyleDeclaration* inlineStyleDecl = elem->inlineStyleDecl();
1188 removeNodePreservingChildren(elem);
1190 HTMLElement* newSpanElement = replaceNodeWithSpanPreservingChildrenAndAttributes(elem);
1192 elem = newSpanElement;
1196 void ApplyStyleCommand::removeHTMLFontStyle(CSSMutableStyleDeclaration *style, HTMLElement *elem)
1199 ASSERT(elem);
1201 if (!elem->hasLocalName(fontTag))
1208 removeNodeAttribute(elem, colorAttr);
1211 removeNodeAttribute(elem, faceAttr);
1214 removeNodeAttribute(elem, sizeAttr);
1219 if (isEmptyFontTag(elem))
1220 removeNodePreservingChildren(elem);
1223 void ApplyStyleCommand::removeHTMLBidiEmbeddingStyle(CSSMutableStyleDeclaration *style, HTMLElement *elem)
1226 ASSERT(elem);
1228 if (!elem->hasAttribute(dirAttr))
1234 removeNodeAttribute(elem, dirAttr);
1237 if (isUnstyledStyleSpan(elem))
1238 removeNodePreservingChildren(elem);
1241 void ApplyStyleCommand::removeCSSStyle(CSSMutableStyleDeclaration* style, HTMLElement* elem)
1244 ASSERT(elem);
1246 CSSMutableStyleDeclaration* decl = elem->inlineStyleDecl();
1254 if (value && (propertyID != CSSPropertyWhiteSpace || !isTabSpanNode(elem))) {
1263 removeNodeAttribute(elem, styleAttr);
1265 if (isSpanWithoutAttributesOrUnstyleStyleSpan(elem))
1266 removeNodePreservingChildren(elem);
1465 HTMLElement* elem = static_cast<HTMLElement*>(node);
1466 Node* prev = elem->traversePreviousNodePostOrder();
1467 Node* next = elem->traverseNextNode();
1468 if (m_styledInlineElement && elem->hasTagName(m_styledInlineElement->tagQName()))
1469 removeNodePreservingChildren(elem);
1471 if (implicitlyStyledElementShouldBeRemovedWhenApplyingStyle(elem, style.get()))
1472 replaceWithSpanOrRemoveIfWithoutAttributes(elem);
1476 if (elem->inDocument()) {
1477 removeHTMLFontStyle(style.get(), elem);
1478 removeHTMLBidiEmbeddingStyle(style.get(), elem);
1479 removeCSSStyle(style.get(), elem);
1481 if (!elem->inDocument()) {
1482 if (s.node() == elem) {
1483 // Since elem must have been fully selected, and it is at the start
1488 if (e.node() == elem) {
1489 // Since elem must have been fully selected, and it is at the end