2006-01-21 Anders Carlsson <andersca@mac.com>
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Jan 2006 01:03:42 +0000 (01:03 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Jan 2006 01:03:42 +0000 (01:03 +0000)
        Reviewed by David Hyatt.

        Rename Frame::xmlDocImpl => Frame::document and
        Frame::replaceDocImpl => Frame::setDocument

        * bridge/mac/MacFrame.mm:
        (MacFrame::findString):
        (MacFrame::advanceToNextMisspelling):
        (MacFrame::nextKeyViewInFrame):
        (MacFrame::nextKeyViewInFrameHierarchy):
        (MacFrame::keyEvent):
        (MacFrame::dispatchCPPEvent):
        (MacFrame::setDisplaysWithFocusAttributes):
        (MacFrame::bodyBackgroundColor):
        (MacFrame::markMisspellings):
        (MacFrame::respondToChangedSelection):
        (MacFrame::setMarkedTextRange):
        (MacFrame::dashboardRegionsDictionary):
        (MacFrame::shouldClose):
        * bridge/mac/WebCoreFrameBridge.mm:
        (updateRenderingForBindings):
        (frameHasSelection):
        (-[WebCoreFrameBridge addData:]):
        (-[WebCoreFrameBridge didNotOpenURL:pageCache:]):
        (-[WebCoreFrameBridge saveDocumentState]):
        (-[WebCoreFrameBridge restoreDocumentState]):
        (-[WebCoreFrameBridge saveDocumentToPageCache]):
        (-[WebCoreFrameBridge _documentTypeString]):
        (-[WebCoreFrameBridge deselectAll]):
        (-[WebCoreFrameBridge reapplyStylesForDeviceType:]):
        (nowPrinting):
        (-[WebCoreFrameBridge _setupRootForPrinting:]):
        (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
        (-[WebCoreFrameBridge copyDOMTree:]):
        (-[WebCoreFrameBridge URLWithAttributeString:]):
        (-[WebCoreFrameBridge unmarkAllMisspellings]):
        (-[WebCoreFrameBridge nextKeyView]):
        (-[WebCoreFrameBridge previousKeyView]):
        (-[WebCoreFrameBridge nextKeyViewInsideWebFrameViews]):
        (-[WebCoreFrameBridge previousKeyViewInsideWebFrameViews]):
        (-[WebCoreFrameBridge DOMDocument]):
        (-[WebCoreFrameBridge baseURL]):
        (-[WebCoreFrameBridge domain]):
        (-[WebCoreFrameBridge numPendingOrLoadingRequests]):
        (-[WebCoreFrameBridge doneProcessingData]):
        (-[WebCoreFrameBridge selectionColor]):
        (-[WebCoreFrameBridge accessibilityTree]):
        (-[WebCoreFrameBridge setSelectedDOMRange:affinity:closeTyping:]):
        (-[WebCoreFrameBridge convertToNSRange:]):
        (-[WebCoreFrameBridge convertToDOMRange:]):
        (-[WebCoreFrameBridge replaceMarkedTextWithText:]):
        (-[WebCoreFrameBridge smartDeleteRangeForProposedRange:]):
        (-[WebCoreFrameBridge documentFragmentWithMarkupString:baseURLString:]):
        (-[WebCoreFrameBridge documentFragmentWithText:]):
        (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]):
        (-[WebCoreFrameBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
        (-[WebCoreFrameBridge insertLineBreak]):
        (-[WebCoreFrameBridge insertParagraphSeparator]):
        (-[WebCoreFrameBridge insertParagraphSeparatorInQuotedContent]):
        (-[WebCoreFrameBridge insertText:selectInsertedText:]):
        (-[WebCoreFrameBridge moveSelectionToDragCaret:smartMove:]):
        (-[WebCoreFrameBridge deleteSelectionWithSmartDelete:]):
        (-[WebCoreFrameBridge deleteKeyPressedWithSmartDelete:]):
        (-[WebCoreFrameBridge forwardDeleteKeyPressedWithSmartDelete:]):
        * khtml/ecma/kjs_html.cpp:
        (KJS::KJS::HTMLDocument::putValueProperty):
        * khtml/ecma/kjs_window.cpp:
        (KJS::createNewWindow):
        (KJS::Window::getValueProperty):
        (KJS::Window::namedItemGetter):
        (KJS::Window::getOwnPropertySlot):
        (KJS::Window::put):
        (KJS::Window::isSafeScript):
        (KJS::Window::setListener):
        (KJS::Window::getListener):
        (KJS::WindowFunc::callAsFunction):
        (KJS::Window::updateLayout):
        (KJS::ScheduledAction::execute):
        (KJS::Location::put):
        (KJS::LocationFunc::callAsFunction):
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequestProtoFunc::callAsFunction):
        * khtml/editing/jsediting.cpp:
        * khtml/html/html_baseimpl.cpp:
        (WebCore::HTMLFrameElementImpl::contentDocument):
        * khtml/html/htmltokenizer.cpp:
        (WebCore::HTMLTokenizer::scriptExecution):
        * khtml/xml/DocumentImpl.cpp:
        (WebCore::DocumentImpl::parentDocument):
        * khtml/xsl/xslt_processorimpl.cpp:
        (DOM::XSLTProcessorImpl::createDocumentFromSource):
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject textUnderElement]):
        (-[KWQAccObject doAXTextMarkerForPosition:]):
        (-[KWQAccObject rendererForView:]):
        * kwq/KWQKJavaAppletWidget.mm:
        (KJavaAppletWidget::KJavaAppletWidget):
        * page/Frame.cpp:
        (Frame::document):
        (Frame::setDocument):
        (Frame::setFocusNodeIfNeeded):
        (Frame::isPointInsideSelection):
        (Frame::computeAndSetTypingStyle):
        (Frame::applyStyle):
        (Frame::applyParagraphStyle):
        (Frame::selectionComputedStyle):
        (Frame::selectFrameElementInParentIfFullySelected):
        (Frame::renderer):
        (Frame::scrollOverflow):
        (Frame::paint):
        (Frame::adjustPageHeight):
        (Frame::updatePolicyBaseURL):
        (Frame::setPolicyBaseURL):
        (Frame::forceLayoutWithPageWidthRange):
        (Frame::sendScrollEvent):
        (Frame::clearTimers):
        (Frame::styleForSelectionStart):
        (Frame::setSelectionFromNone):
        (Frame::setWindowHasFocus):
        (Frame::backslashAsCurrencySymbol):
        * page/Frame.h:
        * page/FrameView.cpp:
        (FrameView::~FrameView):
        (FrameView::clear):
        (FrameView::resizeEvent):
        (FrameView::adjustViewSize):
        (FrameView::layout):
        (FrameView::updateDashboardRegions):
        (FrameView::viewportMousePressEvent):
        (FrameView::viewportMouseDoubleClickEvent):
        (FrameView::viewportMouseMoveEvent):
        (FrameView::viewportMouseReleaseEvent):
        (FrameView::keyPressEvent):
        (FrameView::dispatchDragEvent):
        (FrameView::updateDragAndDrop):
        (FrameView::focusNextPrevNode):
        (FrameView::dispatchMouseEvent):
        (FrameView::viewportWheelEvent):
        (FrameView::timerEvent):
        (FrameView::scheduleRelayout):
        (FrameView::unscheduleRelayout):
        * rendering/render_frames.cpp:
        (WebCore::RenderPartObject::updateWidget):

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

17 files changed:
WebCore/ChangeLog
WebCore/bridge/mac/MacFrame.mm
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/khtml/ecma/kjs_html.cpp
WebCore/khtml/ecma/kjs_window.cpp
WebCore/khtml/ecma/xmlhttprequest.cpp
WebCore/khtml/editing/jsediting.cpp
WebCore/khtml/html/html_baseimpl.cpp
WebCore/khtml/html/htmltokenizer.cpp
WebCore/khtml/xml/DocumentImpl.cpp
WebCore/khtml/xsl/xslt_processorimpl.cpp
WebCore/kwq/KWQAccObject.mm
WebCore/kwq/KWQKJavaAppletWidget.mm
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/FrameView.cpp
WebCore/rendering/render_frames.cpp

index a217765..6be8d07 100644 (file)
@@ -1,3 +1,149 @@
+2006-01-21  Anders Carlsson  <andersca@mac.com>
+
+        Reviewed by David Hyatt.
+
+        Rename Frame::xmlDocImpl => Frame::document and
+        Frame::replaceDocImpl => Frame::setDocument
+        
+        * bridge/mac/MacFrame.mm:
+        (MacFrame::findString):
+        (MacFrame::advanceToNextMisspelling):
+        (MacFrame::nextKeyViewInFrame):
+        (MacFrame::nextKeyViewInFrameHierarchy):
+        (MacFrame::keyEvent):
+        (MacFrame::dispatchCPPEvent):
+        (MacFrame::setDisplaysWithFocusAttributes):
+        (MacFrame::bodyBackgroundColor):
+        (MacFrame::markMisspellings):
+        (MacFrame::respondToChangedSelection):
+        (MacFrame::setMarkedTextRange):
+        (MacFrame::dashboardRegionsDictionary):
+        (MacFrame::shouldClose):
+        * bridge/mac/WebCoreFrameBridge.mm:
+        (updateRenderingForBindings):
+        (frameHasSelection):
+        (-[WebCoreFrameBridge addData:]):
+        (-[WebCoreFrameBridge didNotOpenURL:pageCache:]):
+        (-[WebCoreFrameBridge saveDocumentState]):
+        (-[WebCoreFrameBridge restoreDocumentState]):
+        (-[WebCoreFrameBridge saveDocumentToPageCache]):
+        (-[WebCoreFrameBridge _documentTypeString]):
+        (-[WebCoreFrameBridge deselectAll]):
+        (-[WebCoreFrameBridge reapplyStylesForDeviceType:]):
+        (nowPrinting):
+        (-[WebCoreFrameBridge _setupRootForPrinting:]):
+        (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
+        (-[WebCoreFrameBridge copyDOMTree:]):
+        (-[WebCoreFrameBridge URLWithAttributeString:]):
+        (-[WebCoreFrameBridge unmarkAllMisspellings]):
+        (-[WebCoreFrameBridge nextKeyView]):
+        (-[WebCoreFrameBridge previousKeyView]):
+        (-[WebCoreFrameBridge nextKeyViewInsideWebFrameViews]):
+        (-[WebCoreFrameBridge previousKeyViewInsideWebFrameViews]):
+        (-[WebCoreFrameBridge DOMDocument]):
+        (-[WebCoreFrameBridge baseURL]):
+        (-[WebCoreFrameBridge domain]):
+        (-[WebCoreFrameBridge numPendingOrLoadingRequests]):
+        (-[WebCoreFrameBridge doneProcessingData]):
+        (-[WebCoreFrameBridge selectionColor]):
+        (-[WebCoreFrameBridge accessibilityTree]):
+        (-[WebCoreFrameBridge setSelectedDOMRange:affinity:closeTyping:]):
+        (-[WebCoreFrameBridge convertToNSRange:]):
+        (-[WebCoreFrameBridge convertToDOMRange:]):
+        (-[WebCoreFrameBridge replaceMarkedTextWithText:]):
+        (-[WebCoreFrameBridge smartDeleteRangeForProposedRange:]):
+        (-[WebCoreFrameBridge documentFragmentWithMarkupString:baseURLString:]):
+        (-[WebCoreFrameBridge documentFragmentWithText:]):
+        (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]):
+        (-[WebCoreFrameBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
+        (-[WebCoreFrameBridge insertLineBreak]):
+        (-[WebCoreFrameBridge insertParagraphSeparator]):
+        (-[WebCoreFrameBridge insertParagraphSeparatorInQuotedContent]):
+        (-[WebCoreFrameBridge insertText:selectInsertedText:]):
+        (-[WebCoreFrameBridge moveSelectionToDragCaret:smartMove:]):
+        (-[WebCoreFrameBridge deleteSelectionWithSmartDelete:]):
+        (-[WebCoreFrameBridge deleteKeyPressedWithSmartDelete:]):
+        (-[WebCoreFrameBridge forwardDeleteKeyPressedWithSmartDelete:]):
+        * khtml/ecma/kjs_html.cpp:
+        (KJS::KJS::HTMLDocument::putValueProperty):
+        * khtml/ecma/kjs_window.cpp:
+        (KJS::createNewWindow):
+        (KJS::Window::getValueProperty):
+        (KJS::Window::namedItemGetter):
+        (KJS::Window::getOwnPropertySlot):
+        (KJS::Window::put):
+        (KJS::Window::isSafeScript):
+        (KJS::Window::setListener):
+        (KJS::Window::getListener):
+        (KJS::WindowFunc::callAsFunction):
+        (KJS::Window::updateLayout):
+        (KJS::ScheduledAction::execute):
+        (KJS::Location::put):
+        (KJS::LocationFunc::callAsFunction):
+        * khtml/ecma/xmlhttprequest.cpp:
+        (KJS::XMLHttpRequestProtoFunc::callAsFunction):
+        * khtml/editing/jsediting.cpp:
+        * khtml/html/html_baseimpl.cpp:
+        (WebCore::HTMLFrameElementImpl::contentDocument):
+        * khtml/html/htmltokenizer.cpp:
+        (WebCore::HTMLTokenizer::scriptExecution):
+        * khtml/xml/DocumentImpl.cpp:
+        (WebCore::DocumentImpl::parentDocument):
+        * khtml/xsl/xslt_processorimpl.cpp:
+        (DOM::XSLTProcessorImpl::createDocumentFromSource):
+        * kwq/KWQAccObject.mm:
+        (-[KWQAccObject textUnderElement]):
+        (-[KWQAccObject doAXTextMarkerForPosition:]):
+        (-[KWQAccObject rendererForView:]):
+        * kwq/KWQKJavaAppletWidget.mm:
+        (KJavaAppletWidget::KJavaAppletWidget):
+        * page/Frame.cpp:
+        (Frame::document):
+        (Frame::setDocument):
+        (Frame::setFocusNodeIfNeeded):
+        (Frame::isPointInsideSelection):
+        (Frame::computeAndSetTypingStyle):
+        (Frame::applyStyle):
+        (Frame::applyParagraphStyle):
+        (Frame::selectionComputedStyle):
+        (Frame::selectFrameElementInParentIfFullySelected):
+        (Frame::renderer):
+        (Frame::scrollOverflow):
+        (Frame::paint):
+        (Frame::adjustPageHeight):
+        (Frame::updatePolicyBaseURL):
+        (Frame::setPolicyBaseURL):
+        (Frame::forceLayoutWithPageWidthRange):
+        (Frame::sendScrollEvent):
+        (Frame::clearTimers):
+        (Frame::styleForSelectionStart):
+        (Frame::setSelectionFromNone):
+        (Frame::setWindowHasFocus):
+        (Frame::backslashAsCurrencySymbol):
+        * page/Frame.h:
+        * page/FrameView.cpp:
+        (FrameView::~FrameView):
+        (FrameView::clear):
+        (FrameView::resizeEvent):
+        (FrameView::adjustViewSize):
+        (FrameView::layout):
+        (FrameView::updateDashboardRegions):
+        (FrameView::viewportMousePressEvent):
+        (FrameView::viewportMouseDoubleClickEvent):
+        (FrameView::viewportMouseMoveEvent):
+        (FrameView::viewportMouseReleaseEvent):
+        (FrameView::keyPressEvent):
+        (FrameView::dispatchDragEvent):
+        (FrameView::updateDragAndDrop):
+        (FrameView::focusNextPrevNode):
+        (FrameView::dispatchMouseEvent):
+        (FrameView::viewportWheelEvent):
+        (FrameView::timerEvent):
+        (FrameView::scheduleRelayout):
+        (FrameView::unscheduleRelayout):
+        * rendering/render_frames.cpp:
+        (WebCore::RenderPartObject::updateWidget):
+
 2006-01-20  mrmacwow  <cpetersen@apple.com>
 
         Reviewed by eseidel.
index 6ba2f36..7892469 100644 (file)
@@ -442,7 +442,7 @@ bool MacFrame::findString(NSString *string, bool forward, bool caseFlag, bool wr
     }
     
     // Initially search from the start (if forward) or end (if backward) of the selection, and search to edge of document.
-    RefPtr<RangeImpl> searchRange(rangeOfContents(xmlDocImpl()));
+    RefPtr<RangeImpl> searchRange(rangeOfContents(document()));
     if (selection().start().node()) {
         if (forward) {
             setStart(searchRange.get(), VisiblePosition(selection().start(), selection().affinity()));
@@ -454,7 +454,7 @@ bool MacFrame::findString(NSString *string, bool forward, bool caseFlag, bool wr
     
     // If we re-found the (non-empty) selected range, then search again starting just past the selected range.
     if (selection().start().node() && *resultRange == *selection().toRange()) {
-        searchRange = rangeOfContents(xmlDocImpl());
+        searchRange = rangeOfContents(document());
         if (forward) {
             setStart(searchRange.get(), VisiblePosition(selection().end(), selection().affinity()));
         } else {
@@ -468,7 +468,7 @@ bool MacFrame::findString(NSString *string, bool forward, bool caseFlag, bool wr
     // if we didn't find anything and we're wrapping, search again in the entire document (this will
     // redundantly re-search the area already searched in some cases).
     if (resultRange->collapsed(exception) && wrapFlag) {
-        searchRange = rangeOfContents(xmlDocImpl());
+        searchRange = rangeOfContents(document());
         resultRange = findPlainText(searchRange.get(), target, forward, caseFlag);
         // We used to return false here if we ended up with the same range that we started with
         // (e.g., the selection was already the only instance of this text). But we decided that
@@ -751,7 +751,7 @@ QString MacFrame::advanceToNextMisspelling(bool startBeforeSelection)
     
     // Start at the end of the selection, search to edge of document.  Starting at the selection end makes
     // repeated "check spelling" commands work.
-    RefPtr<RangeImpl> searchRange(rangeOfContents(xmlDocImpl()));
+    RefPtr<RangeImpl> searchRange(rangeOfContents(document()));
     bool startedWithSelection = false;
     if (selection().start().node()) {
         startedWithSelection = true;
@@ -818,7 +818,7 @@ QString MacFrame::advanceToNextMisspelling(bool startBeforeSelection)
                 if (misspelling.length > 0) {
                     // Build up result range and string.  Note the misspelling may span many text nodes,
                     // but the CharIterator insulates us from this complexity
-                    RefPtr<RangeImpl> misspellingRange(rangeOfContents(xmlDocImpl()));
+                    RefPtr<RangeImpl> misspellingRange(rangeOfContents(document()));
                     CharacterIterator chars(it.range().get());
                     chars.advance(misspelling.location);
                     misspellingRange->setStart(chars.range()->startContainer(exception), chars.range()->startOffset(exception), exception);
@@ -828,7 +828,7 @@ QString MacFrame::advanceToNextMisspelling(bool startBeforeSelection)
                     setSelection(SelectionController(misspellingRange.get(), DOWNSTREAM));
                     revealSelection();
                     // Mark misspelling in document.
-                    xmlDocImpl()->addMarker(misspellingRange.get(), DocumentMarker::Spelling);
+                    document()->addMarker(misspellingRange.get(), DocumentMarker::Spelling);
                     return result;
                 }
             }
@@ -960,7 +960,7 @@ QString MacFrame::mimeTypeForFileName(const QString &fileName) const
 
 NSView *MacFrame::nextKeyViewInFrame(NodeImpl *node, KWQSelectionDirection direction)
 {
-    DocumentImpl *doc = xmlDocImpl();
+    DocumentImpl *doc = document();
     if (!doc) {
         return nil;
     }
@@ -1004,7 +1004,7 @@ NSView *MacFrame::nextKeyViewInFrameHierarchy(NodeImpl *node, KWQSelectionDirect
     
     // remove focus from currently focused node if we're giving focus to another view
     if (next && (next != [_bridge documentView])) {
-        DocumentImpl *doc = xmlDocImpl();
+        DocumentImpl *doc = document();
         if (doc) {
             doc->setFocusNode(0);
         }            
@@ -1441,7 +1441,7 @@ bool MacFrame::keyEvent(NSEvent *event)
 
     // Check for cases where we are too early for events -- possible unmatched key up
     // from pressing return in the location bar.
-    DocumentImpl *doc = xmlDocImpl();
+    DocumentImpl *doc = document();
     if (!doc) {
         return false;
     }
@@ -1859,8 +1859,8 @@ void MacFrame::khtmlMouseMoveEvent(MouseMoveEvent *event)
 bool MacFrame::dispatchCPPEvent(const AtomicString &eventType, KWQClipboard::AccessPolicy policy)
 {
     NodeImpl *target = d->m_selection.start().element();
-    if (!target && xmlDocImpl()) {
-        target = xmlDocImpl()->body();
+    if (!target && document()) {
+        target = document()->body();
     }
     if (!target) {
         return true;
@@ -3045,7 +3045,7 @@ void MacFrame::setDisplaysWithFocusAttributes(bool flag)
     setCaretVisible(flag);
     
     // 3. The drawing of a focus ring around links in web pages.
-    DocumentImpl *doc = xmlDocImpl();
+    DocumentImpl *doc = document();
     if (doc) {
         NodeImpl *node = doc->focusNode();
         if (node) {
@@ -3071,8 +3071,8 @@ void MacFrame::setDisplaysWithFocusAttributes(bool flag)
 
 NSColor *MacFrame::bodyBackgroundColor() const
 {
-    if (xmlDocImpl() && xmlDocImpl()->body() && xmlDocImpl()->body()->renderer()) {
-        QColor bgColor = xmlDocImpl()->body()->renderer()->style()->backgroundColor();
+    if (document() && document()->body() && document()->body()->renderer()) {
+        QColor bgColor = document()->body()->renderer()->style()->backgroundColor();
         if (bgColor.isValid()) {
             return nsColor(bgColor);
         }
@@ -3310,14 +3310,14 @@ void MacFrame::markMisspellings(const SelectionController &selection)
                 else {
                     // Build up result range and string.  Note the misspelling may span many text nodes,
                     // but the CharIterator insulates us from this complexity
-                    RefPtr<RangeImpl> misspellingRange(rangeOfContents(xmlDocImpl()));
+                    RefPtr<RangeImpl> misspellingRange(rangeOfContents(document()));
                     CharacterIterator chars(it.range().get());
                     chars.advance(misspelling.location);
                     misspellingRange->setStart(chars.range()->startContainer(exception), chars.range()->startOffset(exception), exception);
                     chars.advance(misspelling.length);
                     misspellingRange->setEnd(chars.range()->startContainer(exception), chars.range()->startOffset(exception), exception);
                     // Mark misspelling in document.
-                    xmlDocImpl()->addMarker(misspellingRange.get(), DocumentMarker::Spelling);
+                    document()->addMarker(misspellingRange.get(), DocumentMarker::Spelling);
                     startIndex = misspelling.location + misspelling.length;
                 }
             }
@@ -3330,7 +3330,7 @@ void MacFrame::markMisspellings(const SelectionController &selection)
 
 void MacFrame::respondToChangedSelection(const SelectionController &oldSelection, bool closeTyping)
 {
-    if (xmlDocImpl()) {
+    if (document()) {
         if ([_bridge isContinuousSpellCheckingEnabled]) {
             SelectionController oldAdjacentWords = SelectionController();
             
@@ -3359,11 +3359,11 @@ void MacFrame::respondToChangedSelection(const SelectionController &oldSelection
 
                 // This only erases a marker in the first word of the selection.
                 // Perhaps peculiar, but it matches AppKit.
-                xmlDocImpl()->removeMarkers(newAdjacentWords.toRange().get(), DocumentMarker::Spelling);
+                document()->removeMarkers(newAdjacentWords.toRange().get(), DocumentMarker::Spelling);
             }
         } else {
             // When continuous spell checking is off, no markers appear after the selection changes.
-            xmlDocImpl()->removeMarkers(DocumentMarker::Spelling);
+            document()->removeMarkers(DocumentMarker::Spelling);
         }
     }
 
@@ -3451,7 +3451,7 @@ void MacFrame::setMarkedTextRange(const RangeImpl *range, NSArray *attributes, N
         m_markedTextUnderlines = convertAttributesToUnderlines(range, attributes, ranges);
     }
 
-    if (m_markedTextRange.get() && xmlDocImpl() && m_markedTextRange->startContainer(exception)->renderer())
+    if (m_markedTextRange.get() && document() && m_markedTextRange->startContainer(exception)->renderer())
         m_markedTextRange->startContainer(exception)->renderer()->repaint();
 
     if ( range && range->collapsed(exception) ) {
@@ -3460,7 +3460,7 @@ void MacFrame::setMarkedTextRange(const RangeImpl *range, NSArray *attributes, N
         m_markedTextRange = const_cast<RangeImpl *>(range);
     }
 
-    if (m_markedTextRange.get() && xmlDocImpl() && m_markedTextRange->startContainer(exception)->renderer()) {
+    if (m_markedTextRange.get() && document() && m_markedTextRange->startContainer(exception)->renderer()) {
         m_markedTextRange->startContainer(exception)->renderer()->repaint();
     }
 }
@@ -3477,7 +3477,7 @@ void MacFrame::didFirstLayout()
 
 NSMutableDictionary *MacFrame::dashboardRegionsDictionary()
 {
-    DocumentImpl *doc = xmlDocImpl();
+    DocumentImpl *doc = document();
     if (!doc) {
         return nil;
     }
@@ -3545,19 +3545,19 @@ bool MacFrame::shouldClose()
     if (![_bridge canRunBeforeUnloadConfirmPanel])
         return true;
 
-    RefPtr<DocumentImpl> document = xmlDocImpl();
-    if (!document)
+    RefPtr<DocumentImpl> doc = document();
+    if (!doc)
         return true;
-    HTMLElementImpl* body = document->body();
+    HTMLElementImpl* body = doc->body();
     if (!body)
         return true;
 
     RefPtr<BeforeUnloadEventImpl> event = new BeforeUnloadEventImpl;
-    event->setTarget(document.get());
+    event->setTarget(doc.get());
     int exception = 0;
     body->dispatchGenericEvent(event.get(), exception);
-    if (!event->defaultPrevented() && document)
-        document->defaultEventHandler(event.get());
+    if (!event->defaultPrevented() && doc)
+        doc->defaultEventHandler(event.get());
     if (event->result().isNull())
         return true;
 
index 15bab33..58ceeb8 100644 (file)
@@ -151,7 +151,7 @@ static void updateRenderingForBindings (ExecState *exec, JSObject *rootObject)
     if (!window)
         return;
         
-    DocumentImpl *doc = static_cast<DocumentImpl*>(window->frame()->xmlDocImpl());
+    DocumentImpl *doc = static_cast<DocumentImpl*>(window->frame()->document());
     if (doc)
         doc->updateRendering();
 }
@@ -169,7 +169,7 @@ static BOOL frameHasSelection(WebCoreFrameBridge *bridge)
         return NO;
 
     // If a part has a selection, it should also have a document.        
-    ASSERT(frame->xmlDocImpl());
+    ASSERT(frame->document());
 
     return YES;
 }
@@ -626,7 +626,7 @@ static bool initializedKJS = FALSE;
 
 - (void)addData:(NSData *)data
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     
     // Document may be nil if the part is about to redirect
     // as a result of JS executing during load, i.e. one frame
@@ -655,7 +655,7 @@ static bool initializedKJS = FALSE;
     // We might have made a page cache item, but now we're bailing out due to an error before we ever
     // transitioned to the new page (before WebFrameState==commit).  The goal here is to restore any state
     // so that the existing view (that wenever got far enough to replace) can continue being used.
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (doc) {
         doc->setInPageCache(NO);
     }
@@ -675,7 +675,7 @@ static bool initializedKJS = FALSE;
 
 - (void)saveDocumentState
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (doc != 0){
         QStringList list = doc->docState();
         NSMutableArray *documentState = [[[NSMutableArray alloc] init] autorelease];
@@ -690,7 +690,7 @@ static bool initializedKJS = FALSE;
 
 - (void)restoreDocumentState
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     
     if (doc != 0){
         NSArray *documentState = [self documentState];
@@ -725,7 +725,7 @@ static bool initializedKJS = FALSE;
 
 - (BOOL)saveDocumentToPageCache
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (!doc)
         return NO;
     if (!doc->view())
@@ -829,7 +829,7 @@ static bool initializedKJS = FALSE;
 - (NSString *)_documentTypeString
 {
     NSString *documentTypeString = nil;
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (doc) {
         DocumentTypeImpl *doctype = doc->realDocType();
         if (doctype) {
@@ -906,7 +906,7 @@ static bool initializedKJS = FALSE;
 - (void)deselectAll
 {
     [self deselectText];
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (doc) {
         doc->setFocusNode(0);
     }
@@ -926,7 +926,7 @@ static bool initializedKJS = FALSE;
 - (void)reapplyStylesForDeviceType:(WebCoreDeviceType)deviceType
 {
     m_frame->setMediaType(deviceType == WebCoreDeviceScreen ? "screen" : "print");
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (doc) {
         static QPaintDevice screen;
         static QPrinter printer;
@@ -937,7 +937,7 @@ static bool initializedKJS = FALSE;
 
 static BOOL nowPrinting(WebCoreFrameBridge *self)
 {
-    DocumentImpl *doc = self->m_frame->xmlDocImpl();
+    DocumentImpl *doc = self->m_frame->document();
     return doc && doc->paintDevice() && doc->paintDevice()->devType() == QInternal::Printer;
 }
 
@@ -945,7 +945,7 @@ static BOOL nowPrinting(WebCoreFrameBridge *self)
 - (void)_setupRootForPrinting:(BOOL)onOrOff
 {
     if (nowPrinting(self)) {
-        RenderCanvas *root = static_cast<RenderCanvas *>(m_frame->xmlDocImpl()->renderer());
+        RenderCanvas *root = static_cast<RenderCanvas *>(m_frame->document()->renderer());
         if (root) {
             root->setPrintingMode(onOrOff);
         }
@@ -1012,8 +1012,8 @@ static BOOL nowPrinting(WebCoreFrameBridge *self)
         return pages;
     }
 
-    if (!m_frame || !m_frame->xmlDocImpl() || !m_frame->view()) return pages;
-    RenderCanvas* root = static_cast<RenderCanvas *>(m_frame->xmlDocImpl()->renderer());
+    if (!m_frame || !m_frame->document() || !m_frame->view()) return pages;
+    RenderCanvas* root = static_cast<RenderCanvas *>(m_frame->document()->renderer());
     if (!root) return pages;
     
     FrameView* view = m_frame->view();
@@ -1065,7 +1065,7 @@ static BOOL nowPrinting(WebCoreFrameBridge *self)
 
 - (NSObject *)copyDOMTree:(id <WebCoreDOMTreeCopier>)copier
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (!doc) {
         return nil;
     }
@@ -1411,7 +1411,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (NSURL *)URLWithAttributeString:(NSString *)string
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (!doc) {
         return nil;
     }
@@ -1436,7 +1436,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (void)unmarkAllMisspellings
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (!doc) {
         return;
     }
@@ -1459,7 +1459,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (NSView *)nextKeyView
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (!doc) {
         return nil;
     }
@@ -1468,7 +1468,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (NSView *)previousKeyView
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (!doc) {
         return nil;
     }
@@ -1477,7 +1477,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (NSView *)nextKeyViewInsideWebFrameViews
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (!doc) {
         return nil;
     }
@@ -1487,7 +1487,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (NSView *)previousKeyViewInsideWebFrameViews
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (!doc) {
         return nil;
     }
@@ -1519,7 +1519,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (DOMDocument *)DOMDocument
 {
-    return [DOMDocument _documentWithImpl:m_frame->xmlDocImpl()];
+    return [DOMDocument _documentWithImpl:m_frame->document()];
 }
 
 - (DOMHTMLElement *)frameElement
@@ -1632,7 +1632,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (NSURL *)baseURL
 {
-    return m_frame->completeURL(m_frame->xmlDocImpl()->baseURL()).getNSURL();
+    return m_frame->completeURL(m_frame->document()->baseURL()).getNSURL();
 }
 
 - (NSString *)referrer
@@ -1642,7 +1642,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (NSString *)domain
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (doc && doc->isHTMLDocument()) {
         return doc->domain().qstring().getNSString();
     }
@@ -1731,7 +1731,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (int)numPendingOrLoadingRequests
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     
     if (doc)
         return KWQNumberOfPendingOrLoadingRequests (doc->docLoader());
@@ -1740,7 +1740,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (BOOL)doneProcessingData
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (doc) {
         Tokenizer* tok = doc->tokenizer();
         if (tok)
@@ -1761,7 +1761,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (NSColor *)selectionColor
 {
-    RenderCanvas* root = static_cast<RenderCanvas *>(m_frame->xmlDocImpl()->renderer());
+    RenderCanvas* root = static_cast<RenderCanvas *>(m_frame->document()->renderer());
     if (root) {
         RenderStyle *pseudoStyle = root->getPseudoStyle(RenderStyle::SELECTION);
         if (pseudoStyle && pseudoStyle->backgroundColor().isValid()) {
@@ -1781,10 +1781,10 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 -(id)accessibilityTree
 {
     KWQAccObjectCache::enableAccessibility();
-    if (!m_frame || !m_frame->xmlDocImpl()) return nil;
-    RenderCanvas* root = static_cast<RenderCanvas *>(m_frame->xmlDocImpl()->renderer());
+    if (!m_frame || !m_frame->document()) return nil;
+    RenderCanvas* root = static_cast<RenderCanvas *>(m_frame->document()->renderer());
     if (!root) return nil;
-    return m_frame->xmlDocImpl()->getAccObjectCache()->accObject(root);
+    return m_frame->document()->getAccObjectCache()->accObject(root);
 }
 
 - (void)setDrawsBackground:(BOOL)drawsBackground
@@ -1920,7 +1920,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     ASSERT(startContainer->getDocument());
     ASSERT(startContainer->getDocument() == endContainer->getDocument());
     
-    m_frame->xmlDocImpl()->updateLayoutIgnorePendingStylesheets();
+    m_frame->document()->updateLayoutIgnorePendingStylesheets();
 
     EAffinity affinity = static_cast<EAffinity>(selectionAffinity);
     
@@ -1947,7 +1947,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
         return NSMakeRange(NSNotFound, 0);
     }
 
-    RefPtr<RangeImpl> fromStartRange(m_frame->xmlDocImpl()->createRange());
+    RefPtr<RangeImpl> fromStartRange(m_frame->document()->createRange());
     int exception = 0;
 
     fromStartRange->setEnd(range->startContainer(exception), range->startOffset(exception), exception);
@@ -1966,7 +1966,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     if (nsrange.length > INT_MAX || nsrange.location + nsrange.length > INT_MAX)
         nsrange.length = INT_MAX - nsrange.location;
 
-    return TextIterator::rangeFromLocationAndLength(m_frame->xmlDocImpl(), nsrange.location, nsrange.length);
+    return TextIterator::rangeFromLocationAndLength(m_frame->document(), nsrange.location, nsrange.length);
 }
 
 - (DOMRange *)convertNSRangeToDOMRange:(NSRange)nsrange
@@ -2029,10 +2029,10 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
     RangeImpl *markedTextRange = m_frame->markedTextRange();
     if (markedTextRange && !markedTextRange->collapsed(exception))
-        TypingCommand::deleteKeyPressed(m_frame->xmlDocImpl(), NO);
+        TypingCommand::deleteKeyPressed(m_frame->document(), NO);
     
     if ([text length] > 0)
-        TypingCommand::insertText(m_frame->xmlDocImpl(), text, YES);
+        TypingCommand::insertText(m_frame->document(), text, YES);
     
     [self ensureSelectionVisible];
 }
@@ -2069,7 +2069,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     ASSERT(startContainer->getDocument());
     ASSERT(startContainer->getDocument() == endContainer->getDocument());
     
-    m_frame->xmlDocImpl()->updateLayoutIgnorePendingStylesheets();
+    m_frame->document()->updateLayoutIgnorePendingStylesheets();
 
     Position start(startContainer, [proposedRange startOffset]);
     Position end(endContainer, [proposedRange endOffset]);
@@ -2080,7 +2080,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     if (newEnd.isNull())
         newEnd = end;
 
-    RangeImpl *range = m_frame->xmlDocImpl()->createRange();
+    RangeImpl *range = m_frame->document()->createRange();
     int exception = 0;
     range->setStart(newStart.node(), newStart.offset(), exception);
     range->setEnd(newStart.node(), newStart.offset(), exception);
@@ -2153,10 +2153,10 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 
 - (DOMDocumentFragment *)documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString 
 {
-    if (!m_frame || !m_frame->xmlDocImpl())
+    if (!m_frame || !m_frame->document())
         return 0;
 
-    PassRefPtr<DocumentFragmentImpl> fragment = createFragmentFromMarkup(m_frame->xmlDocImpl(), QString::fromNSString(markupString), QString::fromNSString(baseURLString));
+    PassRefPtr<DocumentFragmentImpl> fragment = createFragmentFromMarkup(m_frame->document(), QString::fromNSString(markupString), QString::fromNSString(baseURLString));
     return [DOMDocumentFragment _documentFragmentWithImpl:fragment.get()];
 }
 
@@ -2165,7 +2165,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     if (!frameHasSelection(self) || !text)
         return 0;
     
-    return [DOMDocumentFragment _documentFragmentWithImpl:createFragmentFromText(m_frame->xmlDocImpl(), QString::fromNSString(text)).get()];
+    return [DOMDocumentFragment _documentFragmentWithImpl:createFragmentFromText(m_frame->document(), QString::fromNSString(text)).get()];
 }
 
 - (DOMDocumentFragment *)documentFragmentWithNodesAsParagraphs:(NSArray *)nodes
@@ -2174,14 +2174,14 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     DOMNode *node;
     QPtrList<NodeImpl> nodeList;
     
-    if (!m_frame || !m_frame->xmlDocImpl())
+    if (!m_frame || !m_frame->document())
         return 0;
     
     while ((node = [nodeEnum nextObject])) {
         nodeList.append([node _nodeImpl]);
     }
     
-    return [DOMDocumentFragment _documentFragmentWithImpl:createFragmentFromNodeList(m_frame->xmlDocImpl(), nodeList).get()];
+    return [DOMDocumentFragment _documentFragmentWithImpl:createFragmentFromNodeList(m_frame->document(), nodeList).get()];
 }
 
 - (void)replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle
@@ -2189,7 +2189,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     if (!frameHasSelection(self) || !fragment)
         return;
     
-    EditCommandPtr(new ReplaceSelectionCommand(m_frame->xmlDocImpl(), [fragment _fragmentImpl], selectReplacement, smartReplace, matchStyle)).apply();
+    EditCommandPtr(new ReplaceSelectionCommand(m_frame->document(), [fragment _fragmentImpl], selectReplacement, smartReplace, matchStyle)).apply();
     [self ensureSelectionVisible];
 }
 
@@ -2216,7 +2216,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     if (!frameHasSelection(self))
         return;
     
-    TypingCommand::insertLineBreak(m_frame->xmlDocImpl());
+    TypingCommand::insertLineBreak(m_frame->document());
     [self ensureSelectionVisible];
 }
 
@@ -2225,7 +2225,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     if (!frameHasSelection(self))
         return;
     
-    TypingCommand::insertParagraphSeparator(m_frame->xmlDocImpl());
+    TypingCommand::insertParagraphSeparator(m_frame->document());
     [self ensureSelectionVisible];
 }
 
@@ -2234,7 +2234,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     if (!frameHasSelection(self))
         return;
     
-    TypingCommand::insertParagraphSeparatorInQuotedContent(m_frame->xmlDocImpl());
+    TypingCommand::insertParagraphSeparatorInQuotedContent(m_frame->document());
     [self ensureSelectionVisible];
 }
 
@@ -2243,7 +2243,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     if (!frameHasSelection(self))
         return;
     
-    TypingCommand::insertText(m_frame->xmlDocImpl(), text, selectInsertedText);
+    TypingCommand::insertText(m_frame->document(), text, selectInsertedText);
     [self ensureSelectionVisible];
 }
 
@@ -2255,7 +2255,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
 - (void)moveSelectionToDragCaret:(DOMDocumentFragment *)selectionFragment smartMove:(BOOL)smartMove
 {
     Position base = m_frame->dragCaret().base();
-    EditCommandPtr(new MoveSelectionCommand(m_frame->xmlDocImpl(), [selectionFragment _fragmentImpl], base, smartMove)).apply();
+    EditCommandPtr(new MoveSelectionCommand(m_frame->document(), [selectionFragment _fragmentImpl], base, smartMove)).apply();
 }
 
 - (VisiblePosition)_visiblePositionForPoint:(NSPoint)point
@@ -2326,24 +2326,24 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     if (!frameHasSelection(self))
         return;
     
-    EditCommandPtr(new DeleteSelectionCommand(m_frame->xmlDocImpl(), smartDelete)).apply();
+    EditCommandPtr(new DeleteSelectionCommand(m_frame->document(), smartDelete)).apply();
 }
 
 - (void)deleteKeyPressedWithSmartDelete:(BOOL)smartDelete
 {
-    if (!m_frame || !m_frame->xmlDocImpl())
+    if (!m_frame || !m_frame->document())
         return;
     
-    TypingCommand::deleteKeyPressed(m_frame->xmlDocImpl(), smartDelete);
+    TypingCommand::deleteKeyPressed(m_frame->document(), smartDelete);
     [self ensureSelectionVisible];
 }
 
 - (void)forwardDeleteKeyPressedWithSmartDelete:(BOOL)smartDelete
 {
-    if (!m_frame || !m_frame->xmlDocImpl())
+    if (!m_frame || !m_frame->document())
         return;
     
-    TypingCommand::forwardDeleteKeyPressed(m_frame->xmlDocImpl(), smartDelete);
+    TypingCommand::forwardDeleteKeyPressed(m_frame->document(), smartDelete);
     [self ensureSelectionVisible];
 }
 
index d0e9265..05a3b9d 100644 (file)
@@ -378,7 +378,7 @@ void KJS::HTMLDocument::putValueProperty(ExecState *exec, int token, JSValue *va
       // the target frame.
       Frame *activePart = static_cast<KJS::ScriptInterpreter *>( exec->dynamicInterpreter() )->frame();
       if (activePart)
-        str = activePart->xmlDocImpl()->completeURL(str);
+        str = activePart->document()->completeURL(str);
 
       // We want a new history item if this JS was called via a user gesture
       bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
index fbba18d..59117e0 100644 (file)
@@ -566,7 +566,7 @@ static Frame *createNewWindow(ExecState *exec, Window *openerWindow, const QStri
     if (dialogArgs)
         newWindow->putDirect("dialogArguments", dialogArgs);
 
-    DocumentImpl *activeDoc = activePart ? activePart->xmlDocImpl() : 0;
+    DocumentImpl *activeDoc = activePart ? activePart->document() : 0;
     if (!URL.isEmpty() && activeDoc) {
         QString completedURL = activeDoc->completeURL(URL);
         if (!completedURL.startsWith("javascript:", false) || newWindow->isSafeScript(exec)) {
@@ -801,15 +801,15 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
     case Image:
       // FIXME: this property (and the few below) probably shouldn't create a new object every
       // time
-      return new ImageConstructorImp(exec, m_frame->xmlDocImpl());
+      return new ImageConstructorImp(exec, m_frame->document());
     case Option:
-      return new OptionConstructorImp(exec, m_frame->xmlDocImpl());
+      return new OptionConstructorImp(exec, m_frame->document());
     case XMLHttpRequest:
-      return new XMLHttpRequestConstructorImp(exec, m_frame->xmlDocImpl());
+      return new XMLHttpRequestConstructorImp(exec, m_frame->document());
     case XMLSerializer:
       return new XMLSerializerConstructorImp(exec);
     case DOMParser:
-      return new DOMParserConstructorImp(exec, m_frame->xmlDocImpl());
+      return new DOMParserConstructorImp(exec, m_frame->document());
 #ifdef KHTML_XSLT
     case XSLTProcessor:
       return new XSLTProcessorConstructorImp(exec);
@@ -818,7 +818,7 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
       return jsUndefined();
 #endif
     case FrameElement:
-      if (DocumentImpl *doc = m_frame->xmlDocImpl())
+      if (DocumentImpl *doc = m_frame->document())
         if (ElementImpl *fe = doc->ownerElement())
           if (checkNodeSecurity(exec, fe)) {
             return getDOMNode(exec, fe);
@@ -831,13 +831,13 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
 
    switch (token) {
    case Document:
-     if (!m_frame->xmlDocImpl()) {
+     if (!m_frame->document()) {
        m_frame->createEmptyDocument();
        m_frame->begin();
        m_frame->write("<HTML><BODY>");
        m_frame->end();
      }
-     return getDOMNode(exec, m_frame->xmlDocImpl());
+     return getDOMNode(exec, m_frame->document());
    case Onabort:
      return getListener(exec, abortEvent);
    case Onblur:
@@ -923,7 +923,7 @@ JSValue *Window::indexGetter(ExecState *exec, JSObject *originalObject, const Id
 JSValue *Window::namedItemGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
 {
   Window *thisObj = static_cast<Window *>(slot.slotBase());
-  DocumentImpl *doc = thisObj->m_frame->xmlDocImpl();
+  DocumentImpl *doc = thisObj->m_frame->document();
   assert(thisObj->isSafeScript(exec) && doc && doc->isHTMLDocument());
 
   DOMString name = propertyName.domString();
@@ -1019,7 +1019,7 @@ bool Window::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName,
   }
 
   // allow shortcuts like 'Image1' instead of document.images.Image1
-  DocumentImpl *doc = m_frame->xmlDocImpl();
+  DocumentImpl *doc = m_frame->document();
   if (isSafeScript(exec) && doc && doc->isHTMLDocument()) {
     AtomicString name = propertyName.domString().impl();
     if (static_cast<HTMLDocumentImpl *>(doc)->hasNamedItem(name) || doc->getElementById(name)) {
@@ -1061,7 +1061,7 @@ void Window::put(ExecState* exec, const Identifier &propertyName, JSValue *value
     case _Location: {
       Frame* p = Window::retrieveActive(exec)->m_frame;
       if (p) {
-        QString dstUrl = p->xmlDocImpl()->completeURL(value->toString(exec).qstring());
+        QString dstUrl = p->document()->completeURL(value->toString(exec).qstring());
         if (!dstUrl.startsWith("javascript:", false) || isSafeScript(exec))
         {
           bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
@@ -1220,11 +1220,11 @@ bool Window::isSafeScript(const ScriptInterpreter *origin, const ScriptInterpret
     // JS may be attempting to access the "window" object, which should be valid,
     // even if the document hasn't been constructed yet.  If the document doesn't
     // exist yet allow JS to access the window object.
-    if (!targetPart->xmlDocImpl())
+    if (!targetPart->document())
         return true;
 
-    DOM::DocumentImpl *originDocument = originPart->xmlDocImpl();
-    DOM::DocumentImpl *targetDocument = targetPart->xmlDocImpl();
+    DOM::DocumentImpl *originDocument = originPart->document();
+    DOM::DocumentImpl *targetDocument = targetPart->document();
 
     if (!targetDocument) {
         return false;
@@ -1248,7 +1248,7 @@ bool Window::isSafeScript(const ScriptInterpreter *origin, const ScriptInterpret
         }
 
         if (ancestorPart)
-            originDomain = ancestorPart->xmlDocImpl()->domain();
+            originDomain = ancestorPart->document()->domain();
     }
 
     if ( targetDomain == originDomain )
@@ -1283,11 +1283,11 @@ bool Window::isSafeScript(ExecState *exec) const
   // JS may be attempting to access the "window" object, which should be valid,
   // even if the document hasn't been constructed yet.  If the document doesn't
   // exist yet allow JS to access the window object.
-  if (!m_frame->xmlDocImpl())
+  if (!m_frame->document())
       return true;
 
-  DOM::DocumentImpl* thisDocument = m_frame->xmlDocImpl();
-  DOM::DocumentImpl* actDocument = activePart->xmlDocImpl();
+  DOM::DocumentImpl* thisDocument = m_frame->document();
+  DOM::DocumentImpl* actDocument = activePart->document();
 
   if (!actDocument) {
     kdDebug(6070) << "Window::isSafeScript: active frame has no document!" << endl;
@@ -1312,7 +1312,7 @@ bool Window::isSafeScript(ExecState *exec) const
     }
     
     if (ancestorPart)
-      thisDomain = ancestorPart->xmlDocImpl()->domain();
+      thisDomain = ancestorPart->document()->domain();
   }
 
   if (actDomain == thisDomain)
@@ -1334,7 +1334,7 @@ void Window::setListener(ExecState *exec, const AtomicString &eventType, JSValue
 {
   if (!isSafeScript(exec))
     return;
-  DOM::DocumentImpl *doc = m_frame->xmlDocImpl();
+  DOM::DocumentImpl *doc = m_frame->document();
   if (!doc)
     return;
 
@@ -1345,7 +1345,7 @@ JSValue *Window::getListener(ExecState *exec, const AtomicString &eventType) con
 {
   if (!isSafeScript(exec))
     return jsUndefined();
-  DOM::DocumentImpl *doc = m_frame->xmlDocImpl();
+  DOM::DocumentImpl *doc = m_frame->document();
   if (!doc)
     return jsUndefined();
 
@@ -1568,18 +1568,18 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
 
   switch (id) {
   case Window::Alert:
-    if (frame && frame->xmlDocImpl())
-      frame->xmlDocImpl()->updateRendering();
+    if (frame && frame->document())
+      frame->document()->updateRendering();
     frame->runJavaScriptAlert(str);
     return jsUndefined();
   case Window::Confirm:
-    if (frame && frame->xmlDocImpl())
-      frame->xmlDocImpl()->updateRendering();
+    if (frame && frame->document())
+      frame->document()->updateRendering();
     return jsBoolean(frame->runJavaScriptConfirm(str));
   case Window::Prompt:
   {
-    if (frame && frame->xmlDocImpl())
-      frame->xmlDocImpl()->updateRendering();
+    if (frame && frame->document())
+      frame->document()->updateRendering();
     DOMString message = args.size() >= 2 ? args[1]->toString(exec).domString() : DOMString();
     bool ok = frame->runJavaScriptPrompt(str, message, str2);
     if (ok)
@@ -1606,7 +1606,7 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
       KURL url;
       Frame* activePart = Window::retrieveActive(exec)->m_frame;
       if (!str.isEmpty() && activePart)
-          url = activePart->xmlDocImpl()->completeURL(str.qstring());
+          url = activePart->document()->completeURL(str.qstring());
 
       URLArgs uargs;
       uargs.frameName = frameName;
@@ -1645,8 +1645,8 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
       frame->setOpener(frame);
       frame->setOpenedByJS(true);
       
-      if (!frame->xmlDocImpl()) {
-          DocumentImpl *oldDoc = frame->xmlDocImpl();
+      if (!frame->document()) {
+          DocumentImpl *oldDoc = frame->document();
           if (oldDoc && oldDoc->baseURL() != 0)
               frame->begin(oldDoc->baseURL());
           else
@@ -1657,8 +1657,8 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
           
           if (oldDoc) {
               kdDebug(6070) << "Setting domain to " << oldDoc->domain().qstring() << endl;
-              frame->xmlDocImpl()->setDomain( oldDoc->domain(), true );
-              frame->xmlDocImpl()->setBaseURL( oldDoc->baseURL() );
+              frame->document()->setDomain( oldDoc->domain(), true );
+              frame->document()->setBaseURL( oldDoc->baseURL() );
           }
       }
       if (!url.isEmpty()) {
@@ -1843,14 +1843,14 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
         if (!window->isSafeScript(exec))
             return jsUndefined();
         if (JSEventListener *listener = Window::retrieveActive(exec)->getJSEventListener(args[1]))
-            if (DocumentImpl *doc = frame->xmlDocImpl())
+            if (DocumentImpl *doc = frame->document())
                 doc->addWindowEventListener(AtomicString(args[0]->toString(exec).domString()), listener, args[2]->toBoolean(exec));
         return jsUndefined();
   case Window::RemoveEventListener:
         if (!window->isSafeScript(exec))
             return jsUndefined();
         if (JSEventListener *listener = Window::retrieveActive(exec)->getJSEventListener(args[1]))
-            if (DocumentImpl *doc = frame->xmlDocImpl())
+            if (DocumentImpl *doc = frame->document())
                 doc->removeWindowEventListener(AtomicString(args[0]->toString(exec).domString()), listener, args[2]->toBoolean(exec));
         return jsUndefined();
   case Window::ShowModalDialog:
@@ -1861,7 +1861,7 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
 
 void Window::updateLayout() const
 {
-  DOM::DocumentImpl* docimpl = m_frame->xmlDocImpl();
+  DOM::DocumentImpl* docimpl = m_frame->document();
   if (docimpl)
     docimpl->updateLayoutIgnorePendingStylesheets();
 }
@@ -1898,7 +1898,7 @@ void ScheduledAction::execute(Window *window)
   
     // Update our document's rendering following the execution of the timeout callback.
     // FIXME: Why? Why not other documents, for example?
-    DocumentImpl *doc = window->m_frame->xmlDocImpl();
+    DocumentImpl *doc = window->m_frame->document();
     if (doc)
         doc->updateRendering();
   
@@ -2180,7 +2180,7 @@ void Location::put(ExecState *exec, const Identifier &p, JSValue *v, int attr)
     case Href: {
       Frame* p = Window::retrieveActive(exec)->frame();
       if ( p )
-        url = p->xmlDocImpl()->completeURL( str );
+        url = p->document()->completeURL( str );
       else
         url = str;
       break;
@@ -2259,7 +2259,7 @@ JSValue *LocationFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const
         const Window* window = Window::retrieveWindow(frame);
         if (!str.startsWith("javascript:", false) || (window && window->isSafeScript(exec))) {
           bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
-          frame->scheduleLocationChange(p->xmlDocImpl()->completeURL(str), p->referrer(), true /*lock history*/, userGesture);
+          frame->scheduleLocationChange(p->document()->completeURL(str), p->referrer(), true /*lock history*/, userGesture);
         }
       }
       break;
@@ -2279,7 +2279,7 @@ JSValue *LocationFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const
         Frame *p = Window::retrieveActive(exec)->frame();
         if (p) {
             const Window *window = Window::retrieveWindow(frame);
-            QString dstUrl = p->xmlDocImpl()->completeURL(args[0]->toString(exec).qstring());
+            QString dstUrl = p->document()->completeURL(args[0]->toString(exec).qstring());
             if (!dstUrl.startsWith("javascript:", false) || (window && window->isSafeScript(exec))) {
                 bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
                 // We want a new history item if this JS was called via a user gesture
index 282e0b5..302de4b 100644 (file)
@@ -718,7 +718,7 @@ JSValue *XMLHttpRequestProtoFunc::callAsFunction(ExecState *exec, JSObject *this
       }
     
       QString method = args[0]->toString(exec).qstring();
-      KURL url = KURL(Window::retrieveActive(exec)->frame()->xmlDocImpl()->completeURL(args[1]->toString(exec).qstring()));
+      KURL url = KURL(Window::retrieveActive(exec)->frame()->document()->completeURL(args[1]->toString(exec).qstring()));
 
       bool async = true;
       if (args.size() >= 3) {
index b1ec9c6..7b6de45 100644 (file)
@@ -202,13 +202,13 @@ bool execCut(Frame *frame, bool userInterface, const DOMString &value)
 
 bool execDelete(Frame *frame, bool userInterface, const DOMString &value)
 {
-    TypingCommand::deleteKeyPressed(frame->xmlDocImpl(), frame->selectionGranularity() == khtml::WORD);
+    TypingCommand::deleteKeyPressed(frame->document(), frame->selectionGranularity() == khtml::WORD);
     return true;
 }
 
 bool execForwardDelete(Frame *frame, bool userInterface, const DOMString &value)
 {
-    TypingCommand::forwardDeleteKeyPressed(frame->xmlDocImpl());
+    TypingCommand::forwardDeleteKeyPressed(frame->document());
     return true;
 }
 
@@ -240,25 +240,25 @@ bool execIndent(Frame *frame, bool userInterface, const DOMString &value)
 
 bool execInsertLineBreak(Frame *frame, bool userInterface, const DOMString &value)
 {
-    TypingCommand::insertLineBreak(frame->xmlDocImpl());
+    TypingCommand::insertLineBreak(frame->document());
     return true;
 }
 
 bool execInsertParagraph(Frame *frame, bool userInterface, const DOMString &value)
 {
-    TypingCommand::insertParagraphSeparator(frame->xmlDocImpl());
+    TypingCommand::insertParagraphSeparator(frame->document());
     return true;
 }
 
 bool execInsertNewlineInQuotedContent(Frame *frame, bool userInterface, const DOMString &value)
 {
-    TypingCommand::insertParagraphSeparatorInQuotedContent(frame->xmlDocImpl());
+    TypingCommand::insertParagraphSeparatorInQuotedContent(frame->document());
     return true;
 }
 
 bool execInsertText(Frame *frame, bool userInterface, const DOMString &value)
 {
-    TypingCommand::insertText(frame->xmlDocImpl(), value);
+    TypingCommand::insertText(frame->document(), value);
     return true;
 }
 
index 015a08f..dac0bf2 100644 (file)
@@ -549,7 +549,7 @@ DocumentImpl* HTMLFrameElementImpl::contentDocument() const
     }
 
     // Return the document for that part, which is our contentDocument.
-    return frame->xmlDocImpl();
+    return frame->document();
 }
 
 bool HTMLFrameElementImpl::isURLAttribute(AttributeImpl *attr) const
index 8f636e7..89af6ee 100644 (file)
@@ -468,7 +468,7 @@ HTMLTokenizer::State HTMLTokenizer::scriptExecution(const QString& str, State st
     state.setInScript(false);
     QString url;    
     if (scriptURL.isNull())
-      url = view->frame()->xmlDocImpl()->URL();
+      url = view->frame()->document()->URL();
     else
       url = scriptURL;
 
index 53049e1..ed506fe 100644 (file)
@@ -2926,7 +2926,7 @@ DocumentImpl *DocumentImpl::parentDocument() const
     Frame *parent = childPart->parentFrame();
     if (!parent)
         return 0;
-    return parent->xmlDocImpl();
+    return parent->document();
 }
 
 DocumentImpl *DocumentImpl::topDocument() const
index bced9ae..cbebca2 100644 (file)
@@ -208,8 +208,8 @@ RefPtr<DocumentImpl> XSLTProcessorImpl::createDocumentFromSource(const QString &
     // in place. We have to do this only if we're rendering the result document.
     if (view) {
         view->clear();
-        result->setTransformSourceDocument(view->frame()->xmlDocImpl());
-        view->frame()->replaceDocImpl(result.get());
+        result->setTransformSourceDocument(view->frame()->document());
+        view->frame()->setDocument(result.get());
     }
     
     result->open();
index abceaeb..0682f92 100644 (file)
@@ -474,7 +474,7 @@ using namespace HTMLNames;
         Frame* p = d->frame();
         if (p) {
             // catch stale KWQAccObject (see <rdar://problem/3960196>)
-            if (p->xmlDocImpl() != d)
+            if (p->document() != d)
                 return nil;
             return plainText(rangeOfContents(e).get()).getNSString();
         }
@@ -1105,7 +1105,7 @@ static IntRect boundingBoxRect(RenderObject* obj)
         Frame *frame = static_cast<FrameView *>(widget)->frame();
         if (!frame)
             break;
-        DocumentImpl *document = frame->xmlDocImpl();
+        DocumentImpl *document = frame->document();
         if (!document)
             break;
         renderer = document->renderer();
@@ -1831,7 +1831,7 @@ static void AXAttributedStringAppendReplaced (NSMutableAttributedString *attrStr
     if (!frame)
         return NULL;
         
-    DocumentImpl *document = frame->xmlDocImpl();
+    DocumentImpl *document = frame->document();
     if (!document)
         return NULL;
         
index 9b31569..6e70507 100644 (file)
@@ -53,7 +53,7 @@ KJavaAppletWidget::KJavaAppletWidget(const IntSize& size, Frame* frame, const St
     }
     
     if (baseURLString.isEmpty()) {
-        baseURLString = frame->xmlDocImpl()->baseURL();
+        baseURLString = frame->document()->baseURL();
     }
     setView([Mac(frame)->bridge() viewForJavaAppletWithFrame:NSMakeRect(0, 0, size.width(), size.height())
                                         attributeNames:attributeNames
index 936cb7e..ecef9c3 100644 (file)
@@ -628,14 +628,14 @@ bool Frame::openFile()
   return true;
 }
 
-DocumentImpl *Frame::xmlDocImpl() const
+DocumentImpl *Frame::document() const
 {
     if ( d )
         return d->m_doc;
     return 0;
 }
 
-void Frame::replaceDocImpl(DocumentImpl* newDoc)
+void Frame::setDocument(DocumentImpl* newDoc)
 {
     if (d) {
         if (d->m_doc) {
@@ -1436,7 +1436,7 @@ static bool isFrameElement(const NodeImpl *n)
 
 void Frame::setFocusNodeIfNeeded()
 {
-    if (!xmlDocImpl() || d->m_selection.isNone() || !d->m_isFocused)
+    if (!document() || d->m_selection.isNone() || !d->m_isFocused)
         return;
 
     NodeImpl *startNode = d->m_selection.start().node();
@@ -1448,11 +1448,11 @@ void Frame::setFocusNodeIfNeeded()
             // so add the !isFrameElement check here. There's probably a better way to make this
             // work in the long term, but this is the safest fix at this time.
             if (target->isMouseFocusable() && !::isFrameElement(target)) {
-                xmlDocImpl()->setFocusNode(target);
+                document()->setFocusNode(target);
                 return;
             }
         }
-        xmlDocImpl()->setFocusNode(0);
+        document()->setFocusNode(0);
     }
 }
 
@@ -2144,11 +2144,11 @@ bool Frame::isPointInsideSelection(int x, int y)
     // Treat a collapsed selection like no selection.
     if (!d->m_selection.isRange())
         return false;
-    if (!xmlDocImpl()->renderer()) 
+    if (!document()->renderer()) 
         return false;
     
     RenderObject::NodeInfo nodeInfo(true, true);
-    xmlDocImpl()->renderer()->layer()->hitTest(nodeInfo, x, y);
+    document()->renderer()->layer()->hitTest(nodeInfo, x, y);
     NodeImpl *innerNode = nodeInfo.innerNode();
     if (!innerNode || !innerNode->renderer())
         return false;
@@ -2668,8 +2668,8 @@ void Frame::computeAndSetTypingStyle(CSSStyleDeclarationImpl *style, EditAction
     CSSMutableStyleDeclarationImpl *blockStyle = mutableStyle->copyBlockProperties();
     blockStyle->ref();
     blockStyle->diff(mutableStyle);
-    if (xmlDocImpl() && blockStyle->length() > 0) {
-        EditCommandPtr cmd(new ApplyStyleCommand(xmlDocImpl(), blockStyle, editingAction));
+    if (document() && blockStyle->length() > 0) {
+        EditCommandPtr cmd(new ApplyStyleCommand(document(), blockStyle, editingAction));
         cmd.apply();
     }
     blockStyle->deref();
@@ -2690,8 +2690,8 @@ void Frame::applyStyle(CSSStyleDeclarationImpl *style, EditAction editingAction)
             break;
         }
         case WebCore::Selection::RANGE:
-            if (xmlDocImpl() && style) {
-                EditCommandPtr cmd(new ApplyStyleCommand(xmlDocImpl(), style, editingAction));
+            if (document() && style) {
+                EditCommandPtr cmd(new ApplyStyleCommand(document(), style, editingAction));
                 cmd.apply();
             }
             break;
@@ -2706,8 +2706,8 @@ void Frame::applyParagraphStyle(CSSStyleDeclarationImpl *style, EditAction editi
             break;
         case WebCore::Selection::CARET:
         case WebCore::Selection::RANGE:
-            if (xmlDocImpl() && style) {
-                EditCommandPtr cmd(new ApplyStyleCommand(xmlDocImpl(), style, editingAction, ApplyStyleCommand::ForceBlockProperties));
+            if (document() && style) {
+                EditCommandPtr cmd(new ApplyStyleCommand(document(), style, editingAction, ApplyStyleCommand::ForceBlockProperties));
                 cmd.apply();
             }
             break;
@@ -2827,7 +2827,7 @@ CSSComputedStyleDeclarationImpl *Frame::selectionComputedStyle(NodeImpl *&nodeTo
 {
     nodeToRemove = 0;
 
-    if (!xmlDocImpl())
+    if (!document())
         return 0;
 
     if (d->m_selection.isNone())
@@ -2844,7 +2844,7 @@ CSSComputedStyleDeclarationImpl *Frame::selectionComputedStyle(NodeImpl *&nodeTo
     int exceptionCode = 0;
 
     if (d->m_typingStyle) {
-        styleElement = xmlDocImpl()->createElementNS(xhtmlNamespaceURI, "span", exceptionCode);
+        styleElement = document()->createElementNS(xhtmlNamespaceURI, "span", exceptionCode);
         assert(exceptionCode == 0);
 
         styleElement->ref();
@@ -2852,7 +2852,7 @@ CSSComputedStyleDeclarationImpl *Frame::selectionComputedStyle(NodeImpl *&nodeTo
         styleElement->setAttribute(styleAttr, d->m_typingStyle->cssText().impl(), exceptionCode);
         assert(exceptionCode == 0);
         
-        TextImpl *text = xmlDocImpl()->createEditingTextNode("");
+        TextImpl *text = document()->createEditingTextNode("");
         styleElement->appendChild(text, exceptionCode);
         assert(exceptionCode == 0);
 
@@ -3035,10 +3035,10 @@ void Frame::selectFrameElementInParentIfFullySelected()
         return;
 
     // Get to the <iframe> or <frame> (or even <object>) element in the parent frame.
-    DocumentImpl *document = xmlDocImpl();
-    if (!document)
+    DocumentImpl *doc = document();
+    if (!doc)
         return;
-    ElementImpl *ownerElement = document->ownerElement();
+    ElementImpl *ownerElement = doc->ownerElement();
     if (!ownerElement)
         return;
     NodeImpl *ownerElementParent = ownerElement->parentNode();
@@ -3102,7 +3102,7 @@ bool Frame::userGestureHint()
 
 RenderObject *Frame::renderer() const
 {
-    DocumentImpl *doc = xmlDocImpl();
+    DocumentImpl *doc = document();
     return doc ? doc->renderer() : 0;
 }
 
@@ -3230,11 +3230,11 @@ void Frame::revealSelection()
 // FIXME: should this be here?
 bool Frame::scrollOverflow(KWQScrollDirection direction, KWQScrollGranularity granularity)
 {
-    if (!xmlDocImpl()) {
+    if (!document()) {
         return false;
     }
     
-    NodeImpl *node = xmlDocImpl()->focusNode();
+    NodeImpl *node = document()->focusNode();
     if (node == 0) {
         node = d->m_mousePressNode.get();
     }
@@ -3256,7 +3256,7 @@ void Frame::paint(QPainter *p, const IntRect& rect)
     bool fillWithRed;
     if (p->device()->devType() == QInternal::Printer)
         fillWithRed = false; // Printing, don't fill with red (can't remember why).
-    else if (!xmlDocImpl() || xmlDocImpl()->ownerElement())
+    else if (!document() || document()->ownerElement())
         fillWithRed = false; // Subframe, don't fill with red.
     else if (view() && view()->isTransparent())
         fillWithRed = false; // Transparent, don't fill with red.
@@ -3287,7 +3287,7 @@ void Frame::paint(QPainter *p, const IntRect& rect)
 
 void Frame::adjustPageHeight(float *newBottom, float oldTop, float oldBottom, float bottomLimit)
 {
-    RenderCanvas *root = static_cast<RenderCanvas *>(xmlDocImpl()->renderer());
+    RenderCanvas *root = static_cast<RenderCanvas *>(document()->renderer());
     if (root) {
         // Use a printer device, with painting disabled for the pagination phase
         QPainter painter(true);
@@ -3436,16 +3436,16 @@ QPtrList<Frame> &Frame::mutableInstances()
 
 void Frame::updatePolicyBaseURL()
 {
-    if (parentFrame() && parentFrame()->xmlDocImpl())
-        setPolicyBaseURL(parentFrame()->xmlDocImpl()->policyBaseURL());
+    if (parentFrame() && parentFrame()->document())
+        setPolicyBaseURL(parentFrame()->document()->policyBaseURL());
     else
         setPolicyBaseURL(m_url.url());
 }
 
 void Frame::setPolicyBaseURL(const DOMString &s)
 {
-    if (xmlDocImpl())
-        xmlDocImpl()->setPolicyBaseURL(s);
+    if (document())
+        document()->setPolicyBaseURL(s);
     ConstFrameIt end = d->m_frames.end();
     for (ConstFrameIt it = d->m_frames.begin(); it != end; ++it) {
         ObjectContents *subpart = (*it).m_frame;
@@ -3471,7 +3471,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 *>(xmlDocImpl()->renderer());
+    RenderCanvas *root = static_cast<RenderCanvas *>(document()->renderer());
     if (root) {
         // This magic is basically copied from khtmlview::print
         int pageW = (int)ceil(minPageWidth);
@@ -3506,7 +3506,7 @@ void Frame::sendScrollEvent()
 {
     FrameView *v = d->m_view;
     if (v) {
-        DocumentImpl *doc = xmlDocImpl();
+        DocumentImpl *doc = document();
         if (!doc)
             return;
         doc->dispatchHTMLEvent(scrollEvent, true, false);
@@ -3608,7 +3608,7 @@ void Frame::clearTimers(FrameView *view)
     if (view) {
         view->unscheduleRelayout();
         if (view->frame()) {
-            DocumentImpl* document = view->frame()->xmlDocImpl();
+            DocumentImpl* document = view->frame()->document();
             if (document && document->renderer() && document->renderer()->layer())
                 document->renderer()->layer()->suspendMarquees();
         }
@@ -3655,7 +3655,7 @@ RenderStyle *Frame::styleForSelectionStart(NodeImpl *&nodeToRemove) const
 {
     nodeToRemove = 0;
     
-    if (!xmlDocImpl())
+    if (!document())
         return 0;
     if (d->m_selection.isNone())
         return 0;
@@ -3671,7 +3671,7 @@ RenderStyle *Frame::styleForSelectionStart(NodeImpl *&nodeToRemove) const
         return node->renderer()->style();
     
     int exceptionCode = 0;
-    ElementImpl *styleElement = xmlDocImpl()->createElementNS(xhtmlNamespaceURI, "span", exceptionCode);
+    ElementImpl *styleElement = document()->createElementNS(xhtmlNamespaceURI, "span", exceptionCode);
     ASSERT(exceptionCode == 0);
     
     styleElement->ref();
@@ -3679,7 +3679,7 @@ RenderStyle *Frame::styleForSelectionStart(NodeImpl *&nodeToRemove) const
     styleElement->setAttribute(styleAttr, d->m_typingStyle->cssText().impl(), exceptionCode);
     ASSERT(exceptionCode == 0);
     
-    TextImpl *text = xmlDocImpl()->createEditingTextNode("");
+    TextImpl *text = document()->createEditingTextNode("");
     styleElement->appendChild(text, exceptionCode);
     ASSERT(exceptionCode == 0);
     
@@ -3703,7 +3703,7 @@ void Frame::setSelectionFromNone()
     // Put the caret someplace if the selection is empty and the part is editable.
     // This has the effect of flashing the caret in a contentEditable view automatically 
     // without requiring the programmer to set a selection explicitly.
-    DocumentImpl *doc = xmlDocImpl();
+    DocumentImpl *doc = document();
     if (doc && selection().isNone() && isContentEditable()) {
         NodeImpl *node = doc->documentElement();
         while (node) {
@@ -3729,14 +3729,14 @@ void Frame::setWindowHasFocus(bool flag)
         return;
     m_windowHasFocus = flag;
     
-    if (DocumentImpl *doc = xmlDocImpl())
+    if (DocumentImpl *doc = document())
         if (NodeImpl *body = doc->body())
             body->dispatchWindowEvent(flag ? focusEvent : blurEvent, false, false);
 }
 
 QChar Frame::backslashAsCurrencySymbol() const
 {
-    DocumentImpl *doc = xmlDocImpl();
+    DocumentImpl *doc = document();
     if (!doc)
         return '\\';
     Decoder *decoder = doc->decoder();
index 8b11b20..b07d341 100644 (file)
@@ -952,8 +952,8 @@ private:
   WebCore::EventListener *createHTMLEventListener(const WebCore::DOMString& code, WebCore::NodeImpl *node);
 
 public:
-  WebCore::DocumentImpl *xmlDocImpl() const;
-  void replaceDocImpl(WebCore::DocumentImpl* newDoc);
+  WebCore::DocumentImpl *document() const;
+  void setDocument(WebCore::DocumentImpl* newDoc);
 
   // Workaround for the fact that it's hard to delete a frame.
   // Call this after doing user-triggered selections to make it easy to delete the frame you entirely selected.
index 7e07dc1..e73da03 100644 (file)
@@ -186,7 +186,7 @@ FrameView::~FrameView()
     {
         //WABA: Is this Ok? Do I need to deref it as well?
         //Does this need to be done somewhere else?
-        DocumentImpl *doc = m_frame->xmlDocImpl();
+        DocumentImpl *doc = m_frame->document();
         if (doc)
             doc->detach();
 
@@ -239,8 +239,8 @@ void FrameView::clear()
     d->reset();
 
 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
-    if (d->layoutTimerId && m_frame->xmlDocImpl() && !m_frame->xmlDocImpl()->ownerElement())
-        printf("Killing the layout timer from a clear at %d\n", m_frame->xmlDocImpl()->elapsedTime());
+    if (d->layoutTimerId && m_frame->document() && !m_frame->document()->ownerElement())
+        printf("Killing the layout timer from a clear at %d\n", m_frame->document()->elapsedTime());
 #endif
     
     killTimers();
@@ -251,8 +251,8 @@ void FrameView::clear()
 
 void FrameView::resizeEvent(QResizeEvent* e)
 {
-    if (m_frame && m_frame->xmlDocImpl())
-        m_frame->xmlDocImpl()->dispatchWindowEvent(EventNames::resizeEvent, false, false);
+    if (m_frame && m_frame->document())
+        m_frame->document()->dispatchWindowEvent(EventNames::resizeEvent, false, false);
 }
 
 void FrameView::initScrollBars()
@@ -277,8 +277,8 @@ void FrameView::setMarginHeight(int h)
 
 void FrameView::adjustViewSize()
 {
-    if( m_frame->xmlDocImpl() ) {
-        DocumentImpl *document = m_frame->xmlDocImpl();
+    if( m_frame->document() ) {
+        DocumentImpl *document = m_frame->document();
 
         RenderCanvas* root = static_cast<RenderCanvas *>(document->renderer());
         if ( !root )
@@ -354,7 +354,7 @@ void FrameView::layout()
         return;
     }
 
-    DocumentImpl* document = m_frame->xmlDocImpl();
+    DocumentImpl* document = m_frame->document();
     if (!document) {
         // FIXME: Should we set _height here too?
         _width = visibleWidth();
@@ -499,7 +499,7 @@ void FrameView::layout()
 #if __APPLE__
 void FrameView::updateDashboardRegions()
 {
-    DocumentImpl* document = m_frame->xmlDocImpl();
+    DocumentImpl* document = m_frame->document();
     if (document->hasDashboardRegions()) {
         QValueList<DashboardRegionValue> newRegions = document->renderer()->computeDashboardRegions();
         QValueList<DashboardRegionValue> currentRegions = document->dashboardRegions();
@@ -516,7 +516,7 @@ void FrameView::updateDashboardRegions()
 
 void FrameView::viewportMousePressEvent( QMouseEvent *_mouse )
 {
-    if(!m_frame->xmlDocImpl()) return;
+    if(!m_frame->document()) return;
 
     RefPtr<FrameView> protector(this);
 
@@ -526,7 +526,7 @@ void FrameView::viewportMousePressEvent( QMouseEvent *_mouse )
     d->mousePressed = true;
 
     NodeImpl::MouseEvent mev( _mouse->stateAfter(), NodeImpl::MousePress );
-    m_frame->xmlDocImpl()->prepareMouseEvent( false, xm, ym, &mev );
+    m_frame->document()->prepareMouseEvent( false, xm, ym, &mev );
 
     if (m_frame->passSubframeEventToSubframe(mev)) {
         invalidateClick();
@@ -559,7 +559,7 @@ void FrameView::viewportMousePressEvent( QMouseEvent *_mouse )
 
 void FrameView::viewportMouseDoubleClickEvent( QMouseEvent *_mouse )
 {
-    if(!m_frame->xmlDocImpl()) return;
+    if(!m_frame->document()) return;
 
     RefPtr<FrameView> protector(this);
 
@@ -570,7 +570,7 @@ void FrameView::viewportMouseDoubleClickEvent( QMouseEvent *_mouse )
     d->mousePressed = false;
 
     NodeImpl::MouseEvent mev( _mouse->stateAfter(), NodeImpl::MouseDblClick );
-    m_frame->xmlDocImpl()->prepareMouseEvent( false, xm, ym, &mev );
+    m_frame->document()->prepareMouseEvent( false, xm, ym, &mev );
 
     if (m_frame->passSubframeEventToSubframe(mev))
         return;
@@ -661,7 +661,7 @@ void FrameView::viewportMouseMoveEvent( QMouseEvent * _mouse )
     // but also assert so that we can try to figure this out in debug
     // builds, if it happens.
     assert(m_frame);
-    if(!m_frame || !m_frame->xmlDocImpl()) return;
+    if(!m_frame || !m_frame->document()) return;
 
     int xm, ym;
     viewportToContents(_mouse->x(), _mouse->y(), xm, ym);
@@ -671,7 +671,7 @@ void FrameView::viewportMouseMoveEvent( QMouseEvent * _mouse )
     // This means that :hover and :active freeze in the state they were in when the mouse
     // was pressed, rather than updating for nodes the mouse moves over as you hold the mouse down.
     NodeImpl::MouseEvent mev( _mouse->stateAfter(), NodeImpl::MouseMove );
-    m_frame->xmlDocImpl()->prepareMouseEvent(d->mousePressed && m_frame->mouseDownMayStartSelect(), d->mousePressed, xm, ym, &mev );
+    m_frame->document()->prepareMouseEvent(d->mousePressed && m_frame->mouseDownMayStartSelect(), d->mousePressed, xm, ym, &mev );
 
     if (!m_frame->passSubframeEventToSubframe(mev))
         viewport()->setCursor(selectCursor(mev, m_frame, d->mousePressed));
@@ -702,7 +702,7 @@ void FrameView::invalidateClick()
 
 void FrameView::viewportMouseReleaseEvent( QMouseEvent * _mouse )
 {
-    if ( !m_frame->xmlDocImpl() ) return;
+    if ( !m_frame->document() ) return;
 
     RefPtr<FrameView> protector(this);
 
@@ -712,7 +712,7 @@ void FrameView::viewportMouseReleaseEvent( QMouseEvent * _mouse )
     d->mousePressed = false;
 
     NodeImpl::MouseEvent mev( _mouse->stateAfter(), NodeImpl::MouseRelease );
-    m_frame->xmlDocImpl()->prepareMouseEvent( false, xm, ym, &mev );
+    m_frame->document()->prepareMouseEvent( false, xm, ym, &mev );
 
     if (m_frame->passSubframeEventToSubframe(mev))
         return;
@@ -735,8 +735,8 @@ void FrameView::viewportMouseReleaseEvent( QMouseEvent * _mouse )
 
 void FrameView::keyPressEvent( QKeyEvent *_ke )
 {
-    if (m_frame->xmlDocImpl() && m_frame->xmlDocImpl()->focusNode()) {
-        if (m_frame->xmlDocImpl()->focusNode()->dispatchKeyEvent(_ke))
+    if (m_frame->document() && m_frame->document()->focusNode()) {
+        if (m_frame->document()->focusNode()->dispatchKeyEvent(_ke))
         {
             _ke->accept();
             return;
@@ -758,7 +758,7 @@ bool FrameView::dispatchDragEvent(const AtomicString &eventType, NodeImpl *dragT
     bool metaKey = 0;
     
     MouseEventImpl *me = new MouseEventImpl(eventType,
-                                            true, true, m_frame->xmlDocImpl()->defaultView(),
+                                            true, true, m_frame->document()->defaultView(),
                                             0, screenX, screenY, clientX, clientY,
                                             ctrlKey, altKey, shiftKey, metaKey,
                                             0, 0, clipboard);
@@ -776,7 +776,7 @@ bool FrameView::updateDragAndDrop(const IntPoint &loc, ClipboardImpl *clipboard)
     int xm, ym;
     viewportToContents(loc.x(), loc.y(), xm, ym);
     NodeImpl::MouseEvent mev(0, NodeImpl::MouseMove);
-    m_frame->xmlDocImpl()->prepareMouseEvent(true, xm, ym, &mev);
+    m_frame->document()->prepareMouseEvent(true, xm, ym, &mev);
     NodeImpl *newTarget = mev.innerNode.get();
 
     // Drag events should never go to text nodes (following IE, and proper mouseover/out dispatch)
@@ -905,7 +905,7 @@ void FrameView::focusNextPrevNode(bool next)
     // used is that specified in the HTML spec (see DocumentImpl::nextFocusNode() and DocumentImpl::previousFocusNode()
     // for details).
 
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     NodeImpl *oldFocusNode = doc->focusNode();
     NodeImpl *newFocusNode;
 
@@ -972,7 +972,7 @@ void FrameView::focusNextPrevNode(bool next)
         }
     }
     // Set focus node on the document
-    m_frame->xmlDocImpl()->setFocusNode(newFocusNode);
+    m_frame->document()->setFocusNode(newFocusNode);
 }
 
 void FrameView::setMediaType( const QString &medium )
@@ -1059,7 +1059,7 @@ bool FrameView::dispatchMouseEvent(const AtomicString &eventType, NodeImpl *targ
             RefPtr<NodeImpl> oldUnder;
             if (d->prevMouseX >= 0 && d->prevMouseY >= 0) {
                 NodeImpl::MouseEvent mev( _mouse->stateAfter(), static_cast<NodeImpl::MouseEventType>(mouseEventType));
-                m_frame->xmlDocImpl()->prepareMouseEvent( true, d->prevMouseX, d->prevMouseY, &mev );
+                m_frame->document()->prepareMouseEvent( true, d->prevMouseX, d->prevMouseY, &mev );
                 oldUnder = mev.innerNode;
                 if (oldUnder && oldUnder->isTextNode())
                     oldUnder = oldUnder->parentNode();
@@ -1090,10 +1090,10 @@ bool FrameView::dispatchMouseEvent(const AtomicString &eventType, NodeImpl *targ
         // If focus shift is blocked, we eat the event.  Note we should never clear swallowEvent
         // if the page already set it (e.g., by canceling default behavior).
         if (node && node->isMouseFocusable()) {
-            if (!m_frame->xmlDocImpl()->setFocusNode(node))
+            if (!m_frame->document()->setFocusNode(node))
                 swallowEvent = true;
         } else if (!node || !node->focused()) {
-            if (!m_frame->xmlDocImpl()->setFocusNode(0))
+            if (!m_frame->document()->setFocusNode(0))
             swallowEvent = true;
         }
     }
@@ -1108,7 +1108,7 @@ void FrameView::setIgnoreWheelEvents( bool e )
 
 void FrameView::viewportWheelEvent(QWheelEvent* e)
 {
-    DocumentImpl *doc = m_frame->xmlDocImpl();
+    DocumentImpl *doc = m_frame->document();
     if (doc) {
         RenderObject *docRenderer = doc->renderer();
         if (docRenderer) {
@@ -1157,8 +1157,8 @@ void FrameView::timerEvent ( QTimerEvent *e )
 {
     if (e->timerId()==d->layoutTimerId) {
 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
-        if (m_frame->xmlDocImpl() && !m_frame->xmlDocImpl()->ownerElement())
-            printf("Layout timer fired at %d\n", m_frame->xmlDocImpl()->elapsedTime());
+        if (m_frame->document() && !m_frame->document()->ownerElement())
+            printf("Layout timer fired at %d\n", m_frame->document()->elapsedTime());
 #endif
         layout();
     }
@@ -1169,10 +1169,10 @@ void FrameView::scheduleRelayout()
     if (!d->layoutSchedulingEnabled)
         return;
 
-    if (!m_frame->xmlDocImpl() || !m_frame->xmlDocImpl()->shouldScheduleLayout())
+    if (!m_frame->document() || !m_frame->document()->shouldScheduleLayout())
         return;
 
-    int delay = m_frame->xmlDocImpl()->minimumLayoutDelay();
+    int delay = m_frame->document()->minimumLayoutDelay();
     if (d->layoutTimerId && d->delayedLayout && !delay)
         unscheduleRelayout();
     if (d->layoutTimerId)
@@ -1181,7 +1181,7 @@ void FrameView::scheduleRelayout()
     d->delayedLayout = delay != 0;
 
 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
-    if (!m_frame->xmlDocImpl()->ownerElement())
+    if (!m_frame->document()->ownerElement())
         printf("Scheduling layout for %d\n", delay);
 #endif
 
@@ -1204,8 +1204,8 @@ void FrameView::unscheduleRelayout()
         return;
 
 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
-    if (m_frame->xmlDocImpl() && !m_frame->xmlDocImpl()->ownerElement())
-        printf("Layout timer unscheduled at %d\n", m_frame->xmlDocImpl()->elapsedTime());
+    if (m_frame->document() && !m_frame->document()->ownerElement())
+        printf("Layout timer unscheduled at %d\n", m_frame->document()->elapsedTime());
 #endif
     
     killTimer(d->layoutTimerId);
index 818d952..aea087d 100644 (file)
@@ -936,8 +936,8 @@ void RenderPartObject::updateWidget()
       bool requestSucceeded = v->frame()->requestFrame( this, url, o->m_name.qstring(), QStringList(), QStringList(), true );
       if (requestSucceeded && url == "about:blank") {
           Frame *newPart = v->frame()->findFrame( o->m_name.qstring() );
-          if (newPart && newPart->xmlDocImpl()) {
-              newPart->xmlDocImpl()->setBaseURL( v->frame()->baseURL().url() );
+          if (newPart && newPart->document()) {
+              newPart->document()->setBaseURL( v->frame()->baseURL().url() );
           }
       }
   }