Rename RenderCanvas to RenderView. Rename canvas(), isCanvas()
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 May 2006 01:48:18 +0000 (01:48 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 May 2006 01:48:18 +0000 (01:48 +0000)
        to view(), isView().  Rename the frame view accessor on the old canvas
        from view() to frameView() (to avoid view()->view(), since that just looks
        stupid). :)

        Reviewed by andersca

        * WebCore.vcproj/WebCore/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/kjs_dom.cpp:
        * bindings/js/kjs_window.cpp:
        * bridge/mac/FrameMac.mm:
        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge _setupRootForPrinting:]):
        (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
        (-[WebCoreFrameBridge selectionColor]):
        (-[WebCoreFrameBridge accessibilityTree]):
        * dom/Document.cpp:
        (WebCore::Document::attach):
        (WebCore::Document::updateSelection):
        (WebCore::Document::prepareMouseEvent):
        * editing/SelectionController.cpp:
        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
        * ksvg2/svg/SVGClipPathElement.cpp:
        (SVGClipPathElement::canvasResource):
        * ksvg2/svg/SVGFEFloodElement.cpp:
        (SVGFEFloodElement::filterEffect):
        * ksvg2/svg/SVGGradientElement.cpp:
        (SVGGradientElement::rebuildStops):
        * ksvg2/svg/SVGHelper.cpp:
        (SVGHelper::PercentageOfViewport):
        * ksvg2/svg/SVGPathElement.cpp:
        (WebCore::SVGPathElement::getPointAtLength):
        * ksvg2/svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::currentTranslate):
        * ksvg2/svg/SVGStyledElement.cpp:
        (WebCore::SVGStyledElement::view):
        (WebCore::SVGStyledElement::pushAttributeContext):
        * ksvg2/svg/SVGStyledElement.h:
        * kwq/WebCoreAXObject.mm:
        (-[WebCoreAXObject accessibilityShouldUseUniqueId]):
        (-[WebCoreAXObject role]):
        (-[WebCoreAXObject value]):
        (-[WebCoreAXObject position]):
        (-[WebCoreAXObject accessibilityIsIgnored]):
        (-[WebCoreAXObject accessibilityAttributeNames]):
        (-[WebCoreAXObject topView]):
        (-[WebCoreAXObject accessibilityAttributeValue:]):
        * page/Frame.cpp:
        (WebCore::Frame::selectionRect):
        (WebCore::Frame::paint):
        (WebCore::Frame::adjustPageHeight):
        (WebCore::Frame::forceLayoutWithPageWidthRange):
        * page/FrameView.cpp:
        (WebCore::FrameView::adjustViewSize):
        (WebCore::FrameView::layout):
        * page/FrameView.h:
        * rendering/AutoTableLayout.cpp:
        (WebCore::shouldScaleColumns):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::MarginInfo::MarginInfo):
        (WebCore::RenderBlock::isSelfCollapsingBlock):
        (WebCore::RenderBlock::layoutBlock):
        (WebCore::RenderBlock::paintChildren):
        (WebCore::RenderBlock::setSelectionState):
        (WebCore::RenderBlock::isSelectionRoot):
        (WebCore::RenderBlock::fillInlineSelectionGaps):
        (WebCore::RenderBlock::lowestPosition):
        (WebCore::RenderBlock::rightmostPosition):
        (WebCore::RenderBlock::leftmostPosition):
        (WebCore::RenderBlock::clearFloats):
        (WebCore::RenderBlock::nodeAtPoint):
        (WebCore::RenderBlock::calcBlocminMaxWidth):
        (WebCore::RenderBlock::inRootBlockContext):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::setStyle):
        (WebCore::RenderBox::paintRootBoxDecorations):
        (WebCore::RenderBox::paintBackgroundExtended):
        (WebCore::RenderBox::calcHeight):
        (WebCore::RenderBox::calcPercentageHeight):
        (WebCore::RenderBox::availableHeightUsing):
        * rendering/RenderCanvas.cpp: Removed.
        * rendering/RenderCanvas.h: Removed.
        * rendering/RenderContainer.cpp:
        (WebCore::RenderContainer::removeChildNode):
        * rendering/RenderFileButton.cpp:
        (WebCore::RenderFileButton::RenderFileButton):
        * rendering/RenderFlow.cpp:
        (WebCore::RenderFlow::destroy):
        (WebCore::RenderFlow::paintLines):
        * rendering/RenderFrameSet.cpp:
        (WebCore::RenderFrameSet::layout):
        (WebCore::RenderFrameSet::userResize):
        (WebCore::RenderFrameSet::setResizing):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paint):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositions):
        (WebCore::RenderLayer::updateLayerPosition):
        (WebCore::RenderLayer::stackingContext):
        (WebCore::RenderLayer::enclosingPositionedAncestor):
        (WebCore::RenderLayer::convertToLayerCoords):
        (WebCore::RenderLayer::scrollToOffset):
        (WebCore::isSubframeCanvas):
        (WebCore::RenderLayer::intersectsDamageRect):
        * rendering/RenderLayer.h:
        (WebCore::RenderLayer::isStackingContext):
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::paint):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::scroll):
        (WebCore::RenderObject::containingBlock):
        (WebCore::RenderObject::repaint):
        (WebCore::RenderObject::repaintRectangle):
        (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
        (WebCore::RenderObject::draggableNode):
        (WebCore::RenderObject::selectionStartEnd):
        (WebCore::RenderObject::setStyle):
        (WebCore::RenderObject::viewRect):
        (WebCore::RenderObject::view):
        (WebCore::RenderObject::container):
        (WebCore::RenderObject::removeFromObjectLists):
        (WebCore::RenderObject::scheduleRelayout):
        (WebCore::RenderObject::imageChanged):
        (WebCore::RenderObject::maximalOutlineSize):
        * rendering/RenderObject.h:
        (WebCore::RenderObject::isRenderView):
        * rendering/RenderTextArea.cpp:
        (WebCore::RenderTextArea::RenderTextArea):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::paintCheckbox):
        (WebCore::RenderThemeMac::paintRadio):
        (WebCore::RenderThemeMac::paintButton):
        * rendering/RenderTreeAsText.cpp:
        (externalRepresentation):
        * rendering/RenderView.cpp: Added.
        (WebCore::RenderView::RenderView):
        (WebCore::RenderView::~RenderView):
        (WebCore::RenderView::calcHeight):
        (WebCore::RenderView::calcWidth):
        (WebCore::RenderView::calcMinMaxWidth):
        (WebCore::RenderView::layout):
        (WebCore::RenderView::absolutePosition):
        (WebCore::RenderView::paint):
        (WebCore::RenderView::paintBoxDecorations):
        (WebCore::RenderView::repaintViewRectangle):
        (WebCore::RenderView::getAbsoluteRepaintRect):
        (WebCore::RenderView::computeAbsoluteRepaintRect):
        (WebCore::RenderView::absoluteRects):
        (WebCore::RenderView::selectionRect):
        (WebCore::RenderView::setSelection):
        (WebCore::RenderView::clearSelection):
        (WebCore::RenderView::selectionStartEnd):
        (WebCore::RenderView::updateWidgetPositions):
        (WebCore::RenderView::addWidget):
        (WebCore::RenderView::removeWidget):
        (WebCore::RenderView::viewRect):
        (WebCore::RenderView::docHeight):
        (WebCore::RenderView::docWidth):
        (WebCore::RenderView::setBestTruncatedAt):
        * rendering/RenderView.h: Added.
        (WebCore::RenderView::renderName):
        (WebCore::RenderView::isRenderView):
        (WebCore::RenderView::frameView):
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::RenderWidget):
        (WebCore::RenderWidget::destroy):
        (WebCore::RenderWidget::updateWidgetPosition):
        * rendering/RenderWidget.h:
        (WebCore::RenderWidget::widget):
        * rendering/bidi.cpp:
        (WebCore::RenderBlock::layoutInlineChildren):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14638 268f45cc-cd09-0410-ab3c-d52691b4dbfc

44 files changed:
WebCore/ChangeLog
WebCore/RenderView.cpp [moved from WebCore/rendering/RenderCanvas.cpp with 100% similarity]
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/kjs_dom.cpp
WebCore/bindings/js/kjs_window.cpp
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/dom/Document.cpp
WebCore/editing/SelectionController.cpp
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.mm
WebCore/ksvg2/svg/SVGClipPathElement.cpp
WebCore/ksvg2/svg/SVGFEFloodElement.cpp
WebCore/ksvg2/svg/SVGGradientElement.cpp
WebCore/ksvg2/svg/SVGHelper.cpp
WebCore/ksvg2/svg/SVGPathElement.cpp
WebCore/ksvg2/svg/SVGSVGElement.cpp
WebCore/ksvg2/svg/SVGStyledElement.cpp
WebCore/ksvg2/svg/SVGStyledElement.h
WebCore/kwq/WebCoreAXObject.mm
WebCore/page/Frame.cpp
WebCore/page/FrameView.cpp
WebCore/page/FrameView.h
WebCore/rendering/AutoTableLayout.cpp
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderBox.cpp
WebCore/rendering/RenderContainer.cpp
WebCore/rendering/RenderFileButton.cpp
WebCore/rendering/RenderFlow.cpp
WebCore/rendering/RenderFrameSet.cpp
WebCore/rendering/RenderImage.cpp
WebCore/rendering/RenderLayer.cpp
WebCore/rendering/RenderLayer.h
WebCore/rendering/RenderListMarker.cpp
WebCore/rendering/RenderObject.cpp
WebCore/rendering/RenderObject.h
WebCore/rendering/RenderTextArea.cpp
WebCore/rendering/RenderThemeMac.mm
WebCore/rendering/RenderTreeAsText.cpp
WebCore/rendering/RenderView.cpp [new file with mode: 0644]
WebCore/rendering/RenderView.h [moved from WebCore/rendering/RenderCanvas.h with 91% similarity]
WebCore/rendering/RenderWidget.cpp
WebCore/rendering/RenderWidget.h
WebCore/rendering/bidi.cpp

index 734491a05943ffa818590eab13f79e2d90c2930f..ddfab0dee0805171165acbcec7736520c74c33bc 100644 (file)
@@ -1,3 +1,178 @@
+2006-05-30  David Hyatt  <hyatt@apple.com>
+
+        Rename RenderCanvas to RenderView. Rename canvas(), isCanvas()
+        to view(), isView().  Rename the frame view accessor on the old canvas
+        from view() to frameView() (to avoid view()->view(), since that just looks
+        stupid). :)
+
+        Reviewed by andersca
+
+        * WebCore.vcproj/WebCore/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/kjs_dom.cpp:
+        * bindings/js/kjs_window.cpp:
+        * bridge/mac/FrameMac.mm:
+        * bridge/mac/WebCoreFrameBridge.mm:
+        (-[WebCoreFrameBridge _setupRootForPrinting:]):
+        (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
+        (-[WebCoreFrameBridge selectionColor]):
+        (-[WebCoreFrameBridge accessibilityTree]):
+        * dom/Document.cpp:
+        (WebCore::Document::attach):
+        (WebCore::Document::updateSelection):
+        (WebCore::Document::prepareMouseEvent):
+        * editing/SelectionController.cpp:
+        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
+        * ksvg2/svg/SVGClipPathElement.cpp:
+        (SVGClipPathElement::canvasResource):
+        * ksvg2/svg/SVGFEFloodElement.cpp:
+        (SVGFEFloodElement::filterEffect):
+        * ksvg2/svg/SVGGradientElement.cpp:
+        (SVGGradientElement::rebuildStops):
+        * ksvg2/svg/SVGHelper.cpp:
+        (SVGHelper::PercentageOfViewport):
+        * ksvg2/svg/SVGPathElement.cpp:
+        (WebCore::SVGPathElement::getPointAtLength):
+        * ksvg2/svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::currentTranslate):
+        * ksvg2/svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::view):
+        (WebCore::SVGStyledElement::pushAttributeContext):
+        * ksvg2/svg/SVGStyledElement.h:
+        * kwq/WebCoreAXObject.mm:
+        (-[WebCoreAXObject accessibilityShouldUseUniqueId]):
+        (-[WebCoreAXObject role]):
+        (-[WebCoreAXObject value]):
+        (-[WebCoreAXObject position]):
+        (-[WebCoreAXObject accessibilityIsIgnored]):
+        (-[WebCoreAXObject accessibilityAttributeNames]):
+        (-[WebCoreAXObject topView]):
+        (-[WebCoreAXObject accessibilityAttributeValue:]):
+        * page/Frame.cpp:
+        (WebCore::Frame::selectionRect):
+        (WebCore::Frame::paint):
+        (WebCore::Frame::adjustPageHeight):
+        (WebCore::Frame::forceLayoutWithPageWidthRange):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::adjustViewSize):
+        (WebCore::FrameView::layout):
+        * page/FrameView.h:
+        * rendering/AutoTableLayout.cpp:
+        (WebCore::shouldScaleColumns):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::MarginInfo::MarginInfo):
+        (WebCore::RenderBlock::isSelfCollapsingBlock):
+        (WebCore::RenderBlock::layoutBlock):
+        (WebCore::RenderBlock::paintChildren):
+        (WebCore::RenderBlock::setSelectionState):
+        (WebCore::RenderBlock::isSelectionRoot):
+        (WebCore::RenderBlock::fillInlineSelectionGaps):
+        (WebCore::RenderBlock::lowestPosition):
+        (WebCore::RenderBlock::rightmostPosition):
+        (WebCore::RenderBlock::leftmostPosition):
+        (WebCore::RenderBlock::clearFloats):
+        (WebCore::RenderBlock::nodeAtPoint):
+        (WebCore::RenderBlock::calcBlocminMaxWidth):
+        (WebCore::RenderBlock::inRootBlockContext):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::setStyle):
+        (WebCore::RenderBox::paintRootBoxDecorations):
+        (WebCore::RenderBox::paintBackgroundExtended):
+        (WebCore::RenderBox::calcHeight):
+        (WebCore::RenderBox::calcPercentageHeight):
+        (WebCore::RenderBox::availableHeightUsing):
+        * rendering/RenderCanvas.cpp: Removed.
+        * rendering/RenderCanvas.h: Removed.
+        * rendering/RenderContainer.cpp:
+        (WebCore::RenderContainer::removeChildNode):
+        * rendering/RenderFileButton.cpp:
+        (WebCore::RenderFileButton::RenderFileButton):
+        * rendering/RenderFlow.cpp:
+        (WebCore::RenderFlow::destroy):
+        (WebCore::RenderFlow::paintLines):
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::layout):
+        (WebCore::RenderFrameSet::userResize):
+        (WebCore::RenderFrameSet::setResizing):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::paint):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPositions):
+        (WebCore::RenderLayer::updateLayerPosition):
+        (WebCore::RenderLayer::stackingContext):
+        (WebCore::RenderLayer::enclosingPositionedAncestor):
+        (WebCore::RenderLayer::convertToLayerCoords):
+        (WebCore::RenderLayer::scrollToOffset):
+        (WebCore::isSubframeCanvas):
+        (WebCore::RenderLayer::intersectsDamageRect):
+        * rendering/RenderLayer.h:
+        (WebCore::RenderLayer::isStackingContext):
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::paint):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::scroll):
+        (WebCore::RenderObject::containingBlock):
+        (WebCore::RenderObject::repaint):
+        (WebCore::RenderObject::repaintRectangle):
+        (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
+        (WebCore::RenderObject::draggableNode):
+        (WebCore::RenderObject::selectionStartEnd):
+        (WebCore::RenderObject::setStyle):
+        (WebCore::RenderObject::viewRect):
+        (WebCore::RenderObject::view):
+        (WebCore::RenderObject::container):
+        (WebCore::RenderObject::removeFromObjectLists):
+        (WebCore::RenderObject::scheduleRelayout):
+        (WebCore::RenderObject::imageChanged):
+        (WebCore::RenderObject::maximalOutlineSize):
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isRenderView):
+        * rendering/RenderTextArea.cpp:
+        (WebCore::RenderTextArea::RenderTextArea):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintCheckbox):
+        (WebCore::RenderThemeMac::paintRadio):
+        (WebCore::RenderThemeMac::paintButton):
+        * rendering/RenderTreeAsText.cpp:
+        (externalRepresentation):
+        * rendering/RenderView.cpp: Added.
+        (WebCore::RenderView::RenderView):
+        (WebCore::RenderView::~RenderView):
+        (WebCore::RenderView::calcHeight):
+        (WebCore::RenderView::calcWidth):
+        (WebCore::RenderView::calcMinMaxWidth):
+        (WebCore::RenderView::layout):
+        (WebCore::RenderView::absolutePosition):
+        (WebCore::RenderView::paint):
+        (WebCore::RenderView::paintBoxDecorations):
+        (WebCore::RenderView::repaintViewRectangle):
+        (WebCore::RenderView::getAbsoluteRepaintRect):
+        (WebCore::RenderView::computeAbsoluteRepaintRect):
+        (WebCore::RenderView::absoluteRects):
+        (WebCore::RenderView::selectionRect):
+        (WebCore::RenderView::setSelection):
+        (WebCore::RenderView::clearSelection):
+        (WebCore::RenderView::selectionStartEnd):
+        (WebCore::RenderView::updateWidgetPositions):
+        (WebCore::RenderView::addWidget):
+        (WebCore::RenderView::removeWidget):
+        (WebCore::RenderView::viewRect):
+        (WebCore::RenderView::docHeight):
+        (WebCore::RenderView::docWidth):
+        (WebCore::RenderView::setBestTruncatedAt):
+        * rendering/RenderView.h: Added.
+        (WebCore::RenderView::renderName):
+        (WebCore::RenderView::isRenderView):
+        (WebCore::RenderView::frameView):
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::RenderWidget):
+        (WebCore::RenderWidget::destroy):
+        (WebCore::RenderWidget::updateWidgetPosition):
+        * rendering/RenderWidget.h:
+        (WebCore::RenderWidget::widget):
+        * rendering/bidi.cpp:
+        (WebCore::RenderBlock::layoutInlineChildren):
+
 2006-05-30  Tim Omernick  <timo@apple.com>
 
         Reviewed by Geoff.
index 69101f710541eb40d1b8be3493dbb665a4aca893..2f5aef56e77be7b38c0ccb3862ba8939f1a2b8e9 100644 (file)
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\rendering\RenderCanvas.cpp"\r
+                               RelativePath="..\..\rendering\RenderView.cpp"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\rendering\RenderCanvas.h"\r
+                               RelativePath="..\..\rendering\RenderView.h"\r
                                >\r
                        </File>\r
                        <File\r
index e91687921136cb6634859f9b16302d8c67457b15..8cef09d6ff20cec1c7a0722edfe9a681894e159c 100644 (file)
                BCEA4864097D93020094C9E4 /* RenderBR.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4825097D93020094C9E4 /* RenderBR.h */; };
                BCEA4865097D93020094C9E4 /* RenderButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4826097D93020094C9E4 /* RenderButton.cpp */; };
                BCEA4866097D93020094C9E4 /* RenderButton.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4827097D93020094C9E4 /* RenderButton.h */; };
-               BCEA4867097D93020094C9E4 /* RenderCanvas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4828097D93020094C9E4 /* RenderCanvas.cpp */; };
-               BCEA4868097D93020094C9E4 /* RenderCanvas.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4829097D93020094C9E4 /* RenderCanvas.h */; };
+               BCEA4867097D93020094C9E4 /* RenderView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4828097D93020094C9E4 /* RenderView.cpp */; };
+               BCEA4868097D93020094C9E4 /* RenderView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4829097D93020094C9E4 /* RenderView.h */; };
                BCEA4869097D93020094C9E4 /* RenderHTMLCanvas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA482A097D93020094C9E4 /* RenderHTMLCanvas.cpp */; };
                BCEA486A097D93020094C9E4 /* RenderHTMLCanvas.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA482B097D93020094C9E4 /* RenderHTMLCanvas.h */; };
                BCEA486B097D93020094C9E4 /* RenderContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA482C097D93020094C9E4 /* RenderContainer.cpp */; };
                BCEA4825097D93020094C9E4 /* RenderBR.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderBR.h; sourceTree = "<group>"; };
                BCEA4826097D93020094C9E4 /* RenderButton.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderButton.cpp; sourceTree = "<group>"; };
                BCEA4827097D93020094C9E4 /* RenderButton.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderButton.h; sourceTree = "<group>"; };
-               BCEA4828097D93020094C9E4 /* RenderCanvas.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderCanvas.cpp; sourceTree = "<group>"; };
-               BCEA4829097D93020094C9E4 /* RenderCanvas.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderCanvas.h; sourceTree = "<group>"; };
+               BCEA4828097D93020094C9E4 /* RenderView.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderView.cpp; sourceTree = "<group>"; };
+               BCEA4829097D93020094C9E4 /* RenderView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderView.h; sourceTree = "<group>"; };
                BCEA482A097D93020094C9E4 /* RenderHTMLCanvas.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderHTMLCanvas.cpp; sourceTree = "<group>"; };
                BCEA482B097D93020094C9E4 /* RenderHTMLCanvas.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderHTMLCanvas.h; sourceTree = "<group>"; };
                BCEA482C097D93020094C9E4 /* RenderContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderContainer.cpp; sourceTree = "<group>"; };
                                BCEA4825097D93020094C9E4 /* RenderBR.h */,
                                BCEA4826097D93020094C9E4 /* RenderButton.cpp */,
                                BCEA4827097D93020094C9E4 /* RenderButton.h */,
-                               BCEA4828097D93020094C9E4 /* RenderCanvas.cpp */,
-                               BCEA4829097D93020094C9E4 /* RenderCanvas.h */,
+                               BCEA4828097D93020094C9E4 /* RenderView.cpp */,
+                               BCEA4829097D93020094C9E4 /* RenderView.h */,
                                BCEA482C097D93020094C9E4 /* RenderContainer.cpp */,
                                BCEA482D097D93020094C9E4 /* RenderContainer.h */,
                                93B70EB009EEE5B5009D8468 /* RenderEmptyApplet.cpp */,
                                BCEA4862097D93020094C9E4 /* RenderBox.h in Headers */,
                                BCEA4864097D93020094C9E4 /* RenderBR.h in Headers */,
                                BCEA4866097D93020094C9E4 /* RenderButton.h in Headers */,
-                               BCEA4868097D93020094C9E4 /* RenderCanvas.h in Headers */,
+                               BCEA4868097D93020094C9E4 /* RenderView.h in Headers */,
                                BCEA486A097D93020094C9E4 /* RenderHTMLCanvas.h in Headers */,
                                BCEA486C097D93020094C9E4 /* RenderContainer.h in Headers */,
                                BCEA486E097D93020094C9E4 /* RenderFlexibleBox.h in Headers */,
                                BCEA4861097D93020094C9E4 /* RenderBox.cpp in Sources */,
                                BCEA4863097D93020094C9E4 /* RenderBR.cpp in Sources */,
                                BCEA4865097D93020094C9E4 /* RenderButton.cpp in Sources */,
-                               BCEA4867097D93020094C9E4 /* RenderCanvas.cpp in Sources */,
+                               BCEA4867097D93020094C9E4 /* RenderView.cpp in Sources */,
                                BCEA4869097D93020094C9E4 /* RenderHTMLCanvas.cpp in Sources */,
                                BCEA486B097D93020094C9E4 /* RenderContainer.cpp in Sources */,
                                BCEA486D097D93020094C9E4 /* RenderFlexibleBox.cpp in Sources */,
index 069d006bf20def5563d8bdf28b011d467e185418..34f4c2ca9cd3c5f3c379a8ea969f0266485b14ad 100644 (file)
@@ -54,7 +54,7 @@
 #include "Notation.h"
 #include "ProcessingInstruction.h"
 #include "Range.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "dom2_eventsimpl.h"
 #include "kjs_css.h"
 #include "kjs_events.h"
index bb5c4806b7d30da08d900a06f52b52a3daf0981f..6a37bc946c9d878b5ce096ad44b9b8a196a32e87 100644 (file)
@@ -45,7 +45,7 @@
 #include "Logging.h"
 #include "Page.h"
 #include "PlugInInfoStore.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "Screen.h"
 #include "SelectionController.h"
 #include "dom2_eventsimpl.h"
index e928a491976677c8f8d07eaa02280568a8455d48..858d0208c5b7fd7255ec0982a71084adabfff4e7 100644 (file)
@@ -54,7 +54,7 @@
 #import "PlatformWheelEvent.h"
 #import "Plugin.h"
 #import "RegularExpression.h"
-#import "RenderCanvas.h"
+#import "RenderView.h"
 #import "RenderImage.h"
 #import "RenderListItem.h"
 #import "RenderPart.h"
index 60c34c0153e80ea154c08c9f527a4efc34c5ca93..cb8ebebc031c3e2a7ec91a19625c2586ba6ea19f 100644 (file)
@@ -52,7 +52,7 @@
 #import "ModifySelectionListLevel.h"
 #import "MoveSelectionCommand.h"
 #import "Page.h"
-#import "RenderCanvas.h"
+#import "RenderView.h"
 #import "RenderImage.h"
 #import "RenderPart.h"
 #import "RenderTreeAsText.h"
@@ -859,7 +859,7 @@ static BOOL nowPrinting(WebCoreFrameBridge *self)
 - (void)_setupRootForPrinting:(BOOL)onOrOff
 {
     if (nowPrinting(self)) {
-        RenderCanvas *root = static_cast<RenderCanvas *>(m_frame->document()->renderer());
+        RenderView *root = static_cast<RenderView *>(m_frame->document()->renderer());
         if (root) {
             root->setPrintingMode(onOrOff);
         }
@@ -924,7 +924,7 @@ static BOOL nowPrinting(WebCoreFrameBridge *self)
     }
 
     if (!m_frame || !m_frame->document() || !m_frame->view()) return pages;
-    RenderCanvas* root = static_cast<RenderCanvas *>(m_frame->document()->renderer());
+    RenderView* root = static_cast<RenderView *>(m_frame->document()->renderer());
     if (!root) return pages;
     
     FrameView* view = m_frame->view();
@@ -1527,7 +1527,7 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
 
 - (NSColor *)selectionColor
 {
-    RenderCanvas* root = static_cast<RenderCanvas *>(m_frame->document()->renderer());
+    RenderView* root = static_cast<RenderView *>(m_frame->document()->renderer());
     if (root) {
         RenderStyle *pseudoStyle = root->getPseudoStyle(RenderStyle::SELECTION);
         if (pseudoStyle && pseudoStyle->backgroundColor().isValid()) {
@@ -1549,7 +1549,7 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     AccessibilityObjectCache::enableAccessibility();
     if (!m_frame || !m_frame->document())
         return nil;
-    RenderCanvas* root = static_cast<RenderCanvas *>(m_frame->document()->renderer());
+    RenderView* root = static_cast<RenderView *>(m_frame->document()->renderer());
     if (!root)
         return nil;
     return m_frame->document()->getAccObjectCache()->get(root);
index a30abfe4239e34ecc42ec6c2f92afcd99903bc93..489f36135d82b94b83b259abee9699f3fe2a4e0e 100644 (file)
@@ -59,7 +59,7 @@
 #include "ProcessingInstruction.h"
 #include "RegularExpression.h"
 #include "RenderArena.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "RenderWidget.h"
 #include "SegmentedString.h"
 #include "SelectionController.h"
@@ -918,7 +918,7 @@ void Document::attach()
         m_renderArena = new RenderArena();
     
     // Create the rendering tree
-    setRenderer(new (m_renderArena) RenderCanvas(this, m_view));
+    setRenderer(new (m_renderArena) RenderView(this, m_view));
 
     recalcStyle(Force);
 
@@ -1036,7 +1036,7 @@ void Document::updateSelection()
     if (!renderer())
         return;
     
-    RenderCanvas *canvas = static_cast<RenderCanvas*>(renderer());
+    RenderView *canvas = static_cast<RenderView*>(renderer());
     SelectionController s = frame()->selection();
     if (!s.isRange()) {
         canvas->clearSelection();
@@ -1047,7 +1047,7 @@ void Document::updateSelection()
         if (startPos.isNotNull() && endPos.isNotNull()) {
             RenderObject *startRenderer = startPos.node()->renderer();
             RenderObject *endRenderer = endPos.node()->renderer();
-            static_cast<RenderCanvas*>(renderer())->setSelection(startRenderer, startPos.offset(), endRenderer, endPos.offset());
+            static_cast<RenderView*>(renderer())->setSelection(startRenderer, startPos.offset(), endRenderer, endPos.offset());
         }
     }
     
@@ -1637,7 +1637,7 @@ MouseEventWithHitTestResults Document::prepareMouseEvent(bool readonly, bool act
     if (!renderer())
         return MouseEventWithHitTestResults(event, 0, false);
 
-    assert(renderer()->isCanvas());
+    assert(renderer()->isRenderView());
     RenderObject::NodeInfo renderInfo(readonly, active, mouseMove);
     renderer()->layer()->hitTest(renderInfo, point);
 
index 92fbe08d1a0d4ed2bdd81a2cf19e2002d3a21f6d..e8fa1591b9f01329bba4b1aa5f0f25ec4694ad81 100644 (file)
@@ -31,7 +31,7 @@
 #include "EventNames.h"
 #include "Frame.h"
 #include "GraphicsContext.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "TextIterator.h"
 #include "dom2_eventsimpl.h"
 #include "htmlediting.h"
index c9d6ac7201e52d360c619db2ad4a340356aad4ef..0165ec6e006c9a69fc210e1511347326957d5909 100644 (file)
@@ -40,7 +40,7 @@
 #import "KRenderingStrokePainter.h"
 #import "Logging.h"
 #import "QuartzSupport.h"
-#import "RenderCanvas.h"
+#import "RenderView.h"
 #import <Cocoa/Cocoa.h>
 
 namespace WebCore {
index 094d47063485fe04af6889d7d3dc2f2c3d54de50..a58aac1fd4067877bc441f679241232bef4807ba 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "Attr.h"
 #include "Document.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "SVGAnimatedEnumeration.h"
 #include "SVGHelper.h"
 #include "SVGNames.h"
@@ -81,7 +81,7 @@ void SVGClipPathElement::parseMappedAttribute(MappedAttribute *attr)
 
 KCanvasClipper *SVGClipPathElement::canvasResource()
 {
-    if (!canvas())
+    if (!view())
         return 0;
     if (!m_clipper)
         m_clipper = static_cast<KCanvasClipper *>(renderingDevice()->createResource(RS_CLIPPER));
@@ -98,10 +98,10 @@ KCanvasClipper *SVGClipPathElement::canvasResource()
             RenderStyle *pathStyle = document()->styleSelector()->styleForElement(styled, clipPathStyle);
             if (KCanvasPath* pathData = styled->toPathData())
                 m_clipper->addClipData(pathData, (KCWindRule) pathStyle->svgStyle()->clipRule(), bbox);
-            pathStyle->deref(canvas()->renderArena());
+            pathStyle->deref(view()->renderArena());
         }
     }
-    clipPathStyle->deref(canvas()->renderArena());
+    clipPathStyle->deref(view()->renderArena());
     return m_clipper;
 }
 
index da540587e0f70e3ed1b6c6063eccd1612d9f7979..934a479841ca720a85e453f2dc8e16e06d213e4f 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "Attr.h"
 #include "DeprecatedStringList.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "SVGAnimatedString.h"
 #include "SVGDOMImplementation.h"
 #include "SVGHelper.h"
@@ -75,7 +75,7 @@ KCanvasFEFlood *SVGFEFloodElement::filterEffect() const
     const SVGRenderStyle *svgStyle = filterStyle->svgStyle();
     m_filterEffect->setFloodColor(svgStyle->floodColor());
     m_filterEffect->setFloodOpacity(svgStyle->floodOpacity());
-    filterStyle->deref(canvas()->renderArena());
+    filterStyle->deref(view()->renderArena());
 
     return m_filterEffect;
 }
index 657ba42e3fee6684a9019948e9eeb5aeef1f5bad..0fe264bf7655d8746de498558d07cf47559f412a 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "Attr.h"
 #include "Document.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedNumber.h"
 #include "SVGAnimatedTransformList.h"
@@ -156,10 +156,10 @@ void SVGGradientElement::rebuildStops() const
                 float opacity = stopStyle->svgStyle()->stopOpacity();
                 
                 stops.append(makeGradientStop(stopOffset, makeRGBA(c.red(), c.green(), c.blue(), int(opacity * 255.))));
-                stopStyle->deref(canvas()->renderArena());
+                stopStyle->deref(view()->renderArena());
             }
         }
-        gradientStyle->deref(canvas()->renderArena());
+        gradientStyle->deref(view()->renderArena());
         m_resource->setGradientStops(stops);
     }
 }
index a20817cb423df1160b9a3b3c5341c00352dc3a03..68a08ec7350faeae863faef078bce22c572f3284 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "Document.h"
 #include "FrameView.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "SVGAnimatedLength.h"
 #include "SVGAnimatedRect.h"
 #include "SVGSVGElement.h"
@@ -60,11 +60,10 @@ float SVGHelper::PercentageOfViewport(float value, const SVGElement *viewportEle
             if(doc->documentElement() == svg)
             {
                 // We have to ask the canvas for the full "canvas size"...
-                RenderCanvas *canvas = static_cast<RenderCanvas *>(doc->renderer());
-                if(canvas)
-                {
-                    width = canvas->view()->visibleWidth(); // TODO: recheck!
-                    height = canvas->view()->visibleHeight(); // TODO: recheck!
+                RenderView* view = static_cast<RenderView *>(doc->renderer());
+                if(view) {
+                    width = view->frameView()->visibleWidth(); // TODO: recheck!
+                    height = view->frameView()->visibleHeight(); // TODO: recheck!
                 }
             }
         }
index 11486d3a84efb08df488ef67335ae8a115ddae55..e3e9bd14dfef4127c83197e2f724980ce1b205c5 100644 (file)
@@ -78,7 +78,7 @@ SVGPoint *SVGPathElement::getPointAtLength(double /*distance*/)
 {
     SVGPoint *ret = SVGSVGElement::createSVGPoint();
     /*double totalDistance = getTotalLength();
-    T2P::BezierPath *path = ownerDoc()->canvas()->toBezierPath(m_item);
+    T2P::BezierPath *path = ownerDoc()->view()->toBezierPath(m_item);
     if(path)
     {
         T2P::Point p;
index 4730ebaaa2d3ad19bfae8bf44527d89856315289..f4cd82e734cb49d554968849657f1bad6a658ed2 100644 (file)
@@ -203,7 +203,7 @@ void SVGSVGElement::setCurrentScale(float scale)
 
 SVGPoint *SVGSVGElement::currentTranslate() const
 {
-    //if(!canvas())
+    //if(!view())
         return 0;
 
     //return createSVGPoint(canvasView()->pan());
index d55df4083372557bddaba42e5fb79971aa75805c..5d100bb095361a08c472399c344c38c6ae154bbc 100644 (file)
@@ -30,7 +30,7 @@
 #include "KCanvasRenderingStyle.h"
 #include "KRenderingDevice.h"
 #include "PlatformString.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "RenderPath.h"
 #include "SVGAnimatedString.h"
 #include "SVGDOMImplementation.h"
@@ -112,9 +112,9 @@ void SVGStyledElement::attributeChanged(Attribute* attr, bool preserveDecls)
     notifyAttributeChange();
 }
 
-RenderCanvas* SVGStyledElement::canvas() const
+RenderView* SVGStyledElement::view() const
 {
-    return static_cast<RenderCanvas*>(document()->renderer());
+    return static_cast<RenderView*>(document()->renderer());
 }
 
 void SVGStyledElement::updateCanvasItem()
@@ -140,7 +140,7 @@ void SVGStyledElement::updateCanvasItem()
 
 const SVGStyledElement* SVGStyledElement::pushAttributeContext(const SVGStyledElement*)
 {
-    if (canvas())
+    if (view())
         static_cast<RenderPath*>(renderer())->setPath(toPathData());
 
     return 0;
index 9d6030a88143c666c0a6f210be84a8bbf182fed9..77f229498315bf6da781dbc59583b8ea708eaeda 100644 (file)
@@ -38,7 +38,7 @@ namespace WebCore
     class KCanvasResource;
     class KCanvasRenderingStyle;
     class CSSStyleDeclaration;
-    class RenderCanvas;
+    class RenderView;
     class SVGStyledElement : public SVGElement
     {
     public:
@@ -58,7 +58,7 @@ namespace WebCore
         
         virtual void parseMappedAttribute(MappedAttribute *attr);
 
-        RenderCanvas *canvas() const;
+        RenderView *view() const;
         virtual void notifyAttributeChange() const;
         virtual void attributeChanged(Attribute *attr, bool preserveDecls = false);
 
index fb9b38f7e965ea9e1ced4756bb152719ec925769..ee2d486d8888e90d44d867f4ab331077fc5e1bc8 100644 (file)
@@ -41,7 +41,7 @@
 #import "HTMLInputElement.h"
 #import "HTMLMapElement.h"
 #import "HTMLNames.h"
-#import "RenderCanvas.h"
+#import "RenderView.h"
 #import "RenderImage.h"
 #import "RenderListMarker.h"
 #import "RenderTheme.h"
@@ -83,7 +83,7 @@ using namespace HTMLNames;
 // appropriate place (e.g. dealloc) to remove these non-retained references from
 // AppKit's id mapping tables.
 - (BOOL)accessibilityShouldUseUniqueId {
-    return m_renderer && m_renderer->isCanvas();
+    return m_renderer && m_renderer->isRenderView();
 }
 
 -(void)detach
@@ -320,7 +320,7 @@ using namespace HTMLNames;
             return NSAccessibilityButtonRole;
         return NSAccessibilityImageRole;
     }
-    if (m_renderer->isCanvas())
+    if (m_renderer->isRenderView())
         return @"AXWebArea";
     
     if (m_renderer->element() && m_renderer->element()->hasTagName(inputTag)) {
@@ -460,7 +460,7 @@ using namespace HTMLNames;
     if (m_renderer->isListMarker())
         return static_cast<RenderListMarker*>(m_renderer)->text().getNSString();
 
-    if (m_renderer->isCanvas()) {
+    if (m_renderer->isRenderView()) {
         if (m_renderer->document()->frame())
             return nil;
         
@@ -561,8 +561,8 @@ static IntRect boundingBoxRect(RenderObject* obj)
     
     // The Cocoa accessibility API wants the lower-left corner.
     NSPoint point = NSMakePoint(rect.x(), rect.bottom());
-    if (m_renderer && m_renderer->canvas() && m_renderer->canvas()->view()) {
-        NSView* view = m_renderer->canvas()->view()->getDocumentView();
+    if (m_renderer && m_renderer->view() && m_renderer->view()->view()) {
+        NSView* view = m_renderer->view()->frameView()->getDocumentView();
         point = [[view window] convertBaseToScreen: [view convertPoint: point toView:nil]];
     }
     return [NSValue valueWithPoint: point];
@@ -597,7 +597,7 @@ static IntRect boundingBoxRect(RenderObject* obj)
     if (m_renderer->isBlockFlow() && m_renderer->childrenInline())
         return !static_cast<RenderBlock*>(m_renderer)->firstLineBox() && ![self mouseButtonListener];
 
-    return (!m_renderer->isListMarker() && !m_renderer->isCanvas() && 
+    return (!m_renderer->isListMarker() && !m_renderer->isRenderView() && 
             !m_renderer->isImage() &&
             !(m_renderer->element() && m_renderer->element()->isHTMLElement() &&
               m_renderer->element()->hasTagName(buttonTag)));
@@ -672,7 +672,7 @@ static IntRect boundingBoxRect(RenderObject* obj)
             nil];
     }
     
-    if (m_renderer && m_renderer->isCanvas())
+    if (m_renderer && m_renderer->isRenderView())
         return webAreaAttrs;
     if (m_areaElement || (m_renderer && !m_renderer->isImage() && m_renderer->element() && m_renderer->element()->isLink()))
         return anchorAttrs;
@@ -768,7 +768,7 @@ static IntRect boundingBoxRect(RenderObject* obj)
 
 - (FrameView *)topView
 {
-    return m_renderer->document()->topDocument()->renderer()->canvas()->view();
+    return m_renderer->document()->topDocument()->renderer()->view()->frameView();
 }
 
 - (id)accessibilityAttributeValue:(NSString *)attributeName
@@ -786,8 +786,8 @@ static IntRect boundingBoxRect(RenderObject* obj)
         return [self roleDescription];
     
     if ([attributeName isEqualToString: NSAccessibilityParentAttribute]) {
-        if (m_renderer->isCanvas() && m_renderer->canvas() && m_renderer->canvas()->view())
-            return m_renderer->canvas()->view()->getView();
+        if (m_renderer->isRenderView() && m_renderer->view() && m_renderer->view()->view())
+            return m_renderer->view()->frameView()->getView();
         return [self parentObjectUnignored];
     }
 
@@ -800,7 +800,7 @@ static IntRect boundingBoxRect(RenderObject* obj)
         return m_children;
     }
 
-    if (m_renderer->isCanvas()) {
+    if (m_renderer->isRenderView()) {
         if ([attributeName isEqualToString: @"AXLinkUIElements"]) {
             NSMutableArray *links = [NSMutableArray arrayWithCapacity: 32];
             HTMLCollection *coll = new HTMLCollection(m_renderer->document(), HTMLCollection::DOC_LINKS);
@@ -822,7 +822,7 @@ static IntRect boundingBoxRect(RenderObject* obj)
         if ([attributeName isEqualToString: @"AXLoaded"])
             return [NSNumber numberWithBool: (!m_renderer->document()->tokenizer())];
         if ([attributeName isEqualToString: @"AXLayoutCount"])
-            return [NSNumber numberWithInt: (static_cast<RenderCanvas*>(m_renderer)->view()->layoutCount())];
+            return [NSNumber numberWithInt: (static_cast<RenderView*>(m_renderer)->frameView()->layoutCount())];
     }
     
     if ([attributeName isEqualToString: @"AXURL"] && 
@@ -866,8 +866,8 @@ static IntRect boundingBoxRect(RenderObject* obj)
         return [self position];
 
     if ([attributeName isEqualToString: NSAccessibilityWindowAttribute]) {
-        if (m_renderer && m_renderer->canvas() && m_renderer->canvas()->view())
-            return [m_renderer->canvas()->view()->getView() window];
+        if (m_renderer && m_renderer->view() && m_renderer->view()->view())
+            return [m_renderer->view()->frameView()->getView() window];
         return nil;
     }
     
@@ -878,7 +878,7 @@ static IntRect boundingBoxRect(RenderObject* obj)
         // Trouble is we need to know which document view to ask.
         SelectionController   sel = [self topView]->frame()->selection();
         if (sel.isNone()) {
-            sel = m_renderer->document()->renderer()->canvas()->view()->frame()->selection();
+            sel = m_renderer->document()->renderer()->view()->frameView()->frame()->selection();
             if (sel.isNone())
                 return nil;
         }
index f3275744b14248a353bb0988fe3451c27b06e44a..c26ba92d0810f032251edec7c19bd421a7832729 100644 (file)
@@ -55,7 +55,7 @@
 #include "NodeList.h"
 #include "Page.h"
 #include "Plugin.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "RenderPart.h"
 #include "RenderTheme.h"
 #include "SegmentedString.h"
@@ -2552,7 +2552,7 @@ RenderPart* Frame::ownerRenderer()
 
 IntRect Frame::selectionRect() const
 {
-    RenderCanvas *root = static_cast<RenderCanvas*>(renderer());
+    RenderView *root = static_cast<RenderView*>(renderer());
     if (!root)
         return IntRect();
 
@@ -2813,7 +2813,7 @@ void Frame::paint(GraphicsContext* p, const IntRect& rect)
 #if __APPLE__
         // Regions may have changed as a result of the visibility/z-index of element changing.
         if (renderer()->document()->dashboardRegionsDirty())
-            renderer()->canvas()->view()->updateDashboardRegions();
+            renderer()->view()->frameView()->updateDashboardRegions();
 #endif
     } else
         LOG_ERROR("called Frame::paint with nil renderer");
@@ -2823,7 +2823,7 @@ void Frame::paint(GraphicsContext* p, const IntRect& rect)
 
 void Frame::adjustPageHeight(float *newBottom, float oldTop, float oldBottom, float bottomLimit)
 {
-    RenderCanvas *root = static_cast<RenderCanvas*>(document()->renderer());
+    RenderView *root = static_cast<RenderView*>(document()->renderer());
     if (root) {
         // Use a context with painting disabled.
         GraphicsContext context(0);
@@ -3000,7 +3000,7 @@ void Frame::forceLayoutWithPageWidthRange(float minPageWidth, float maxPageWidth
 {
     // Dumping externalRepresentation(m_frame->renderer()).ascii() is a good trick to see
     // the state of things before and after the layout
-    RenderCanvas *root = static_cast<RenderCanvas*>(document()->renderer());
+    RenderView *root = static_cast<RenderView*>(document()->renderer());
     if (root) {
         // This magic is basically copied from khtmlview::print
         int pageW = (int)ceilf(minPageWidth);
index a22ed12d9166b42214314d704334e4dcaef5b35f..89481422ef6d52b7dcf046d3f7e160b09d15af81 100644 (file)
@@ -44,7 +44,7 @@
 #include "HTMLDocument.h"
 #include "HTMLNames.h"
 #include "RenderArena.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 
 namespace WebCore {
 
@@ -240,7 +240,7 @@ void FrameView::adjustViewSize()
     if (m_frame->document()) {
         Document *document = m_frame->document();
 
-        RenderCanvas* root = static_cast<RenderCanvas *>(document->renderer());
+        RenderView* root = static_cast<RenderView *>(document->renderer());
         if (!root)
             return;
         
@@ -327,7 +327,7 @@ void FrameView::layout()
     if (document->hasChangedChild())
         document->recalcStyle();
 
-    RenderCanvas* root = static_cast<RenderCanvas*>(document->renderer());
+    RenderView* root = static_cast<RenderView*>(document->renderer());
     if (!root) {
         // FIXME: Do we need to set m_size here?
         d->layoutSchedulingEnabled = true;
index 240e2f7265f996fde0ed7198914e57febf4ab05b..d72fa8cb5f2598dbb7253d36b98d0f52d9015c8b 100644 (file)
@@ -58,7 +58,7 @@ class PlatformMouseEvent;
 class MouseEventWithHitTestResults;
 class Node;
 class RenderBox;
-class RenderCanvas;
+class RenderView;
 class RenderLineEdit;
 class RenderObject;
 class RenderPart;
@@ -83,7 +83,7 @@ class FrameView : public ScrollView {
     friend class HTMLTitleElement;
     friend class FrameMac;
     friend class RenderBox;
-    friend class RenderCanvas;
+    friend class RenderView;
     friend class RenderLineEdit;
     friend class RenderObject;
     friend class RenderPart;
index 525bd9c3e7e86c47b5098faacc6a2f8ed16d8160..8e070d11afcc572cb0dc7417868eb59a2b392c6e 100644 (file)
@@ -216,7 +216,7 @@ static bool shouldScaleColumns(RenderTable* table)
         Length tw = table->style()->width();
         if ((tw.isAuto() || tw.isPercent()) && !table->isPositioned()) {
             RenderBlock* cb = table->containingBlock();
-            while (cb && !cb->isCanvas() && !cb->isTableCell() &&
+            while (cb && !cb->isRenderView() && !cb->isTableCell() &&
                 cb->style()->width().isAuto() && !cb->isPositioned())
                 cb = cb->containingBlock();
 
index f901b4a34eaf117386a4b778d635a5e1a754ccfb..b5507da0c99edc661abfce7a8795da65f3f3484e 100644 (file)
@@ -33,7 +33,7 @@
 #include "RenderTextFragment.h"
 #include "SelectionController.h"
 #include "HTMLNames.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "RenderTheme.h"
 #include "KWQTextStream.h"
 
@@ -49,7 +49,7 @@ RenderBlock::MarginInfo::MarginInfo(RenderBlock* block, int top, int bottom)
     // Whether or not we can collapse our own margins with our children.  We don't do this
     // if we had any border/padding (obviously), if we're the root or HTML elements, or if
     // we're positioned, floating, a table cell.
-    m_canCollapseWithChildren = !block->isCanvas() && !block->isRoot() && !block->isPositioned() &&
+    m_canCollapseWithChildren = !block->isRenderView() && !block->isRoot() && !block->isPositioned() &&
         !block->isFloating() && !block->isTableCell() && !block->hasOverflowClip() && !block->isInlineBlockOrInlineTable();
 
     m_canCollapseTopWithChildren = m_canCollapseWithChildren && (top == 0) && block->style()->marginTopCollapse() != MSEPARATE;
@@ -383,7 +383,7 @@ bool RenderBlock::isSelfCollapsingBlock() const
     bool hasAutoHeight = style()->height().isAuto();
     if (style()->height().isPercent() && !style()->htmlHacks()) {
         hasAutoHeight = true;
-        for (RenderBlock* cb = containingBlock(); !cb->isCanvas(); cb = cb->containingBlock()) {
+        for (RenderBlock* cb = containingBlock(); !cb->isRenderView(); cb = cb->containingBlock()) {
             if (cb->style()->height().isFixed() || cb->isTableCell())
                 hasAutoHeight = false;
         }
@@ -552,10 +552,10 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
     if (checkForRepaint)
         didFullRepaint = repaintAfterLayoutIfNeeded(oldBounds, oldFullBounds);
     if (!didFullRepaint && !repaintRect.isEmpty()) {
-        RenderCanvas* c = canvas();
-        if (c && c->view()) {
+        RenderView* v = view();
+        if (v && v->view()) {
             repaintRect.inflate(maximalOutlineSize(PaintPhaseOutline));
-            c->view()->addRepaintInfo(this, repaintRect); // We need to do a partial repaint of our content.
+            v->frameView()->addRepaintInfo(this, repaintRect); // We need to do a partial repaint of our content.
         }
     }
     setNeedsLayout(false);
@@ -1268,7 +1268,7 @@ void RenderBlock::paintChildren(PaintInfo& i, int _tx, int _ty)
         if (isPrinting && !childrenInline() && child->style()->pageBreakBefore() == PBALWAYS &&
             inRootBlockContext() && (_ty + child->yPos()) > i.r.y() && 
             (_ty + child->yPos()) < i.r.bottom()) {
-            canvas()->setBestTruncatedAt(_ty + child->yPos(), this, true);
+            view()->setBestTruncatedAt(_ty + child->yPos(), this, true);
             return;
         }
         
@@ -1279,7 +1279,7 @@ void RenderBlock::paintChildren(PaintInfo& i, int _tx, int _ty)
         if (isPrinting && !childrenInline() && child->style()->pageBreakAfter() == PBALWAYS && 
             inRootBlockContext() && (_ty + child->yPos() + child->height()) > i.r.y() && 
             (_ty + child->yPos() + child->height()) < i.r.bottom()) {
-            canvas()->setBestTruncatedAt(_ty + child->yPos() + child->height() + child->collapsedMarginBottom(), this, true);
+            view()->setBestTruncatedAt(_ty + child->yPos() + child->height() + child->collapsedMarginBottom(), this, true);
             return;
         }
     }
@@ -1434,7 +1434,7 @@ void RenderBlock::setSelectionState(SelectionState s)
         m_selectionState = s;
     
     RenderBlock* cb = containingBlock();
-    if (cb && !cb->isCanvas())
+    if (cb && !cb->isRenderView())
         cb->setSelectionState(s);
 }
 
@@ -1456,8 +1456,8 @@ bool RenderBlock::isSelectionRoot() const
         isFloatingOrPositioned() || isTableCell() || isInlineBlockOrInlineTable())
         return true;
     
-    if (canvas() && canvas()->selectionStart()) {
-        Node* startElement = canvas()->selectionStart()->element();
+    if (view() && view()->selectionStart()) {
+        Node* startElement = view()->selectionStart()->element();
         if (startElement && startElement->rootEditableElement() == element())
             return true;
     }
@@ -1516,7 +1516,7 @@ GapRects RenderBlock::fillInlineSelectionGaps(RenderBlock* rootBlock, int blockX
 {
     GapRects result;
     
-    RenderObject* selStart = canvas()->selectionStart();
+    RenderObject* selStart = view()->selectionStart();
     // If there is no selection, don't try to get the selection's containing block. 
     // If we do, we'll crash.
     bool containsStart = (selStart && (selStart == this || selStart->containingBlock() == this));
@@ -2096,7 +2096,7 @@ RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf) cons
 
     // Fixed positioned objects do not scroll and thus should not constitute
     // part of the lowest position.
-    if (m_positionedObjects && !isCanvas()) {
+    if (m_positionedObjects && !isRenderView()) {
         RenderObject* r;
         DeprecatedPtrListIterator<RenderObject> it(*m_positionedObjects);
         for ( ; (r = it.current()); ++it ) {
@@ -2132,7 +2132,7 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
         }
     }
 
-    if (m_positionedObjects && !isCanvas()) {
+    if (m_positionedObjects && !isRenderView()) {
         RenderObject* r;
         DeprecatedPtrListIterator<RenderObject> it(*m_positionedObjects);
         for ( ; (r = it.current()); ++it ) {
@@ -2173,7 +2173,7 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf
         }
     }
     
-    if (m_positionedObjects && !isCanvas()) {
+    if (m_positionedObjects && !isRenderView()) {
         RenderObject* r;
         DeprecatedPtrListIterator<RenderObject> it(*m_positionedObjects);
         for ( ; (r = it.current()); ++it ) {
@@ -2225,7 +2225,7 @@ RenderBlock::clearFloats()
         m_floatingObjects->clear();
 
     // Inline blocks are covered by the isReplaced() check in the avoidFloats method.
-    if (avoidsFloats() || isRoot() || isCanvas() || isFloatingOrPositioned() || isTableCell())
+    if (avoidsFloats() || isRoot() || isRenderView() || isFloatingOrPositioned() || isTableCell())
         return;
     
     // Attempt to locate a previous sibling with overhanging floats.  We skip any elements that are
@@ -2514,9 +2514,9 @@ bool RenderBlock::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty,
     
     // Hit test floats.
     if (hitTestAction == HitTestFloat && m_floatingObjects) {
-        if (isCanvas()) {
-            scrolledX += static_cast<RenderCanvas*>(this)->view()->contentsX();
-            scrolledY += static_cast<RenderCanvas*>(this)->view()->contentsY();
+        if (isRenderView()) {
+            scrolledX += static_cast<RenderView*>(this)->frameView()->contentsX();
+            scrolledY += static_cast<RenderView*>(this)->frameView()->contentsY();
         }
         
         FloatingObject* o;
@@ -3191,7 +3191,7 @@ void RenderBlock::calcBlocminMaxWidth()
         if (style()->htmlHacks() && child->style()->width().isPercent() &&
             !isTableCell() && child->isTable() && m_maxWidth < BLOCK_MAX_WIDTH) {
             RenderBlock* cb = containingBlock();
-            while (!cb->isCanvas() && !cb->isTableCell())
+            while (!cb->isRenderView() && !cb->isTableCell())
                 cb = cb->containingBlock();
             if (!cb->isTableCell())
                 m_maxWidth = BLOCK_MAX_WIDTH;
@@ -3433,7 +3433,7 @@ bool RenderBlock::inRootBlockContext() const
     if (isTableCell() || isFloatingOrPositioned() || hasOverflowClip())
         return false;
     
-    if (isRoot() || isCanvas())
+    if (isRoot() || isRenderView())
         return true;
     
     return containingBlock()->inRootBlockContext();
index 95cb04304479543e6ba23bcb020386527c9b3f60..7c04ed496cee3f62cc86577c658f2ea6ad3caaf8 100644 (file)
@@ -34,7 +34,7 @@
 #include "HTMLElement.h"
 #include "HTMLNames.h"
 #include "RenderArena.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "RenderFlexibleBox.h"
 #include "RenderTableCell.h"
 #include "RenderTheme.h"
@@ -108,7 +108,7 @@ void RenderBox::setStyle(RenderStyle *_style)
                 m_layer->updateLayerPositions();
         }
     }
-    else if (m_layer && !isRoot() && !isCanvas()) {
+    else if (m_layer && !isRoot() && !isRenderView()) {
         assert(m_layer->parent());
         RenderLayer *layer = m_layer;
         m_layer = 0;
@@ -123,7 +123,7 @@ void RenderBox::setStyle(RenderStyle *_style)
         element()->document()->setTextColor(_style->color());
     
     if (style()->outlineWidth() > 0 && style()->outlineSize() > maximalOutlineSize(PaintPhaseOutline))
-        static_cast<RenderCanvas*>(document()->renderer())->setMaximalOutlineSize(style()->outlineSize());
+        static_cast<RenderView*>(document()->renderer())->setMaximalOutlineSize(style()->outlineSize());
 }
 
 RenderBox::~RenderBox()
@@ -290,13 +290,13 @@ void RenderBox::paintRootBoxDecorations(PaintInfo& i, int _tx, int _ty)
     int h = height();
 
     int rw, rh;
-    if (canvas()->view()) {
-        rw = canvas()->view()->contentsWidth();
-        rh = canvas()->view()->contentsHeight();
+    if (view()->frameView()) {
+        rw = view()->frameView()->contentsWidth();
+        rh = view()->frameView()->contentsHeight();
     }
     else {
-        rw = canvas()->width();
-        rh = canvas()->height();
+        rw = view()->width();
+        rh = view()->height();
     }
     
     int bx = _tx - marginLeft();
@@ -455,7 +455,7 @@ void RenderBox::paintBackgroundExtended(GraphicsContext* p, const Color& c, cons
 
     // Only fill with a base color (e.g., white) if we're the root document, since iframes/frames with
     // no background in the child document should show the parent's background.
-    if (!bgLayer->next() && isRoot() && !(bgColor.isValid() && bgColor.alpha() > 0) && canvas()->view()) {
+    if (!bgLayer->next() && isRoot() && !(bgColor.isValid() && bgColor.alpha() > 0) && view()->view()) {
         bool isTransparent;
         WebCore::Node* elt = document()->ownerElement();
         if (elt) {
@@ -470,10 +470,10 @@ void RenderBox::paintBackgroundExtended(GraphicsContext* p, const Color& c, cons
                 isTransparent = !body || !body->hasLocalName(framesetTag); // Can't scroll a frameset document anyway.
             }
         } else
-            isTransparent = canvas()->view()->isTransparent();
+            isTransparent = view()->view()->isTransparent();
         
         if (isTransparent)
-            canvas()->view()->useSlowRepaints(); // The parent must show behind the child.
+            view()->frameView()->useSlowRepaints(); // The parent must show behind the child.
         else
             bgColor = Color::white;
     }
@@ -482,7 +482,7 @@ void RenderBox::paintBackgroundExtended(GraphicsContext* p, const Color& c, cons
     if (!bgLayer->next() && bgColor.isValid() && bgColor.alpha() > 0) {
         IntRect rect(_tx, clipy, w, cliph);
         // If we have an alpha and we are painting the root element, go ahead and blend with white.
-        if (bgColor.alpha() < 0xFF && isRoot() && !canvas()->view()->isTransparent())
+        if (bgColor.alpha() < 0xFF && isRoot() && !view()->view()->isTransparent())
             p->fillRect(rect, Color(Color::white));
         p->fillRect(rect, bgColor);
     }
@@ -1197,7 +1197,7 @@ void RenderBox::calcHeight()
     if (style()->htmlHacks() && style()->height().isAuto() &&
         !isFloatingOrPositioned() && (isRoot() || isBody())) {
         int margins = collapsedMarginTop() + collapsedMarginBottom();
-        int visHeight = canvas()->view()->visibleHeight();
+        int visHeight = view()->frameView()->visibleHeight();
         if (isRoot())
             m_height = max(m_height, visHeight - margins);
         else
@@ -1234,7 +1234,7 @@ int RenderBox::calcPercentageHeight(const Length& height)
         // block that may have a specified height and then use it.  In strict mode, this violates the
         // specification, which states that percentage heights just revert to auto if the containing
         // block has an auto height.
-        for ( ; !cb->isCanvas() && !cb->isBody() && !cb->isTableCell() && !cb->isPositioned() &&
+        for ( ; !cb->isRenderView() && !cb->isBody() && !cb->isTableCell() && !cb->isPositioned() &&
                 cb->style()->height().isAuto(); cb = cb->containingBlock());
     }
 
@@ -1269,7 +1269,7 @@ int RenderBox::calcPercentageHeight(const Length& height)
         result = cb->calcPercentageHeight(cb->style()->height());
         if (result != -1)
             result = cb->calcContentBoxHeight(result);
-    } else if (cb->isCanvas() || (cb->isBody() && style()->htmlHacks()) ||
+    } else if (cb->isRenderView() || (cb->isBody() && style()->htmlHacks()) ||
                (cb->isPositioned() && !(cb->style()->top().isAuto() || cb->style()->bottom().isAuto()))) {
         // Don't allow this to affect the block' m_height member variable, since this
         // can get called while the block is still laying out its kids.
@@ -1379,8 +1379,8 @@ int RenderBox::availableHeightUsing(const Length& h) const
     if (h.isFixed())
         return calcContentBoxHeight(h.value());
 
-    if (isCanvas())
-        return static_cast<const RenderCanvas*>(this)->view()->visibleHeight();
+    if (isRenderView())
+        return static_cast<const RenderView*>(this)->frameView()->visibleHeight();
 
     // We need to stop here, since we don't want to increase the height of the table
     // artificially.  We're going to rely on this cell getting expanded to some new
index 224dbdf2c6c99318ff2f2df93f8521892169e753..21e61d8c7efc9d79da569ad3ac908e707c28dbc0 100644 (file)
@@ -31,7 +31,7 @@
 #include "RenderTable.h"
 #include "RenderTextFragment.h"
 #include "RenderImage.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "Document.h"
 
 // For accessibility
@@ -177,7 +177,7 @@ RenderObject* RenderContainer::removeChildNode(RenderObject* oldChild)
         // FIXME: The SelectionController should be responsible for this when it
         // is notified of DOM mutations.
         if (oldChild->isSelectionBorder())
-            canvas()->clearSelection();
+            view()->clearSelection();
 
         // renumber ordered lists
         if (oldChild->isListItem())
index f437de5a4c6ce275b1d3b23cc5c670f75be35b11..3b369ef261932a63889d1a5a3af89a4967e36788 100644 (file)
@@ -36,7 +36,7 @@ namespace WebCore {
 RenderFileButton::RenderFileButton(HTMLInputElement* element)
     : RenderFormElement(element)
 {
-    setWidget(new KWQFileButton(view()->frame()));
+    setWidget(new KWQFileButton(m_view->frame()));
 }
 
 void RenderFileButton::calcMinMaxWidth()
index aa91b9bd36f78bb98cf901aba2ce529cc02ce9c3..b9c1ad7811332997f0e852cd4b15551f15f11de2 100644 (file)
@@ -30,7 +30,7 @@
 #include "InlineTextBox.h"
 #include "HTMLNames.h"
 #include "RenderArena.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "RenderInline.h"
 
 using namespace std;
@@ -192,7 +192,7 @@ void RenderFlow::destroy()
             // FIXME: The SelectionController should be responsible for this when it
             // is notified of DOM mutations.
             if (isSelectionBorder())
-                canvas()->clearSelection();
+                view()->clearSelection();
 
             // If line boxes are contained inside a root, that means we're an inline.
             // In that case, we need to remove all the line boxes so that the parent
@@ -384,7 +384,7 @@ void RenderFlow::paintLines(PaintInfo& i, int _tx, int _ty)
             // FIXME: This is a feeble effort to avoid splitting a line across two pages.
             // It is utterly inadequate, and this should not be done at paint time at all.
             // The whole way objects break across pages needs to be redone.
-            RenderCanvas* c = canvas();
+            RenderView* c = view();
             // Try to avoid splitting a line vertically, but only if it's less than the height
             // of the entire page.
             if (curr->root()->bottomOverflow() - curr->root()->topOverflow() <= c->printRect().height()) {
index 925e2ce76db14c00b493b010cce4273312bae311..6ea144acb068b16225e57f4a0872d8992e93af25 100644 (file)
@@ -32,7 +32,7 @@
 #include "HTMLNames.h"
 #include "HTMLFrameSetElement.h"
 #include "dom2_eventsimpl.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "RenderFrame.h"
 #include "KWQTextStream.h"
 
@@ -96,9 +96,9 @@ void RenderFrameSet::layout()
     KHTMLAssert(minMaxKnown());
 
     if (!parent()->isFrameSet()) {
-        FrameView* view = canvas()->view();
-        m_width = view->visibleWidth();
-        m_height = view->visibleHeight();
+        FrameView* v = view()->frameView();
+        m_width = v->visibleWidth();
+        m_height = v->visibleHeight();
     }
 
     int remainingLen[2];
@@ -453,7 +453,7 @@ bool RenderFrameSet::userResize(MouseEvent* evt)
             m_hSplitPos = _y;
             m_oldpos = -1;
         } else
-            canvas()->view()->setCursor(pointerCursor());
+            view()->frameView()->setCursor(pointerCursor());
     }
     
     // ### check the resize is not going out of bounds.
@@ -475,7 +475,7 @@ bool RenderFrameSet::userResize(MouseEvent* evt)
         // important, otherwise the moving indicator is not correctly erased
         setNeedsLayout(true);
     } else if (m_resizing || evt->type() == mouseupEvent) {
-        FrameView* v = canvas()->view();        
+        FrameView* v = view()->frameView();        
         v->disableFlushDrawing();
         GraphicsContext* context = v->lockDrawingFocus();
         
@@ -516,7 +516,7 @@ void RenderFrameSet::setResizing(bool e)
     for (RenderObject* p = parent(); p; p = p->parent())
         if (p->isFrameSet())
             static_cast<RenderFrameSet*>(p)->m_clientResizing = m_resizing;
-    canvas()->view()->setResizingFrameSet(e ? element() : 0);
+    view()->frameView()->setResizingFrameSet(e ? element() : 0);
 }
 
 bool RenderFrameSet::canResize(int _x, int _y)
index 93ab39e7b883136f95220710a3ff7a7cd5db9a8e..1b191e51907f8e9db5d3d3f6ec9d0e7952133a11 100644 (file)
@@ -34,7 +34,7 @@
 #include "HTMLInputElement.h"
 #include "HTMLMapElement.h"
 #include "HTMLNames.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 
 using namespace std;
 
@@ -203,7 +203,7 @@ void RenderImage::paint(PaintInfo& i, int _tx, int _ty)
     int leftPad = paddingLeft();
     int topPad = paddingTop();
 
-    if (isPrinting && !canvas()->printImages())
+    if (isPrinting && !view()->printImages())
         return;
 
     if (!m_cachedImage || image()->isNull() || errorOccurred()) {
index 7576c4595f54ba310d53f8e796a20a749c6f184f..690b2179a33d3d9e417babc6ff0ef7d0609c308e 100644 (file)
@@ -54,7 +54,7 @@
 #include "HTMLMarqueeElement.h"
 #include "HTMLNames.h"
 #include "RenderArena.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "RenderInline.h"
 #include "RenderTheme.h"
 #include "SelectionController.h"
@@ -192,7 +192,7 @@ void RenderLayer::updateLayerPositions(bool doFullRepaint, bool checkForRepaint)
 
     // FIXME: Child object could override visibility.
     if (checkForRepaint && (m_object->style()->visibility() == VISIBLE)) {
-        RenderCanvas *c = m_object->canvas();
+        RenderView *c = m_object->view();
         if (c && !c->printingMode()) {
             int x, y;
             m_object->absolutePosition(x, y);
@@ -223,9 +223,9 @@ void RenderLayer::updateLayerPosition()
     // Clear our cached clip rect information.
     clearClipRect();
 
-    // The canvas is sized to the docWidth/Height over in RenderCanvas::layout, so we
+    // The canvas is sized to the docWidth/Height over in RenderView::layout, so we
     // don't need to ever update our layer position here.
-    if (renderer()->isCanvas())
+    if (renderer()->isRenderView())
         return;
     
     int x = m_object->xPos();
@@ -316,7 +316,7 @@ void RenderLayer::updateLayerPosition()
 RenderLayer *RenderLayer::stackingContext() const
 {
     RenderLayer* curr = parent();
-    for ( ; curr && !curr->m_object->isCanvas() && !curr->m_object->isRoot() &&
+    for ( ; curr && !curr->m_object->isRenderView() && !curr->m_object->isRoot() &&
           curr->m_object->style()->hasAutoZIndex();
           curr = curr->parent());
     return curr;
@@ -326,7 +326,7 @@ RenderLayer*
 RenderLayer::enclosingPositionedAncestor() const
 {
     RenderLayer* curr = parent();
-    for ( ; curr && !curr->m_object->isCanvas() && !curr->m_object->isRoot() &&
+    for ( ; curr && !curr->m_object->isRenderView() && !curr->m_object->isRoot() &&
          !curr->m_object->isPositioned() && !curr->m_object->isRelPositioned();
          curr = curr->parent());
          
@@ -530,7 +530,7 @@ RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, int& x, int&
         
     if (m_object->style()->position() == FixedPosition) {
         // Add in the offset of the view.  We can obtain this by calling
-        // absolutePosition() on the RenderCanvas.
+        // absolutePosition() on the RenderView.
         int xOff, yOff;
         m_object->absolutePosition(xOff, yOff, true);
         x += xOff;
@@ -593,15 +593,15 @@ void RenderLayer::scrollToOffset(int x, int y, bool updateScrollbars, bool repai
     for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
         child->updateLayerPositions(false, false);
     
-    RenderCanvas *canvas = renderer()->canvas();
-    if (canvas) {
+    RenderView* view = renderer()->view();
+    if (view) {
 #if __APPLE__
         // Update dashboard regions, scrolling may change the clip of a
         // particular region.
-        canvas->view()->updateDashboardRegions();
+        view->frameView()->updateDashboardRegions();
 #endif
 
-        m_object->canvas()->updateWidgetPositions();
+        m_object->view()->updateWidgetPositions();
     }
 
     // Just schedule a full repaint of our object.
@@ -1195,7 +1195,7 @@ RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* p,
 
 static inline bool isSubframeCanvas(RenderObject* renderer)
 {
-    return renderer->isCanvas() && renderer->node()->document()->frame()->tree()->parent();
+    return renderer->isRenderView() && renderer->node()->document()->frame()->tree()->parent();
 }
 
 static inline IntRect frameVisibleRect(RenderObject* renderer)
@@ -1433,7 +1433,7 @@ void RenderLayer::calculateRects(const RenderLayer* rootLayer, const IntRect& pa
 bool RenderLayer::intersectsDamageRect(const IntRect& layerBounds, const IntRect& damageRect) const
 {
     // Always examine the canvas and the root.
-    if (renderer()->isCanvas() || renderer()->isRoot())
+    if (renderer()->isRenderView() || renderer()->isRoot())
         return true;
 
     // If we aren't an inline flow, and our layer bounds do intersect the damage rect, then we 
index 21d2bcc32fb48b342555eae305fad39af30d619d..f9be35afa986a2ee1cb48d5c2a2488aa26c4b782 100644 (file)
@@ -53,7 +53,7 @@ class QScrollBar;
 namespace WebCore {
 
 class CachedObject;
-class RenderCanvas;
+class RenderView;
 class RenderFrameSet;
 class RenderObject;
 class RenderStyle;
@@ -260,7 +260,7 @@ public:
     // Get the enclosing stacking context for this layer.  A stacking context is a layer
     // that has a non-auto z-index.
     RenderLayer* stackingContext() const;
-    bool isStackingContext() const { return !hasAutoZIndex() || renderer()->isCanvas(); }
+    bool isStackingContext() const { return !hasAutoZIndex() || renderer()->isRenderView(); }
 
     void dirtyZOrderLists();
     void updateZOrderLists();
index b0a70ee1a52a3197b3aa26478082389e59197c4b..c316ced3fca02f32f5c5b528deb25f610b67135a 100644 (file)
@@ -29,7 +29,7 @@
 #include "Document.h"
 #include "GraphicsContext.h"
 #include "ListMarkerBox.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "RenderListItem.h"
 
 using namespace std;
@@ -175,7 +175,7 @@ void RenderListMarker::paint(PaintInfo& i, int _tx, int _ty)
             // This has been printed already we suppose.
             return;
         
-        RenderCanvas* c = canvas();
+        RenderView* c = view();
         if (box.y() + box.height() + paddingBottom() + borderBottom() >= c->printRect().bottom()) {
             if (box.y() < c->truncatedAt())
                 c->setBestTruncatedAt(box.y(), this);
index 66973448131ebba1161483e0f412a267e7239893..7bbffe4fd7b5964da56e1d9e3f11280d86bf65bf 100644 (file)
@@ -40,7 +40,7 @@
 #include "KWQWMatrix.h"
 #include "Position.h"
 #include "RenderArena.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "RenderFlexibleBox.h"
 #include "RenderInline.h"
 #include "RenderListItem.h"
@@ -637,7 +637,7 @@ bool RenderObject::scroll(KWQScrollDirection direction, KWQScrollGranularity gra
         return true;
     }
     RenderBlock *b = containingBlock();
-    if (b != 0 && !b->isCanvas()) {
+    if (b != 0 && !b->isRenderView()) {
         return b->scroll(direction, granularity, multiplier);
     }
     return false;
@@ -717,17 +717,17 @@ RenderBlock* RenderObject::containingBlock() const
 {
     if(isTableCell())
         return static_cast<const RenderTableCell *>(this)->table();
-    if (isCanvas())
+    if (isRenderView())
         return (RenderBlock*)this;
 
     RenderObject *o = parent();
     if (!isText() && m_style->position() == FixedPosition) {
-        while ( o && !o->isCanvas() )
+        while ( o && !o->isRenderView() )
             o = o->parent();
     }
     else if (!isText() && m_style->position() == AbsolutePosition) {
         while (o && (o->style()->position() == StaticPosition || (o->isInline() && !o->isReplaced()))
-               && !o->isRoot() && !o->isCanvas()) {
+               && !o->isRoot() && !o->isRenderView()) {
             // For relpositioned inlines, we return the nearest enclosing block.  We don't try
             // to return the inline itself.  This allows us to avoid having a positioned objects
             // list in all RenderInlines and lets us return a strongly-typed RenderBlock* result
@@ -1392,12 +1392,12 @@ void RenderObject::paint(PaintInfo& i, int tx, int ty)
 
 void RenderObject::repaint(bool immediate)
 {
-    // Can't use canvas(), since we might be unrooted.
+    // Can't use view(), since we might be unrooted.
     RenderObject* o = this;
     while ( o->parent() ) o = o->parent();
-    if (!o->isCanvas())
+    if (!o->isRenderView())
         return;
-    RenderCanvas* c = static_cast<RenderCanvas*>(o);
+    RenderView* c = static_cast<RenderView*>(o);
     if (c->printingMode())
         return; // Don't repaint if we're printing.
     c->repaintViewRectangle(getAbsoluteRepaintRect(), immediate);    
@@ -1405,12 +1405,12 @@ void RenderObject::repaint(bool immediate)
 
 void RenderObject::repaintRectangle(const IntRect& r, bool immediate)
 {
-    // Can't use canvas(), since we might be unrooted.
+    // Can't use view(), since we might be unrooted.
     RenderObject* o = this;
     while ( o->parent() ) o = o->parent();
-    if (!o->isCanvas())
+    if (!o->isRenderView())
         return;
-    RenderCanvas* c = static_cast<RenderCanvas*>(o);
+    RenderView* c = static_cast<RenderView*>(o);
     if (c->printingMode())
         return; // Don't repaint if we're printing.
     IntRect absRect(r);
@@ -1420,7 +1420,7 @@ void RenderObject::repaintRectangle(const IntRect& r, bool immediate)
 
 bool RenderObject::repaintAfterLayoutIfNeeded(const IntRect& oldBounds, const IntRect& oldFullBounds)
 {
-    RenderCanvas* c = canvas();
+    RenderView* c = view();
     if (c->printingMode())
         return false; // Don't repaint if we're printing.
             
@@ -1649,7 +1649,7 @@ Node* RenderObject::draggableNode(bool dhtmlOK, bool uaOK, int x, int y, bool& d
         if (elt && elt->nodeType() == Node::TEXT_NODE) {
             // Since there's no way for the author to address the -webkit-user-drag style for a text node,
             // we use our own judgement.
-            if (uaOK && canvas()->view()->frame()->shouldDragAutoNode(curr->node(), IntPoint(x, y))) {
+            if (uaOK && view()->frameView()->frame()->shouldDragAutoNode(curr->node(), IntPoint(x, y))) {
                 dhtmlWillDrag = false;
                 return curr->node();
             } else if (curr->shouldSelect()) {
@@ -1664,7 +1664,7 @@ Node* RenderObject::draggableNode(bool dhtmlOK, bool uaOK, int x, int y, bool& d
                 dhtmlWillDrag = true;
                 return curr->node();
             } else if (uaOK && dragMode == DRAG_AUTO
-                       && canvas()->view()->frame()->shouldDragAutoNode(curr->node(), IntPoint(x, y)))
+                       && view()->frameView()->frame()->shouldDragAutoNode(curr->node(), IntPoint(x, y)))
             {
                 dhtmlWillDrag = false;
                 return curr->node();
@@ -1677,7 +1677,7 @@ Node* RenderObject::draggableNode(bool dhtmlOK, bool uaOK, int x, int y, bool& d
 
 void RenderObject::selectionStartEnd(int& spos, int& epos)
 {
-    canvas()->selectionStartEnd(spos, epos);
+    view()->selectionStartEnd(spos, epos);
 }
 
 RenderBlock* RenderObject::createAnonymousBlock()
@@ -1761,7 +1761,7 @@ void RenderObject::setStyle(RenderStyle *style)
         // the canvas.  Just dirty the entire canvas when our style changes substantially.
         if (d >= RenderStyle::Repaint && element() &&
             (element()->hasTagName(htmlTag) || element()->hasTagName(bodyTag)))
-            canvas()->repaint();
+            view()->repaint();
         else if (m_parent && !isText()) {
             // Do a repaint with the old style first, e.g., for example if we go from
             // having an outline to not having an outline.
@@ -1874,7 +1874,7 @@ void RenderObject::updateBackgroundImages(RenderStyle* oldStyle)
 
 IntRect RenderObject::viewRect() const
 {
-    return canvas()->viewRect();
+    return view()->viewRect();
 }
 
 bool RenderObject::absolutePosition(int &xPos, int &yPos, bool f)
@@ -1958,9 +1958,9 @@ int RenderObject::tabWidth() const
     return containingBlock()->tabWidth(true);
 }
 
-RenderCanvas* RenderObject::canvas() const
+RenderView* RenderObject::view() const
 {
-    return static_cast<RenderCanvas*>(document()->renderer());
+    return static_cast<RenderView*>(document()->renderer());
 }
 
 RenderObject *RenderObject::container() const
@@ -1978,7 +1978,7 @@ RenderObject *RenderObject::container() const
     RenderObject *o = 0;
     if (!isText() && pos == FixedPosition) {
         // container() can be called on an object that is not in the
-        // tree yet.  We don't call canvas() since it will assert if it
+        // tree yet.  We don't call view() since it will assert if it
         // can't get back to the canvas.  Instead we just walk as high up
         // as we can.  If we're in the tree, we'll get the root.  If we
         // aren't we'll get the root of our little subtree (most likely
@@ -1991,7 +1991,7 @@ RenderObject *RenderObject::container() const
         // we may not have one if we're part of an uninstalled subtree.  We'll
         // climb as high as we can though.
         o = parent();
-        while (o && o->style()->position() == StaticPosition && !o->isRoot() && !o->isCanvas())
+        while (o && o->style()->position() == StaticPosition && !o->isRoot() && !o->isRenderView())
             o = o->parent();
     }
     else
@@ -2017,7 +2017,7 @@ void RenderObject::removeFromObjectLists()
 {
     if (isFloating()) {
         RenderBlock* outermostBlock = containingBlock();
-        for (RenderBlock* p = outermostBlock; p && !p->isCanvas(); p = p->containingBlock()) {
+        for (RenderBlock* p = outermostBlock; p && !p->isRenderView(); p = p->containingBlock()) {
             if (p->containsFloat(this))
                 outermostBlock = p;
         }
@@ -2289,9 +2289,9 @@ void RenderObject::recalcMinMaxWidths()
 
 void RenderObject::scheduleRelayout()
 {
-    if (!isCanvas())
+    if (!isRenderView())
         return;
-    FrameView *view = static_cast<RenderCanvas *>(this)->view();
+    FrameView *view = static_cast<RenderView *>(this)->frameView();
     if (view)
         view->scheduleRelayout();
 }
@@ -2514,8 +2514,8 @@ void RenderObject::imageChanged(CachedImage *image)
     // subclasses). It would be even better to find a more elegant way of doing this that
     // would avoid putting this function and the CachedObjectClient base class into RenderObject.
     if (image && image->canRender() && parent()) {
-        if (canvas() && element() && (element()->hasTagName(htmlTag) || element()->hasTagName(bodyTag)))
-            canvas()->repaint();    // repaint the entire canvas since the background gets propagated up
+        if (view() && element() && (element()->hasTagName(htmlTag) || element()->hasTagName(bodyTag)))
+            view()->repaint();    // repaint the entire canvas since the background gets propagated up
         else
             repaint();              // repaint object, which is a box or a container with boxes inside it
     }
@@ -2536,7 +2536,7 @@ int RenderObject::maximalOutlineSize(PaintPhase p) const
 {
     if (p != PaintPhaseOutline && p != PaintPhaseSelfOutline)
         return 0;
-    return static_cast<RenderCanvas*>(document()->renderer())->maximalOutlineSize();
+    return static_cast<RenderView*>(document()->renderer())->maximalOutlineSize();
 }
 
 int RenderObject::caretMinOffset() const
index 91146da14eb6b95e73631c8797cbf23acc36a00e..78d678cc335c14d9615d00a1c49edc72423eed95 100644 (file)
@@ -63,7 +63,7 @@ class InlineBox;
 class InlineFlowBox;
 class Position;
 class RenderBlock;
-class RenderCanvas;
+class RenderView;
 class RenderFlow;
 class RenderFrameSet;
 class RenderLayer;
@@ -253,7 +253,7 @@ public:
     
     virtual bool isListItem() const { return false; }
     virtual bool isListMarker() const { return false; }
-    virtual bool isCanvas() const { return false; }
+    virtual bool isRenderView() const { return false; }
     bool isRoot() const;
     bool isBody() const;
     bool isHR() const;
@@ -323,7 +323,7 @@ public:
     
     void updateDragState(bool dragOn);
 
-    RenderCanvas* canvas() const;
+    RenderView* view() const;
 
     // don't even think about making this method virtual!
     Node* element() const { return m_isAnonymous ? 0 : m_node; }
@@ -916,7 +916,7 @@ private:
     // note: do not add unnecessary bitflags, we have 32 bit already!
     friend class RenderListItem;
     friend class RenderContainer;
-    friend class RenderCanvas;
+    friend class RenderView;
 };
 
 
index 1339c138ce468a8f55030df36d0849aa2008730e..2fd9e12507e349b75850e5a6a339cd5651d785a6 100644 (file)
@@ -37,7 +37,7 @@ RenderTextArea::RenderTextArea(HTMLTextAreaElement* element)
     , m_dirty(false)
     , m_updating(false)
 {
-    QTextEdit* edit = new QTextEdit(view());
+    QTextEdit* edit = new QTextEdit(m_view);
 
     if (element->wrap() != HTMLTextAreaElement::ta_NoWrap)
         edit->setWordWrap(QTextEdit::WidgetWidth);
index 6afe50484c1b64b4fd6c2f0ea2adeacdb9f319a9..37f2e0adb2d8a9b4a14ea15ed2ae754de2186cf9 100644 (file)
@@ -25,7 +25,7 @@
 #import "Document.h"
 #import "FoundationExtras.h"
 #import "FrameView.h"
-#import "RenderCanvas.h"
+#import "RenderView.h"
 #import "WebCoreSystemInterface.h"
 #import "cssstyleselector.h"
 
@@ -266,7 +266,7 @@ bool RenderThemeMac::paintCheckbox(RenderObject* o, const RenderObject::PaintInf
     // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
     // shadow" and the check.  We don't consider this part of the bounds of the control in WebKit.
     IntRect inflatedRect = inflateRect(r, checkboxSizes()[[checkbox controlSize]], checkboxMargins());
-    [checkbox drawWithFrame:NSRect(inflatedRect) inView:o->canvas()->view()->getDocumentView()];
+    [checkbox drawWithFrame:NSRect(inflatedRect) inView:o->view()->frameView()->getDocumentView()];
     [checkbox setControlView: nil];
     
     return false;
@@ -326,7 +326,7 @@ bool RenderThemeMac::paintRadio(RenderObject* o, const RenderObject::PaintInfo&
     // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
     // shadow" and the check.  We don't consider this part of the bounds of the control in WebKit.
     IntRect inflatedRect = inflateRect(r, radioSizes()[[radio controlSize]], radioMargins());
-    [radio drawWithFrame:NSRect(inflatedRect) inView:o->canvas()->view()->getDocumentView()];
+    [radio drawWithFrame:NSRect(inflatedRect) inView:o->view()->frameView()->getDocumentView()];
     [radio setControlView: nil];
     
     return false;
@@ -516,7 +516,7 @@ bool RenderThemeMac::paintButton(RenderObject* o, const RenderObject::PaintInfo&
         inflatedRect = inflateRect(inflatedRect, size, buttonMargins());
     }
 
-    [button drawWithFrame:NSRect(inflatedRect) inView:o->canvas()->view()->getDocumentView()];
+    [button drawWithFrame:NSRect(inflatedRect) inView:o->view()->frameView()->getDocumentView()];
     [button setControlView:nil];
 
     return false;
index 4a96e7dede9c4d25e4015523bac499bce44abb6b..cf3c167298fcd2f9f22e88bc058664471745619c 100644 (file)
@@ -31,7 +31,7 @@
 #include "InlineTextBox.h"
 #include "JSEditor.h"
 #include "RenderBR.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "RenderTableCell.h"
 #include "RenderWidget.h"
 #include "SelectionController.h"
@@ -418,7 +418,7 @@ DeprecatedString externalRepresentation(RenderObject* o)
         ts.precision(2);
         writeRenderResources(ts, o->document());
 #endif
-        o->canvas()->view()->layout();
+        o->view()->view()->layout();
         RenderLayer* l = o->layer();
         if (l) {
             writeLayers(ts, l, l, IntRect(l->xPos(), l->yPos(), l->width(), l->height()));
diff --git a/WebCore/rendering/RenderView.cpp b/WebCore/rendering/RenderView.cpp
new file mode 100644 (file)
index 0000000..fed9a3e
--- /dev/null
@@ -0,0 +1,558 @@
+/**
+ * This file is part of the HTML widget for KDE.
+ *
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "RenderView.h"
+
+#include "Document.h"
+#include "Element.h"
+#include "FrameView.h"
+#include "GraphicsContext.h"
+
+namespace WebCore {
+
+//#define BOX_DEBUG
+
+RenderView::RenderView(Node* node, FrameView *view)
+    : RenderBlock(node)
+{
+    // Clear our anonymous bit, set because RenderObject assumes
+    // any renderer with document as the node is anonymous.
+    setIsAnonymous(false);
+        
+    // init RenderObject attributes
+    setInline(false);
+
+    m_frameView = view;
+    // try to contrain the width to the views width
+
+    m_minWidth = 0;
+    m_height = 0;
+
+    m_width = m_minWidth;
+    m_maxWidth = m_minWidth;
+
+    setPositioned(true); // to 0,0 :)
+
+    m_printingMode = false;
+    m_printImages = true;
+
+    m_maximalOutlineSize = 0;
+    
+    m_selectionStart = 0;
+    m_selectionEnd = 0;
+    m_selectionStartPos = -1;
+    m_selectionEndPos = -1;
+
+    // Create a new root layer for our layer hierarchy.
+    m_layer = new (node->document()->renderArena()) RenderLayer(this);
+}
+
+RenderView::~RenderView()
+{
+}
+
+void RenderView::calcHeight()
+{
+    if (!m_printingMode && m_frameView)
+        m_height = m_frameView->visibleHeight();
+}
+
+void RenderView::calcWidth()
+{
+    if (!m_printingMode && m_frameView)
+        m_width = m_frameView->visibleWidth();
+    m_marginLeft = 0;
+    m_marginRight = 0;
+}
+
+void RenderView::calcMinMaxWidth()
+{
+    KHTMLAssert( !minMaxKnown() );
+
+    RenderBlock::calcMinMaxWidth();
+
+    m_maxWidth = m_minWidth;
+
+    setMinMaxKnown();
+}
+
+void RenderView::layout()
+{
+    KHTMLAssert(!frameView()->inLayout());
+    
+    if (m_printingMode)
+        m_minWidth = m_width;
+
+    setChildNeedsLayout(true);
+    setMinMaxKnown(false);
+    for (RenderObject *c = firstChild(); c; c = c->nextSibling())
+        c->setChildNeedsLayout(true);
+
+    if ( recalcMinMax() )
+        recalcMinMaxWidths();
+
+    RenderBlock::layout();
+
+    int docw = docWidth();
+    int doch = docHeight();
+
+    if (!m_printingMode) {
+        setWidth(m_frameView->visibleWidth());
+        setHeight(m_frameView->visibleHeight());
+    }
+
+    // ### we could maybe do the call below better and only pass true if the docsize changed.
+    layoutPositionedObjects( true );
+
+    layer()->setHeight(max(doch, m_height));
+    layer()->setWidth(max(docw, m_width));
+    
+    setNeedsLayout(false);
+}
+
+bool RenderView::absolutePosition(int &xPos, int &yPos, bool f)
+{
+    if ( f && m_frameView) {
+        xPos = m_frameView->contentsX();
+        yPos = m_frameView->contentsY();
+    } else
+        xPos = yPos = 0;
+    return true;
+}
+
+void RenderView::paint(PaintInfo& i, int _tx, int _ty)
+{
+#ifdef DEBUG_LAYOUT
+    kdDebug( 6040 ) << renderName() << "(RenderView) " << this << " ::paintObject() w/h = (" << width() << "/" << height() << ")" << endl;
+#endif
+    
+    // Cache the print rect because the dirty rect could get changed during painting.
+    if (m_printingMode)
+        setPrintRect(i.r);
+    
+    // 1. paint background, borders etc
+    if (i.phase == PaintPhaseBlockBackground) {
+        paintBoxDecorations(i, _tx, _ty);
+        return;
+    }
+    
+    // 2. paint contents
+    for (RenderObject *child = firstChild(); child; child = child->nextSibling())
+        if (!child->layer() && !child->isFloating())
+            child->paint(i, _tx, _ty);
+
+    if (m_frameView) {
+        _tx += m_frameView->contentsX();
+        _ty += m_frameView->contentsY();
+    }
+    
+    // 3. paint floats.
+    if (i.phase == PaintPhaseFloat)
+        paintFloats(i, _tx, _ty);
+        
+#ifdef BOX_DEBUG
+    outlineBox(i.p, _tx, _ty);
+#endif
+}
+
+void RenderView::paintBoxDecorations(PaintInfo& i, int _tx, int _ty)
+{
+    // Check to see if we are enclosed by a transparent layer.  If so, we cannot blit
+    // when scrolling, and we need to use slow repaints.
+    Element* elt = element()->document()->ownerElement();
+    if (view() && elt) {
+        RenderLayer* layer = elt->renderer()->enclosingLayer();
+        if (layer->isTransparent() || layer->transparentAncestor())
+            frameView()->useSlowRepaints();
+    }
+    
+    if ((firstChild() && firstChild()->style()->visibility() == VISIBLE) || !view())
+        return;
+
+    // This code typically only executes if the root element's visibility has been set to hidden.
+    // Only fill with white if we're the root document, since iframes/frames with
+    // no background in the child document should show the parent's background.
+    if (elt || view()->isTransparent())
+        frameView()->useSlowRepaints(); // The parent must show behind the child.
+    else
+        i.p->fillRect(i.r, Color(Color::white));
+}
+
+void RenderView::repaintViewRectangle(const IntRect& ur, bool immediate)
+{
+    if (m_printingMode || ur.width() == 0 || ur.height() == 0) return;
+    
+    IntRect vr = viewRect();
+    if (m_frameView && ur.intersects(vr)) {
+        // We always just invalidate the root view, since we could be an iframe that is clipped out
+        // or even invisible.
+        IntRect r = intersection(ur, vr);
+        Element* elt = element()->document()->ownerElement();
+        if (!elt)
+            m_frameView->repaintRectangle(r, immediate);
+        else {
+            // Subtract out the contentsX and contentsY offsets to get our coords within the viewing
+            // rectangle.
+            r.move(-m_frameView->contentsX(), -m_frameView->contentsY());
+
+            RenderObject* obj = elt->renderer();
+            // FIXME: Hardcoded offsets here are not good.
+            int yFrameOffset = m_frameView->hasBorder() ? 2 : 0;
+            int xFrameOffset = m_frameView->hasBorder() ? 1 : 0;
+            r.move(obj->borderLeft() + obj->paddingLeft() + xFrameOffset,
+                obj->borderTop() + obj->paddingTop() + yFrameOffset);
+            obj->repaintRectangle(r, immediate);
+        }
+    }
+}
+
+IntRect RenderView::getAbsoluteRepaintRect()
+{
+    IntRect result;
+    if (m_frameView && !m_printingMode)
+        result = IntRect(m_frameView->contentsX(), m_frameView->contentsY(),
+                       m_frameView->visibleWidth(), m_frameView->visibleHeight());
+    return result;
+}
+
+void RenderView::computeAbsoluteRepaintRect(IntRect& r, bool f)
+{
+    if (m_printingMode)
+        return;
+
+    if (f && m_frameView)
+        r.move(m_frameView->contentsX(), m_frameView->contentsY());
+}
+
+void RenderView::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+{
+    rects.append(IntRect(_tx, _ty, m_layer->width(), m_layer->height()));
+}
+
+RenderObject* rendererAfterPosition(RenderObject* object, unsigned offset)
+{
+    if (!object)
+        return 0;
+    RenderObject* child = object->childAt(offset);
+    return child ? child : object->nextInPreOrderAfterChildren();
+}
+
+IntRect RenderView::selectionRect() const
+{
+    typedef HashMap<RenderObject*, SelectionInfo*> SelectionMap;
+    SelectionMap selectedObjects;
+
+    RenderObject* os = m_selectionStart;
+    RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos);
+    while (os && os != stop) {
+        
+        if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
+            // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
+//          assert(!selectedObjects.get(os));
+            selectedObjects.set(os, new SelectionInfo(os));
+            RenderBlock* cb = os->containingBlock();
+            while (cb && !cb->isRenderView()) {
+                SelectionInfo* blockInfo = selectedObjects.get(cb);
+                if (blockInfo)
+                    break;
+                selectedObjects.set(cb, new SelectionInfo(cb));
+                cb = cb->containingBlock();
+            }
+        }
+        
+        os = os->nextInPreOrder();
+    }
+
+    // Now create a single bounding box rect that encloses the whole selection.
+    IntRect selRect;
+    SelectionMap::iterator end = selectedObjects.end();
+    for (SelectionMap::iterator i = selectedObjects.begin(); i != end; ++i) {
+        SelectionInfo* info = i->second;
+        selRect.unite(info->rect());
+        delete info;
+    }
+    return selRect;
+}
+
+void RenderView::setSelection(RenderObject *s, int sp, RenderObject *e, int ep)
+{
+    // Make sure both our start and end objects are defined. 
+    // Check www.msnbc.com and try clicking around to find the case where this happened.
+    if ((s && !e) || (e && !s))
+        return;
+
+    // Just return if the selection hasn't changed.
+    if (m_selectionStart == s && m_selectionStartPos == sp &&
+        m_selectionEnd == e && m_selectionEndPos == ep)
+        return;
+
+    // Record the old selected objects.  These will be used later
+    // when we compare against the new selected objects.
+    int oldStartPos = m_selectionStartPos;
+    int oldEndPos = m_selectionEndPos;
+
+    // Objects each have a single selection rect to examine.
+    typedef HashMap<RenderObject*, SelectionInfo*> SelectedObjectMap;
+    SelectedObjectMap oldSelectedObjects;
+    SelectedObjectMap newSelectedObjects;
+
+    // Blocks contain selected objects and fill gaps between them, either on the left, right, or in between lines and blocks.
+    // In order to get the repaint rect right, we have to examine left, middle, and right rects individually, since otherwise
+    // the union of those rects might remain the same even when changes have occurred.
+    typedef HashMap<RenderBlock*, BlockSelectionInfo*> SelectedBlockMap;
+    SelectedBlockMap oldSelectedBlocks;
+    SelectedBlockMap newSelectedBlocks;
+
+    RenderObject* os = m_selectionStart;
+    RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos);
+    while (os && os != stop) {
+        if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
+            // Blocks are responsible for painting line gaps and margin gaps.  They must be examined as well.
+            oldSelectedObjects.set(os, new SelectionInfo(os));
+            RenderBlock* cb = os->containingBlock();
+            while (cb && !cb->isRenderView()) {
+                BlockSelectionInfo* blockInfo = oldSelectedBlocks.get(cb);
+                if (blockInfo)
+                    break;
+                oldSelectedBlocks.set(cb, new BlockSelectionInfo(cb));
+                cb = cb->containingBlock();
+            }
+        }
+        
+        os = os->nextInPreOrder();
+    }
+
+    // Now clear the selection.
+    SelectedObjectMap::iterator oldObjectsEnd = oldSelectedObjects.end();
+    for (SelectedObjectMap::iterator i = oldSelectedObjects.begin(); i != oldObjectsEnd; ++i)
+        i->first->setSelectionState(SelectionNone);
+
+    // set selection start and end
+    m_selectionStart = s;
+    m_selectionStartPos = sp;
+    m_selectionEnd = e;
+    m_selectionEndPos = ep;
+
+    // Update the selection status of all objects between m_selectionStart and m_selectionEnd
+    if (s && s == e)
+        s->setSelectionState(SelectionBoth);
+    else {
+        if (s)
+            s->setSelectionState(SelectionStart);
+        if (e)
+            e->setSelectionState(SelectionEnd);
+    }
+
+    RenderObject* o = s;
+    stop = rendererAfterPosition(e, ep);
+    
+    while (o && o != stop) {
+        if (o != s && o != e && o->canBeSelectionLeaf())
+            o->setSelectionState(SelectionInside);
+        o = o->nextInPreOrder();
+    }
+
+    // Now that the selection state has been updated for the new objects, walk them again and
+    // put them in the new objects list.
+    o = s;
+    while (o && o != stop) {
+        
+        if ((o->canBeSelectionLeaf() || o == s || o == e) && o->selectionState() != SelectionNone) {
+            newSelectedObjects.set(o, new SelectionInfo(o));
+            RenderBlock* cb = o->containingBlock();
+            while (cb && !cb->isRenderView()) {
+                BlockSelectionInfo* blockInfo = newSelectedBlocks.get(cb);
+                if (blockInfo)
+                    break;
+                newSelectedBlocks.set(cb, new BlockSelectionInfo(cb));
+                cb = cb->containingBlock();
+            }
+        }
+
+        o = o->nextInPreOrder();
+    }
+
+    if (!m_frameView)
+        return;
+
+    // Have any of the old selected objects changed compared to the new selection?
+    for (SelectedObjectMap::iterator i = oldSelectedObjects.begin(); i != oldObjectsEnd; ++i) {
+        RenderObject* obj = i->first;
+        SelectionInfo* newInfo = newSelectedObjects.get(obj);
+        SelectionInfo* oldInfo = i->second;
+        if (!newInfo || oldInfo->rect() != newInfo->rect() || oldInfo->state() != newInfo->state() ||
+            (m_selectionStart == obj && oldStartPos != m_selectionStartPos) ||
+            (m_selectionEnd == obj && oldEndPos != m_selectionEndPos)) {
+            m_frameView->updateContents(oldInfo->rect());
+            if (newInfo) {
+                m_frameView->updateContents(newInfo->rect());
+                newSelectedObjects.remove(obj);
+                delete newInfo;
+            }
+        }
+        delete oldInfo;
+    }
+    
+    // Any new objects that remain were not found in the old objects dict, and so they need to be updated.
+    SelectedObjectMap::iterator newObjectsEnd = newSelectedObjects.end();
+    for (SelectedObjectMap::iterator i = newSelectedObjects.begin(); i != newObjectsEnd; ++i) {
+        SelectionInfo* newInfo = i->second;
+        m_frameView->updateContents(newInfo->rect());
+        delete newInfo;
+    }
+
+    // Have any of the old blocks changed?
+    SelectedBlockMap::iterator oldBlocksEnd = oldSelectedBlocks.end();
+    for (SelectedBlockMap::iterator i = oldSelectedBlocks.begin(); i != oldBlocksEnd; ++i) {
+        RenderBlock* block = i->first;
+        BlockSelectionInfo* newInfo = newSelectedBlocks.get(block);
+        BlockSelectionInfo* oldInfo = i->second;
+        if (!newInfo || oldInfo->rects() != newInfo->rects() || oldInfo->state() != newInfo->state()) {
+            m_frameView->updateContents(oldInfo->rects());
+            if (newInfo) {
+                m_frameView->updateContents(newInfo->rects());
+                newSelectedBlocks.remove(block);
+                delete newInfo;
+            }
+        }
+        delete oldInfo;
+    }
+    
+    // Any new blocks that remain were not found in the old blocks dict, and so they need to be updated.
+    SelectedBlockMap::iterator newBlocksEnd = newSelectedBlocks.end();
+    for (SelectedBlockMap::iterator i = newSelectedBlocks.begin(); i != newBlocksEnd; ++i) {
+        BlockSelectionInfo* newInfo = i->second;
+        m_frameView->updateContents(newInfo->rects());
+        delete newInfo;
+    }
+}
+
+void RenderView::clearSelection()
+{
+    setSelection(0, -1, 0, -1);
+}
+
+void RenderView::selectionStartEnd(int& spos, int& epos)
+{
+    spos = m_selectionStartPos;
+    epos = m_selectionEndPos;
+}
+
+void RenderView::updateWidgetPositions()
+{
+    RenderObjectSet::iterator end = m_widgets.end();
+    for (RenderObjectSet::iterator it = m_widgets.begin(); it != end; ++it) {
+        (*it)->updateWidgetPosition();
+    }
+}
+
+void RenderView::addWidget(RenderObject *o)
+{
+    m_widgets.add(o);
+}
+
+void RenderView::removeWidget(RenderObject *o)
+{
+    m_widgets.remove(o);
+}
+
+IntRect RenderView::viewRect() const
+{
+    if (m_printingMode)
+        return IntRect(0, 0, m_width, m_height);
+    if (m_frameView)
+        return IntRect(m_frameView->contentsX(),
+            m_frameView->contentsY(),
+            m_frameView->visibleWidth(),
+            m_frameView->visibleHeight());
+    return IntRect();
+}
+
+int RenderView::docHeight() const
+{
+    int h;
+    if (m_printingMode || !m_frameView)
+        h = m_height;
+    else
+        h = m_frameView->visibleHeight();
+
+    int lowestPos = lowestPosition();
+    if( lowestPos > h )
+        h = lowestPos;
+
+    // FIXME: This doesn't do any margin collapsing.
+    // Instead of this dh computation we should keep the result
+    // when we call RenderBlock::layout.
+    int dh = 0;
+    for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
+        dh += c->height() + c->marginTop() + c->marginBottom();
+    }
+    if( dh > h )
+        h = dh;
+
+    return h;
+}
+
+int RenderView::docWidth() const
+{
+    int w;
+    if (m_printingMode || !m_frameView)
+        w = m_width;
+    else
+        w = m_frameView->visibleWidth();
+
+    int rightmostPos = rightmostPosition();
+    if( rightmostPos > w )
+        w = rightmostPos;
+
+    for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
+        int dw = c->width() + c->marginLeft() + c->marginRight();
+        if( dw > w )
+            w = dw;
+    }
+    return w;
+}
+
+// The idea here is to take into account what object is moving the pagination point, and
+// thus choose the best place to chop it.
+void RenderView::setBestTruncatedAt(int y, RenderObject *forRenderer, bool forcedBreak)
+{
+    // Nobody else can set a page break once we have a forced break.
+    if (m_forcedPageBreak) return;
+    
+    // Forced breaks always win over unforced breaks.
+    if (forcedBreak) {
+        m_forcedPageBreak = true;
+        m_bestTruncatedAt = y;
+        return;
+    }
+    
+    // prefer the widest object who tries to move the pagination point
+    int width = forRenderer->width();
+    if (width > m_truncatorWidth) {
+        m_truncatorWidth = width;
+        m_bestTruncatedAt = y;
+    }
+}
+
+}
similarity index 91%
rename from WebCore/rendering/RenderCanvas.h
rename to WebCore/rendering/RenderView.h
index 22fe52431696924bcbcc61c64c53810c9960137f..ceb14264488fa52848d2b5dd6342a1f5f860d101 100644 (file)
@@ -30,14 +30,14 @@ namespace WebCore {
 
 class FrameView;
 
-class RenderCanvas : public RenderBlock {
+class RenderView : public RenderBlock {
 public:
-    RenderCanvas(WebCore::Node* node, FrameView *view);
-    virtual ~RenderCanvas();
+    RenderView(WebCore::Node* node, FrameView *view);
+    virtual ~RenderView();
 
-    virtual const char *renderName() const { return "RenderCanvas"; }
+    virtual const char *renderName() const { return "RenderView"; }
 
-    virtual bool isCanvas() const { return true; }
+    virtual bool isRenderView() const { return true; }
 
     virtual void layout();
     virtual void calcWidth();
@@ -48,7 +48,7 @@ public:
     int docHeight() const;
     int docWidth() const;
 
-    FrameView *view() const { return m_view; }
+    FrameView* frameView() const { return m_frameView; }
 
     virtual bool hasOverhangingFloats() { return false; }
     
@@ -98,7 +98,7 @@ public:
 
 protected:
 
-    FrameView *m_view;
+    FrameView* m_frameView;
 
     RenderObject* m_selectionStart;
     RenderObject* m_selectionEnd;
index 59d8b8e5f00a438ad8b0fcf207bdced3ca21229a..7e1572e62388c1f5dc0802cc451af2257a3f1888 100644 (file)
@@ -29,7 +29,7 @@
 #include "EventNames.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 
 using namespace std;
 
@@ -51,7 +51,7 @@ RenderWidget::RenderWidget(Node* node)
     ASSERT(node);
     m_view = node->document()->view();
 
-    canvas()->addWidget(this);
+    view()->addWidget(this);
 
     // this is no real reference counting, its just there
     // to make sure that we're not deleted while we're recursed
@@ -67,7 +67,7 @@ void RenderWidget::destroy()
     // both RenderBox::destroy() and RenderObject::destroy().
     // Fix originally made for <rdar://problem/4228818>.
 
-    if (RenderCanvas *c = canvas())
+    if (RenderView *c = view())
         c->removeWidget(this);
 
     remove();
@@ -252,7 +252,7 @@ void RenderWidget::updateWidgetPosition()
     if (newBounds != oldBounds) {
         // The widget changed positions.  Update the frame geometry.
         if (checkForRepaintDuringLayout()) {
-            RenderCanvas* c = canvas();
+            RenderView* c = view();
             if (!c->printingMode()) {
                 c->repaintViewRectangle(oldBounds);
                 c->repaintViewRectangle(newBounds);
index d2d96063504bb92423c3ad39a6f3db1efc322959..1336ae97af7ffcd1b192d8d34acb231db962a3a5 100644 (file)
@@ -44,7 +44,6 @@ public:
     virtual void layout( );
 
     Widget* widget() const { return m_widget; }
-    FrameView* view() const { return m_view; }
 
     RenderArena* ref() { ++m_refCount; return renderArena(); }
     void deref(RenderArena*);
index 840501b440283402490fb0d49456c4ac0910102c..48ffd9dbd5c430dd4f710728d34c6890e4ced930 100644 (file)
@@ -29,7 +29,7 @@
 #include "FrameView.h"
 #include "InlineTextBox.h"
 #include "RenderArena.h"
-#include "RenderCanvas.h"
+#include "RenderView.h"
 #include "break_lines.h"
 #include <wtf/AlwaysInline.h>
 
@@ -1547,7 +1547,7 @@ IntRect RenderBlock::layoutInlineChildren(bool relayoutChildren)
                 // that the block really needed a full layout, we missed our chance to repaint the layer
                 // before layout started.  Luckily the layer has cached the repaint rect for its original
                 // position and size, and so we can use that to make a repaint happen now.
-                RenderCanvas* c = canvas();
+                RenderView* c = view();
                 if (c && !c->printingMode())
                     c->repaintViewRectangle(m_layer->repaintRect());
             }