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

Unified Diff: Source/core/dom/Document.cpp

Issue 17654008: Implement the ::backdrop pseudo-element for modal <dialog>. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: use element directly Created 7 years, 5 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/core/dom/Document.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index b296bc131d40aea6bdf021f90fa105adad0f7928..59580fe49cb933c4c4e3f51ff2b4f71c55ee690a 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -4666,12 +4666,19 @@ void Document::enqueuePopstateEvent(PassRefPtr<SerializedScriptValue> stateObjec
dispatchWindowEvent(PopStateEvent::create(stateObject, domWindow() ? domWindow()->history() : 0));
}
-void Document::addToTopLayer(Element* element)
+void Document::addToTopLayer(Element* element, const Element* before)
{
if (element->isInTopLayer())
return;
+
ASSERT(!m_topLayerElements.contains(element));
- m_topLayerElements.append(element);
+ ASSERT(!before || m_topLayerElements.contains(before));
+ if (before) {
+ size_t beforePosition = m_topLayerElements.find(before);
+ m_topLayerElements.insert(beforePosition, element);
+ } else {
+ m_topLayerElements.append(element);
+ }
element->setIsInTopLayer(true);
}
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698