Changeset 136575 in webkit
- Timestamp:
- Dec 4, 2012 2:43:26 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r136574 r136575 1 2012-12-04 Elliott Sprehn <esprehn@chromium.org> 2 3 setIsInTopLayer is not really a setter 4 https://bugs.webkit.org/show_bug.cgi?id=103912 5 6 Reviewed by Eric Seidel. 7 8 Element::setInTopLayer isn't just a setter, it also adds the element 9 to the top layer vector in the document which changes it's display and 10 causes a reattach. 11 12 To make this more obvious make HTMLDialogElement use the methods on 13 Document and make those update the state boolean. 14 15 There also doesn't seem to be any reason for setInTopLayer 16 or isInTopLayer to be virtual, it appears it was a typo. 17 18 No new tests, just refactoring. 19 20 * dom/Document.cpp: 21 (WebCore::Document::addToTopLayer): 22 (WebCore::Document::removeFromTopLayer): 23 * dom/Element.cpp: 24 (WebCore::Element::setIsInTopLayer): 25 * dom/Element.h: 26 * html/HTMLDialogElement.cpp: 27 (WebCore::HTMLDialogElement::close): 28 (WebCore::HTMLDialogElement::showModal): 29 1 30 2012-12-04 Elliott Sprehn <esprehn@chromium.org> 2 31 -
trunk/Source/WebCore/dom/Document.cpp
r136574 r136575 5426 5426 void Document::addToTopLayer(Element* element) 5427 5427 { 5428 if (element->isInTopLayer()) 5429 return; 5428 5430 ASSERT(!m_topLayerElements.contains(element)); 5429 5431 m_topLayerElements.append(element); 5432 element->setIsInTopLayer(true); 5430 5433 } 5431 5434 5432 5435 void Document::removeFromTopLayer(Element* element) 5433 5436 { 5437 if (!element->isInTopLayer()) 5438 return; 5434 5439 size_t position = m_topLayerElements.find(element); 5435 5440 ASSERT(position != notFound); 5436 5441 m_topLayerElements.remove(position); 5442 element->setIsInTopLayer(false); 5437 5443 } 5438 5444 #endif -
trunk/Source/WebCore/dom/Element.cpp
r136574 r136575 2231 2231 void Element::setIsInTopLayer(bool inTopLayer) 2232 2232 { 2233 if (isInTopLayer() == inTopLayer)2234 return;2235 2236 2233 ensureElementRareData()->setIsInTopLayer(inTopLayer); 2237 2238 if (inTopLayer)2239 document()->addToTopLayer(this);2240 else2241 document()->removeFromTopLayer(this);2242 2234 setNeedsStyleRecalc(SyntheticStyleChange); 2243 2235 } -
trunk/Source/WebCore/dom/Element.h
r136573 r136575 438 438 439 439 #if ENABLE(DIALOG_ELEMENT) 440 virtualbool isInTopLayer() const;441 v irtual void setIsInTopLayer(bool);440 bool isInTopLayer() const; 441 void setIsInTopLayer(bool); 442 442 #endif 443 443 -
trunk/Source/WebCore/html/HTMLDialogElement.cpp
r135242 r136575 54 54 } 55 55 setBooleanAttribute(openAttr, false); 56 setIsInTopLayer(false);56 document()->removeFromTopLayer(this); 57 57 } 58 58 … … 71 71 } 72 72 setBooleanAttribute(openAttr, true); 73 setIsInTopLayer(true);73 document()->addToTopLayer(this); 74 74 } 75 75
Note: See TracChangeset
for help on using the changeset viewer.