Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index d369a5ec7df561bb902763ea6f8a21b031f2bdde..05ac8fce845a05c40611a58d802f6072e6df8de4 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -5716,6 +5716,35 @@ Element* Document::activeElement() const |
| return body(); |
| } |
| +void Document::hideTransitionElements(unsigned elementsToHide) |
| +{ |
| + unsigned currentValidTransitionElementsTag = 0; |
| + for (HTMLMetaElement* metaElement = head() ? Traversal<HTMLMetaElement>::firstChild(*head()) : 0; metaElement; metaElement = Traversal<HTMLMetaElement>::nextSibling(*metaElement)) { |
| + if (metaElement->name() != "transition-elements") |
| + continue; |
| + |
| + Vector<String> tokens; |
| + metaElement->content().string().split(';', tokens); |
| + if (tokens.size() != 2) |
| + continue; |
| + |
| + TrackExceptionState exceptionState; |
| + RefPtr<NodeList> nodeList = querySelectorAll(AtomicString(tokens[0]), exceptionState); |
| + if (nodeList && !exceptionState.hadException()) { |
| + unsigned nodeListLength = nodeList->length(); |
| + if (!nodeListLength || elementsToHide != currentValidTransitionElementsTag++) |
| + continue; |
|
abarth-chromium
2014/06/21 05:38:36
What if the meta tag has changed since the caller
oystein (OOO til 10th of July)
2014/07/22 21:17:21
I've changed this to just pass around the CSS sele
|
| + |
| + for (unsigned nodeIdx = 0; nodeIdx < nodeListLength; ++nodeIdx) { |
|
abarth-chromium
2014/06/21 05:38:36
nodeIndex
oystein (OOO til 10th of July)
2014/07/22 21:17:21
Done.
|
| + Node* node = nodeList->item(nodeIdx); |
| + toElement(node)->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); |
|
abarth-chromium
2014/06/21 05:38:36
This all looks like something that could be better
|
| + } |
| + |
| + return; |
| + } |
| + } |
| +} |
| + |
| bool Document::hasFocus() const |
| { |
| Page* page = this->page(); |