Changeset 79875 in webkit
- Timestamp:
- Feb 28, 2011 9:51:03 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r79873 r79875 1 2011-02-28 Andreas Kling <kling@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 Use Frame::ownerElement() directly where appropriate. 6 https://bugs.webkit.org/show_bug.cgi?id=55385 7 8 Don't take the roundabout way through frame->document->ownerElement 9 which just checks that the document->frame is non-null. 10 11 No new test, refactoring only. 12 13 * editing/SelectionController.cpp: 14 (WebCore::SelectionController::selectFrameElementInParentIfFullySelected): 15 * loader/FrameLoader.cpp: 16 (WebCore::FrameLoader::loadWithDocumentLoader): 17 * page/DOMWindow.cpp: 18 (WebCore::DOMWindow::dispatchLoadEvent): 19 * page/EventHandler.cpp: 20 (WebCore::EventHandler::scrollRecursively): 21 (WebCore::EventHandler::logicalScrollRecursively): 22 * page/FrameView.cpp: 23 (WebCore::FrameView::init): 24 (WebCore::FrameView::layout): 25 (WebCore::FrameView::repaintContentRectangle): 26 (WebCore::FrameView::windowClipRect): 27 (WebCore::FrameView::paintContents): 28 1 29 2011-02-28 Pavel Podivilov <podivilov@chromium.org> 2 30 -
trunk/Source/WebCore/editing/SelectionController.cpp
r79290 r79875 1346 1346 1347 1347 // Get to the <iframe> or <frame> (or even <object>) element in the parent frame. 1348 Element* ownerElement = m_frame-> document()->ownerElement();1348 Element* ownerElement = m_frame->ownerElement(); 1349 1349 if (!ownerElement) 1350 1350 return; -
trunk/Source/WebCore/loader/FrameLoader.cpp
r79855 r79875 1484 1484 loader->setTriggeringAction(NavigationAction(newURL, policyChecker()->loadType(), isFormSubmission)); 1485 1485 1486 if (Element* ownerElement = m_frame-> document()->ownerElement()) {1486 if (Element* ownerElement = m_frame->ownerElement()) { 1487 1487 if (!ownerElement->dispatchBeforeLoadEvent(loader->request().url().string())) { 1488 1488 continueLoadAfterNavigationPolicy(loader->request(), formState, false); -
trunk/Source/WebCore/page/DOMWindow.cpp
r79776 r79875 1530 1530 // This is a DOM extension and is independent of bubbling/capturing rules of 1531 1531 // the DOM. 1532 Element* ownerElement = document()->ownerElement();1532 Element* ownerElement = m_frame ? m_frame->ownerElement() : 0; 1533 1533 if (ownerElement) { 1534 1534 RefPtr<Event> ownerEvent = Event::create(eventNames().loadEvent, false, false); -
trunk/Source/WebCore/page/EventHandler.cpp
r79606 r79875 1039 1039 if (!frame) 1040 1040 return false; 1041 return frame->eventHandler()->scrollRecursively(direction, granularity, m_frame-> document()->ownerElement());1041 return frame->eventHandler()->scrollRecursively(direction, granularity, m_frame->ownerElement()); 1042 1042 } 1043 1043 … … 1068 1068 return false; 1069 1069 1070 return frame->eventHandler()->logicalScrollRecursively(direction, granularity, m_frame-> document()->ownerElement());1070 return frame->eventHandler()->logicalScrollRecursively(direction, granularity, m_frame->ownerElement()); 1071 1071 } 1072 1072 -
trunk/Source/WebCore/page/FrameView.cpp
r79167 r79875 261 261 262 262 // Propagate the marginwidth/height and scrolling modes to the view. 263 Element* ownerElement = m_frame && m_frame->document() ? m_frame->document()->ownerElement() : 0;263 Element* ownerElement = m_frame ? m_frame->ownerElement() : 0; 264 264 if (ownerElement && (ownerElement->hasTagName(frameTag) || ownerElement->hasTagName(iframeTag))) { 265 265 HTMLFrameElement* frameElt = static_cast<HTMLFrameElement*>(ownerElement); … … 829 829 830 830 #ifdef INSTRUMENT_LAYOUT_SCHEDULING 831 if (m_firstLayout && ! document->ownerElement())831 if (m_firstLayout && !m_frame->ownerElement()) 832 832 printf("Elapsed time before first layout: %d\n", document->elapsedTime()); 833 833 #endif … … 1430 1430 void FrameView::repaintContentRectangle(const IntRect& r, bool immediate) 1431 1431 { 1432 ASSERT(!m_frame-> document()->ownerElement());1432 ASSERT(!m_frame->ownerElement()); 1433 1433 1434 1434 double delay = adjustedDeferredRepaintDelay(); … … 2019 2019 // Set our clip rect to be our contents. 2020 2020 IntRect clipRect = contentsToWindow(visibleContentRect(!clipToContents)); 2021 if (!m_frame || !m_frame-> document() || !m_frame->document()->ownerElement())2021 if (!m_frame || !m_frame->ownerElement()) 2022 2022 return clipRect; 2023 2023 2024 2024 // Take our owner element and get the clip rect from the enclosing layer. 2025 Element* elt = m_frame-> document()->ownerElement();2025 Element* elt = m_frame->ownerElement(); 2026 2026 RenderLayer* layer = elt->renderer()->enclosingLayer(); 2027 2027 // FIXME: layer should never be null, but sometimes seems to be anyway. … … 2244 2244 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willPaint(m_frame.get(), rect); 2245 2245 2246 Document* document = frame()->document();2246 Document* document = m_frame->document(); 2247 2247 2248 2248 #ifndef NDEBUG … … 2250 2250 if (document->printing()) 2251 2251 fillWithRed = false; // Printing, don't fill with red (can't remember why). 2252 else if ( document->ownerElement())2252 else if (m_frame->ownerElement()) 2253 2253 fillWithRed = false; // Subframe, don't fill with red. 2254 2254 else if (isTransparent()) … … 2298 2298 2299 2299 bool flatteningPaint = m_paintBehavior & PaintBehaviorFlattenCompositingLayers; 2300 bool isRootFrame = ! document->ownerElement();2300 bool isRootFrame = !m_frame->ownerElement(); 2301 2301 if (flatteningPaint && isRootFrame) 2302 2302 notifyWidgetsInAllFrames(WillPaintFlattened);
Note: See TracChangeset
for help on using the changeset viewer.