Changeset 155344 in webkit
- Timestamp:
- Sep 9, 2013, 3:37:34 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r155340 r155344 1 2013-09-09 Antti Koivisto <antti@apple.com> 2 3 Hide Document::renderer() 4 https://bugs.webkit.org/show_bug.cgi?id=121028 5 6 Reviewed by Andreas Kling. 7 8 Use less generic Document::renderView() instead. 9 10 * accessibility/AXObjectCache.cpp: 11 (WebCore::AXObjectCache::postNotification): 12 * accessibility/AccessibilityObject.cpp: 13 (WebCore::appendAccessibilityObject): 14 * accessibility/AccessibilityScrollView.cpp: 15 (WebCore::AccessibilityScrollView::webAreaObject): 16 * css/CSSFontSelector.cpp: 17 (WebCore::CSSFontSelector::dispatchInvalidationCallbacks): 18 * css/StyleResolver.cpp: 19 (WebCore::StyleResolver::appendAuthorStyleSheets): 20 * dom/Document.cpp: 21 (WebCore::Document::~Document): 22 (WebCore::Document::webkitGetNamedFlows): 23 (WebCore::Document::setVisualUpdatesAllowed): 24 (WebCore::Document::elementFromPoint): 25 (WebCore::Document::caretRangeFromPoint): 26 (WebCore::Document::updateLayout): 27 (WebCore::Document::existingAXObjectCache): 28 (WebCore::Document::axObjectCache): 29 (WebCore::Document::setVisuallyOrdered): 30 (WebCore::Document::implicitClose): 31 (WebCore::Document::prepareMouseEvent): 32 (WebCore::Document::styleResolverChanged): 33 (WebCore::Document::documentWillBecomeInactive): 34 (WebCore::Document::documentDidResumeFromPageCache): 35 * dom/Document.h: 36 * dom/DocumentStyleSheetCollection.cpp: 37 (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): 38 * dom/Element.cpp: 39 (WebCore::Element::~Element): 40 * dom/InlineStyleSheetOwner.cpp: 41 (WebCore::InlineStyleSheetOwner::removedFromDocument): 42 * dom/ProcessingInstruction.cpp: 43 (WebCore::ProcessingInstruction::removedFrom): 44 * editing/FrameSelection.cpp: 45 (WebCore::FrameSelection::contains): 46 * html/HTMLElement.cpp: 47 (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged): 48 * html/HTMLLinkElement.cpp: 49 (WebCore::HTMLLinkElement::removedFrom): 50 * html/HTMLStyleElement.cpp: 51 (WebCore::HTMLStyleElement::parseAttribute): 52 (WebCore::HTMLStyleElement::registerWithScopingNode): 53 (WebCore::HTMLStyleElement::unregisterWithScopingNode): 54 * html/parser/HTMLResourcePreloader.cpp: 55 (WebCore::HTMLResourcePreloader::preload): 56 * loader/ImageLoader.cpp: 57 (WebCore::ImageLoader::updateFromElement): 58 * page/EventHandler.cpp: 59 (WebCore::EventHandler::handleWheelEvent): 60 (WebCore::EventHandler::handleGestureScrollBegin): 61 * page/Frame.cpp: 62 (WebCore::Frame::setPageAndTextZoomFactors): 63 * page/FrameView.cpp: 64 (WebCore::FrameView::layout): 65 (WebCore::FrameView::doLayoutWithFrameFlattening): 66 * page/Page.cpp: 67 (WebCore::Page::setPageScaleFactor): 68 * page/PrintContext.cpp: 69 (WebCore::PrintContext::spoolAllPagesWithBoundaries): 70 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: 71 (WebCore::MediaPlayerPrivateQTKit::paint): 72 * style/StyleResolveTree.cpp: 73 (WebCore::Style::resolveTree): 74 * svg/SVGDocument.cpp: 75 (WebCore::SVGDocument::updatePan): 76 1 77 2013-09-09 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 78 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r154877 r155344 728 728 729 729 if (!object && document) 730 object = get(document->render er());730 object = get(document->renderView()); 731 731 732 732 if (!object) -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r155191 r155344 399 399 400 400 Document* doc = toFrameView(widget)->frame().document(); 401 if (!doc || !doc->render er())401 if (!doc || !doc->renderView()) 402 402 return; 403 403 -
trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp
r154184 r155344 190 190 191 191 Document* doc = toFrameView(m_scrollView)->frame().document(); 192 if (!doc || !doc->render er())192 if (!doc || !doc->renderView()) 193 193 return 0; 194 194 -
trunk/Source/WebCore/css/CSSFontSelector.cpp
r154962 r155344 352 352 if (StyleResolver* styleResolver = m_document->styleResolverIfExists()) 353 353 styleResolver->invalidateMatchedPropertiesCache(); 354 if (m_document->inPageCache() || !m_document->render er())354 if (m_document->inPageCache() || !m_document->renderView()) 355 355 return; 356 356 m_document->scheduleForcedStyleRecalc(); -
trunk/Source/WebCore/css/StyleResolver.cpp
r154996 r155344 299 299 { 300 300 m_ruleSets.appendAuthorStyleSheets(firstNew, styleSheets, m_medium.get(), m_inspectorCSSOMWrappers, document().isViewSource(), this); 301 if (document().render er() && document().renderer()->style())302 document().render er()->style()->font().update(fontSelector());301 if (document().renderView() && document().renderView()->style()) 302 document().renderView()->style()->font().update(fontSelector()); 303 303 304 304 #if ENABLE(CSS_DEVICE_ADAPTATION) -
trunk/Source/WebCore/dom/Document.cpp
r155304 r155344 544 544 Document::~Document() 545 545 { 546 ASSERT(!render er());546 ASSERT(!renderView()); 547 547 ASSERT(!m_inPageCache); 548 548 ASSERT(!m_savedRenderView); … … 1152 1152 PassRefPtr<DOMNamedFlowCollection> Document::webkitGetNamedFlows() 1153 1153 { 1154 if (!cssRegionsEnabled() || !render er())1154 if (!cssRegionsEnabled() || !renderView()) 1155 1155 return 0; 1156 1156 … … 1275 1275 1276 1276 FrameView* frameView = view(); 1277 bool needsLayout = frameView && render er() && (frameView->layoutPending() || renderer()->needsLayout());1277 bool needsLayout = frameView && renderView() && (frameView->layoutPending() || renderView()->needsLayout()); 1278 1278 if (needsLayout) 1279 1279 updateLayout(); … … 1417 1417 Element* Document::elementFromPoint(int x, int y) const 1418 1418 { 1419 if (!render er())1419 if (!renderView()) 1420 1420 return 0; 1421 1421 … … 1425 1425 PassRefPtr<Range> Document::caretRangeFromPoint(int x, int y) 1426 1426 { 1427 if (!render er())1427 if (!renderView()) 1428 1428 return 0; 1429 1429 LayoutPoint localPoint; … … 1852 1852 1853 1853 // Only do a layout if changes have occurred that make it necessary. 1854 if (frameView && render er() && (frameView->layoutPending() || renderer()->needsLayout()))1854 if (frameView && renderView() && (frameView->layoutPending() || renderView()->needsLayout())) 1855 1855 frameView->layout(); 1856 1856 } … … 2162 2162 // If the renderer is gone then we are in the process of destruction. 2163 2163 // This method will be called before m_frame = 0. 2164 if (!topDocument()->render er())2164 if (!topDocument()->renderView()) 2165 2165 return 0; 2166 2166 … … 2180 2180 2181 2181 // If the document has already been detached, do not make a new axObjectCache. 2182 if (!topDocument->render er())2182 if (!topDocument->renderView()) 2183 2183 return 0; 2184 2184 … … 2192 2192 { 2193 2193 m_visuallyOrdered = true; 2194 if (render er())2195 render er()->style()->setRTLOrdering(VisualOrder);2194 if (renderView()) 2195 renderView()->style()->setRTLOrdering(VisualOrder); 2196 2196 } 2197 2197 … … 2455 2455 2456 2456 // Always do a layout after loading if needed. 2457 if (view() && render er() && (!renderer()->firstChild() || renderer()->needsLayout()))2457 if (view() && renderView() && (!renderView()->firstChild() || renderView()->needsLayout())) 2458 2458 view()->layout(); 2459 2459 } … … 2462 2462 2463 2463 #if PLATFORM(MAC) || PLATFORM(WIN) 2464 if (f && render er() && AXObjectCache::accessibilityEnabled()) {2464 if (f && renderView() && AXObjectCache::accessibilityEnabled()) { 2465 2465 // The AX cache may have been cleared at this point, but we need to make sure it contains an 2466 2466 // AX object to send the notification to. getOrCreate will make sure that an valid AX object 2467 2467 // exists in the cache (we ignore the return value because we don't need it here). This is 2468 2468 // only safe to call when a layout is not in progress, so it can not be used in postNotification. 2469 axObjectCache()->getOrCreate(render er());2469 axObjectCache()->getOrCreate(renderView()); 2470 2470 if (this == topDocument()) 2471 axObjectCache()->postNotification(render er(), AXObjectCache::AXLoadComplete, true);2471 axObjectCache()->postNotification(renderView(), AXObjectCache::AXLoadComplete, true); 2472 2472 else { 2473 2473 // AXLoadComplete can only be posted on the top document, so if it's a document 2474 2474 // in an iframe that just finished loading, post AXLayoutComplete instead. 2475 axObjectCache()->postNotification(render er(), AXObjectCache::AXLayoutComplete, true);2475 axObjectCache()->postNotification(renderView(), AXObjectCache::AXLayoutComplete, true); 2476 2476 } 2477 2477 } … … 2969 2969 MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& request, const LayoutPoint& documentPoint, const PlatformMouseEvent& event) 2970 2970 { 2971 ASSERT(!renderer() || renderer()->isRenderView()); 2972 2973 if (!renderer()) 2971 if (!renderView()) 2974 2972 return MouseEventWithHitTestResults(event, HitTestResult(LayoutPoint())); 2975 2973 … … 3182 3180 if (didLayoutWithPendingStylesheets() && !m_styleSheetCollection->hasPendingSheets()) { 3183 3181 m_pendingSheetLayout = IgnoreLayoutWithPendingSheets; 3184 if (render er())3182 if (renderView()) 3185 3183 renderView()->repaintViewAndCompositedLayers(); 3186 3184 } … … 3201 3199 #endif 3202 3200 3203 if (render er()) {3204 render er()->setNeedsLayoutAndPrefWidthsRecalc();3201 if (renderView()) { 3202 renderView()->setNeedsLayoutAndPrefWidthsRecalc(); 3205 3203 if (view()) 3206 3204 view()->scheduleRelayout(); … … 4021 4019 { 4022 4020 #if USE(ACCELERATED_COMPOSITING) 4023 if (render er())4021 if (renderView()) 4024 4022 renderView()->setIsInWindow(false); 4025 4023 #endif … … 4050 4048 4051 4049 #if USE(ACCELERATED_COMPOSITING) 4052 if (render er())4050 if (renderView()) 4053 4051 renderView()->setIsInWindow(true); 4054 4052 #endif -
trunk/Source/WebCore/dom/Document.h
r155304 r155344 542 542 RenderView* renderView() const { return m_renderView; } 543 543 544 // FIXME: Remove this, callers that have a Document* should call renderView().545 // Shadow the implementations on Node to provide faster access for documents.546 RenderView* renderer() const { return m_renderView; }547 548 544 bool renderTreeBeingDestroyed() const { return m_renderTreeBeingDestroyed; } 549 545 … … 1189 1185 friend class IgnoreDestructiveWriteCountIncrementer; 1190 1186 1187 RenderObject* renderer() const WTF_DELETED_FUNCTION; 1191 1188 void setRenderer(RenderObject*) WTF_DELETED_FUNCTION; 1192 1189 void setRenderView(RenderView*); -
trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp
r154877 r155344 464 464 465 465 } 466 if (!m_document->render er() || !m_document->attached())466 if (!m_document->renderView() || !m_document->attached()) 467 467 return false; 468 468 -
trunk/Source/WebCore/dom/Element.cpp
r155303 r155344 163 163 { 164 164 #ifndef NDEBUG 165 if (document().render er()) {165 if (document().renderView()) { 166 166 // When the document is not destroyed, an element that was part of a named flow 167 167 // content nodes should have been removed from the content nodes collection -
trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp
r154877 r155344 71 71 72 72 // If we're in document teardown, then we don't need to do any notification of our sheet's removal. 73 if (document->render er())73 if (document->renderView()) 74 74 document->styleResolverChanged(DeferRecalcStyle); 75 75 } -
trunk/Source/WebCore/dom/ProcessingInstruction.cpp
r155340 r155344 288 288 289 289 // If we're in document teardown, then we don't need to do any notification of our sheet's removal. 290 if (document().render er())290 if (document().renderView()) 291 291 document().styleResolverChanged(DeferRecalcStyle); 292 292 } -
trunk/Source/WebCore/editing/FrameSelection.cpp
r155211 r155344 1560 1560 if (!isRange()) 1561 1561 return false; 1562 if (!document->render er())1562 if (!document->renderView()) 1563 1563 return false; 1564 1564 -
trunk/Source/WebCore/html/HTMLElement.cpp
r155194 r155344 915 915 { 916 916 // FIXME: This function looks suspicious. 917 if (document().render er() && (changeType == ElementRemoved || changeType == TextRemoved)) {917 if (document().renderView() && (changeType == ElementRemoved || changeType == TextRemoved)) { 918 918 Node* node = beforeChange ? beforeChange->nextSibling() : 0; 919 919 for (; node; node = node->nextSibling()) { -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r154962 r155344 283 283 removePendingSheet(RemovePendingSheetNotifyLater); 284 284 285 if (document().render er())285 if (document().renderView()) 286 286 document().styleResolverChanged(DeferRecalcStyleIfNeeded); 287 287 } -
trunk/Source/WebCore/html/HTMLStyleElement.cpp
r154957 r155344 81 81 if (sheet()) { 82 82 sheet()->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(value)); 83 if (inDocument() && document().render er())83 if (inDocument() && document().renderView()) 84 84 document().styleResolverChanged(RecalcStyleImmediately); 85 85 } … … 148 148 else 149 149 scope->setNeedsStyleRecalc(); 150 if (inDocument() && !document().parsing() && document().render er())150 if (inDocument() && !document().parsing() && document().renderView()) 151 151 document().styleResolverChanged(DeferRecalcStyle); 152 152 … … 166 166 scope->setNeedsStyleRecalc(); 167 167 } 168 if (inDocument() && !document().parsing() && document().render er())168 if (inDocument() && !document().parsing() && document().renderView()) 169 169 document().styleResolverChanged(DeferRecalcStyle); 170 170 -
trunk/Source/WebCore/html/parser/HTMLResourcePreloader.cpp
r154676 r155344 82 82 { 83 83 ASSERT(m_document->frame()); 84 ASSERT(m_document->render er());85 ASSERT(m_document->render er()->style());86 if (!preload->media().isEmpty() && !mediaAttributeMatches(m_document->frame(), m_document->render er()->style(), preload->media()))84 ASSERT(m_document->renderView()); 85 ASSERT(m_document->renderView()->style()); 86 if (!preload->media().isEmpty() && !mediaAttributeMatches(m_document->frame(), m_document->renderView()->style(), preload->media())) 87 87 return; 88 88 -
trunk/Source/WebCore/loader/ImageLoader.cpp
r154937 r155344 169 169 // down the raw HTML parsing case by loading images we don't intend to display. 170 170 Document& document = m_element->document(); 171 if (!document.render er())171 if (!document.renderView()) 172 172 return; 173 173 -
trunk/Source/WebCore/page/EventHandler.cpp
r154947 r155344 2460 2460 Document* doc = m_frame.document(); 2461 2461 2462 RenderObject* docRenderer = doc->render er();2462 RenderObject* docRenderer = doc->renderView(); 2463 2463 if (!docRenderer) 2464 2464 return false; … … 2798 2798 { 2799 2799 Document* document = m_frame.document(); 2800 RenderObject* documentRenderer = document->render er();2800 RenderObject* documentRenderer = document->renderView(); 2801 2801 if (!documentRenderer) 2802 2802 return false; -
trunk/Source/WebCore/page/Frame.cpp
r155174 r155344 886 886 887 887 if (FrameView* view = this->view()) { 888 if (document->render er() && document->renderer()->needsLayout() && view->didFirstLayout())888 if (document->renderView() && document->renderView()->needsLayout() && view->didFirstLayout()) 889 889 view->layout(); 890 890 } -
trunk/Source/WebCore/page/FrameView.cpp
r155315 r155344 1172 1172 return; 1173 1173 1174 root = subtree ? m_layoutRoot : document->render er();1174 root = subtree ? m_layoutRoot : document->renderView(); 1175 1175 if (!root) { 1176 1176 // FIXME: Do we need to set m_size here? … … 3448 3448 parentView->layout(allowSubtree); 3449 3449 3450 RenderObject* root = m_layoutRoot ? m_layoutRoot : frame().document()->render er();3450 RenderObject* root = m_layoutRoot ? m_layoutRoot : frame().document()->renderView(); 3451 3451 ASSERT_UNUSED(root, !root->needsLayout()); 3452 3452 -
trunk/Source/WebCore/page/Page.cpp
r155228 r155344 764 764 765 765 if (!m_settings->applyPageScaleFactorInCompositor()) { 766 if (document->render er())767 document->render er()->setNeedsLayout(true);766 if (document->renderView()) 767 document->renderView()->setNeedsLayout(true); 768 768 769 769 document->recalcStyle(Style::Force); … … 781 781 782 782 if (view && view->scrollPosition() != origin) { 783 if (!m_settings->applyPageScaleFactorInCompositor() && document->render er() && document->renderer()->needsLayout() && view->didFirstLayout())783 if (!m_settings->applyPageScaleFactorInCompositor() && document->renderView() && document->renderView()->needsLayout() && view->didFirstLayout()) 784 784 view->layout(); 785 785 view->setScrollPosition(origin); -
trunk/Source/WebCore/page/PrintContext.cpp
r154877 r155344 318 318 void PrintContext::spoolAllPagesWithBoundaries(Frame* frame, GraphicsContext& graphicsContext, const FloatSize& pageSizeInPixels) 319 319 { 320 if (!frame->document() || !frame->view() || !frame->document()->render er())320 if (!frame->document() || !frame->view() || !frame->document()->renderView()) 321 321 return; 322 322 -
trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
r154314 r155344 1355 1355 Frame* frame = m_player->frameView() ? &m_player->frameView()->frame() : NULL; 1356 1356 Document* document = frame ? frame->document() : NULL; 1357 RenderObject* renderer = document ? document->render er() : NULL;1357 RenderObject* renderer = document ? document->renderView() : NULL; 1358 1358 RenderStyle* styleToUse = renderer ? renderer->style() : NULL; 1359 1359 if (styleToUse) { -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r155253 r155344 812 812 #endif 813 813 814 Style::Change documentChange = determineChange(documentStyle.get(), document.render er()->style(), document.settings());814 Style::Change documentChange = determineChange(documentStyle.get(), document.renderView()->style(), document.settings()); 815 815 if (documentChange != NoChange) 816 document.render er()->setStyle(documentStyle.release());816 document.renderView()->setStyle(documentStyle.release()); 817 817 } 818 818 -
trunk/Source/WebCore/svg/SVGDocument.cpp
r154371 r155344 89 89 if (rootElement()) { 90 90 rootElement()->setCurrentTranslate(FloatPoint(pos.x() - m_translate.x(), pos.y() - m_translate.y())); 91 if (render er())92 render er()->repaint();91 if (renderView()) 92 renderView()->repaint(); 93 93 } 94 94 }
Note:
See TracChangeset
for help on using the changeset viewer.