[webkit-changes] cvs commit: WebCore/khtml/xml dom_docimpl.cpp
dom_docimpl.h dom_elementimpl.cpp dom_elementimpl.h
dom_nodeimpl.cpp dom_position.cpp dom_textimpl.h
dom_xmlimpl.h xml_tokenizer.cpp xml_tokenizer.h
Eric
eseidel at opensource.apple.com
Sun Nov 20 17:20:51 PST 2005
eseidel 05/11/20 17:20:48
Modified: . ChangeLog
khtml khtml_part.cpp khtml_part.h khtmlpart_p.h
khtmlview.cpp khtmlview.h
khtml/css css_computedstyle.cpp css_valueimpl.cpp
css_valueimpl.h cssparser.cpp cssstyleselector.cpp
cssstyleselector.h
khtml/dom dom_node.h
khtml/ecma kjs_binding.cpp kjs_binding.h kjs_css.cpp
kjs_dom.cpp kjs_html.cpp kjs_html.h
kjs_navigator.cpp kjs_proxy.cpp kjs_window.cpp
kjs_window.h xmlhttprequest.cpp xmlhttprequest.h
khtml/editing SelectionController.cpp
append_node_command.cpp apply_style_command.cpp
break_blockquote_command.cpp
composite_edit_command.cpp
delete_from_text_node_command.cpp
delete_selection_command.cpp edit_command.cpp
htmlediting.cpp insert_into_text_node_command.cpp
insert_line_break_command.cpp
insert_node_before_command.cpp
insert_paragraph_separator_command.cpp
insert_text_command.cpp join_text_nodes_command.cpp
jsediting.cpp markup.cpp
merge_identical_elements_command.cpp
move_selection_command.cpp
rebalance_whitespace_command.cpp
remove_css_property_command.cpp
remove_node_attribute_command.cpp
remove_node_command.cpp
remove_node_preserving_children_command.cpp
replace_selection_command.cpp
set_node_attribute_command.cpp
split_element_command.cpp
split_text_node_command.cpp
split_text_node_containing_element.cpp
typing_command.cpp visible_position.cpp
wrap_contents_in_dummy_span_command.cpp
khtml/html html_documentimpl.cpp html_formimpl.cpp
html_formimpl.h html_imageimpl.cpp
html_inlineimpl.cpp html_objectimpl.cpp
html_objectimpl.h html_tableimpl.cpp htmlparser.cpp
htmltokenizer.cpp htmltokenizer.h
khtml/misc decoder.cpp decoder.h helper.cpp helper.h
loader.cpp loader.h stringit.h
khtml/rendering render_applet.cpp render_applet.h
render_canvas.cpp render_canvas.h
render_container.cpp render_flexbox.cpp
render_flow.cpp render_flow.h render_form.cpp
render_form.h render_frames.cpp render_image.cpp
render_image.h render_layer.cpp render_layer.h
render_line.cpp render_list.cpp render_list.h
render_object.cpp render_object.h
render_replaced.cpp render_replaced.h
render_style.cpp render_style.h render_text.h
khtml/xml dom_docimpl.cpp dom_docimpl.h dom_elementimpl.cpp
dom_elementimpl.h dom_nodeimpl.cpp dom_position.cpp
dom_textimpl.h dom_xmlimpl.h xml_tokenizer.cpp
xml_tokenizer.h
Log:
Bug #: 5711
Submitted by: eseidel
Reviewed by: mjs
Remove #if !APPLE_CHANGES and #if 0 blocks. No functional changes.
http://bugzilla.opendarwin.org/show_bug.cgi?id=5711
* khtml/css/css_computedstyle.cpp:
(DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
* khtml/css/css_valueimpl.cpp:
(DOM::CSSMutableStyleDeclarationImpl::setProperty):
(DOM::CSSPrimitiveValueImpl::computeLength):
(DOM::CSSPrimitiveValueImpl::computeLengthFloat):
(DOM::CSSPrimitiveValueImpl::cssText):
(DOM::FontFamilyValueImpl::FontFamilyValueImpl):
* khtml/css/css_valueimpl.h:
* khtml/css/cssparser.cpp:
(qFatal):
(CSSParser::parseValue):
(CSSParser::parseDashboardRegions):
* khtml/css/cssstyleselector.cpp:
(khtml::):
(khtml::colorForCSSValue):
(khtml::CSSStyleSelector::applyDeclarations):
(khtml::CSSStyleSelector::applyProperty):
(khtml::CSSStyleSelector::checkForTextSizeAdjust):
* khtml/css/cssstyleselector.h:
* khtml/dom/dom_node.h:
* khtml/ecma/kjs_binding.cpp:
* khtml/ecma/kjs_binding.h:
* khtml/ecma/kjs_css.cpp:
(KJS::DOMStyleSheetList::getOwnPropertySlot):
* khtml/ecma/kjs_dom.cpp:
(KJS::DOMNode::getValueProperty):
(KJS::NodeConstructor::getValueProperty):
(KJS::DOMExceptionConstructor::getValueProperty):
* khtml/ecma/kjs_html.cpp:
(KJS::HTMLElement::getOwnPropertySlot):
(KJS::KJS::HTMLElementFunction::callAsFunction):
(KJS::KJS::HTMLElement::put):
* khtml/ecma/kjs_html.h:
* khtml/ecma/kjs_navigator.cpp:
(KJS::Navigator::getValueProperty):
(KJS::PluginBase::refresh):
* khtml/ecma/kjs_proxy.cpp:
(KJSProxyImpl::evaluate):
(KJSProxyImpl::initScript):
* khtml/ecma/kjs_window.cpp:
(KJS::allowPopUp):
(KJS::Window::getValueProperty):
(KJS::Window::put):
(KJS::Window::resumeTimeouts):
(KJS::Window::scheduleClose):
(KJS::Window::isSafeScript):
(KJS::WindowFunc::callAsFunction):
(KJS::WindowQObject::hasTimeouts):
(KJS::Location::put):
(KJS::LocationFunc::callAsFunction):
(KJS::BarInfo::getValueProperty):
* khtml/ecma/kjs_window.h:
* khtml/ecma/xmlhttprequest.cpp:
(KJS::XMLHttpRequestQObject::slotData):
(KJS::XMLHttpRequest::send):
(KJS::XMLHttpRequest::processSyncLoadResults):
(KJS::XMLHttpRequest::slotData):
* khtml/ecma/xmlhttprequest.h:
* khtml/editing/SelectionController.cpp:
(khtml::SelectionController::debugPosition):
* khtml/editing/append_node_command.cpp:
* khtml/editing/apply_style_command.cpp:
* khtml/editing/break_blockquote_command.cpp:
* khtml/editing/composite_edit_command.cpp:
* khtml/editing/delete_from_text_node_command.cpp:
* khtml/editing/delete_selection_command.cpp:
* khtml/editing/edit_command.cpp:
* khtml/editing/htmlediting.cpp:
* khtml/editing/insert_into_text_node_command.cpp:
* khtml/editing/insert_line_break_command.cpp:
* khtml/editing/insert_node_before_command.cpp:
* khtml/editing/insert_paragraph_separator_command.cpp:
* khtml/editing/insert_text_command.cpp:
* khtml/editing/join_text_nodes_command.cpp:
* khtml/editing/jsediting.cpp:
* khtml/editing/markup.cpp:
* khtml/editing/merge_identical_elements_command.cpp:
* khtml/editing/move_selection_command.cpp:
* khtml/editing/rebalance_whitespace_command.cpp:
* khtml/editing/remove_css_property_command.cpp:
* khtml/editing/remove_node_attribute_command.cpp:
* khtml/editing/remove_node_command.cpp:
* khtml/editing/remove_node_preserving_children_command.cpp:
* khtml/editing/replace_selection_command.cpp:
* khtml/editing/set_node_attribute_command.cpp:
* khtml/editing/split_element_command.cpp:
* khtml/editing/split_text_node_command.cpp:
* khtml/editing/split_text_node_containing_element.cpp:
* khtml/editing/typing_command.cpp:
* khtml/editing/visible_position.cpp:
* khtml/editing/wrap_contents_in_dummy_span_command.cpp:
* khtml/html/html_documentimpl.cpp:
(DOM::HTMLDocumentImpl::referrer):
(DOM::HTMLDocumentImpl::cookie):
(DOM::HTMLDocumentImpl::setCookie):
* khtml/html/html_formimpl.cpp:
(DOM::HTMLFormElementImpl::attach):
(DOM::HTMLFormElementImpl::formData):
(DOM::HTMLFormElementImpl::submit):
(DOM::HTMLFormElementImpl::parseMappedAttribute):
(DOM::HTMLGenericFormElementImpl::isMouseFocusable):
(DOM::HTMLGenericFormElementImpl::defaultEventHandler):
(DOM::HTMLInputElementImpl::setInputType):
(DOM::HTMLInputElementImpl::type):
(DOM::HTMLInputElementImpl::canHaveSelection):
(DOM::HTMLInputElementImpl::selectionStart):
(DOM::HTMLInputElementImpl::selectionEnd):
(DOM::HTMLInputElementImpl::setSelectionStart):
(DOM::HTMLInputElementImpl::setSelectionEnd):
(DOM::HTMLInputElementImpl::select):
(DOM::HTMLInputElementImpl::setSelectionRange):
(DOM::HTMLInputElementImpl::click):
(DOM::HTMLInputElementImpl::accessKeyAction):
(DOM::HTMLInputElementImpl::rendererIsNeeded):
(DOM::HTMLInputElementImpl::createRenderer):
(DOM::HTMLInputElementImpl::attach):
(DOM::HTMLInputElementImpl::altText):
(DOM::HTMLInputElementImpl::appendFormData):
(DOM::HTMLInputElementImpl::valueWithDefault):
(DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute):
(DOM::HTMLInputElementImpl::defaultEventHandler):
(DOM::HTMLSelectElementImpl::state):
(DOM::HTMLSelectElementImpl::restoreState):
(DOM::HTMLKeygenElementImpl::appendFormData):
* khtml/html/html_formimpl.h:
(DOM::HTMLInputElementImpl::):
* khtml/html/html_imageimpl.cpp:
(HTMLImageLoader::updateFromElement):
(HTMLImageElementImpl::parseMappedAttribute):
* khtml/html/html_inlineimpl.cpp:
(DOM::HTMLAnchorElementImpl::isMouseFocusable):
* khtml/html/html_objectimpl.cpp:
(DOM::HTMLAppletElementImpl::getMember):
(DOM::HTMLAppletElementImpl::callMember):
(DOM::HTMLAppletElementImpl::allParamsAvailable):
(DOM::HTMLEmbedElementImpl::getEmbedInstance):
(DOM::HTMLObjectElementImpl::HTMLObjectElementImpl):
(DOM::HTMLObjectElementImpl::getObjectInstance):
(DOM::HTMLObjectElementImpl::rendererIsNeeded):
* khtml/html/html_objectimpl.h:
(DOM::HTMLObjectElementImpl::isDocNamedItem):
* khtml/html/html_tableimpl.cpp:
(DOM::HTMLTableElementImpl::HTMLTableElementImpl):
(DOM::HTMLTableElementImpl::parseMappedAttribute):
* khtml/html/htmlparser.cpp:
(HTMLParser::handleIsindex):
* khtml/html/htmltokenizer.cpp:
(khtml::HTMLTokenizer::scriptExecution):
* khtml/html/htmltokenizer.h:
* khtml/khtml_part.cpp:
(KHTMLPart::KHTMLPart):
(KHTMLPart::init):
(KHTMLPart::~KHTMLPart):
(KHTMLPart::restoreURL):
(KHTMLPart::didOpenURL):
(KHTMLPart::stopLoading):
(KHTMLPart::createJavaContext):
(KHTMLPart::setAutoloadImages):
(KHTMLPart::clear):
(KHTMLPart::receivedFirstData):
(KHTMLPart::slotFinished):
(KHTMLPart::childBegin):
(KHTMLPart::begin):
(KHTMLPart::write):
(KHTMLPart::gotoAnchor):
(KHTMLPart::slotLoaderRequestStarted):
(KHTMLPart::slotLoaderRequestDone):
(KHTMLPart::checkCompleted):
(KHTMLPart::completeURL):
(KHTMLPart::scheduleHistoryNavigation):
(KHTMLPart::urlCursor):
(KHTMLPart::text):
(KHTMLPart::selectedText):
(KHTMLPart::hasSelection):
(KHTMLPart::setSelection):
(KHTMLPart::urlSelected):
(KHTMLPart::requestFrameName):
(KHTMLPart::requestObject):
(KHTMLPart::processObjectRequest):
(KHTMLPart::submitForm):
(KHTMLPart::slotChildStarted):
(KHTMLPart::slotChildCompleted):
(KHTMLPart::childFrame):
(KHTMLPart::findFrame):
(KHTMLPart::frameExists):
(KHTMLPart::parentPart):
(KHTMLPart::emitSelectionChanged):
(KHTMLPart::setZoomFactor):
(KHTMLPart::reparseConfiguration):
(KHTMLPart::khtmlMousePressEvent):
(KHTMLPart::khtmlMouseMoveEvent):
(KHTMLPart::startAutoScroll):
(KHTMLPart::stopAutoScroll):
(KHTMLPart::shouldChangeSelection):
(KHTMLPart::appliedEditing):
(KHTMLPart::unappliedEditing):
(KHTMLPart::reappliedEditing):
(KHTMLPart::copyToPasteboard):
(KHTMLPart::cutToPasteboard):
(KHTMLPart::pasteFromPasteboard):
(KHTMLPart::pasteAndMatchStyle):
(KHTMLPart::transpose):
(KHTMLPart::redo):
(KHTMLPart::undo):
* khtml/khtml_part.h:
(KHTMLPart::didFirstLayout):
* khtml/khtmlpart_p.h:
(KHTMLPartPrivate::KHTMLPartPrivate):
(KHTMLPartPrivate::~KHTMLPartPrivate):
* khtml/khtmlview.cpp:
(KHTMLViewPrivate::KHTMLViewPrivate):
(KHTMLViewPrivate::~KHTMLViewPrivate):
(KHTMLViewPrivate::reset):
(KHTMLView::KHTMLView):
(KHTMLView::~KHTMLView):
(KHTMLView::resetScrollBars):
(KHTMLView::init):
(KHTMLView::clear):
(KHTMLView::resizeEvent):
(KHTMLView::initScrollBars):
(KHTMLView::layout):
(KHTMLView::updateDashboardRegions):
(KHTMLView::viewportMousePressEvent):
(KHTMLView::viewportMouseDoubleClickEvent):
(KHTMLView::viewportMouseMoveEvent):
(KHTMLView::viewportMouseReleaseEvent):
(KHTMLView::keyPressEvent):
(KHTMLView::contentsContextMenuEvent):
(KHTMLView::dispatchDragEvent):
(KHTMLView::focusNextPrevNode):
(KHTMLView::mediaType):
(KHTMLView::setScrollBarsMode):
(KHTMLView::restoreScrollBar):
(KHTMLView::viewportWheelEvent):
* khtml/khtmlview.h:
* khtml/misc/decoder.cpp:
(Decoder::setEncoding):
(Decoder::decode):
(Decoder::flush):
* khtml/misc/decoder.h:
* khtml/misc/helper.cpp:
(khtml::findWordBoundary):
(khtml::nextWordFromIndex):
(khtml::findSentenceBoundary):
(khtml::nextSentenceFromIndex):
* khtml/misc/helper.h:
* khtml/misc/loader.cpp:
(CachedObject::~CachedObject):
(CachedImageCallback::clear):
(CachedImage::CachedImage):
(CachedImage::tiled_pixmap):
(CachedImage::pixmap):
(CachedImage::setShowAnimations):
(CachedImage::clear):
(CachedImage::data):
(CachedImage::error):
(DocLoader::DocLoader):
(DocLoader::requestImage):
(DocLoader::requestStyleSheet):
(DocLoader::requestScript):
(DocLoader::requestXSLStyleSheet):
(DocLoader::requestXBLDocument):
(Loader::Loader):
(Loader::~Loader):
(Loader::servePendingRequests):
(Loader::slotFinished):
(Loader::slotData):
(Loader::numRequests):
(Loader::cancelRequests):
(Loader::removeBackgroundDecodingRequest):
(Cache::init):
(Cache::requestImage):
(Cache::requestStyleSheet):
(Cache::requestScript):
(Cache::requestXSLStyleSheet):
(Cache::requestXBLDocument):
* khtml/misc/loader.h:
(khtml::CachedObject::CachedObject):
* khtml/misc/stringit.h:
(khtml::TokenizerSubstring::TokenizerSubstring):
* khtml/rendering/render_applet.cpp:
(RenderApplet::RenderApplet):
(RenderApplet::layout):
(RenderEmptyApplet::RenderEmptyApplet):
(RenderEmptyApplet::layout):
* khtml/rendering/render_applet.h:
* khtml/rendering/render_canvas.cpp:
(RenderCanvas::setBestTruncatedAt):
* khtml/rendering/render_canvas.h:
(khtml::RenderCanvas::printImages):
* khtml/rendering/render_container.cpp:
(RenderContainer::addChild):
(RenderContainer::removeChildNode):
(RenderContainer::appendChildNode):
(RenderContainer::insertChildNode):
* khtml/rendering/render_flexbox.cpp:
(khtml::RenderFlexibleBox::layoutVerticalBox):
* khtml/rendering/render_flow.cpp:
(RenderFlow::paintLines):
(RenderFlow::paintFocusRing):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_form.cpp:
(RenderFormElement::baselinePosition):
(RenderFormElement::setStyle):
(RenderFormElement::updateFromElement):
(RenderFormElement::layout):
(RenderLineEdit::RenderLineEdit):
(RenderLineEdit::slotReturnPressed):
(RenderLineEdit::addSearchResult):
(RenderLineEdit::calcMinMaxWidth):
(RenderLineEdit::setStyle):
(RenderLineEdit::updateFromElement):
(RenderFileButton::RenderFileButton):
(RenderFileButton::calcMinMaxWidth):
(RenderFileButton::slotClicked):
(RenderFileButton::updateFromElement):
(RenderFileButton::select):
(ComboBoxWidget::event):
(ComboBoxWidget::eventFilter):
(RenderSelect::updateFromElement):
(RenderSelect::layout):
(RenderTextArea::RenderTextArea):
(RenderTextArea::calcMinMaxWidth):
(RenderTextArea::setStyle):
(RenderTextArea::updateFromElement):
(RenderTextArea::text):
(RenderTextArea::selectionStart):
(RenderTextArea::selectionEnd):
(RenderTextArea::setSelectionStart):
(RenderTextArea::setSelectionEnd):
(RenderTextArea::setSelectionRange):
* khtml/rendering/render_form.h:
(khtml::RenderFormElement::intrinsicMargin):
(khtml::RenderLineEdit::canHaveIntrinsicMargins):
(khtml::RenderSelect::canHaveIntrinsicMargins):
(khtml::RenderTextArea::canHaveIntrinsicMargins):
* khtml/rendering/render_frames.cpp:
(RenderFrameSet::userResize):
(RenderFrame::slotViewCleared):
(RenderPartObject::layout):
(RenderPartObject::slotViewCleared):
* khtml/rendering/render_image.cpp:
(RenderImage::setPixmap):
(RenderImage::resetAnimation):
(RenderImage::paint):
(RenderImage::layout):
* khtml/rendering/render_image.h:
* khtml/rendering/render_layer.cpp:
(khtml::RenderLayer::scrollToOffset):
(khtml::RenderLayer::updateScrollInfoAfterLayout):
(khtml::RenderLayer::paintScrollbars):
(khtml::setClip):
(khtml::RenderLayer::paintLayer):
(khtml::RenderLayer::hitTest):
* khtml/rendering/render_layer.h:
* khtml/rendering/render_line.cpp:
(khtml::InlineFlowBox::paintDecorations):
* khtml/rendering/render_list.cpp:
(RenderListMarker::paint):
* khtml/rendering/render_list.h:
(khtml::RenderListItem::markerStringValue):
* khtml/rendering/render_object.cpp:
(RenderObject::addFocusRingRects):
(RenderObject::paintOutline):
(RenderObject::setStyle):
(RenderObject::removeFromObjectLists):
(RenderObject::remove):
(RenderObject::backslashAsCurrencySymbol):
* khtml/rendering/render_object.h:
* khtml/rendering/render_replaced.cpp:
(RenderWidget::resizeWidget):
(RenderWidget::sendConsumedMouseUp):
(RenderWidget::setStyle):
* khtml/rendering/render_replaced.h:
* khtml/rendering/render_style.cpp:
(StyleVisualData::StyleVisualData):
(StyleCSS3NonInheritedData::operator==):
(textSizeAdjust):
(StyleCSS3InheritedData):
(StyleCSS3InheritedData::operator==):
(RenderStyle::diff):
* khtml/rendering/render_style.h:
(khtml::StyleVisualData::operator==):
(khtml::RenderStyle::textSizeAdjust):
(khtml::RenderStyle::setDashboardRegion):
(khtml::RenderStyle::setTextSizeAdjust):
* khtml/rendering/render_text.h:
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::DocumentImpl):
(DocumentImpl::~DocumentImpl):
(DocumentImpl::updateTitle):
(DocumentImpl::recalcStyle):
(DocumentImpl::updateRendering):
(DocumentImpl::attach):
(DocumentImpl::detach):
(DocumentImpl::getAccObjectCache):
(DocumentImpl::updateSelection):
(DocumentImpl::implicitClose):
(DocumentImpl::processHttpEquiv):
(DocumentImpl::updateStyleSelector):
(DocumentImpl::setFocusNode):
* khtml/xml/dom_docimpl.h:
* khtml/xml/dom_elementimpl.cpp:
(ElementImpl::recalcStyle):
* khtml/xml/dom_elementimpl.h:
* khtml/xml/dom_nodeimpl.cpp:
(DOM::NodeImpl::dispatchKeyEvent):
(DOM::NodeImpl::createRendererIfNeeded):
* khtml/xml/dom_position.cpp:
* khtml/xml/dom_textimpl.h:
* khtml/xml/dom_xmlimpl.h:
* khtml/xml/xml_tokenizer.cpp:
(khtml::Tokenizer::Tokenizer):
(khtml::Tokenizer::finishedParsing):
(khtml::XMLTokenizer::error):
* khtml/xml/xml_tokenizer.h:
Revision Changes Path
1.386 +425 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.385
retrieving revision 1.386
diff -u -r1.385 -r1.386
--- ChangeLog 20 Nov 2005 21:34:09 -0000 1.385
+++ ChangeLog 21 Nov 2005 01:19:45 -0000 1.386
@@ -1,3 +1,428 @@
+2005-11-20 eseidel <eseidel at apple.com>
+
+ Reviewed by mjs.
+
+ Remove #if !APPLE_CHANGES and #if 0 blocks. No functional changes.
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=5711
+
+ * khtml/css/css_computedstyle.cpp:
+ (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
+ * khtml/css/css_valueimpl.cpp:
+ (DOM::CSSMutableStyleDeclarationImpl::setProperty):
+ (DOM::CSSPrimitiveValueImpl::computeLength):
+ (DOM::CSSPrimitiveValueImpl::computeLengthFloat):
+ (DOM::CSSPrimitiveValueImpl::cssText):
+ (DOM::FontFamilyValueImpl::FontFamilyValueImpl):
+ * khtml/css/css_valueimpl.h:
+ * khtml/css/cssparser.cpp:
+ (qFatal):
+ (CSSParser::parseValue):
+ (CSSParser::parseDashboardRegions):
+ * khtml/css/cssstyleselector.cpp:
+ (khtml::):
+ (khtml::colorForCSSValue):
+ (khtml::CSSStyleSelector::applyDeclarations):
+ (khtml::CSSStyleSelector::applyProperty):
+ (khtml::CSSStyleSelector::checkForTextSizeAdjust):
+ * khtml/css/cssstyleselector.h:
+ * khtml/dom/dom_node.h:
+ * khtml/ecma/kjs_binding.cpp:
+ * khtml/ecma/kjs_binding.h:
+ * khtml/ecma/kjs_css.cpp:
+ (KJS::DOMStyleSheetList::getOwnPropertySlot):
+ * khtml/ecma/kjs_dom.cpp:
+ (KJS::DOMNode::getValueProperty):
+ (KJS::NodeConstructor::getValueProperty):
+ (KJS::DOMExceptionConstructor::getValueProperty):
+ * khtml/ecma/kjs_html.cpp:
+ (KJS::HTMLElement::getOwnPropertySlot):
+ (KJS::KJS::HTMLElementFunction::callAsFunction):
+ (KJS::KJS::HTMLElement::put):
+ * khtml/ecma/kjs_html.h:
+ * khtml/ecma/kjs_navigator.cpp:
+ (KJS::Navigator::getValueProperty):
+ (KJS::PluginBase::refresh):
+ * khtml/ecma/kjs_proxy.cpp:
+ (KJSProxyImpl::evaluate):
+ (KJSProxyImpl::initScript):
+ * khtml/ecma/kjs_window.cpp:
+ (KJS::allowPopUp):
+ (KJS::Window::getValueProperty):
+ (KJS::Window::put):
+ (KJS::Window::resumeTimeouts):
+ (KJS::Window::scheduleClose):
+ (KJS::Window::isSafeScript):
+ (KJS::WindowFunc::callAsFunction):
+ (KJS::WindowQObject::hasTimeouts):
+ (KJS::Location::put):
+ (KJS::LocationFunc::callAsFunction):
+ (KJS::BarInfo::getValueProperty):
+ * khtml/ecma/kjs_window.h:
+ * khtml/ecma/xmlhttprequest.cpp:
+ (KJS::XMLHttpRequestQObject::slotData):
+ (KJS::XMLHttpRequest::send):
+ (KJS::XMLHttpRequest::processSyncLoadResults):
+ (KJS::XMLHttpRequest::slotData):
+ * khtml/ecma/xmlhttprequest.h:
+ * khtml/editing/SelectionController.cpp:
+ (khtml::SelectionController::debugPosition):
+ * khtml/editing/append_node_command.cpp:
+ * khtml/editing/apply_style_command.cpp:
+ * khtml/editing/break_blockquote_command.cpp:
+ * khtml/editing/composite_edit_command.cpp:
+ * khtml/editing/delete_from_text_node_command.cpp:
+ * khtml/editing/delete_selection_command.cpp:
+ * khtml/editing/edit_command.cpp:
+ * khtml/editing/htmlediting.cpp:
+ * khtml/editing/insert_into_text_node_command.cpp:
+ * khtml/editing/insert_line_break_command.cpp:
+ * khtml/editing/insert_node_before_command.cpp:
+ * khtml/editing/insert_paragraph_separator_command.cpp:
+ * khtml/editing/insert_text_command.cpp:
+ * khtml/editing/join_text_nodes_command.cpp:
+ * khtml/editing/jsediting.cpp:
+ * khtml/editing/markup.cpp:
+ * khtml/editing/merge_identical_elements_command.cpp:
+ * khtml/editing/move_selection_command.cpp:
+ * khtml/editing/rebalance_whitespace_command.cpp:
+ * khtml/editing/remove_css_property_command.cpp:
+ * khtml/editing/remove_node_attribute_command.cpp:
+ * khtml/editing/remove_node_command.cpp:
+ * khtml/editing/remove_node_preserving_children_command.cpp:
+ * khtml/editing/replace_selection_command.cpp:
+ * khtml/editing/set_node_attribute_command.cpp:
+ * khtml/editing/split_element_command.cpp:
+ * khtml/editing/split_text_node_command.cpp:
+ * khtml/editing/split_text_node_containing_element.cpp:
+ * khtml/editing/typing_command.cpp:
+ * khtml/editing/visible_position.cpp:
+ * khtml/editing/wrap_contents_in_dummy_span_command.cpp:
+ * khtml/html/html_documentimpl.cpp:
+ (DOM::HTMLDocumentImpl::referrer):
+ (DOM::HTMLDocumentImpl::cookie):
+ (DOM::HTMLDocumentImpl::setCookie):
+ * khtml/html/html_formimpl.cpp:
+ (DOM::HTMLFormElementImpl::attach):
+ (DOM::HTMLFormElementImpl::formData):
+ (DOM::HTMLFormElementImpl::submit):
+ (DOM::HTMLFormElementImpl::parseMappedAttribute):
+ (DOM::HTMLGenericFormElementImpl::isMouseFocusable):
+ (DOM::HTMLGenericFormElementImpl::defaultEventHandler):
+ (DOM::HTMLInputElementImpl::setInputType):
+ (DOM::HTMLInputElementImpl::type):
+ (DOM::HTMLInputElementImpl::canHaveSelection):
+ (DOM::HTMLInputElementImpl::selectionStart):
+ (DOM::HTMLInputElementImpl::selectionEnd):
+ (DOM::HTMLInputElementImpl::setSelectionStart):
+ (DOM::HTMLInputElementImpl::setSelectionEnd):
+ (DOM::HTMLInputElementImpl::select):
+ (DOM::HTMLInputElementImpl::setSelectionRange):
+ (DOM::HTMLInputElementImpl::click):
+ (DOM::HTMLInputElementImpl::accessKeyAction):
+ (DOM::HTMLInputElementImpl::rendererIsNeeded):
+ (DOM::HTMLInputElementImpl::createRenderer):
+ (DOM::HTMLInputElementImpl::attach):
+ (DOM::HTMLInputElementImpl::altText):
+ (DOM::HTMLInputElementImpl::appendFormData):
+ (DOM::HTMLInputElementImpl::valueWithDefault):
+ (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute):
+ (DOM::HTMLInputElementImpl::defaultEventHandler):
+ (DOM::HTMLSelectElementImpl::state):
+ (DOM::HTMLSelectElementImpl::restoreState):
+ (DOM::HTMLKeygenElementImpl::appendFormData):
+ * khtml/html/html_formimpl.h:
+ (DOM::HTMLInputElementImpl::):
+ * khtml/html/html_imageimpl.cpp:
+ (HTMLImageLoader::updateFromElement):
+ (HTMLImageElementImpl::parseMappedAttribute):
+ * khtml/html/html_inlineimpl.cpp:
+ (DOM::HTMLAnchorElementImpl::isMouseFocusable):
+ * khtml/html/html_objectimpl.cpp:
+ (DOM::HTMLAppletElementImpl::getMember):
+ (DOM::HTMLAppletElementImpl::callMember):
+ (DOM::HTMLAppletElementImpl::allParamsAvailable):
+ (DOM::HTMLEmbedElementImpl::getEmbedInstance):
+ (DOM::HTMLObjectElementImpl::HTMLObjectElementImpl):
+ (DOM::HTMLObjectElementImpl::getObjectInstance):
+ (DOM::HTMLObjectElementImpl::rendererIsNeeded):
+ * khtml/html/html_objectimpl.h:
+ (DOM::HTMLObjectElementImpl::isDocNamedItem):
+ * khtml/html/html_tableimpl.cpp:
+ (DOM::HTMLTableElementImpl::HTMLTableElementImpl):
+ (DOM::HTMLTableElementImpl::parseMappedAttribute):
+ * khtml/html/htmlparser.cpp:
+ (HTMLParser::handleIsindex):
+ * khtml/html/htmltokenizer.cpp:
+ (khtml::HTMLTokenizer::scriptExecution):
+ * khtml/html/htmltokenizer.h:
+ * khtml/khtml_part.cpp:
+ (KHTMLPart::KHTMLPart):
+ (KHTMLPart::init):
+ (KHTMLPart::~KHTMLPart):
+ (KHTMLPart::restoreURL):
+ (KHTMLPart::didOpenURL):
+ (KHTMLPart::stopLoading):
+ (KHTMLPart::createJavaContext):
+ (KHTMLPart::setAutoloadImages):
+ (KHTMLPart::clear):
+ (KHTMLPart::receivedFirstData):
+ (KHTMLPart::slotFinished):
+ (KHTMLPart::childBegin):
+ (KHTMLPart::begin):
+ (KHTMLPart::write):
+ (KHTMLPart::gotoAnchor):
+ (KHTMLPart::slotLoaderRequestStarted):
+ (KHTMLPart::slotLoaderRequestDone):
+ (KHTMLPart::checkCompleted):
+ (KHTMLPart::completeURL):
+ (KHTMLPart::scheduleHistoryNavigation):
+ (KHTMLPart::urlCursor):
+ (KHTMLPart::text):
+ (KHTMLPart::selectedText):
+ (KHTMLPart::hasSelection):
+ (KHTMLPart::setSelection):
+ (KHTMLPart::urlSelected):
+ (KHTMLPart::requestFrameName):
+ (KHTMLPart::requestObject):
+ (KHTMLPart::processObjectRequest):
+ (KHTMLPart::submitForm):
+ (KHTMLPart::slotChildStarted):
+ (KHTMLPart::slotChildCompleted):
+ (KHTMLPart::childFrame):
+ (KHTMLPart::findFrame):
+ (KHTMLPart::frameExists):
+ (KHTMLPart::parentPart):
+ (KHTMLPart::emitSelectionChanged):
+ (KHTMLPart::setZoomFactor):
+ (KHTMLPart::reparseConfiguration):
+ (KHTMLPart::khtmlMousePressEvent):
+ (KHTMLPart::khtmlMouseMoveEvent):
+ (KHTMLPart::startAutoScroll):
+ (KHTMLPart::stopAutoScroll):
+ (KHTMLPart::shouldChangeSelection):
+ (KHTMLPart::appliedEditing):
+ (KHTMLPart::unappliedEditing):
+ (KHTMLPart::reappliedEditing):
+ (KHTMLPart::copyToPasteboard):
+ (KHTMLPart::cutToPasteboard):
+ (KHTMLPart::pasteFromPasteboard):
+ (KHTMLPart::pasteAndMatchStyle):
+ (KHTMLPart::transpose):
+ (KHTMLPart::redo):
+ (KHTMLPart::undo):
+ * khtml/khtml_part.h:
+ (KHTMLPart::didFirstLayout):
+ * khtml/khtmlpart_p.h:
+ (KHTMLPartPrivate::KHTMLPartPrivate):
+ (KHTMLPartPrivate::~KHTMLPartPrivate):
+ * khtml/khtmlview.cpp:
+ (KHTMLViewPrivate::KHTMLViewPrivate):
+ (KHTMLViewPrivate::~KHTMLViewPrivate):
+ (KHTMLViewPrivate::reset):
+ (KHTMLView::KHTMLView):
+ (KHTMLView::~KHTMLView):
+ (KHTMLView::resetScrollBars):
+ (KHTMLView::init):
+ (KHTMLView::clear):
+ (KHTMLView::resizeEvent):
+ (KHTMLView::initScrollBars):
+ (KHTMLView::layout):
+ (KHTMLView::updateDashboardRegions):
+ (KHTMLView::viewportMousePressEvent):
+ (KHTMLView::viewportMouseDoubleClickEvent):
+ (KHTMLView::viewportMouseMoveEvent):
+ (KHTMLView::viewportMouseReleaseEvent):
+ (KHTMLView::keyPressEvent):
+ (KHTMLView::contentsContextMenuEvent):
+ (KHTMLView::dispatchDragEvent):
+ (KHTMLView::focusNextPrevNode):
+ (KHTMLView::mediaType):
+ (KHTMLView::setScrollBarsMode):
+ (KHTMLView::restoreScrollBar):
+ (KHTMLView::viewportWheelEvent):
+ * khtml/khtmlview.h:
+ * khtml/misc/decoder.cpp:
+ (Decoder::setEncoding):
+ (Decoder::decode):
+ (Decoder::flush):
+ * khtml/misc/decoder.h:
+ * khtml/misc/helper.cpp:
+ (khtml::findWordBoundary):
+ (khtml::nextWordFromIndex):
+ (khtml::findSentenceBoundary):
+ (khtml::nextSentenceFromIndex):
+ * khtml/misc/helper.h:
+ * khtml/misc/loader.cpp:
+ (CachedObject::~CachedObject):
+ (CachedImageCallback::clear):
+ (CachedImage::CachedImage):
+ (CachedImage::tiled_pixmap):
+ (CachedImage::pixmap):
+ (CachedImage::setShowAnimations):
+ (CachedImage::clear):
+ (CachedImage::data):
+ (CachedImage::error):
+ (DocLoader::DocLoader):
+ (DocLoader::requestImage):
+ (DocLoader::requestStyleSheet):
+ (DocLoader::requestScript):
+ (DocLoader::requestXSLStyleSheet):
+ (DocLoader::requestXBLDocument):
+ (Loader::Loader):
+ (Loader::~Loader):
+ (Loader::servePendingRequests):
+ (Loader::slotFinished):
+ (Loader::slotData):
+ (Loader::numRequests):
+ (Loader::cancelRequests):
+ (Loader::removeBackgroundDecodingRequest):
+ (Cache::init):
+ (Cache::requestImage):
+ (Cache::requestStyleSheet):
+ (Cache::requestScript):
+ (Cache::requestXSLStyleSheet):
+ (Cache::requestXBLDocument):
+ * khtml/misc/loader.h:
+ (khtml::CachedObject::CachedObject):
+ * khtml/misc/stringit.h:
+ (khtml::TokenizerSubstring::TokenizerSubstring):
+ * khtml/rendering/render_applet.cpp:
+ (RenderApplet::RenderApplet):
+ (RenderApplet::layout):
+ (RenderEmptyApplet::RenderEmptyApplet):
+ (RenderEmptyApplet::layout):
+ * khtml/rendering/render_applet.h:
+ * khtml/rendering/render_canvas.cpp:
+ (RenderCanvas::setBestTruncatedAt):
+ * khtml/rendering/render_canvas.h:
+ (khtml::RenderCanvas::printImages):
+ * khtml/rendering/render_container.cpp:
+ (RenderContainer::addChild):
+ (RenderContainer::removeChildNode):
+ (RenderContainer::appendChildNode):
+ (RenderContainer::insertChildNode):
+ * khtml/rendering/render_flexbox.cpp:
+ (khtml::RenderFlexibleBox::layoutVerticalBox):
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::paintLines):
+ (RenderFlow::paintFocusRing):
+ * khtml/rendering/render_flow.h:
+ * khtml/rendering/render_form.cpp:
+ (RenderFormElement::baselinePosition):
+ (RenderFormElement::setStyle):
+ (RenderFormElement::updateFromElement):
+ (RenderFormElement::layout):
+ (RenderLineEdit::RenderLineEdit):
+ (RenderLineEdit::slotReturnPressed):
+ (RenderLineEdit::addSearchResult):
+ (RenderLineEdit::calcMinMaxWidth):
+ (RenderLineEdit::setStyle):
+ (RenderLineEdit::updateFromElement):
+ (RenderFileButton::RenderFileButton):
+ (RenderFileButton::calcMinMaxWidth):
+ (RenderFileButton::slotClicked):
+ (RenderFileButton::updateFromElement):
+ (RenderFileButton::select):
+ (ComboBoxWidget::event):
+ (ComboBoxWidget::eventFilter):
+ (RenderSelect::updateFromElement):
+ (RenderSelect::layout):
+ (RenderTextArea::RenderTextArea):
+ (RenderTextArea::calcMinMaxWidth):
+ (RenderTextArea::setStyle):
+ (RenderTextArea::updateFromElement):
+ (RenderTextArea::text):
+ (RenderTextArea::selectionStart):
+ (RenderTextArea::selectionEnd):
+ (RenderTextArea::setSelectionStart):
+ (RenderTextArea::setSelectionEnd):
+ (RenderTextArea::setSelectionRange):
+ * khtml/rendering/render_form.h:
+ (khtml::RenderFormElement::intrinsicMargin):
+ (khtml::RenderLineEdit::canHaveIntrinsicMargins):
+ (khtml::RenderSelect::canHaveIntrinsicMargins):
+ (khtml::RenderTextArea::canHaveIntrinsicMargins):
+ * khtml/rendering/render_frames.cpp:
+ (RenderFrameSet::userResize):
+ (RenderFrame::slotViewCleared):
+ (RenderPartObject::layout):
+ (RenderPartObject::slotViewCleared):
+ * khtml/rendering/render_image.cpp:
+ (RenderImage::setPixmap):
+ (RenderImage::resetAnimation):
+ (RenderImage::paint):
+ (RenderImage::layout):
+ * khtml/rendering/render_image.h:
+ * khtml/rendering/render_layer.cpp:
+ (khtml::RenderLayer::scrollToOffset):
+ (khtml::RenderLayer::updateScrollInfoAfterLayout):
+ (khtml::RenderLayer::paintScrollbars):
+ (khtml::setClip):
+ (khtml::RenderLayer::paintLayer):
+ (khtml::RenderLayer::hitTest):
+ * khtml/rendering/render_layer.h:
+ * khtml/rendering/render_line.cpp:
+ (khtml::InlineFlowBox::paintDecorations):
+ * khtml/rendering/render_list.cpp:
+ (RenderListMarker::paint):
+ * khtml/rendering/render_list.h:
+ (khtml::RenderListItem::markerStringValue):
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::addFocusRingRects):
+ (RenderObject::paintOutline):
+ (RenderObject::setStyle):
+ (RenderObject::removeFromObjectLists):
+ (RenderObject::remove):
+ (RenderObject::backslashAsCurrencySymbol):
+ * khtml/rendering/render_object.h:
+ * khtml/rendering/render_replaced.cpp:
+ (RenderWidget::resizeWidget):
+ (RenderWidget::sendConsumedMouseUp):
+ (RenderWidget::setStyle):
+ * khtml/rendering/render_replaced.h:
+ * khtml/rendering/render_style.cpp:
+ (StyleVisualData::StyleVisualData):
+ (StyleCSS3NonInheritedData::operator==):
+ (textSizeAdjust):
+ (StyleCSS3InheritedData):
+ (StyleCSS3InheritedData::operator==):
+ (RenderStyle::diff):
+ * khtml/rendering/render_style.h:
+ (khtml::StyleVisualData::operator==):
+ (khtml::RenderStyle::textSizeAdjust):
+ (khtml::RenderStyle::setDashboardRegion):
+ (khtml::RenderStyle::setTextSizeAdjust):
+ * khtml/rendering/render_text.h:
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::DocumentImpl):
+ (DocumentImpl::~DocumentImpl):
+ (DocumentImpl::updateTitle):
+ (DocumentImpl::recalcStyle):
+ (DocumentImpl::updateRendering):
+ (DocumentImpl::attach):
+ (DocumentImpl::detach):
+ (DocumentImpl::getAccObjectCache):
+ (DocumentImpl::updateSelection):
+ (DocumentImpl::implicitClose):
+ (DocumentImpl::processHttpEquiv):
+ (DocumentImpl::updateStyleSelector):
+ (DocumentImpl::setFocusNode):
+ * khtml/xml/dom_docimpl.h:
+ * khtml/xml/dom_elementimpl.cpp:
+ (ElementImpl::recalcStyle):
+ * khtml/xml/dom_elementimpl.h:
+ * khtml/xml/dom_nodeimpl.cpp:
+ (DOM::NodeImpl::dispatchKeyEvent):
+ (DOM::NodeImpl::createRendererIfNeeded):
+ * khtml/xml/dom_position.cpp:
+ * khtml/xml/dom_textimpl.h:
+ * khtml/xml/dom_xmlimpl.h:
+ * khtml/xml/xml_tokenizer.cpp:
+ (khtml::Tokenizer::Tokenizer):
+ (khtml::Tokenizer::finishedParsing):
+ (khtml::XMLTokenizer::error):
+ * khtml/xml/xml_tokenizer.h:
+
2005-11-20 Eric Seidel <eseidel at apple.com>
No review, rollout only.
1.358 +70 -2525 WebCore/khtml/khtml_part.cpp
Index: khtml_part.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtml_part.cpp,v
retrieving revision 1.357
retrieving revision 1.358
diff -u -r1.357 -r1.358
--- khtml_part.cpp 7 Nov 2005 19:59:21 -0000 1.357
+++ khtml_part.cpp 21 Nov 2005 01:19:48 -0000 1.358
@@ -27,11 +27,9 @@
#include "config.h"
#include "khtml_part.h"
-#if APPLE_CHANGES
#define DIRECT_LINKAGE_TO_ECMA
#define QT_NO_CLIPBOARD
#define QT_NO_DRAGANDDROP
-#endif
#include "khtml_pagecache.h"
@@ -109,9 +107,7 @@
#include "dom/html_document.h"
#endif
-#if APPLE_CHANGES
#include <CoreServices/CoreServices.h>
-#endif
using namespace DOM::EventNames;
@@ -190,24 +186,8 @@
d = 0;
KHTMLFactory::registerPart( this );
setInstance( KHTMLFactory::instance(), prof == BrowserViewGUI && !parentPart() );
-#if !APPLE_CHANGES
- init( new KHTMLView( this, parentWidget, widgetname ), prof );
-#endif
-}
-
-#if !APPLE_CHANGES
-
-KHTMLPart::KHTMLPart( KHTMLView *view, QObject *parent, const char *name, GUIProfile prof )
-: KParts::ReadOnlyPart( parent, name )
-{
- d = 0;
- KHTMLFactory::registerPart( this );
- setInstance( KHTMLFactory::instance(), prof == BrowserViewGUI && !parentPart() );
- assert( view );
- init( view, prof );
}
-#endif // APPLE_CHANGES
void KHTMLPart::init( KHTMLView *view, GUIProfile prof )
{
@@ -227,78 +207,19 @@
d->m_view = view;
setWidget( d->m_view );
-#if !APPLE_CHANGES
- d->m_guiProfile = prof;
-#endif
d->m_extension = new KHTMLPartBrowserExtension( this );
d->m_hostExtension = new KHTMLPartBrowserHostExtension( this );
d->m_bSecurityInQuestion = false;
d->m_bMousePressed = false;
-#if !APPLE_CHANGES
- d->m_paLoadImages = 0;
- d->m_paViewDocument = new KAction( i18n( "View Document Source" ), 0, this, SLOT( slotViewDocumentSource() ), actionCollection(), "viewDocumentSource" );
- d->m_paViewFrame = new KAction( i18n( "View Frame Source" ), 0, this, SLOT( slotViewFrameSource() ), actionCollection(), "viewFrameSource" );
- d->m_paSaveBackground = new KAction( i18n( "Save &Background Image As..." ), 0, this, SLOT( slotSaveBackground() ), actionCollection(), "saveBackground" );
- d->m_paSaveDocument = new KAction( i18n( "&Save As..." ), CTRL+Key_S, this, SLOT( slotSaveDocument() ), actionCollection(), "saveDocument" );
- if ( parentPart() )
- d->m_paSaveDocument->setShortcut( KShortcut() ); // avoid clashes
- d->m_paSaveFrame = new KAction( i18n( "Save &Frame As..." ), 0, this, SLOT( slotSaveFrame() ), actionCollection(), "saveFrame" );
- d->m_paSecurity = new KAction( i18n( "Security..." ), "decrypted", 0, this, SLOT( slotSecurity() ), actionCollection(), "security" );
- d->m_paDebugRenderTree = new KAction( "print rendering tree to stdout", 0, this, SLOT( slotDebugRenderTree() ), actionCollection(), "debugRenderTree" );
- d->m_paDebugDOMTree = new KAction( "print DOM tree to stdout", 0, this, SLOT( slotDebugDOMTree() ), actionCollection(), "debugDOMTree" );
-
- QString foo1 = i18n("Show Images");
- QString foo2 = i18n("Show Animated Images");
- QString foo3 = i18n("Stop Animated Images");
-
- d->m_paSetEncoding = new KSelectAction( i18n( "Set &Encoding" ), 0, this, SLOT( slotSetEncoding() ), actionCollection(), "setEncoding" );
- QStringList encodings = KGlobal::charsets()->descriptiveEncodingNames();
- encodings.prepend( i18n( "Auto" ) );
- d->m_paSetEncoding->setItems( encodings );
- d->m_paSetEncoding->setCurrentItem(0);
-
- d->m_paUseStylesheet = new KSelectAction( i18n( "&Use Stylesheet"), 0, this, SLOT( slotUseStylesheet() ), actionCollection(), "useStylesheet" );
-
- d->m_paIncZoomFactor = new KHTMLZoomFactorAction( this, true, i18n( "Increase Font Sizes" ), "viewmag+", this, SLOT( slotIncZoom() ), actionCollection(), "incFontSizes" );
- d->m_paDecZoomFactor = new KHTMLZoomFactorAction( this, false, i18n( "Decrease Font Sizes" ), "viewmag-", this, SLOT( slotDecZoom() ), actionCollection(), "decFontSizes" );
-
- d->m_paFind = KStdAction::find( this, SLOT( slotFind() ), actionCollection(), "find" );
- if ( parentPart() )
- d->m_paFind->setShortcut( KShortcut() ); // avoid clashes
-
- d->m_paPrintFrame = new KAction( i18n( "Print Frame" ), "frameprint", 0, this, SLOT( slotPrintFrame() ), actionCollection(), "printFrame" );
-
- d->m_paSelectAll = KStdAction::selectAll( this, SLOT( slotSelectAll() ), actionCollection(), "selectAll" );
- if ( parentPart() )
- d->m_paSelectAll->setShortcut( KShortcut() ); // avoid clashes
-#endif
-#if !APPLE_CHANGES
- // set the default java(script) flags according to the current host.
- d->m_bJScriptEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaScriptEnabled();
- d->m_bJScriptDebugEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaScriptDebugEnabled();
- d->m_bJavaEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaEnabled();
- d->m_bPluginsEnabled = KHTMLFactory::defaultHTMLSettings()->isPluginsEnabled();
-#else
// The java, javascript, and plugin settings will be set after the settings
// have been initialized.
d->m_bJScriptEnabled = true;
d->m_bJScriptDebugEnabled = true;
d->m_bJavaEnabled = true;
d->m_bPluginsEnabled = true;
-#endif
-
-#if !APPLE_CHANGES
- connect( this, SIGNAL( completed() ),
- this, SLOT( updateActions() ) );
- connect( this, SIGNAL( completed( bool ) ),
- this, SLOT( updateActions() ) );
- connect( this, SIGNAL( started( KIO::Job * ) ),
- this, SLOT( updateActions() ) );
- d->m_popupMenuXML = KXMLGUIFactory::readConfigFile( locate( "data", "khtml/khtml_popupmenu.rc", KHTMLFactory::instance() ) );
-#endif
connect( khtml::Cache::loader(), SIGNAL( requestStarted( khtml::DocLoader*, khtml::CachedObject* ) ),
this, SLOT( slotLoaderRequestStarted( khtml::DocLoader*, khtml::CachedObject* ) ) );
@@ -307,36 +228,17 @@
connect( khtml::Cache::loader(), SIGNAL( requestFailed( khtml::DocLoader*, khtml::CachedObject *) ),
this, SLOT( slotLoaderRequestDone( khtml::DocLoader*, khtml::CachedObject *) ) );
-#if !APPLE_CHANGES
- findTextBegin(); //reset find variables
-#endif
connect( &d->m_redirectionTimer, SIGNAL( timeout() ),
this, SLOT( slotRedirect() ) );
connect(&d->m_lifeSupportTimer, SIGNAL(timeout()), this, SLOT(slotEndLifeSupport()));
-#if !APPLE_CHANGES
- d->m_dcopobject = new KHTMLPartIface(this);
-#endif
}
KHTMLPart::~KHTMLPart()
{
//kdDebug(6050) << "KHTMLPart::~KHTMLPart " << this << endl;
-#if !APPLE_CHANGES
- if ( d->m_findDialog )
- disconnect( d->m_findDialog, SIGNAL( destroyed() ),
- this, SLOT( slotFindDialogDestroyed() ) );
-
- if ( d->m_manager )
- {
- d->m_manager->setActivePart( 0 );
- // Shouldn't we delete d->m_manager here ? (David)
- // No need to, I would say. We specify "this" as parent qobject
- // in ::partManager() (Simon)
- }
-#endif
stopAutoScroll();
cancelRedirection();
@@ -360,9 +262,7 @@
d->m_view->m_part = 0;
}
-#if APPLE_CHANGES
delete d->m_hostExtension;
-#endif
delete d; d = 0;
KHTMLFactory::deregisterPart( this );
@@ -389,23 +289,13 @@
d->m_workingURL = url;
// set the java(script) flags according to the current host.
-#if !APPLE_CHANGES
- d->m_bJScriptEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaScriptEnabled(url.host());
- d->m_bJScriptDebugEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaScriptDebugEnabled();
- d->m_bJavaEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaEnabled(url.host());
- d->m_bPluginsEnabled = KHTMLFactory::defaultHTMLSettings()->isPluginsEnabled(url.host());
-#else
d->m_bJScriptEnabled = d->m_settings->isJavaScriptEnabled(url.host());
d->m_bJScriptDebugEnabled = d->m_settings->isJavaScriptDebugEnabled();
d->m_bJavaEnabled = d->m_settings->isJavaEnabled(url.host());
d->m_bPluginsEnabled = d->m_settings->isPluginsEnabled(url.host());
-#endif
m_url = url;
-#if !APPLE_CHANGES
- KHTMLPageCache::self()->fetchData( d->m_cacheId, this, SLOT(slotRestoreData(const QByteArray &)));
-#endif
emit started( 0L );
@@ -413,11 +303,7 @@
}
-#if APPLE_CHANGES
bool KHTMLPart::didOpenURL(const KURL &url)
-#else
-bool KHTMLPart::openURL( const KURL &url )
-#endif
{
kdDebug( 6050 ) << "KHTMLPart(" << this << ")::openURL " << url.url() << endl;
@@ -432,74 +318,11 @@
// clear last edit command
d->m_lastEditCommand = EditCommandPtr();
-#if APPLE_CHANGES
KWQ(this)->clearUndoRedoOperations();
-#endif
-#if !APPLE_CHANGES
- // check to see if this is an "error://" URL. This is caused when an error
- // occurs before this part was loaded (e.g. KonqRun), and is passed to
- // khtmlpart so that it can display the error.
- if ( url.protocol() == "error" && url.hasSubURL() ) {
- closeURL();
- /**
- * The format of the error url is that two variables are passed in the query:
- * error = int kio error code, errText = QString error text from kio
- * and the URL where the error happened is passed as a sub URL.
- */
- KURL::List urls = KURL::split( url );
- //kdDebug() << "Handling error URL. URL count:" << urls.count() << endl;
-
- if ( urls.count() > 1 ) {
- KURL mainURL = urls.first();
- int error = mainURL.queryItem( "error" ).toInt();
- // error=0 isn't a valid error code, so 0 means it's missing from the URL
- if ( error == 0 ) error = KIO::ERR_UNKNOWN;
- QString errorText = mainURL.queryItem( "errText" );
- urls.pop_front();
- d->m_workingURL = KURL::join( urls );
- //kdDebug() << "Emitting fixed URL " << d->m_workingURL.prettyURL() << endl;
- emit d->m_extension->setLocationBarURL( d->m_workingURL.prettyURL() );
- htmlError( error, errorText, d->m_workingURL );
- return true;
- }
- }
-#endif // APPLE_CHANGES
KParts::URLArgs args( d->m_extension->urlArgs() );
-#if !APPLE_CHANGES
- // in case we have a) no frameset (don't test m_frames.count(), iframes get in there)
- // b) the url is identical with the currently
- // displayed one (except for the htmlref!) , c) the url request is not a POST
- // operation and d) the caller did not request to reload the page we try to
- // be smart and instead of reloading the whole document we just jump to the
- // request html anchor
- if (d->m_doc) {
- bool isFrameSet = false;
- if ( d->m_doc->isHTMLDocument() ) {
- HTMLDocumentImpl* htmlDoc = static_cast<HTMLDocumentImpl*>(d->m_doc);
- isFrameSet = htmlDoc->body() && (htmlDoc->body()->id() == ID_FRAMESET);
- }
- if ( !isFrameSet &&
- urlcmp( url.url(), m_url.url(), true, true ) &&
- url.hasRef() && !args.doPost() && !args.reload )
- {
- kdDebug( 6050 ) << "KHTMLPart::openURL, jumping to anchor. m_url = " << url.url() << endl;
- m_url = url;
- emit started( 0L );
-
- gotoAnchor();
-
- d->m_bComplete = true;
- d->m_doc->setParsing(false);
-
- kdDebug( 6050 ) << "completed..." << endl;
- emit completed();
- return true;
- }
- }
-#endif // APPLE_CHANGES
if (!d->m_restored)
{
@@ -507,11 +330,6 @@
closeURL();
}
-#if !APPLE_CHANGES
- args.metaData().insert("main_frame_request", parentPart() == 0 ? "TRUE" : "FALSE" );
- args.metaData().insert("ssl_was_in_use", d->m_ssl_in_use ? "TRUE" : "FALSE" );
- args.metaData().insert("ssl_activate_warnings", "TRUE" );
-#endif
if (d->m_restored)
d->m_cachePolicy = KIO::CC_Cache;
@@ -535,10 +353,6 @@
connect( d->m_job, SIGNAL( result( KIO::Job * ) ),
SLOT( slotFinished( KIO::Job * ) ) );
-#if !APPLE_CHANGES
- connect( d->m_job, SIGNAL( data( KIO::Job*, const QByteArray &)),
- SLOT( slotData( KIO::Job*, const QByteArray &)));
-#endif
connect( d->m_job, SIGNAL(redirection(KIO::Job*, const KURL&) ),
SLOT( slotRedirection(KIO::Job*,const KURL&) ) );
@@ -555,15 +369,9 @@
}
// set the javascript flags according to the current url
-#if !APPLE_CHANGES
- d->m_bJScriptDebugEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaScriptDebugEnabled();
- d->m_bJavaEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaEnabled(url.host());
- d->m_bPluginsEnabled = KHTMLFactory::defaultHTMLSettings()->isPluginsEnabled(url.host());
-#else
d->m_bJScriptDebugEnabled = d->m_settings->isJavaScriptDebugEnabled();
d->m_bJavaEnabled = d->m_settings->isJavaEnabled(url.host());
d->m_bPluginsEnabled = d->m_settings->isPluginsEnabled(url.host());
-#endif
// initializing m_url to the new url breaks relative links when opening such a link after this call and _before_ begin() is called (when the first
// data arrives) (Simon)
@@ -608,9 +416,6 @@
if ( d->m_job )
{
-#if !APPLE_CHANGES
- KHTMLPageCache::self()->cancelEntry(d->m_cacheId);
-#endif
d->m_job->kill();
d->m_job = 0;
}
@@ -636,9 +441,6 @@
d->m_bLoadEventEmitted = true; // don't want that one either
d->m_cachePolicy = KIO::CC_Verify; // Why here?
-#if !APPLE_CHANGES
- KHTMLPageCache::self()->cancelFetch(this);
-#endif
if ( d->m_doc && d->m_doc->parsing() )
{
kdDebug( 6050 ) << " was still parsing... calling end " << endl;
@@ -884,15 +686,7 @@
{
#ifndef Q_WS_QWS
if ( !d->m_javaContext ) {
-#if APPLE_CHANGES
d->m_javaContext = new KJavaAppletContext(d->m_dcopobject, this);
-#else
- d->m_javaContext = new KJavaAppletContext(d->m_dcopobject);
- connect( d->m_javaContext, SIGNAL(showStatus(const QString&)),
- this, SIGNAL(setStatusBarText(const QString&)) );
- connect( d->m_javaContext, SIGNAL(showDocument(const QString&, const QString&)),
- this, SLOT(slotShowDocument(const QString&, const QString&)) );
-#endif
}
return d->m_javaContext;
@@ -914,68 +708,6 @@
return d->m_bPluginsEnabled;
}
-#if !APPLE_CHANGES
-
-void KHTMLPart::slotShowDocument( const QString &url, const QString &target )
-{
- // this is mostly copied from KHTMLPart::slotChildURLRequest. The better approach
- // would be to put those functions into a single one.
- khtml::ChildFrame *child = 0;
- KParts::URLArgs args;
- args.frameName = target;
-
- QString frameName = args.frameName.lower();
- if ( !frameName.isEmpty() )
- {
- if ( frameName == QString::fromLatin1( "_top" ) )
- {
- emit d->m_extension->openURLRequest( url, args );
- return;
- }
- else if ( frameName == QString::fromLatin1( "_blank" ) )
- {
- emit d->m_extension->createNewWindow( url, args );
- return;
- }
- else if ( frameName == QString::fromLatin1( "_parent" ) )
- {
- KParts::URLArgs newArgs( args );
- newArgs.frameName = QString::null;
-
- emit d->m_extension->openURLRequest( url, newArgs );
- return;
- }
- else if ( frameName != QString::fromLatin1( "_self" ) )
- {
- khtml::ChildFrame *_frame = recursiveFrameRequest( url, args );
-
- if ( !_frame )
- {
- emit d->m_extension->openURLRequest( url, args );
- return;
- }
-
- child = _frame;
- }
- }
-
- // TODO: handle child target correctly! currently the script are always executed fur the parent
- if ( url.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 ) {
- executeScript( KURL::decode_string( url.right( url.length() - 11) ) );
- return;
- }
-
- if ( child ) {
- requestObject( child, KURL(url), args );
- } else if ( frameName==QString::fromLatin1("_self") ) // this is for embedded objects (via <object>) which want to replace the current document
- {
- KParts::URLArgs newArgs( args );
- newArgs.frameName = QString::null;
- emit d->m_extension->openURLRequest( KURL(url), newArgs );
- }
-}
-
-#endif // APPLE_CHANGES
void KHTMLPart::slotDebugDOMTree()
{
@@ -999,22 +731,6 @@
if ( d->m_doc )
d->m_doc->docLoader()->setAutoloadImages( enable );
-#if !APPLE_CHANGES
- unplugActionList( "loadImages" );
-
- if ( enable ) {
- delete d->m_paLoadImages;
- d->m_paLoadImages = 0;
- }
- else if ( !d->m_paLoadImages )
- d->m_paLoadImages = new KAction( i18n( "Display Images on Page" ), "images_display", 0, this, SLOT( slotLoadImages() ), actionCollection(), "loadImages" );
-
- if ( d->m_paLoadImages ) {
- QPtrList<KAction> lst;
- lst.append( d->m_paLoadImages );
- plugActionList( "loadImages", lst );
- }
-#endif
}
bool KHTMLPart::autoloadImages() const
@@ -1033,32 +749,6 @@
d->m_bClearing = true;
-#if !APPLE_CHANGES
- {
- ConstFrameIt it = d->m_frames.begin();
- ConstFrameIt end = d->m_frames.end();
- for(; it != end; ++it )
- {
- // Stop HTMLRun jobs for frames
- if ( (*it).m_run )
- (*it).m_run->abort();
- }
- }
-
- {
- QValueList<khtml::ChildFrame>::ConstIterator it = d->m_objects.begin();
- QValueList<khtml::ChildFrame>::ConstIterator end = d->m_objects.end();
- for(; it != end; ++it )
- {
- // Stop HTMLRun jobs for objects
- if ( (*it).m_run )
- (*it).m_run->abort();
- }
- }
-
-
- findTextBegin(); // resets d->m_findNode and d->m_findPos
-#endif
d->m_mousePressNode.reset();
@@ -1091,9 +781,6 @@
if ( (*it).m_part )
{
disconnectChild(&*it);
-#if !APPLE_CHANGES
- partManager()->removePart( (*it).m_part );
-#endif
(*it).m_part->deref();
}
}
@@ -1107,9 +794,6 @@
{
if ( (*it).m_part )
{
-#if !APPLE_CHANGES
- partManager()->removePart( (*it).m_part );
-#endif
(*it).m_part->deref();
}
}
@@ -1138,11 +822,6 @@
connect( kapp->clipboard(), SIGNAL( selectionChanged()), SLOT( slotClearSelection()));
#endif
-#if !APPLE_CHANGES
- d->m_totalObjectCount = 0;
- d->m_loadedObjects = 0;
- d->m_jobPercent = 0;
-#endif
if ( !d->m_haveEncoding )
d->m_encoding = QString::null;
@@ -1195,49 +874,9 @@
d->m_doc->docLoader()->setCachePolicy(d->m_cachePolicy);
d->m_workingURL = KURL();
-#if !APPLE_CHANGES
- d->m_cacheId = KHTMLPageCache::self()->createCacheEntry();
-#endif
// When the first data arrives, the metadata has just been made available
-#if APPLE_CHANGES
QString qData;
-#else
- d->m_bSecurityInQuestion = false;
- d->m_ssl_in_use = (d->m_job->queryMetaData("ssl_in_use") == "TRUE");
- kdDebug(6050) << "SSL in use? " << d->m_job->queryMetaData("ssl_in_use") << endl;
-
- {
- KHTMLPart *p = parentPart();
- if (p && p->d->m_ssl_in_use != d->m_ssl_in_use) {
- while (p->parentPart()) p = p->parentPart();
-
- p->d->m_paSecurity->setIcon( "halfencrypted" );
- p->d->m_bSecurityInQuestion = true;
- kdDebug(6050) << "parent setIcon half done." << endl;
- }
- }
-
- d->m_paSecurity->setIcon( d->m_ssl_in_use ? "encrypted" : "decrypted" );
- kdDebug(6050) << "setIcon " << ( d->m_ssl_in_use ? "encrypted" : "decrypted" ) << " done." << endl;
-
- // Shouldn't all of this be done only if ssl_in_use == true ? (DF)
-
- d->m_ssl_peer_certificate = d->m_job->queryMetaData("ssl_peer_certificate");
- d->m_ssl_peer_chain = d->m_job->queryMetaData("ssl_peer_chain");
- d->m_ssl_peer_ip = d->m_job->queryMetaData("ssl_peer_ip");
- d->m_ssl_cipher = d->m_job->queryMetaData("ssl_cipher");
- d->m_ssl_cipher_desc = d->m_job->queryMetaData("ssl_cipher_desc");
- d->m_ssl_cipher_version = d->m_job->queryMetaData("ssl_cipher_version");
- d->m_ssl_cipher_used_bits = d->m_job->queryMetaData("ssl_cipher_used_bits");
- d->m_ssl_cipher_bits = d->m_job->queryMetaData("ssl_cipher_bits");
- d->m_ssl_cert_state = d->m_job->queryMetaData("ssl_cert_state");
-
- // Check for charset meta-data
- QString qData = d->m_job->queryMetaData("charset");
- if ( !qData.isEmpty() && !d->m_haveEncoding ) // only use information if the user didn't override the settings
- d->m_encoding = qData;
-#endif // APPLE_CHANGES
// Support for http-refresh
qData = d->m_job->queryMetaData("http-refresh");
@@ -1252,12 +891,8 @@
if( pos == -1 )
{
delay = qData.stripWhiteSpace().toDouble();
-#if APPLE_CHANGES
// We want a new history item if the refresh timeout > 1 second
scheduleRedirection( delay, m_url.url(), delay <= 1);
-#else
- scheduleRedirection( delay, m_url.url());
-#endif
}
else
{
@@ -1283,12 +918,8 @@
end_pos = index;
}
}
-#if APPLE_CHANGES
// We want a new history item if the refresh timeout > 1 second
scheduleRedirection( delay, d->m_doc->completeURL( qData.mid( pos, end_pos ) ), delay <= 1);
-#else
- scheduleRedirection( delay, d->m_doc->completeURL( qData.mid( pos, end_pos ) ));
-#endif
}
d->m_bHTTPRefresh = true;
}
@@ -1298,193 +929,18 @@
//kdDebug() << "KHTMLPart::slotData metadata modified: " << d->m_lastModified << endl;
}
-#if !APPLE_CHANGES
-
-void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data )
-{
- assert ( d->m_job == kio_job );
-
- //kdDebug( 6050 ) << "slotData: " << data.size() << endl;
- // The first data ?
- if ( !d->m_workingURL.isEmpty() )
- receivedFirstData( );
-
- KHTMLPageCache::self()->addData(d->m_cacheId, data);
- write( data.data(), data.size() );
-}
-
-void KHTMLPart::slotRestoreData(const QByteArray &data )
-{
- // The first data ?
- if ( !d->m_workingURL.isEmpty() )
- {
- long saveCacheId = d->m_cacheId;
- begin( d->m_workingURL, d->m_extension->urlArgs().xOffset, d->m_extension->urlArgs().yOffset );
- d->m_cacheId = saveCacheId;
- d->m_workingURL = KURL();
- }
-
- //kdDebug( 6050 ) << "slotRestoreData: " << data.size() << endl;
- write( data.data(), data.size() );
-
- if (data.size() == 0)
- {
- //kdDebug( 6050 ) << "slotRestoreData: <<end of data>>" << endl;
- // End of data.
- if (d->m_doc && d->m_doc->parsing())
- end(); //will emit completed()
- }
-}
-
-void KHTMLPart::showError( KIO::Job* job )
-{
- kdDebug() << "KHTMLPart::showError d->m_bParsing=" << (d->m_doc && d->m_doc->parsing()) << " d->m_bComplete=" << d->m_bComplete
- << " d->m_bCleared=" << d->m_bCleared << endl;
-
- if (job->error() == KIO::ERR_NO_CONTENT)
- return;
-
- if ( (d->m_doc && d->m_doc->parsing()) || d->m_workingURL.isEmpty() ) // if we got any data already
- job->showErrorDialog( /*d->m_view*/ );
- else
- {
- htmlError( job->error(), job->errorText(), d->m_workingURL );
- }
-}
-
-// This is a protected method, placed here because of it's relevance to showError
-void KHTMLPart::htmlError( int errorCode, const QString& text, const KURL& reqUrl )
-{
- kdDebug(6050) << "KHTMLPart::htmlError errorCode=" << errorCode << " text=" << text << endl;
- // make sure we're not executing any embedded JS
- bool bJSFO = d->m_bJScriptForce;
- bool bJSOO = d->m_bJScriptOverride;
- d->m_bJScriptForce = false;
- d->m_bJScriptOverride = true;
- begin();
- QString errText = QString::fromLatin1( "<HTML><HEAD><TITLE>" );
- errText += i18n( "Error while loading %1" ).arg( reqUrl.htmlURL() );
- errText += QString::fromLatin1( "</TITLE></HEAD><BODY><P>" );
- errText += i18n( "An error occured while loading <B>%1</B>:" ).arg( reqUrl.htmlURL() );
- errText += QString::fromLatin1( "</P><P>" );
- QString kioErrString = KIO::buildErrorString( errorCode, text );
-
- kioErrString.replace(QRegExp("&"), QString("&"));
- kioErrString.replace(QRegExp("<"), QString("<"));
- kioErrString.replace(QRegExp(">"), QString(">"));
-
- // In case the error string has '\n' in it, replace with <BR/>
- kioErrString.replace( QRegExp("\n"), "<BR/>" );
-
- errText += kioErrString;
- errText += QString::fromLatin1( "</P></BODY></HTML>" );
- write(errText);
- end();
-
- d->m_bJScriptForce = bJSFO;
- d->m_bJScriptOverride = bJSOO;
-
- // make the working url the current url, so that reload works and
- // emit the progress signals to advance one step in the history
- // (so that 'back' works)
- m_url = reqUrl; // same as d->m_workingURL
- d->m_workingURL = KURL();
- emit started( 0 );
- emit completed();
- return;
- // following disabled until 3.1
-
- QString errorName, techName, description;
- QStringList causes, solutions;
-
- QByteArray raw = KIO::rawErrorDetail( errorCode, text, &reqUrl );
- QDataStream stream(raw, IO_ReadOnly);
-
- stream >> errorName >> techName >> description >> causes >> solutions;
-
- QString url, protocol, datetime;
- url = reqUrl.prettyURL();
- protocol = reqUrl.protocol();
- datetime = KGlobal::locale()->formatDateTime( QDateTime::currentDateTime(),
- false );
-
- QString doc = QString::fromLatin1( "<html><head><title>" );
- doc += i18n( "Error: " );
- doc += errorName;
- doc += QString::fromLatin1( " - %1</title></head><body><h1>" ).arg( url );
- doc += i18n( "The requested operation could not be completed" );
- doc += QString::fromLatin1( "</h1><h2>" );
- doc += errorName;
- doc += QString::fromLatin1( "</h2>" );
- if ( techName != QString::null ) {
- doc += QString::fromLatin1( "<h2>" );
- doc += i18n( "Technical Reason: " );
- doc += techName;
- doc += QString::fromLatin1( "</h2>" );
- }
- doc += QString::fromLatin1( "<h3>" );
- doc += i18n( "Details of the Request:" );
- doc += QString::fromLatin1( "</h3><ul><li>" );
- doc += i18n( "URL: %1" ).arg( url );
- doc += QString::fromLatin1( "</li><li>" );
- if ( protocol != QString::null ) {
- // uncomment for 3.1... i18n change
- // doc += i18n( "Protocol: %1" ).arg( protocol ).arg( protocol );
- doc += QString::fromLatin1( "</li><li>" );
- }
- doc += i18n( "Date and Time: %1" ).arg( datetime );
- doc += QString::fromLatin1( "</li><li>" );
- doc += i18n( "Additional Information: %1" ).arg( text );
- doc += QString::fromLatin1( "</li></ul><h3>" );
- doc += i18n( "Description:" );
- doc += QString::fromLatin1( "</h3><p>" );
- doc += description;
- doc += QString::fromLatin1( "</p>" );
- if ( causes.count() ) {
- doc += QString::fromLatin1( "<h3>" );
- doc += i18n( "Possible Causes:" );
- doc += QString::fromLatin1( "</h3><ul><li>" );
- doc += causes.join( "</li><li>" );
- doc += QString::fromLatin1( "</li></ul>" );
- }
- if ( solutions.count() ) {
- doc += QString::fromLatin1( "<h3>" );
- doc += i18n( "Possible Solutions:" );
- doc += QString::fromLatin1( "</h3><ul><li>" );
- doc += solutions.join( "</li><li>" );
- doc += QString::fromLatin1( "</li></ul>" );
- }
- doc += QString::fromLatin1( "</body></html>" );
-
- write( doc );
- end();
-}
-
-#endif
void KHTMLPart::slotFinished( KIO::Job * job )
{
if (job->error())
{
-#if !APPLE_CHANGES
- KHTMLPageCache::self()->cancelEntry(d->m_cacheId);
-#endif
d->m_job = 0L;
-#if !APPLE_CHANGES
- emit canceled( job->errorString() );
-#endif
// TODO: what else ?
checkCompleted();
-#if !APPLE_CHANGES
- showError( job );
-#endif
return;
}
//kdDebug( 6050 ) << "slotFinished" << endl;
-#if !APPLE_CHANGES
- KHTMLPageCache::self()->endData(d->m_cacheId);
-#endif
if ( d->m_doc && d->m_doc->docLoader()->expireDate() && m_url.protocol().lower().startsWith("http"))
KIO::http_update_cache(m_url, false, d->m_doc->docLoader()->expireDate());
@@ -1496,7 +952,6 @@
end(); //will emit completed()
}
-#if APPLE_CHANGES
void KHTMLPart::childBegin()
{
// We need to do this when the child is created so as to avoid the bogus state of the parent's
@@ -1506,52 +961,31 @@
// its child->m_bComplete.
d->m_bComplete = false;
}
-#endif
void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
{
-#if APPLE_CHANGES
// If we aren't loading an actual URL, then we need to make sure
// that we have at least an empty document. createEmptyDocument will
// do that if we don't have a document already.
if (d->m_workingURL.isEmpty()) {
KWQ(this)->createEmptyDocument();
}
-#endif
clear();
-#if APPLE_CHANGES
KWQ(this)->partClearedInBegin();
-#endif
// Only do this after clearing the part, so that JavaScript can
// clean up properly if it was on for the last load.
-#if !APPLE_CHANGES
- d->m_bJScriptEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaScriptEnabled(url.host());
-#else
d->m_bJScriptEnabled = d->m_settings->isJavaScriptEnabled(url.host());
-#endif
d->m_bCleared = false;
-#if !APPLE_CHANGES
- d->m_cacheId = 0;
-#endif
d->m_bComplete = false;
d->m_bLoadEventEmitted = false;
d->m_bLoadingMainResource = true;
if(url.isValid()) {
-#if APPLE_CHANGES
KHTMLFactory::vLinks()->insert( KWQ(this)->requestedURLString() );
-#else
- QString urlString = url.url();
- KHTMLFactory::vLinks()->insert( urlString );
- QString urlString2 = url.prettyURL();
- if ( urlString != urlString2 ) {
- KHTMLFactory::vLinks()->insert( urlString2 );
- }
-#endif
}
// ###
@@ -1570,27 +1004,11 @@
m_url = url;
KURL baseurl;
-#if APPLE_CHANGES
// We don't need KDE chained URI handling or window caption setting
if ( !m_url.isEmpty() )
{
baseurl = m_url;
}
-#else
- if ( !m_url.isEmpty() )
- {
- KURL::List lst = KURL::split( m_url );
- if ( !lst.isEmpty() )
- baseurl = *lst.begin();
-
- KURL title( baseurl );
- title.setRef( QString::null );
- title.setQuery( QString::null );
- emit setWindowCaption( title.url() );
- }
- else
- emit setWindowCaption( i18n( "no title", "* Unknown *" ) );
-#endif
if (args.serviceType == "text/xml" || args.serviceType == "application/xml" || args.serviceType == "application/xhtml+xml" ||
args.serviceType == "text/xsl" || args.serviceType == "application/rss+xml" || args.serviceType == "application/atom+xml")
@@ -1609,41 +1027,20 @@
// We prefer m_baseURL over m_url because m_url changes when we are
// about to load a new page.
d->m_doc->setBaseURL( baseurl.url() );
-#if APPLE_CHANGES
if (d->m_decoder)
d->m_doc->setDecoder(d->m_decoder);
-#endif
-#if !APPLE_CHANGES
- d->m_doc->docLoader()->setShowAnimations( KHTMLFactory::defaultHTMLSettings()->showAnimations() );
-#else
d->m_doc->docLoader()->setShowAnimations( d->m_settings->showAnimations() );
-#endif
-#if APPLE_CHANGES
KWQ(this)->updatePolicyBaseURL();
-#endif
-#if !APPLE_CHANGES
- d->m_paUseStylesheet->setItems(QStringList());
- d->m_paUseStylesheet->setEnabled( false );
-#endif
-#if !APPLE_CHANGES
- setAutoloadImages( KHTMLFactory::defaultHTMLSettings()->autoLoadImages() );
- QString userStyleSheet = KHTMLFactory::defaultHTMLSettings()->userStyleSheet();
-#else
setAutoloadImages( d->m_settings->autoLoadImages() );
QString userStyleSheet = d->m_settings->userStyleSheet();
-#endif
if ( !userStyleSheet.isEmpty() )
setUserStyleSheet( KURL( userStyleSheet ) );
-#if APPLE_CHANGES
KWQ(this)->restoreDocumentState();
-#else
- d->m_doc->setRestoreState(args.docState);
-#endif
d->m_doc->implicitOpen();
// clear widget
@@ -1651,9 +1048,6 @@
d->m_view->resizeContents( 0, 0 );
connect(d->m_doc,SIGNAL(finishedParsing()),this,SLOT(slotFinishedParsing()));
-#if !APPLE_CHANGES
- emit d->m_extension->enableAction( "print", true );
-#endif
}
void KHTMLPart::write( const char *str, int len )
@@ -1669,10 +1063,8 @@
? parentPart()->d->m_decoder->encoding() : settings()->encoding().latin1();
d->m_decoder->setEncoding(defaultEncoding, Decoder::DefaultEncoding);
}
-#if APPLE_CHANGES
if (d->m_doc)
d->m_doc->setDecoder(d->m_decoder);
-#endif
}
if ( len == 0 )
return;
@@ -1760,15 +1152,6 @@
}
}
-#if !APPLE_CHANGES
-
-void KHTMLPart::paint(QPainter *p, const QRect &rc, int yOff, bool *more)
-{
- if (!d->m_view) return;
- d->m_view->paint(p, rc, yOff, more);
-}
-
-#endif
void KHTMLPart::stopAnimations()
{
@@ -1796,11 +1179,7 @@
// Decoding here has to match encoding in completeURL, which means it has to use the
// page's encoding rather than UTF-8.
if (d->m_decoder)
-#if !APPLE_CHANGES
- gotoAnchor(KURL::decode_string(ref, d->m_decoder->codec()->mibEnum()));
-#else
gotoAnchor(KURL::decode_string(ref, d->m_decoder->codec()));
-#endif
}
}
@@ -1825,34 +1204,10 @@
void KHTMLPart::slotLoaderRequestStarted( khtml::DocLoader* dl, khtml::CachedObject *obj )
{
-#if !APPLE_CHANGES
- if ( obj && obj->type() == khtml::CachedObject::Image && d->m_doc && d->m_doc->docLoader() == dl ) {
- KHTMLPart* p = this;
- while ( p ) {
- KHTMLPart* op = p;
- p->d->m_totalObjectCount++;
- p = p->parentPart();
- if ( !p && d->m_loadedObjects <= d->m_totalObjectCount )
- QTimer::singleShot( 200, op, SLOT( slotProgressUpdate() ) );
- }
- }
-#endif
}
void KHTMLPart::slotLoaderRequestDone( khtml::DocLoader* dl, khtml::CachedObject *obj )
{
-#if !APPLE_CHANGES
- if ( obj && obj->type() == khtml::CachedObject::Image && d->m_doc && d->m_doc->docLoader() == dl ) {
- KHTMLPart* p = this;
- while ( p ) {
- KHTMLPart* op = p;
- p->d->m_loadedObjects++;
- p = p->parentPart();
- if ( !p && d->m_loadedObjects <= d->m_totalObjectCount && d->m_jobPercent >= 100 )
- QTimer::singleShot( 200, op, SLOT( slotProgressUpdate() ) );
- }
- }
-#endif
// We really only need to call checkCompleted when our own resources are done loading.
// So we should check that d->m_doc->docLoader() == dl here.
// That might help with performance by skipping some unnecessary work, but it's too
@@ -1863,53 +1218,12 @@
}
}
-#if !APPLE_CHANGES
-
-void KHTMLPart::slotProgressUpdate()
-{
- int percent;
- if ( d->m_loadedObjects < d->m_totalObjectCount )
- percent = d->m_jobPercent / 4 + ( d->m_loadedObjects*300 ) / ( 4*d->m_totalObjectCount );
- else
- percent = d->m_jobPercent;
-
- if ( d->m_loadedObjects < d->m_totalObjectCount && percent >= 75 )
- emit d->m_extension->infoMessage( i18n( "%1 of 1 Image loaded", "%1 of %n Images loaded", d->m_totalObjectCount ).arg( d->m_loadedObjects ) );
-
- emit d->m_extension->loadingProgress( percent );
-}
-
-void KHTMLPart::slotJobSpeed( KIO::Job* /*job*/, unsigned long speed )
-{
- emit d->m_extension->speedProgress( speed );
-}
-
-void KHTMLPart::slotJobPercent( KIO::Job* /*job*/, unsigned long percent )
-{
- d->m_jobPercent = percent;
-
- if ( !parentPart() )
- QTimer::singleShot( 0, this, SLOT( slotProgressUpdate() ) );
-}
-
-#endif
void KHTMLPart::checkCompleted()
{
// kdDebug( 6050 ) << "KHTMLPart::checkCompleted() parsing: " << d->m_doc->parsing() << endl;
// kdDebug( 6050 ) << " complete: " << d->m_bComplete << endl;
-#if !APPLE_CHANGES
- // restore the cursor position
- if (d->m_doc && !d->m_doc->parsing() && !d->m_focusNodeRestored)
- {
- if (d->m_focusNodeNumber >= 0)
- d->m_doc->setFocusNode(d->m_doc->nodeWithAbsIndex(d->m_focusNodeNumber));
- else
- d->m_doc->setFocusNode(0);
- d->m_focusNodeRestored = true;
- }
-#endif
// Any frame that hasn't completed yet ?
ConstFrameIt it = d->m_frames.begin();
@@ -1940,12 +1254,6 @@
checkEmitLoadEvent(); // if we didn't do it before
-#if !APPLE_CHANGES
- // check that the view has not been moved by the user
- if ( !m_url.hasRef() && d->m_view->contentsY() == 0 )
- d->m_view->setContentsPos( d->m_extension->urlArgs().xOffset,
- d->m_extension->urlArgs().yOffset );
-#endif
if ( d->m_scheduledRedirection != noRedirectionScheduled )
{
@@ -1964,22 +1272,6 @@
emit completed();
}
-#if !APPLE_CHANGES
- // find the alternate stylesheets
- QStringList sheets;
- if (d->m_doc)
- sheets = d->m_doc->availableStyleSheets();
- d->m_paUseStylesheet->setItems( sheets );
- d->m_paUseStylesheet->setEnabled( !sheets.isEmpty() );
- if (!sheets.isEmpty())
- {
- d->m_paUseStylesheet->setCurrentItem(kMax(sheets.findIndex(d->m_sheetUsed), 0));
- slotUseStylesheet();
- }
-
- if (!parentPart())
- emit setStatusBarText(i18n("Done."));
-#endif
#ifdef SPEED_DEBUG
kdDebug(6050) << "DONE: " <<d->m_parsetime.elapsed() << endl;
@@ -2051,10 +1343,6 @@
{
if ( !d->m_doc ) return url;
-#if !APPLE_CHANGES
- if (d->m_decoder)
- return KURL(d->m_doc->completeURL(url), d->m_decoder->codec()->mibEnum());
-#endif
return KURL( d->m_doc->completeURL( url ) );
}
@@ -2118,14 +1406,12 @@
void KHTMLPart::scheduleHistoryNavigation( int steps )
{
-#if APPLE_CHANGES
// navigation will always be allowed in the 0 steps case, which is OK because
// that's supposed to force a reload.
if (!KWQ(this)->canGoBackOrForward(steps)) {
cancelRedirection();
return;
}
-#endif
d->m_scheduledRedirection = historyNavigationScheduled;
d->m_delayRedirect = 0;
@@ -2210,27 +1496,6 @@
d->m_workingURL = url;
}
-#if !APPLE_CHANGES
-
-bool KHTMLPart::setEncoding( const QString &name, bool override )
-{
- d->m_encoding = name;
- d->m_haveEncoding = override;
-
- if( !m_url.isEmpty() ) {
- // reload document
- closeURL();
- KURL url = m_url;
- m_url = 0;
- d->m_restored = true;
- openURL(url);
- d->m_restored = false;
- }
-
- return true;
-}
-
-#endif
QString KHTMLPart::encoding() const
{
@@ -2287,15 +1552,11 @@
}
}
-#if APPLE_CHANGES
// Scroll nested layers and frames to reveal the anchor.
if (n && n->renderer()) {
// Align to the top and to the closest side (this matches other browsers).
n->renderer()->enclosingLayer()->scrollRectToVisible(n->getRect(), RenderLayer::gAlignToEdgeIfNeeded, RenderLayer::gAlignTopAlways);
}
-#else
- d->m_view->setContentsPos(x, y);
-#endif
return true;
}
@@ -2310,25 +1571,13 @@
d->m_settings->setFixedFontName(name);
}
-#if !APPLE_CHANGES
-
-void KHTMLPart::setURLCursor( const QCursor &c )
-{
- d->m_linkCursor = c;
-}
-
-#endif
QCursor KHTMLPart::urlCursor() const
{
-#if APPLE_CHANGES
// Don't load the link cursor until it's actually used.
// Also, we don't need setURLCursor.
// This speeds up startup time.
return KCursor::handCursor();
-#else
- return d->m_linkCursor;
-#endif
}
bool KHTMLPart::onlyLocalReferences() const
@@ -2341,129 +1590,25 @@
d->m_onlyLocalReferences = enable;
}
-#if !APPLE_CHANGES
-void KHTMLPart::findTextBegin(NodeImpl *startNode, int startPos)
+#if !KHTML_NO_CPLUSPLUS_DOM
+
+QString KHTMLPart::text(const DOM::Range &r) const
{
- d->m_findPos = startPos;
- d->m_findNode = startNode;
+ return plainText(r.handle());
}
-bool KHTMLPart::findTextNext( const QString &str, bool forward, bool caseSensitive, bool isRegExp )
-{
- if ( !d->m_doc )
- return false;
+#endif
- if(!d->m_findNode) {
- if (d->m_doc->isHTMLDocument())
- d->m_findNode = static_cast<HTMLDocumentImpl*>(d->m_doc)->body();
- else
- d->m_findNode = d->m_doc;
- }
+QString KHTMLPart::selectedText() const
+{
+ return plainText(selection().toRange().get());
+}
- if ( !d->m_findNode )
- {
- kdDebug() << "KHTMLPart::findTextNext no findNode -> return false" << endl;
- return false;
- }
- if ( d->m_findNode->id() == ID_FRAMESET )
- {
- kdDebug() << "KHTMLPart::findTextNext FRAMESET -> return false" << endl;
- return false;
- }
-
- while(1)
- {
- if( (d->m_findNode->nodeType() == Node::TEXT_NODE || d->m_findNode->nodeType() == Node::CDATA_SECTION_NODE) && d->m_findNode->renderer() )
- {
- DOMString nodeText = d->m_findNode->nodeValue();
- DOMStringImpl *t = nodeText.impl();
- QConstString s(t->s, t->l);
-
- int matchLen = 0;
- if ( isRegExp ) {
- QRegExp matcher( str );
- matcher.setCaseSensitive( caseSensitive );
- d->m_findPos = matcher.search(s.qstring(), d->m_findPos+1);
- if ( d->m_findPos != -1 )
- matchLen = matcher.matchedLength();
- }
- else {
- d->m_findPos = s.qstring().find(str, d->m_findPos+1, caseSensitive);
- matchLen = str.length();
- }
-
- if(d->m_findPos != -1)
- {
- int x = 0, y = 0;
- static_cast<khtml::RenderText *>(d->m_findNode->renderer())
- ->posOfChar(d->m_findPos, x, y);
- d->m_view->setContentsPos(x-50, y-50);
- Position p1(d->m_findNode, d->m_findPos);
- Position p2(d->m_findNode, d->m_findPos + matchLen);
- SelectionController sel = SelectionController(p1, khtml::DOWNSTREAM, p2, khtml::VP_UPSTREAM_IF_POSSIBLE);
- if (shouldChangeSelection(sel)) {
- setSelection(sel);
- }
- return true;
- }
- }
- d->m_findPos = -1;
-
- NodeImpl *next;
-
- if ( forward )
- {
- next = d->m_findNode->firstChild();
-
- if(!next) next = d->m_findNode->nextSibling();
- while(d->m_findNode && !next) {
- d->m_findNode = d->m_findNode->parentNode();
- if( d->m_findNode ) {
- next = d->m_findNode->nextSibling();
- }
- }
- }
- else
- {
- next = d->m_findNode->lastChild();
-
- if (!next ) next = d->m_findNode->previousSibling();
- while ( d->m_findNode && !next )
- {
- d->m_findNode = d->m_findNode->parentNode();
- if( d->m_findNode )
- {
- next = d->m_findNode->previousSibling();
- }
- }
- }
-
- d->m_findNode = next;
- if(!d->m_findNode) return false;
- }
-}
-
-#endif // APPLE_CHANGES
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-QString KHTMLPart::text(const DOM::Range &r) const
-{
- return plainText(r.handle());
-}
-
-#endif
-
-QString KHTMLPart::selectedText() const
-{
- return plainText(selection().toRange().get());
-}
-
-bool KHTMLPart::hasSelection() const
-{
- return d->m_selection.isCaretOrRange();
-}
+bool KHTMLPart::hasSelection() const
+{
+ return d->m_selection.isCaretOrRange();
+}
const SelectionController &KHTMLPart::selection() const
{
@@ -2503,9 +1648,7 @@
clearCaretRectIfNeeded();
-#if APPLE_CHANGES
SelectionController oldSelection = d->m_selection;
-#endif
d->m_selection = s;
if (!s.isNone())
@@ -2523,9 +1666,7 @@
if (!keepTypingStyle)
clearTypingStyle();
-#if APPLE_CHANGES
KWQ(this)->respondToChangedSelection(oldSelection, closeTyping);
-#endif
emitSelectionChanged();
}
@@ -2562,12 +1703,6 @@
selectionLayoutChanged();
}
-#if !APPLE_CHANGES
-void KHTMLPart::slotClearSelection()
-{
- clearSelection();
-}
-#endif
void KHTMLPart::clearCaretRectIfNeeded()
{
@@ -2672,173 +1807,6 @@
d->m_dragCaret.paintCaret(p, rect);
}
-#if !APPLE_CHANGES
-
-void KHTMLPart::overURL( const QString &url, const QString &target, bool shiftPressed )
-{
- if ( !d->m_kjsStatusBarText.isEmpty() && !shiftPressed ) {
- emit onURL( url );
- emit setStatusBarText( d->m_kjsStatusBarText );
- d->m_kjsStatusBarText = QString::null;
- return;
- }
-
- emit onURL( url );
-
- if ( url.isEmpty() )
- {
- emit setStatusBarText(completeURL(url).htmlURL());
- return;
- }
-
- if (url.find( QString::fromLatin1( "javascript:" ),0, false ) != -1 )
- {
- emit setStatusBarText( KURL::decode_string( url.mid( url.find( "javascript:", 0, false ) ) ) );
- return;
- }
-
- KURL u = completeURL(url);
-
- // special case for <a href="">
- if ( url.isEmpty() )
- u.setFileName( url );
-
- QString com;
-
- KMimeType::Ptr typ = KMimeType::findByURL( u );
-
- if ( typ )
- com = typ->comment( u, false );
-
- if ( u.isMalformed() )
- {
- emit setStatusBarText(u.htmlURL());
- return;
- }
-
- if ( u.isLocalFile() )
- {
- // TODO : use KIO::stat() and create a KFileItem out of its result,
- // to use KFileItem::statusBarText()
- QCString path = QFile::encodeName( u.path() );
-
- struct stat buff;
- bool ok = !stat( path.data(), &buff );
-
- struct stat lbuff;
- if (ok) ok = !lstat( path.data(), &lbuff );
-
- QString text = u.htmlURL();
- QString text2 = text;
-
- if (ok && S_ISLNK( lbuff.st_mode ) )
- {
- QString tmp;
- if ( com.isNull() )
- tmp = i18n( "Symbolic Link");
- else
- tmp = i18n("%1 (Link)").arg(com);
- char buff_two[1024];
- text += " -> ";
- int n = readlink ( path.data(), buff_two, 1022);
- if (n == -1)
- {
- text2 += " ";
- text2 += tmp;
- emit setStatusBarText(text2);
- return;
- }
- buff_two[n] = 0;
-
- text += buff_two;
- text += " ";
- text += tmp;
- }
- else if ( ok && S_ISREG( buff.st_mode ) )
- {
- if (buff.st_size < 1024)
- text = i18n("%2 (%1 bytes)").arg((long) buff.st_size).arg(text2); // always put the URL last, in case it contains '%'
- else
- {
- float d = (float) buff.st_size/1024.0;
- text = i18n("%1 (%2 K)").arg(text2).arg(KGlobal::locale()->formatNumber(d, 2)); // was %.2f
- }
- text += " ";
- text += com;
- }
- else if ( ok && S_ISDIR( buff.st_mode ) )
- {
- text += " ";
- text += com;
- }
- else
- {
- text += " ";
- text += com;
- }
- emit setStatusBarText(text);
- }
- else
- {
- QString extra;
- if (target == QString::fromLatin1("_blank"))
- {
- extra = i18n(" (In new window)");
- }
- else if (!target.isEmpty() &&
- (target != QString::fromLatin1("_top")) &&
- (target != QString::fromLatin1("_self")) &&
- (target != QString::fromLatin1("_parent")))
- {
- extra = i18n(" (In other frame)");
- }
-
- if (u.protocol() == QString::fromLatin1("mailto")) {
- QString mailtoMsg/* = QString::fromLatin1("<img src=%1>").arg(locate("icon", QString::fromLatin1("locolor/16x16/actions/mail_send.png")))*/;
- mailtoMsg += i18n("Email to: ") + KURL::decode_string(u.path());
- QStringList queries = QStringList::split('&', u.query().mid(1));
- for (QStringList::Iterator it = queries.begin(); it != queries.end(); ++it)
- if ((*it).startsWith(QString::fromLatin1("subject=")))
- mailtoMsg += i18n(" - Subject: ") + KURL::decode_string((*it).mid(8));
- else if ((*it).startsWith(QString::fromLatin1("cc=")))
- mailtoMsg += i18n(" - CC: ") + KURL::decode_string((*it).mid(3));
- else if ((*it).startsWith(QString::fromLatin1("bcc=")))
- mailtoMsg += i18n(" - BCC: ") + KURL::decode_string((*it).mid(4));
- mailtoMsg.replace(QRegExp("&"), QString("&"));
- mailtoMsg.replace(QRegExp("<"), QString("<"));
- mailtoMsg.replace(QRegExp(">"), QString(">"));
- mailtoMsg.replace(QRegExp("([\n\r\t]|[ ]{10})"), "");
- emit setStatusBarText(mailtoMsg);
- return;
- }
- // Is this check neccessary at all? (Frerich)
-#if 0
- else if (u.protocol() == QString::fromLatin1("http")) {
- DOM::Node hrefNode = nodeUnderMouse().parentNode();
- while (hrefNode.nodeName().qstring() != QString::fromLatin1("A") && !hrefNode.isNull())
- hrefNode = hrefNode.parentNode();
-
- if (!hrefNode.isNull()) {
- DOM::Node hreflangNode = hrefNode.attributes().getNamedItem("HREFLANG");
- if (!hreflangNode.isNull()) {
- QString countryCode = hreflangNode.nodeValue().qstring().lower();
- // Map the language code to an appropriate country code.
- if (countryCode == QString::fromLatin1("en"))
- countryCode = QString::fromLatin1("gb");
- QString flagImg = QString::fromLatin1("<img src=%1>").arg(
- locate("locale", QString::fromLatin1("l10n/")
- + countryCode
- + QString::fromLatin1("/flag.png")));
- emit setStatusBarText(flagImg + u.prettyURL() + extra);
- }
- }
- }
-#endif
- emit setStatusBarText(u.htmlURL() + extra);
- }
-}
-
-#endif // APPLE_CHANGES
void KHTMLPart::urlSelected( const QString &url, int button, int state, const QString &_target,
KParts::URLArgs args )
@@ -2858,11 +1826,6 @@
}
KURL cURL = completeURL(url);
-#if !APPLE_CHANGES
- // special case for <a href="">
- if ( url.isEmpty() )
- cURL.setFileName( url );
-#endif
if ( !cURL.isValid() )
// ### ERROR HANDLING
@@ -2870,20 +1833,6 @@
//kdDebug( 6000 ) << "urlSelected: complete URL:" << cURL.url() << " target = " << target << endl;
-#if !APPLE_CHANGES
- if ( button == LeftButton && ( state & ShiftButton ) )
- {
- KIO::MetaData metaData;
- metaData["referrer"] = d->m_referrer;
- KHTMLPopupGUIClient::saveURL( d->m_view, i18n( "Save As..." ), cURL, metaData );
- return;
- }
-
- if (!checkLinkSecurity(cURL,
- i18n( "<qt>The link <B>%1</B><BR>leads from this untrusted page to your local filesystem.<BR>Do you want to follow the link?" ),
- i18n( "Follow" )))
- return;
-#endif
args.frameName = target;
@@ -2893,271 +1842,12 @@
args.metaData()["cache"] = "refresh";
}
-#if !APPLE_CHANGES
- args.metaData().insert("main_frame_request",
- parentPart() == 0 ? "TRUE":"FALSE");
- args.metaData().insert("ssl_was_in_use", d->m_ssl_in_use ? "TRUE":"FALSE");
- args.metaData().insert("ssl_activate_warnings", "TRUE");
-#endif
-#if APPLE_CHANGES
if (!d->m_referrer.isEmpty())
args.metaData()["referrer"] = d->m_referrer;
KWQ(this)->urlSelected(cURL, button, state, args);
-#else
- if ( hasTarget )
- {
- // unknown frame names should open in a new window.
- khtml::ChildFrame *frame = recursiveFrameRequest( cURL, args, false );
- if ( frame )
- {
- args.metaData()["referrer"] = d->m_referrer;
- requestObject( frame, cURL, args );
- return;
- }
- }
-
- if ( !d->m_bComplete && !hasTarget )
- closeURL();
-
- if (!d->m_referrer.isEmpty())
- args.metaData()["referrer"] = d->m_referrer;
-
- if ( button == MidButton && (state & ShiftButton) )
- {
- KParts::WindowArgs winArgs;
- winArgs.lowerWindow = true;
- KParts::ReadOnlyPart *newPart = 0;
- emit d->m_extension->createNewWindow( cURL, args, winArgs, newPart );
- return;
- }
- emit d->m_extension->openURLRequest( cURL, args );
-#endif // APPLE_CHANGES
}
-#if !APPLE_CHANGES
-
-void KHTMLPart::slotViewDocumentSource()
-{
- KURL url(m_url);
- if (!(url.isLocalFile()) && KHTMLPageCache::self()->isValid(d->m_cacheId))
- {
- KTempFile sourceFile(QString::null, QString::fromLatin1(".html"));
- if (sourceFile.status() == 0)
- {
- KHTMLPageCache::self()->saveData(d->m_cacheId, sourceFile.dataStream());
- url = KURL();
- url.setPath(sourceFile.name());
- }
- }
-
- // emit d->m_extension->openURLRequest( m_url, KParts::URLArgs( false, 0, 0, QString::fromLatin1( "text/plain" ) ) );
- (void) KRun::runURL( url, QString::fromLatin1("text/plain") );
-}
-
-void KHTMLPart::slotViewFrameSource()
-{
- KParts::ReadOnlyPart *frame = currentFrame();
- if ( !frame )
- return;
-
- KURL url = frame->url();
- if (!(url.isLocalFile()) && frame->inherits("KHTMLPart"))
- {
- int cacheId = static_cast<KHTMLPart *>(frame)->d->m_cacheId;
-
- if (KHTMLPageCache::self()->isValid(cacheId))
- {
- KTempFile sourceFile(QString::null, QString::fromLatin1(".html"));
- if (sourceFile.status() == 0)
- {
- KHTMLPageCache::self()->saveData(cacheId, sourceFile.dataStream());
- url = KURL();
- url.setPath(sourceFile.name());
- }
- }
- }
-
- (void) KRun::runURL( url, QString::fromLatin1("text/plain") );
-}
-
-KURL KHTMLPart::backgroundURL() const
-{
- // ### what about XML documents? get from CSS?
- if (!d->m_doc || !d->m_doc->isHTMLDocument())
- return KURL();
-
- QString relURL = static_cast<HTMLDocumentImpl*>(d->m_doc)->body()->getAttribute( backgroundAttr ).qstring();
-
- return KURL( m_url, relURL );
-}
-
-void KHTMLPart::slotSaveBackground()
-{
- KIO::MetaData metaData;
- metaData["referrer"] = d->m_referrer;
- KHTMLPopupGUIClient::saveURL( d->m_view, i18n("Save background image as"), backgroundURL(), metaData );
-}
-
-void KHTMLPart::slotSaveDocument()
-{
- KURL srcURL( m_url );
-
- if ( srcURL.fileName(false).isEmpty() )
- srcURL.setFileName( "index.html" );
-
- KIO::MetaData metaData;
- // Referre unknown?
- KHTMLPopupGUIClient::saveURL( d->m_view, i18n( "Save As" ), srcURL, metaData, i18n("*.html *.htm|HTML files"), d->m_cacheId );
-}
-
-void KHTMLPart::slotSecurity()
-{
-// kdDebug( 6050 ) << "Meta Data:" << endl
-// << d->m_ssl_peer_cert_subject
-// << endl
-// << d->m_ssl_peer_cert_issuer
-// << endl
-// << d->m_ssl_cipher
-// << endl
-// << d->m_ssl_cipher_desc
-// << endl
-// << d->m_ssl_cipher_version
-// << endl
-// << d->m_ssl_good_from
-// << endl
-// << d->m_ssl_good_until
-// << endl
-// << d->m_ssl_cert_state
-// << endl;
-
- KSSLInfoDlg *kid = new KSSLInfoDlg(d->m_ssl_in_use, widget(), "kssl_info_dlg", true );
-
- if (d->m_bSecurityInQuestion)
- kid->setSecurityInQuestion(true);
-
- if (d->m_ssl_in_use) {
- KSSLCertificate *x = KSSLCertificate::fromString(d->m_ssl_peer_certificate.local8Bit());
- if (x) {
- // Set the chain back onto the certificate
- QStringList cl = QStringList::split(QString("\n"), d->m_ssl_peer_chain);
- QPtrList<KSSLCertificate> ncl;
-
- ncl.setAutoDelete(true);
- for (QStringList::Iterator it = cl.begin(); it != cl.end(); ++it) {
- KSSLCertificate *y = KSSLCertificate::fromString((*it).local8Bit());
- if (y) ncl.append(y);
- }
-
- if (ncl.count() > 0)
- x->chain().setChain(ncl);
-
- kid->setup(x,
- d->m_ssl_peer_ip,
- m_url.url(),
- d->m_ssl_cipher,
- d->m_ssl_cipher_desc,
- d->m_ssl_cipher_version,
- d->m_ssl_cipher_used_bits.toInt(),
- d->m_ssl_cipher_bits.toInt(),
- (KSSLCertificate::KSSLValidation) d->m_ssl_cert_state.toInt()
- );
- kid->exec();
- delete x;
- } else kid->exec();
- } else kid->exec();
-}
-
-void KHTMLPart::slotSaveFrame()
-{
- if ( !d->m_activeFrame )
- return; // should never be the case, but one never knows :-)
-
- KURL srcURL( static_cast<KParts::ReadOnlyPart *>( d->m_activeFrame )->url() );
-
- if ( srcURL.fileName(false).isEmpty() )
- srcURL.setFileName( "index.html" );
-
- KIO::MetaData metaData;
- // Referrer unknown?
- KHTMLPopupGUIClient::saveURL( d->m_view, i18n( "Save As" ), srcURL, metaData, i18n("*.html *.htm|HTML files") );
-}
-
-void KHTMLPart::slotSetEncoding()
-{
- // first Item is always auto
- if(d->m_paSetEncoding->currentItem() == 0)
- setEncoding(QString::null, false);
- else {
- // strip of the language to get the raw encoding again.
- QString enc = KGlobal::charsets()->encodingForName(d->m_paSetEncoding->currentText());
- setEncoding(enc, true);
- }
-}
-
-void KHTMLPart::slotUseStylesheet()
-{
- if (d->m_doc && d->m_paUseStylesheet->currentText() != d->m_sheetUsed) {
- d->m_sheetUsed = d->m_paUseStylesheet->currentText();
- d->m_doc->updateStyleSelector();
- }
-}
-
-void KHTMLPart::updateActions()
-{
- bool frames = false;
-
- QValueList<khtml::ChildFrame>::ConstIterator it = d->m_frames.begin();
- QValueList<khtml::ChildFrame>::ConstIterator end = d->m_frames.end();
- for (; it != end; ++it )
- if ( (*it).m_type == khtml::ChildFrame::Frame )
- {
- frames = true;
- break;
- }
-
- d->m_paViewFrame->setEnabled( frames );
- d->m_paSaveFrame->setEnabled( frames );
-
- if ( frames )
- d->m_paFind->setText( i18n( "&Find in Frame..." ) );
- else
- d->m_paFind->setText( i18n( "&Find..." ) );
-
- KParts::Part *frame = 0;
-
- if ( frames )
- frame = currentFrame();
-
- bool enableFindAndSelectAll = true;
-
- if ( frame )
- enableFindAndSelectAll = frame->inherits( "KHTMLPart" );
-
- d->m_paFind->setEnabled( enableFindAndSelectAll );
- d->m_paSelectAll->setEnabled( enableFindAndSelectAll );
-
- bool enablePrintFrame = false;
-
- if ( frame )
- {
- QObject *ext = KParts::BrowserExtension::childObject( frame );
- if ( ext )
- enablePrintFrame = ext->metaObject()->slotNames().contains( "print()" );
- }
-
- d->m_paPrintFrame->setEnabled( enablePrintFrame );
-
- QString bgURL;
-
- // ### frames
- if ( d->m_doc && d->m_doc->isHTMLDocument() && static_cast<HTMLDocumentImpl*>(d->m_doc)->body() && !d->m_bClearing )
- bgURL = static_cast<HTMLDocumentImpl*>(d->m_doc)->body()->getAttribute( backgroundAttr ).qstring();
-
- d->m_paSaveBackground->setEnabled( !bgURL.isEmpty() );
-}
-
-#endif
bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, const QString &frameName,
const QStringList ¶mNames, const QStringList ¶mValues, bool isIFrame )
@@ -3194,11 +1884,7 @@
QString KHTMLPart::requestFrameName()
{
-#if APPLE_CHANGES
return KWQ(this)->generateFrameName();
-#else
- return QString::fromLatin1("<!--frame %1-->").arg(d->m_frameNameId++);
-#endif
}
bool KHTMLPart::requestObject( khtml::RenderPart *frame, const QString &url, const QString &serviceType,
@@ -3223,10 +1909,6 @@
bool KHTMLPart::requestObject( khtml::ChildFrame *child, const KURL &url, const KParts::URLArgs &_args )
{
-#if !APPLE_CHANGES
- if (!checkLinkSecurity(url))
- return false;
-#endif
if ( child->m_bPreloaded )
{
// kdDebug(6005) << "KHTMLPart::requestObject preload" << endl;
@@ -3239,10 +1921,6 @@
KParts::URLArgs args( _args );
-#if !APPLE_CHANGES
- if ( child->m_run )
- child->m_run->abort();
-#endif
if ( child->m_part && !args.reload && urlcmp( child->m_part->url().url(), url.url(), true, true ) )
args.serviceType = child->m_serviceType;
@@ -3253,29 +1931,12 @@
if (!d->m_referrer.isEmpty() && !child->m_args.metaData().contains( "referrer" ))
child->m_args.metaData()["referrer"] = d->m_referrer;
-#if !APPLE_CHANGES
- child->m_args.metaData().insert("main_frame_request",
- parentPart() == 0 ? "TRUE":"FALSE");
- child->m_args.metaData().insert("ssl_was_in_use",
- d->m_ssl_in_use ? "TRUE":"FALSE");
- child->m_args.metaData().insert("ssl_activate_warnings", "TRUE");
-#endif
// We want a KHTMLPart if the HTML says <frame src=""> or <frame src="about:blank">
if ((url.isEmpty() || url.url() == "about:blank") && args.serviceType.isEmpty())
args.serviceType = QString::fromLatin1( "text/html" );
-#if APPLE_CHANGES
return processObjectRequest( child, url, args.serviceType );
-#else
- if ( args.serviceType.isEmpty() ) {
- child->m_run = new KHTMLRun( this, child, url, child->m_args,
- child->m_type != khtml::ChildFrame::Frame );
- return false;
- } else {
- return processObjectRequest( child, url, args.serviceType );
- }
-#endif
}
bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url, const QString &mimetype )
@@ -3302,7 +1963,6 @@
emit d->m_extension->openURLNotify();
}
-#if APPLE_CHANGES
if ( child->m_part )
{
KHTMLPart *part = static_cast<KHTMLPart *>(&*child->m_part);
@@ -3319,11 +1979,6 @@
KHTMLPart *khtml_part = static_cast<KHTMLPart *>(part);
if (khtml_part && khtml_part->inherits("KHTMLPart"))
khtml_part->childBegin();
-#else
- if ( !child->m_services.contains( mimetype ) )
- {
- KParts::ReadOnlyPart *part = createPart( d->m_view->viewport(), child->m_name.ascii(), this, child->m_name.ascii(), mimetype, child->m_serviceName, child->m_services, child->m_params );
-#endif
if (!part) {
checkEmitLoadEvent();
@@ -3334,9 +1989,6 @@
if ( child->m_part )
{
disconnectChild(child);
-#if !APPLE_CHANGES
- partManager()->removePart( (KParts::ReadOnlyPart *)child->m_part );
-#endif
child->m_part->deref();
}
@@ -3344,52 +1996,13 @@
if ( child->m_frame && part->widget() )
child->m_frame->setWidget( part->widget() );
-#if !APPLE_CHANGES
- if ( child->m_type != khtml::ChildFrame::Object )
- partManager()->addPart( part, false );
-// else
-// kdDebug(6005) << "AH! NO FRAME!!!!!" << endl;
-#endif
child->m_part = part;
assert( ((void*) child->m_part) != 0);
connectChild(child);
-#if APPLE_CHANGES
}
-#else
- child->m_extension = KParts::BrowserExtension::childObject( part );
-
- if ( child->m_extension )
- {
- connect( child->m_extension, SIGNAL( openURLNotify() ),
- d->m_extension, SIGNAL( openURLNotify() ) );
-
- connect( child->m_extension, SIGNAL( openURLRequestDelayed( const KURL &, const KParts::URLArgs & ) ),
- this, SLOT( slotChildURLRequest( const KURL &, const KParts::URLArgs & ) ) );
-
- connect( child->m_extension, SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & ) ),
- d->m_extension, SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & ) ) );
- connect( child->m_extension, SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs &, const KParts::WindowArgs &, KParts::ReadOnlyPart *& ) ),
- d->m_extension, SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & , const KParts::WindowArgs &, KParts::ReadOnlyPart *&) ) );
-
- connect( child->m_extension, SIGNAL( popupMenu( const QPoint &, const KFileItemList & ) ),
- d->m_extension, SIGNAL( popupMenu( const QPoint &, const KFileItemList & ) ) );
- connect( child->m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KFileItemList & ) ),
- d->m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KFileItemList & ) ) );
- connect( child->m_extension, SIGNAL( popupMenu( const QPoint &, const KURL &, const QString &, mode_t ) ),
- d->m_extension, SIGNAL( popupMenu( const QPoint &, const KURL &, const QString &, mode_t ) ) );
- connect( child->m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const QString &, mode_t ) ),
- d->m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const QString &, mode_t ) ) );
-
- connect( child->m_extension, SIGNAL( infoMessage( const QString & ) ),
- d->m_extension, SIGNAL( infoMessage( const QString & ) ) );
-
- child->m_extension->setBrowserInterface( d->m_extension->browserInterface() );
- }
- }
-#endif
checkEmitLoadEvent();
// Some JS code in the load event may have destroyed the part
@@ -3418,7 +2031,6 @@
if ( child->m_extension )
child->m_extension->setURLArgs( child->m_args );
-#if APPLE_CHANGES
// In these cases, the synchronous load would have finished
// before we could connect the signals, so make sure to send the
// completed() signal for the child by hand
@@ -3433,93 +2045,9 @@
part->checkCompleted();
}
}
-#else
- if(url.protocol() == "javascript" || url.url() == "about:blank") {
- if (!child->m_part->inherits("KHTMLPart"))
- return false;
-
- KHTMLPart* p = static_cast<KHTMLPart*>(static_cast<KParts::ReadOnlyPart *>(child->m_part));
-
- p->begin();
- if (d->m_doc && p->d->m_doc)
- p->d->m_doc->setBaseURL(d->m_doc->baseURL());
- if (!url.url().startsWith("about:")) {
- p->write(url.path());
- } else {
- p->m_url = url;
- }
- p->end();
- return true;
- }
- else if ( !url.isEmpty() )
- {
- //kdDebug( 6050 ) << "opening " << url.url() << " in frame " << child->m_part << endl;
- return child->m_part->openURL( url );
- }
- else
-#endif
return true;
}
-#if !APPLE_CHANGES
-
-KParts::ReadOnlyPart *KHTMLPart::createPart( QWidget *parentWidget, const char *widgetName,
- QObject *parent, const char *name, const QString &mimetype,
- QString &serviceName, QStringList &serviceTypes,
- const QStringList ¶ms )
-{
- QString constr;
- if ( !serviceName.isEmpty() )
- constr.append( QString::fromLatin1( "Name == '%1'" ).arg( serviceName ) );
-
- KTrader::OfferList offers = KTrader::self()->query( mimetype, "KParts/ReadOnlyPart", constr, QString::null );
-
- if ( offers.isEmpty() )
- return 0L;
-
- KService::Ptr service = *offers.begin();
-
- KLibFactory *factory = KLibLoader::self()->factory( QFile::encodeName(service->library()) );
-
- if ( !factory )
- return 0L;
-
- KParts::ReadOnlyPart *res = 0L;
-
- const char *className = "KParts::ReadOnlyPart";
- if ( service->serviceTypes().contains( "Browser/View" ) )
- className = "Browser/View";
-
- if ( factory->inherits( "KParts::Factory" ) )
- res = static_cast<KParts::ReadOnlyPart *>(static_cast<KParts::Factory *>( factory )->createPart( parentWidget, widgetName, parent, name, className, params ));
- else
- res = static_cast<KParts::ReadOnlyPart *>(factory->create( parentWidget, widgetName, className ));
-
- if ( !res )
- return res;
-
- serviceTypes = service->serviceTypes();
- serviceName = service->name();
-
- return res;
-}
-
-KParts::PartManager *KHTMLPart::partManager()
-{
- if ( !d->m_manager )
- {
- d->m_manager = new KParts::PartManager( d->m_view->topLevelWidget(), this, "khtml part manager" );
- d->m_manager->setAllowNestedParts( true );
- connect( d->m_manager, SIGNAL( activePartChanged( KParts::Part * ) ),
- this, SLOT( slotActiveFrameChanged( KParts::Part * ) ) );
- connect( d->m_manager, SIGNAL( partRemoved( KParts::Part * ) ),
- this, SLOT( slotPartRemoved( KParts::Part * ) ) );
- }
-
- return d->m_manager;
-}
-
-#endif
void KHTMLPart::submitFormAgain()
{
@@ -3542,65 +2070,6 @@
return;
}
-#if !APPLE_CHANGES
- // Form security checks
- //
-
- /* This is separate for a reason. It has to be _before_ all script, etc,
- * AND I don't want to break anything that uses checkLinkSecurity() in
- * other places.
- */
-
- // This causes crashes... needs to be fixed.
- if (!d->m_submitForm && u.protocol() != "https" && u.protocol() != "mailto") {
- if (d->m_ssl_in_use) { // Going from SSL -> nonSSL
- int rc = KMessageBox::warningContinueCancel(NULL, i18n("Warning: This is a secure form but it is attempting to send your data back unencrypted."
- "\nA third party may be able to intercept and view this information."
- "\nAre you sure you wish to continue?"),
- i18n("SSL"));
- if (rc == KMessageBox::Cancel)
- return;
- } else { // Going from nonSSL -> nonSSL
- KSSLSettings kss(true);
- if (kss.warnOnUnencrypted()) {
- int rc = KMessageBox::warningContinueCancel(NULL,
- i18n("Warning: Your data is about to be transmitted across the network unencrypted."
- "\nAre you sure you wish to continue?"),
- i18n("KDE"),
- QString::null,
- "WarnOnUnencryptedForm");
- // Move this setting into KSSL instead
- KConfig *config = kapp->config();
- QString grpNotifMsgs = QString::fromLatin1("Notification Messages");
- KConfigGroupSaver saver( config, grpNotifMsgs );
-
- if (!config->readBoolEntry("WarnOnUnencryptedForm", true)) {
- config->deleteEntry("WarnOnUnencryptedForm");
- config->sync();
- kss.setWarnOnUnencrypted(false);
- kss.save();
- }
- if (rc == KMessageBox::Cancel)
- return;
- }
- }
- }
-
- if (!d->m_submitForm && u.protocol() == "mailto") {
- int rc = KMessageBox::warningContinueCancel(NULL,
- i18n("This site is attempting to submit form data via email."),
- i18n("KDE"),
- QString::null,
- "WarnTriedEmailSubmit");
-
- if (rc == KMessageBox::Cancel) {
- return;
- }
- }
-
- // End form security checks
- //
-#endif // APPLE_CHANGES
QString urlstring = u.url();
@@ -3612,24 +2081,12 @@
return;
}
-#if !APPLE_CHANGES
- if (!checkLinkSecurity(u,
- i18n( "<qt>The form will be submitted to <BR><B>%1</B><BR>on your local filesystem.<BR>Do you want to submit the form?" ),
- i18n( "Submit" )))
- return;
-#endif
KParts::URLArgs args;
if (!d->m_referrer.isEmpty())
args.metaData()["referrer"] = d->m_referrer;
-#if !APPLE_CHANGES
- args.metaData().insert("main_frame_request",
- parentPart() == 0 ? "TRUE":"FALSE");
- args.metaData().insert("ssl_was_in_use", d->m_ssl_in_use ? "TRUE":"FALSE");
- args.metaData().insert("ssl_activate_warnings", "TRUE");
-#endif
args.frameName = _target.isEmpty() ? d->m_doc->baseTarget() : _target ;
// Handle mailto: forms
@@ -3649,10 +2106,6 @@
}
}
-#if !APPLE_CHANGES
- if (triedToAttach)
- KMessageBox::information(NULL, i18n("This site attempted to attach a file from your computer in the form submission. The attachment was removed for your protection."), i18n("KDE"), "WarnTriedAttach");
-#endif
// 2) Append body=
QString bodyEnc;
@@ -3681,11 +2134,7 @@
args.setDoPost( false );
}
else {
-#if APPLE_CHANGES
args.postData = formData;
-#else
- args.postData = formData.flatten();
-#endif
args.setDoPost( true );
// construct some user headers if necessary
@@ -3711,38 +2160,10 @@
}
else
{
-#if APPLE_CHANGES
KWQ(this)->submitForm( u, args);
-#else
- emit d->m_extension->openURLRequest( u, args );
-#endif
- }
-}
-
-#if !APPLE_CHANGES
-
-void KHTMLPart::popupMenu( const QString &linkUrl )
-{
- KURL popupURL;
- KURL linkKURL;
- if ( linkUrl.isEmpty() ) // click on background
- popupURL = this->url();
- else { // click on link
- popupURL = completeURL( linkUrl );
- linkKURL = popupURL;
}
-
- KXMLGUIClient *client = new KHTMLPopupGUIClient( this, d->m_popupMenuXML, linkKURL );
-
- emit d->m_extension->popupMenu( client, QCursor::pos(), popupURL,
- QString::fromLatin1( "text/html" ), S_IFREG /*always a file*/ );
-
- delete client;
-
- emit popupMenu(linkUrl, QCursor::pos());
}
-#endif
void KHTMLPart::slotParentCompleted()
{
@@ -3763,13 +2184,6 @@
if ( d->m_bComplete )
{
-#if 0
- // WABA: Looks like this belongs somewhere else
- if ( !parentPart() ) // "toplevel" html document? if yes, then notify the hosting browser about the document (url) changes
- {
- emit d->m_extension->openURLNotify();
- }
-#endif
d->m_bComplete = false;
emit started( job );
}
@@ -3786,475 +2200,81 @@
assert( child );
- child->m_bCompleted = true;
- child->m_args = KParts::URLArgs();
-
- if ( complete && parentPart() == 0 )
- d->m_bPendingChildRedirection = true;
-
- checkCompleted();
-}
-
-#if !APPLE_CHANGES
-
-void KHTMLPart::slotChildURLRequest( const KURL &url, const KParts::URLArgs &args )
-{
- khtml::ChildFrame *child = childFrame( sender()->parent() );
-
- QString frameName = args.frameName.lower();
- if ( !frameName.isEmpty() )
- {
- if ( frameName == QString::fromLatin1( "_top" ) )
- {
- emit d->m_extension->openURLRequest( url, args );
- return;
- }
- else if ( frameName == QString::fromLatin1( "_blank" ) )
- {
- emit d->m_extension->createNewWindow( url, args );
- return;
- }
- else if ( frameName == QString::fromLatin1( "_parent" ) )
- {
- KParts::URLArgs newArgs( args );
- newArgs.frameName = QString::null;
-
- emit d->m_extension->openURLRequest( url, newArgs );
- return;
- }
- else if ( frameName != QString::fromLatin1( "_self" ) )
- {
- khtml::ChildFrame *_frame = recursiveFrameRequest( url, args );
-
- if ( !_frame )
- {
- emit d->m_extension->openURLRequest( url, args );
- return;
- }
-
- child = _frame;
- }
- }
-
- // TODO: handle child target correctly! currently the script are always executed fur the parent
- QString urlStr = url.url();
- if ( urlStr.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 ) {
- executeScript( KURL::decode_string( urlStr.right( urlStr.length() - 11) ) );
- return;
- }
-
- if ( child ) {
- // Inform someone that we are about to show something else.
- child->m_bNotify = true;
- requestObject( child, url, args );
- } else if ( frameName==QString::fromLatin1("_self") ) // this is for embedded objects (via <object>) which want to replace the current document
- {
- KParts::URLArgs newArgs( args );
- newArgs.frameName = QString::null;
- emit d->m_extension->openURLRequest( url, newArgs );
- }
-}
-
-#endif // APPLE_CHANGES
-
-khtml::ChildFrame *KHTMLPart::childFrame( const QObject *obj )
-{
- assert( obj->inherits( "KParts::ReadOnlyPart" ) );
- const ReadOnlyPart *part = static_cast<const ReadOnlyPart *>( obj );
-
- FrameIt it = d->m_frames.begin();
- FrameIt end = d->m_frames.end();
- for (; it != end; ++it )
- if ( static_cast<ReadOnlyPart *>((*it).m_part) == part )
- return &(*it);
-
- it = d->m_objects.begin();
- end = d->m_objects.end();
- for (; it != end; ++it )
- if ( static_cast<ReadOnlyPart *>((*it).m_part) == part )
- return &(*it);
-
- return 0L;
-}
-
-KHTMLPart *KHTMLPart::findFrame( const QString &f )
-{
-#if 0
- kdDebug() << "KHTMLPart::findFrame '" << f << "'" << endl;
- FrameIt it2 = d->m_frames.begin();
- FrameIt end = d->m_frames.end();
- for (; it2 != end; ++it2 )
- kdDebug() << " - having frame '" << (*it2).m_name << "'" << endl;
-#endif
-
- // ### http://www.w3.org/TR/html4/appendix/notes.html#notes-frames
- ConstFrameIt it = d->m_frames.find( f );
- if ( it == d->m_frames.end() )
- {
- //kdDebug() << "KHTMLPart::findFrame frame " << f << " not found" << endl;
- return 0L;
- }
- else {
- KParts::ReadOnlyPart *p = (*it).m_part;
- if ( p && p->inherits( "KHTMLPart" ))
- {
- //kdDebug() << "KHTMLPart::findFrame frame " << f << " is a KHTMLPart, ok" << endl;
- return (KHTMLPart*)p;
- }
- else
- {
-#if 0
- if (p)
- kdWarning() << "KHTMLPart::findFrame frame " << f << " found but isn't a KHTMLPart ! " << p->className() << endl;
- else
- kdWarning() << "KHTMLPart::findFrame frame " << f << " found but m_part=0L" << endl;
-#endif
- return 0L;
- }
- }
-}
-
-#if !APPLE_CHANGES
-
-KParts::ReadOnlyPart *KHTMLPart::currentFrame() const
-{
- KParts::ReadOnlyPart* part = (KParts::ReadOnlyPart*)(this);
- // Find active part in our frame manager, in case we are a frameset
- // and keep doing that (in case of nested framesets).
- // Just realized we could also do this recursively, calling part->currentFrame()...
- while ( part && part->inherits("KHTMLPart") &&
- static_cast<KHTMLPart *>(part)->d->m_frames.count() > 0 ) {
- KHTMLPart* frameset = static_cast<KHTMLPart *>(part);
- part = static_cast<KParts::ReadOnlyPart *>(frameset->partManager()->activePart());
- if ( !part ) return frameset;
- }
- return part;
-}
-
-#endif // APPLE_CHANGES
-
-bool KHTMLPart::frameExists( const QString &frameName )
-{
- ConstFrameIt it = d->m_frames.find( frameName );
- if ( it == d->m_frames.end() )
- return false;
-
- // WABA: We only return true if the child actually has a frame
- // set. Otherwise we might find our preloaded-selve.
- // This happens when we restore the frameset.
- return (!(*it).m_frame.isNull());
-}
-
-KHTMLPart *KHTMLPart::parentPart() const
-{
- if ( !parent() || !parent()->inherits( "KHTMLPart" ) )
- return 0L;
-
- return (KHTMLPart *)parent();
-}
-
-#if !APPLE_CHANGES
-
-khtml::ChildFrame *KHTMLPart::recursiveFrameRequest( const KURL &url, const KParts::URLArgs &args,
- bool callParent )
-{
- FrameIt it = d->m_frames.find( args.frameName );
-
- if ( it != d->m_frames.end() )
- return &(*it);
-
- it = d->m_frames.begin();
- FrameIt end = d->m_frames.end();
- for (; it != end; ++it )
- if ( (*it).m_part && (*it).m_part->inherits( "KHTMLPart" ) )
- {
- KHTMLPart *childPart = (KHTMLPart *)(KParts::ReadOnlyPart *)(*it).m_part;
-
- khtml::ChildFrame *res = childPart->recursiveFrameRequest( url, args, false );
- if ( !res )
- continue;
-
- childPart->requestObject( res, url, args );
- return 0L;
- }
-
- if ( parentPart() && callParent )
- {
- khtml::ChildFrame *res = parentPart()->recursiveFrameRequest( url, args );
-
- if ( res )
- parentPart()->requestObject( res, url, args );
-
- return 0L;
- }
-
- return 0L;
-}
-
-void KHTMLPart::saveState( QDataStream &stream )
-{
- kdDebug( 6050 ) << "KHTMLPart::saveState saving URL " << m_url.url() << endl;
-
- stream << m_url << (Q_INT32)d->m_view->contentsX() << (Q_INT32)d->m_view->contentsY()
- << (Q_INT32) d->m_view->contentsWidth() << (Q_INT32) d->m_view->contentsHeight() << (Q_INT32) d->m_view->marginWidth() << (Q_INT32) d->m_view->marginHeight();
-
- // save link cursor position
- int focusNodeNumber;
- if (!d->m_focusNodeRestored)
- focusNodeNumber = d->m_focusNodeNumber;
- else if (d->m_doc->focusNode())
- focusNodeNumber = d->m_doc->nodeAbsIndex(d->m_doc->focusNode());
- else
- focusNodeNumber = -1;
- stream << focusNodeNumber;
-
- // Save the doc's cache id.
- stream << d->m_cacheId;
-
- // Save the state of the document (Most notably the state of any forms)
- QStringList docState;
- if (d->m_doc)
- {
- docState = d->m_doc->docState();
- }
- stream << d->m_encoding << d->m_sheetUsed << docState;
-
- stream << d->m_zoomFactor;
-
- // Save ssl data
- stream << d->m_ssl_in_use
- << d->m_ssl_peer_certificate
- << d->m_ssl_peer_chain
- << d->m_ssl_peer_ip
- << d->m_ssl_cipher
- << d->m_ssl_cipher_desc
- << d->m_ssl_cipher_version
- << d->m_ssl_cipher_used_bits
- << d->m_ssl_cipher_bits
- << d->m_ssl_cert_state;
-
-
- QStringList frameNameLst, frameServiceTypeLst, frameServiceNameLst;
- KURL::List frameURLLst;
- QValueList<QByteArray> frameStateBufferLst;
-
- ConstFrameIt it = d->m_frames.begin();
- ConstFrameIt end = d->m_frames.end();
- for (; it != end; ++it )
- {
- if ( !(*it).m_part )
- continue;
-
- frameNameLst << (*it).m_name;
- frameServiceTypeLst << (*it).m_serviceType;
- frameServiceNameLst << (*it).m_serviceName;
- frameURLLst << (*it).m_part->url();
-
- QByteArray state;
- QDataStream frameStream( state, IO_WriteOnly );
-
- if ( (*it).m_extension )
- (*it).m_extension->saveState( frameStream );
-
- frameStateBufferLst << state;
- }
-
- // Save frame data
- stream << (Q_UINT32) frameNameLst.count();
- stream << frameNameLst << frameServiceTypeLst << frameServiceNameLst << frameURLLst << frameStateBufferLst;
-}
-
-void KHTMLPart::restoreState( QDataStream &stream )
-{
- KURL u;
- Q_INT32 xOffset, yOffset, wContents, hContents, mWidth, mHeight;
- Q_UINT32 frameCount;
- QStringList frameNames, frameServiceTypes, docState, frameServiceNames;
- KURL::List frameURLs;
- QValueList<QByteArray> frameStateBuffers;
- QValueList<int> fSizes;
- QString encoding, sheetUsed;
- long old_cacheId = d->m_cacheId;
-
- stream >> u >> xOffset >> yOffset >> wContents >> hContents >> mWidth >> mHeight;
-
- d->m_view->setMarginWidth( mWidth );
- d->m_view->setMarginHeight( mHeight );
-
- // restore link cursor position
- // nth node is active. value is set in checkCompleted()
- stream >> d->m_focusNodeNumber;
- d->m_focusNodeRestored = false;
- kdDebug(6050)<<"new focus Node number is:"<<d->m_focusNodeNumber<<endl;
-
- stream >> d->m_cacheId;
-
- stream >> encoding >> sheetUsed >> docState;
- d->m_encoding = encoding;
- d->m_sheetUsed = sheetUsed;
-
- int zoomFactor;
- stream >> zoomFactor;
- setZoomFactor(zoomFactor);
-
- // Restore ssl data
- stream >> d->m_ssl_in_use
- >> d->m_ssl_peer_certificate
- >> d->m_ssl_peer_chain
- >> d->m_ssl_peer_ip
- >> d->m_ssl_cipher
- >> d->m_ssl_cipher_desc
- >> d->m_ssl_cipher_version
- >> d->m_ssl_cipher_used_bits
- >> d->m_ssl_cipher_bits
- >> d->m_ssl_cert_state;
-
- d->m_paSecurity->setIcon( d->m_ssl_in_use ? "encrypted" : "decrypted" );
-
- stream >> frameCount >> frameNames >> frameServiceTypes >> frameServiceNames
- >> frameURLs >> frameStateBuffers;
-
- d->m_bComplete = false;
- d->m_bLoadEventEmitted = false;
-
-// kdDebug( 6050 ) << "restoreStakte() docState.count() = " << docState.count() << endl;
-// kdDebug( 6050 ) << "m_url " << m_url.url() << " <-> " << u.url() << endl;
-// kdDebug( 6050 ) << "m_frames.count() " << d->m_frames.count() << " <-> " << frameCount << endl;
-
- if (d->m_cacheId == old_cacheId)
- {
- // Partial restore
- cancelRedirection();
-
- FrameIt fIt = d->m_frames.begin();
- FrameIt fEnd = d->m_frames.end();
-
- for (; fIt != fEnd; ++fIt )
- (*fIt).m_bCompleted = false;
-
- fIt = d->m_frames.begin();
-
- QStringList::ConstIterator fNameIt = frameNames.begin();
- QStringList::ConstIterator fServiceTypeIt = frameServiceTypes.begin();
- QStringList::ConstIterator fServiceNameIt = frameServiceNames.begin();
- KURL::List::ConstIterator fURLIt = frameURLs.begin();
- QValueList<QByteArray>::ConstIterator fBufferIt = frameStateBuffers.begin();
-
- for (; fIt != fEnd; ++fIt, ++fNameIt, ++fServiceTypeIt, ++fServiceNameIt, ++fURLIt, ++fBufferIt )
- {
- khtml::ChildFrame *child = &(*fIt);
-
-// kdDebug( 6050 ) << *fNameIt << " ---- " << *fServiceTypeIt << endl;
-
- if ( child->m_name != *fNameIt || child->m_serviceType != *fServiceTypeIt )
- {
- child->m_bPreloaded = true;
- child->m_name = *fNameIt;
- child->m_serviceName = *fServiceNameIt;
- processObjectRequest( child, *fURLIt, *fServiceTypeIt );
- }
-
- if ( child->m_part )
- {
- child->m_bCompleted = false;
- if ( child->m_extension && !(*fBufferIt).isEmpty() )
- {
- QDataStream frameStream( *fBufferIt, IO_ReadOnly );
- child->m_extension->restoreState( frameStream );
- }
- else
- child->m_part->openURL( *fURLIt );
- }
- }
+ child->m_bCompleted = true;
+ child->m_args = KParts::URLArgs();
- KParts::URLArgs args( d->m_extension->urlArgs() );
- args.xOffset = xOffset;
- args.yOffset = yOffset;
- args.docState = docState; // WABA: How are we going to restore this??
- d->m_extension->setURLArgs( args );
+ if ( complete && parentPart() == 0 )
+ d->m_bPendingChildRedirection = true;
- d->m_view->resizeContents( wContents, hContents);
- d->m_view->setContentsPos( xOffset, yOffset );
- }
- else
- {
- // Full restore.
- closeURL();
- // We must force a clear because we want to be sure to delete all
- // frames.
- d->m_bCleared = false;
- clear();
- d->m_encoding = encoding;
- d->m_sheetUsed = sheetUsed;
-
- QStringList::ConstIterator fNameIt = frameNames.begin();
- QStringList::ConstIterator fNameEnd = frameNames.end();
-
- QStringList::ConstIterator fServiceTypeIt = frameServiceTypes.begin();
- QStringList::ConstIterator fServiceNameIt = frameServiceNames.begin();
- KURL::List::ConstIterator fURLIt = frameURLs.begin();
- QValueList<QByteArray>::ConstIterator fBufferIt = frameStateBuffers.begin();
+ checkCompleted();
+}
- for (; fNameIt != fNameEnd; ++fNameIt, ++fServiceTypeIt, ++fServiceNameIt, ++fURLIt, ++fBufferIt )
- {
- khtml::ChildFrame newChild;
- newChild.m_bPreloaded = true;
- newChild.m_name = *fNameIt;
- newChild.m_serviceName = *fServiceNameIt;
-// kdDebug( 6050 ) << *fNameIt << " ---- " << *fServiceTypeIt << endl;
+khtml::ChildFrame *KHTMLPart::childFrame( const QObject *obj )
+{
+ assert( obj->inherits( "KParts::ReadOnlyPart" ) );
+ const ReadOnlyPart *part = static_cast<const ReadOnlyPart *>( obj );
- FrameIt childFrame = d->m_frames.append( newChild );
+ FrameIt it = d->m_frames.begin();
+ FrameIt end = d->m_frames.end();
+ for (; it != end; ++it )
+ if ( static_cast<ReadOnlyPart *>((*it).m_part) == part )
+ return &(*it);
- processObjectRequest( &(*childFrame), *fURLIt, *fServiceTypeIt );
+ it = d->m_objects.begin();
+ end = d->m_objects.end();
+ for (; it != end; ++it )
+ if ( static_cast<ReadOnlyPart *>((*it).m_part) == part )
+ return &(*it);
- (*childFrame).m_bPreloaded = true;
+ return 0L;
+}
- if ( (*childFrame).m_part )
- {
- if ( (*childFrame).m_extension )
- if ( (*childFrame).m_extension && !(*fBufferIt).isEmpty() )
- {
- QDataStream frameStream( *fBufferIt, IO_ReadOnly );
- (*childFrame).m_extension->restoreState( frameStream );
- }
- else
- (*childFrame).m_part->openURL( *fURLIt );
- }
- }
+KHTMLPart *KHTMLPart::findFrame( const QString &f )
+{
- KParts::URLArgs args( d->m_extension->urlArgs() );
- args.xOffset = xOffset;
- args.yOffset = yOffset;
- args.docState = docState;
- d->m_extension->setURLArgs( args );
- if (!KHTMLPageCache::self()->isValid(d->m_cacheId))
+ // ### http://www.w3.org/TR/html4/appendix/notes.html#notes-frames
+ ConstFrameIt it = d->m_frames.find( f );
+ if ( it == d->m_frames.end() )
+ {
+ //kdDebug() << "KHTMLPart::findFrame frame " << f << " not found" << endl;
+ return 0L;
+ }
+ else {
+ KParts::ReadOnlyPart *p = (*it).m_part;
+ if ( p && p->inherits( "KHTMLPart" ))
{
- d->m_restored = true;
- openURL( u );
- d->m_restored = false;
+ //kdDebug() << "KHTMLPart::findFrame frame " << f << " is a KHTMLPart, ok" << endl;
+ return (KHTMLPart*)p;
}
else
{
- restoreURL( u );
+ return 0L;
}
}
-
}
-void KHTMLPart::show()
+
+bool KHTMLPart::frameExists( const QString &frameName )
{
- if ( d->m_view )
- d->m_view->show();
+ ConstFrameIt it = d->m_frames.find( frameName );
+ if ( it == d->m_frames.end() )
+ return false;
+
+ // WABA: We only return true if the child actually has a frame
+ // set. Otherwise we might find our preloaded-selve.
+ // This happens when we restore the frameset.
+ return (!(*it).m_frame.isNull());
}
-void KHTMLPart::hide()
+KHTMLPart *KHTMLPart::parentPart() const
{
- if ( d->m_view )
- d->m_view->hide();
+ if ( !parent() || !parent()->inherits( "KHTMLPart" ) )
+ return 0L;
+
+ return (KHTMLPart *)parent();
}
-#endif // APPLE_CHANGES
#if !KHTML_NO_CPLUSPLUS_DOM
@@ -4267,11 +2287,6 @@
void KHTMLPart::emitSelectionChanged()
{
-#if !APPLE_CHANGES
- emit d->m_extension->enableAction( "copy", hasSelection() );
- emit d->m_extension->selectionInfo( selectedText() );
- emit selectionChanged();
-#endif
}
int KHTMLPart::zoomFactor() const
@@ -4316,22 +2331,12 @@
void KHTMLPart::setZoomFactor (int percent)
{
-#if !APPLE_CHANGES // limits are client's responsibility
- if (percent < minZoom) percent = minZoom;
- if (percent > maxZoom) percent = maxZoom;
-#endif
if (d->m_zoomFactor == percent) return;
d->m_zoomFactor = percent;
if(d->m_doc) {
-#if !APPLE_CHANGES
- QApplication::setOverrideCursor( waitCursor );
-#endif
d->m_doc->recalcStyle( NodeImpl::Force );
-#if !APPLE_CHANGES
- QApplication::restoreOverrideCursor();
-#endif
}
ConstFrameIt it = d->m_frames.begin();
@@ -4342,10 +2347,6 @@
static_cast<KHTMLPart*>( p )->setZoomFactor(d->m_zoomFactor);
}
-#if !APPLE_CHANGES
- d->m_paDecZoomFactor->setEnabled( d->m_zoomFactor > minZoom );
- d->m_paIncZoomFactor->setEnabled( d->m_zoomFactor < maxZoom );
-#endif
if (d->m_doc && d->m_doc->renderer() && d->m_doc->renderer()->needsLayout())
view()->layout();
@@ -4383,40 +2384,9 @@
return d->m_lastModified;
}
-#if !APPLE_CHANGES
-
-void KHTMLPart::slotLoadImages()
-{
- if (d->m_doc )
- d->m_doc->docLoader()->setAutoloadImages( !d->m_doc->docLoader()->autoloadImages() );
-
- ConstFrameIt it = d->m_frames.begin();
- ConstFrameIt end = d->m_frames.end();
- for (; it != end; ++it )
- if ( !( *it ).m_part.isNull() && ( *it ).m_part->inherits( "KHTMLPart" ) ) {
- KParts::ReadOnlyPart* p = ( *it ).m_part;
- static_cast<KHTMLPart*>( p )->slotLoadImages();
- }
-}
-
-#endif
void KHTMLPart::reparseConfiguration()
{
-#if !APPLE_CHANGES
- setAutoloadImages( settings->autoLoadImages() );
- if (d->m_doc)
- d->m_doc->docLoader()->setShowAnimations( settings->showAnimations() );
-
- d->m_bJScriptEnabled = settings->isJavaScriptEnabled(m_url.host());
- d->m_bJScriptDebugEnabled = settings->isJavaScriptDebugEnabled();
- d->m_bJavaEnabled = settings->isJavaEnabled(m_url.host());
- d->m_bPluginsEnabled = settings->isPluginsEnabled(m_url.host());
- delete d->m_settings;
- d->m_settings = new KHTMLSettings(*KHTMLFactory::defaultHTMLSettings());
-
- QString userStyleSheet = KHTMLFactory::defaultHTMLSettings()->userStyleSheet();
-#else
setAutoloadImages( d->m_settings->autoLoadImages() );
if (d->m_doc)
d->m_doc->docLoader()->setShowAnimations( d->m_settings->showAnimations() );
@@ -4427,19 +2397,12 @@
d->m_bPluginsEnabled = d->m_settings->isPluginsEnabled(m_url.host());
QString userStyleSheet = d->m_settings->userStyleSheet();
-#endif
if ( !userStyleSheet.isEmpty() )
setUserStyleSheet( KURL( userStyleSheet ) );
else
setUserStyleSheet( QString() );
-#if !APPLE_CHANGES
- QApplication::setOverrideCursor( waitCursor );
-#endif
if(d->m_doc) d->m_doc->updateStyleSelector();
-#if !APPLE_CHANGES
- QApplication::restoreOverrideCursor();
-#endif
}
QStringList KHTMLPart::frameNames() const
@@ -4477,25 +2440,6 @@
}
-#if !APPLE_CHANGES
-
-bool KHTMLPart::openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs )
-{
- FrameIt it = d->m_frames.find( urlArgs.frameName );
-
- if ( it == d->m_frames.end() )
- return false;
-
- // Inform someone that we are about to show something else.
- if ( !urlArgs.lockHistory() )
- emit d->m_extension->openURLNotify();
-
- requestObject( &(*it), url, urlArgs );
-
- return true;
-}
-
-#endif
void KHTMLPart::setDNDEnabled( bool b )
{
@@ -4719,12 +2663,6 @@
d->m_strSelectedURLTarget = event->target().qstring();
}
-#if !APPLE_CHANGES
- if (mouse->button() == RightButton) {
- popupMenu(d->m_strSelectedURL);
- d->m_strSelectedURL = d->m_strSelectedURLTarget = QString::null;
- }
-#endif
if (mouse->button() == LeftButton || mouse->button() == MidButton) {
d->m_bMousePressed = true;
@@ -4753,114 +2691,6 @@
{
}
-#if !APPLE_CHANGES
-
-bool KHTMLPart::handleMouseMoveEventDrag(khtml::MouseMoveEvent *event)
-{
-#ifdef QT_NO_DRAGANDDROP
- return false;
-#else
-
- QMouseEvent *mouse = event->qmouseEvent();
- NodeImpl *innerNode = event->innerNode();
-
- if (d->m_bMousePressed && (!d->m_strSelectedURL.isEmpty() || (innerNode && innerNode->id() == ID_IMG)) &&
- (d->m_dragStartPos - mouse->pos()).manhattanLength() > KGlobalSettings::dndEventDelay() &&
- d->m_bDnd && d->m_mousePressNode == innerNode) {
-
- QPixmap p;
- QDragObject *drag = 0;
- if (!d->m_strSelectedURL.isEmpty()) {
- KURL u( completeURL( d->m_strSelectedURL) );
- KURLDrag* urlDrag = KURLDrag::newDrag( u, d->m_view->viewport() );
- if ( !d->m_referrer.isEmpty() )
- urlDrag->metaData()["referrer"] = d->m_referrer;
- drag = urlDrag;
- p = KMimeType::pixmapForURL(u, 0, KIcon::Desktop, KIcon::SizeMedium);
- }
- else {
- HTMLImageElementImpl *i = static_cast<HTMLImageElementImpl *>(innerNode);
- if (i) {
- KMultipleDrag *mdrag = new KMultipleDrag( d->m_view->viewport());
- mdrag->addDragObject(new QImageDrag(i->currentImage(), 0L));
- KURL u( completeURL( khtml::parseURL(i->getAttribute(srcAttr)).qstring()));
- KURLDrag* urlDrag = KURLDrag::newDrag(u, 0L);
- if (!d->m_referrer.isEmpty())
- urlDrag->metaData()["referrer"] = d->m_referrer;
- mdrag->addDragObject( urlDrag );
- drag = mdrag;
- p = KMimeType::mimeType("image/png")->pixmap(KIcon::Desktop);
- }
- }
-
- if ( !p.isNull() )
- drag->setPixmap(p);
-
- stopAutoScroll();
- if(drag)
- drag->drag();
-
- // when we finish our drag, we need to undo our mouse press
- d->m_bMousePressed = false;
- d->m_strSelectedURL = d->m_strSelectedURLTarget = QString::null;
- return true;
- }
-
- return false;
-#endif // QT_NO_DRAGANDDROP
-}
-
-bool KHTMLPart::handleMouseMoveEventOver(khtml::MouseMoveEvent *event)
-{
- // Mouse clicked. Do nothing.
- if (d->m_bMousePressed) {
- return false;
- }
-
- // The mouse is over something
- if (url.length()) {
- bool shiftPressed = (mouse->state() & ShiftButton);
-
- // Image map
- if (innerNode && innerNode->id() == ID_IMG) {
- HTMLImageElementImpl *i = static_cast<HTMLImageElementImpl *>(innerNode);
- if (i && i->isServerMap()) {
- khtml::RenderObject *r = i->renderer();
- if(r) {
- int absx, absy, vx, vy;
- r->absolutePosition(absx, absy);
- view()->contentsToViewport( absx, absy, vx, vy );
-
- int x(mouse->x() - vx);
- int y(mouse->y() - vy);
-
- d->m_overURL = url.qstring() + QString("?%1,%2").arg(x).arg(y);
- d->m_overURLTarget = target.qstring();
- overURL(d->m_overURL, target.qstring(), shiftPressed);
- return true;
- }
- }
- }
- // normal link
- if (d->m_overURL.isEmpty() || d->m_overURL != url || d->m_overURLTarget != target) {
- d->m_overURL = url.qstring();
- d->m_overURLTarget = target.qstring();
- overURL(d->m_overURL, target.qstring(), shiftPressed);
- }
- }
- else { // Not over a link...
- if (!d->m_overURL.isEmpty()) { // and we were over a link -> reset to "default statusbar text"
- d->m_overURL = d->m_overURLTarget = QString::null;
- emit onURL(QString::null);
- // Default statusbar text can be set from javascript. Otherwise it's empty.
- emit setStatusBarText(d->m_kjsDefaultStatusBarText);
- }
- }
-
- return true;
-}
-
-#endif // APPLE_CHANGES
void KHTMLPart::handleMouseMoveEventSelection(khtml::MouseMoveEvent *event)
{
@@ -4917,13 +2747,6 @@
void KHTMLPart::khtmlMouseMoveEvent(khtml::MouseMoveEvent *event)
{
-#if !APPLE_CHANGES
- if (handleMouseMoveEventDrag(event))
- return;
-
- if (handleMouseMoveEventOver(event))
- return;
-#endif
handleMouseMoveEventSelection(event);
}
@@ -5007,141 +2830,15 @@
{
}
-#if !APPLE_CHANGES
-
-void KHTMLPart::guiActivateEvent( KParts::GUIActivateEvent *event )
-{
- if ( event->activated() )
- {
- emitSelectionChanged();
- emit d->m_extension->enableAction( "print", d->m_doc != 0 );
-
- if ( !d->m_settings->autoLoadImages() && d->m_paLoadImages )
- {
- QPtrList<KAction> lst;
- lst.append( d->m_paLoadImages );
- plugActionList( "loadImages", lst );
- }
- }
-}
-
-void KHTMLPart::slotFind()
-{
- KHTMLPart *part = static_cast<KHTMLPart *>( currentFrame() );
- if (!part)
- return;
-
- if (!part->inherits("KHTMLPart") )
- {
- kdError(6000) << "slotFind: part is a " << part->className() << ", can't do a search into it" << endl;
- return;
- }
-
- // use the part's (possibly frame) widget as parent widget, so that it gets
- // properly destroyed when the (possible) frame dies
- if ( !d->m_findDialog ) {
- d->m_findDialog = new KHTMLFind( part, part->widget(), "khtmlfind" );
- connect( d->m_findDialog, SIGNAL( done() ),
- this, SLOT( slotFindDone() ) );
- connect( d->m_findDialog, SIGNAL( destroyed() ),
- this, SLOT( slotFindDialogDestroyed() ) );
- }
-
- d->m_findDialog->setPart( part );
- d->m_findDialog->setText( part->d->m_lastFindState.text );
- d->m_findDialog->setCaseSensitive( part->d->m_lastFindState.caseSensitive );
- d->m_findDialog->setDirection( part->d->m_lastFindState.direction );
-
- d->m_findDialog->show();
-
- d->m_paFind->setEnabled( false );
-}
-
-void KHTMLPart::slotFindDone()
-{
- assert( d->m_findDialog );
-
- KHTMLPart *part = d->m_findDialog->part();
-
- // this code actually belongs into some saveState() method in
- // KHTMLFind, but as we're saving into the private data section of
- // the part we have to do it here (no way to access it from the outside
- // as it is defined only in khtml_part.cpp) (Simon)
- part->d->m_lastFindState.text = d->m_findDialog->getText();
- part->d->m_lastFindState.caseSensitive = d->m_findDialog->case_sensitive();
- part->d->m_lastFindState.direction = d->m_findDialog->get_direction();
-
- d->m_paFind->setEnabled( true );
-}
-
-void KHTMLPart::slotFindDialogDestroyed()
-{
- assert( sender() == d->m_findDialog );
-
- d->m_findDialog = 0;
- d->m_paFind->setEnabled( true );
-}
-
-void KHTMLPart::slotPrintFrame()
-{
- if ( d->m_frames.count() == 0 )
- return;
-
- KParts::ReadOnlyPart *frame = currentFrame();
- if (!frame)
- return;
-
- KParts::BrowserExtension *ext = KParts::BrowserExtension::childObject( frame );
-
- if ( !ext )
- return;
-
- QMetaObject *mo = ext->metaObject();
-
- int idx = mo->findSlot( "print()", TRUE );
- if ( idx >= 0 ) {
- QUObject o[ 1 ];
- ext->qt_invoke( idx, o );
- }
-}
-
-void KHTMLPart::slotSelectAll()
-{
- KParts::ReadOnlyPart *part = currentFrame();
- if (part && part->inherits("KHTMLPart"))
- static_cast<KHTMLPart *>(part)->selectAll();
-}
-
-#endif // !APPLE_CHANGES
void KHTMLPart::startAutoScroll()
{
-#if !APPLE_CHANGES
- connect(&d->m_scrollTimer, SIGNAL( timeout() ), this, SLOT( slotAutoScroll() ));
- d->m_scrollTimer.start(100, false);
-#endif
}
void KHTMLPart::stopAutoScroll()
{
-#if !APPLE_CHANGES
- disconnect(&d->m_scrollTimer, SIGNAL( timeout() ), this, SLOT( slotAutoScroll() ));
- if (d->m_scrollTimer.isActive())
- d->m_scrollTimer.stop();
-#endif
-}
-
-#if !APPLE_CHANGES
-
-void KHTMLPart::slotAutoScroll()
-{
- if (d->m_view)
- d->m_view->doAutoScroll();
- else
- stopAutoScroll(); // Safety
}
-#endif
void KHTMLPart::selectAll()
{
@@ -5161,11 +2858,7 @@
bool KHTMLPart::shouldChangeSelection(const SelectionController &newselection) const
{
-#if APPLE_CHANGES
return KWQ(this)->shouldChangeSelection(d->m_selection, newselection, newselection.startAffinity(), false);
-#else
- return true;
-#endif
}
bool KHTMLPart::shouldBeginEditing(const RangeImpl *range) const
@@ -5212,16 +2905,12 @@
assert(cmd.isTypingCommand());
}
else {
-#if APPLE_CHANGES
// Only register a new undo command if the command passed in is
// different from the last command
KWQ(this)->registerCommandForUndo(cmd);
-#endif
d->m_lastEditCommand = cmd;
}
-#if APPLE_CHANGES
KWQ(this)->respondToChangedContents();
-#endif
}
void KHTMLPart::unappliedEditing(EditCommandPtr &cmd)
@@ -5229,10 +2918,8 @@
if (shouldChangeSelection(cmd.startingSelection())) {
setSelection(cmd.startingSelection(), true);
}
-#if APPLE_CHANGES
KWQ(this)->registerCommandForRedo(cmd);
KWQ(this)->respondToChangedContents();
-#endif
d->m_lastEditCommand = EditCommandPtr::emptyCommand();
}
@@ -5241,10 +2928,8 @@
if (shouldChangeSelection(cmd.endingSelection())) {
setSelection(cmd.endingSelection(), true);
}
-#if APPLE_CHANGES
KWQ(this)->registerCommandForUndo(cmd);
KWQ(this)->respondToChangedContents();
-#endif
d->m_lastEditCommand = EditCommandPtr::emptyCommand();
}
@@ -5271,46 +2956,6 @@
setTypingStyle(0);
}
-#if !APPLE_CHANGES
-
-bool KHTMLPart::checkLinkSecurity(const KURL &linkURL,const QString &message, const QString &button)
-{
- // Security check on the link.
- // KURL u( url ); Wrong!! Relative URL could be mis-interpreted!!! (DA)
- QString linkProto = linkURL.protocol().lower();
- QString proto = m_url.protocol().lower();
-
- if ( !linkProto.isEmpty() && !proto.isEmpty() &&
- ( linkProto == "cgi" || linkProto == "file" ) &&
- proto != "file" && proto != "cgi" && proto != "man" && proto != "about")
- {
- Tokenizer *tokenizer = d->m_doc->tokenizer();
- if (tokenizer)
- tokenizer->setOnHold(true);
-
- int response = KMessageBox::Cancel;
- if (!message.isEmpty())
- {
- response = KMessageBox::warningContinueCancel( 0,
- message.arg(linkURL.url()),
- i18n( "Security Warning" ),
- button);
- }
- else
- {
- KMessageBox::error( 0,
- i18n( "<qt>This untrusted page contains a link<BR><B>%1</B><BR>to your local file system.").arg(linkURL.url()),
- i18n( "Security Alert" ));
- }
-
- if (tokenizer)
- tokenizer->setOnHold(false);
- return (response==KMessageBox::Continue);
- }
- return true;
-}
-
-#endif
QVariant KHTMLPart::executeScript(QString filename, int baseLine, NodeImpl *n, const QString &script)
{
@@ -5333,48 +2978,6 @@
d->m_activeFrame = 0L;
}
-#if !APPLE_CHANGES
-
-void KHTMLPart::slotActiveFrameChanged( KParts::Part *part )
-{
-// kdDebug(6050) << "KHTMLPart::slotActiveFrameChanged part=" << part << endl;
- if ( part == this )
- {
- kdError(6050) << "strange error! we activated ourselves" << endl;
- assert( false );
- return;
- }
-// kdDebug(6050) << "KHTMLPart::slotActiveFrameChanged d->m_activeFrame=" << d->m_activeFrame << endl;
- if ( d->m_activeFrame && d->m_activeFrame->widget() && d->m_activeFrame->widget()->inherits( "QFrame" ) )
- {
- QFrame *frame = static_cast<QFrame *>( d->m_activeFrame->widget() );
- if (frame->frameStyle() != QFrame::NoFrame)
- {
- frame->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken);
- frame->repaint();
- }
- }
-
- d->m_activeFrame = part;
-
- if ( d->m_activeFrame && d->m_activeFrame->widget()->inherits( "QFrame" ) )
- {
- QFrame *frame = static_cast<QFrame *>( d->m_activeFrame->widget() );
- if (frame->frameStyle() != QFrame::NoFrame)
- {
- frame->setFrameStyle( QFrame::StyledPanel | QFrame::Plain);
- frame->repaint();
- }
- kdDebug(6050) << "new active frame " << d->m_activeFrame << endl;
- }
-
- updateActions();
-
- // (note: childObject returns 0 if the argument is 0)
- d->m_extension->setExtensionProxy( KParts::BrowserExtension::childObject( d->m_activeFrame ) );
-}
-
-#endif
#if !KHTML_NO_CPLUSPLUS_DOM
@@ -5434,21 +3037,6 @@
khtml::Cache::preloadScript(url, script);
}
-#if !APPLE_CHANGES
-
-QCString KHTMLPart::dcopObjectId() const
-{
- QCString id;
- id.sprintf("html-widget%d", d->m_dcop_counter);
- return id;
-}
-
-long KHTMLPart::cacheId() const
-{
- return d->m_cacheId;
-}
-
-#endif
bool KHTMLPart::restored() const
{
@@ -5492,74 +3080,39 @@
void KHTMLPart::copyToPasteboard()
{
-#if APPLE_CHANGES
KWQ(this)->issueCopyCommand();
-#endif
}
void KHTMLPart::cutToPasteboard()
{
-#if APPLE_CHANGES
KWQ(this)->issueCutCommand();
-#endif
}
void KHTMLPart::pasteFromPasteboard()
{
-#if APPLE_CHANGES
KWQ(this)->issuePasteCommand();
-#endif
}
void KHTMLPart::pasteAndMatchStyle()
{
-#if APPLE_CHANGES
KWQ(this)->issuePasteAndMatchStyleCommand();
-#endif
}
void KHTMLPart::transpose()
{
-#if APPLE_CHANGES
KWQ(this)->issueTransposeCommand();
-#endif
}
void KHTMLPart::redo()
{
-#if APPLE_CHANGES
KWQ(this)->issueRedoCommand();
-#endif
}
void KHTMLPart::undo()
{
-#if APPLE_CHANGES
KWQ(this)->issueUndoCommand();
-#endif
-}
-
-#if !APPLE_CHANGES
-
-bool KHTMLPart::canPaste() const
-{
- // FIXME: Implement.
- return true;
-}
-
-bool KHTMLPart::canRedo() const
-{
- // FIXME: Implement.
- return true;
-}
-
-bool KHTMLPart::canUndo() const
-{
- // FIXME: Implement.
- return true;
}
-#endif
void KHTMLPart::computeAndSetTypingStyle(CSSStyleDeclarationImpl *style, EditAction editingAction)
{
@@ -5870,14 +3423,6 @@
element->setAttribute(styleAttr, currentStyle->cssText());
}
-#if !APPLE_CHANGES
-
-void KHTMLPart::print()
-{
- // needs implementation
-}
-
-#endif
bool KHTMLPart::isCharacterSmartReplaceExempt(const QChar &, bool)
{
1.139 +0 -100 WebCore/khtml/khtml_part.h
Index: khtml_part.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtml_part.h,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -r1.138 -r1.139
--- khtml_part.h 24 Sep 2005 01:18:52 -0000 1.138
+++ khtml_part.h 21 Nov 2005 01:19:48 -0000 1.139
@@ -221,15 +221,6 @@
void stopLoading(bool sendUnload = false);
virtual bool closeURL();
-#if !APPLE_CHANGES
- /**
- * is called when a certain error situation (i.e. connection timed out) occured.
- * default implementation either shows a KIO error dialog or loads a more verbose
- * error description a as page, depending on the users configuration.
- * @p job is the job that signaled the error situation
- */
- virtual void showError(KIO::Job* job);
-#endif
#if !KHTML_NO_CPLUSPLUS_DOM
@@ -773,26 +764,6 @@
*/
KParts::PartManager *partManager();
-#if !APPLE_CHANGES
- /**
- * Saves the KHTMLPart's complete state (including child frame
- * objects) to the provided @ref QDataStream.
- *
- * This is called from the @ref saveState() method of the
- * @ref browserExtension().
- */
- virtual void saveState( QDataStream &stream );
- /**
- * Restores the KHTMLPart's previously saved state (including
- * child frame objects) from the provided QDataStream.
- *
- * @see saveState()
- *
- * This is called from the @ref restoreState() method of the
- * @ref browserExtension() .
- **/
- virtual void restoreState( QDataStream &stream );
-#endif
virtual void tokenizerProcessedData() {};
@@ -1017,12 +988,6 @@
void selectClosestWordFromMouseEvent(QMouseEvent *mouse, DOM::NodeImpl *innerNode, int x, int y);
-#if !APPLE_CHANGES
- /**
- * Internal reimplementation of KParts::Part::guiActivateEvent .
- */
- virtual void guiActivateEvent( KParts::GUIActivateEvent *event );
-#endif
/**
* Internal empty reimplementation of @ref KParts::ReadOnlyPart::openFile .
@@ -1032,20 +997,6 @@
virtual void urlSelected( const QString &url, int button, int state,
const QString &_target, KParts::URLArgs args = KParts::URLArgs());
-#if !APPLE_CHANGES
- /**
- * This method is called when a new embedded object (include html frames) is to be created.
- * Reimplement it if you want to add support for certain embeddable objects without registering
- * them in the KDE wide registry system (KSyCoCa) . Another reason for re-implementing this
- * method could be if you want to derive from KTHMLPart and also want all html frame objects
- * to be a object of your derived type, in which case you should return a new instance for
- * the mimetype 'text/html' .
- */
- virtual KParts::ReadOnlyPart *createPart( QWidget *parentWidget, const char *widgetName,
- QObject *parent, const char *name,
- const QString &mimetype, QString &serviceName,
- QStringList &serviceTypes, const QStringList ¶ms);
-#endif
public slots:
@@ -1110,52 +1061,11 @@
* @internal
*/
void slotDebugRenderTree();
-#if !APPLE_CHANGES
- /**
- * @internal
- */
- virtual void slotViewDocumentSource();
- /**
- * @internal
- */
- virtual void slotViewFrameSource();
- /**
- * @internal
- */
- virtual void slotSaveBackground();
- /**
- * @internal
- */
- virtual void slotSaveDocument();
- /**
- * @internal
- */
- virtual void slotSaveFrame();
- /**
- * @internal
- */
- virtual void slotSecurity();
- /**
- * @internal
- */
- virtual void slotSetEncoding();
-
- /**
- * @internal
- */
- virtual void slotUseStylesheet();
-
- virtual void slotFind();
- virtual void slotFindDone();
- virtual void slotFindDialogDestroyed();
-#endif
void slotIncZoom();
void slotDecZoom();
-#if APPLE_CHANGES
void childBegin();
-#endif
void slotLoadImages();
@@ -1351,16 +1261,12 @@
KJSProxy *jScript();
-#if APPLE_CHANGES
public:
-#endif
KHTMLPart *opener();
void setOpener(KHTMLPart *_opener);
bool openedByJS();
void setOpenedByJS(bool _openedByJS);
-#if APPLE_CHANGES
private:
-#endif
int cacheId() const;
void checkEmitLoadEvent();
@@ -1379,11 +1285,9 @@
*/
void gotoAnchor();
-#if APPLE_CHANGES
void handleMousePressEventSingleClick(khtml::MousePressEvent *event);
void handleMousePressEventDoubleClick(khtml::MousePressEvent *event);
void handleMousePressEventTripleClick(khtml::MousePressEvent *event);
-#endif
DOM::CSSComputedStyleDeclarationImpl *selectionComputedStyle(DOM::NodeImpl *&nodeToRemove) const;
@@ -1391,7 +1295,6 @@
friend class KHTMLPartPrivate;
friend class khtml::SelectionController;
-#if APPLE_CHANGES
public:
friend class KWQKHTMLPart;
@@ -1402,13 +1305,10 @@
void started(KIO::Job *);
void frameDetached();
virtual void didFirstLayout() {}
-#endif
int frameCount;
};
-#if APPLE_CHANGES
#include "KWQKHTMLPart.h"
-#endif
#endif
1.61 +0 -95 WebCore/khtml/khtmlpart_p.h
Index: khtmlpart_p.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtmlpart_p.h,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- khtmlpart_p.h 27 Sep 2005 22:37:01 -0000 1.60
+++ khtmlpart_p.h 21 Nov 2005 01:19:48 -0000 1.61
@@ -62,9 +62,6 @@
ChildFrame() { m_bCompleted = false; m_bPreloaded = false; m_type = Frame; m_bNotify = false; m_hasFallbackContent = false; }
-#if !APPLE_CHANGES
- ~ChildFrame() { if (m_run) m_run->abort(); }
-#endif
QGuardedPtr<khtml::RenderPart> m_frame;
QGuardedPtr<KParts::ReadOnlyPart> m_part;
@@ -75,9 +72,6 @@
bool m_bCompleted;
QString m_name;
KParts::URLArgs m_args;
-#if !APPLE_CHANGES
- QGuardedPtr<KHTMLRun> m_run;
-#endif
bool m_bPreloaded;
KURL m_workingURL;
Type m_type;
@@ -123,32 +117,15 @@
m_bLoadEventEmitted = true;
m_bUnloadEventEmitted = true;
m_cachePolicy = KIO::CC_Verify;
-#if !APPLE_CHANGES
- m_manager = 0L;
- m_settings = new KHTMLSettings(*KHTMLFactory::defaultHTMLSettings());
-#endif
m_bClearing = false;
m_bCleared = true;
m_zoomFactor = 100;
m_bDnd = true;
-#if !APPLE_CHANGES
- m_linkCursor = KCursor::handCursor();
- m_loadedObjects = 0;
- m_totalObjectCount = 0;
- m_jobPercent = 0;
-#endif
m_haveEncoding = false;
m_activeFrame = 0L;
-#if !APPLE_CHANGES
- m_findDialog = 0;
- m_ssl_in_use = false;
-#endif
#ifndef Q_WS_QWS
m_javaContext = 0;
#endif
-#if !APPLE_CHANGES
- m_cacheId = 0;
-#endif
m_frameNameId = 1;
m_restored = false;
@@ -197,9 +174,6 @@
m_bPluginsForce = part->d->m_bPluginsForce;
m_bPluginsOverride = part->d->m_bPluginsOverride;
// Same for SSL settings
-#if !APPLE_CHANGES
- m_ssl_in_use = part->d->m_ssl_in_use;
-#endif
m_onlyLocalReferences = part->d->m_onlyLocalReferences;
m_zoomFactor = part->d->m_zoomFactor;
}
@@ -218,9 +192,6 @@
{
delete m_dcopobject;
delete m_extension;
-#if !APPLE_CHANGES
- delete m_settings;
-#endif
delete m_jscript;
if ( m_kjs_lib)
m_kjs_lib->unload();
@@ -278,20 +249,6 @@
QString m_kjsDefaultStatusBarText;
QString m_lastModified;
-#if !APPLE_CHANGES
- // QStrings for SSL metadata
- // Note: When adding new variables don't forget to update ::saveState()/::restoreState()!
- bool m_ssl_in_use;
- QString m_ssl_peer_certificate,
- m_ssl_peer_chain,
- m_ssl_peer_ip,
- m_ssl_cipher,
- m_ssl_cipher_desc,
- m_ssl_cipher_version,
- m_ssl_cipher_used_bits,
- m_ssl_cipher_bits,
- m_ssl_cert_state;
-#endif
bool m_bComplete:1;
bool m_bLoadingMainResource:1;
@@ -315,36 +272,9 @@
QString m_redirectReferrer;
int m_scheduledHistoryNavigationSteps;
-#if !APPLE_CHANGES
- KAction *m_paViewDocument;
- KAction *m_paViewFrame;
- KAction *m_paSaveBackground;
- KAction *m_paSaveDocument;
- KAction *m_paSaveFrame;
- KAction *m_paSecurity;
- KSelectAction *m_paSetEncoding;
- KSelectAction *m_paUseStylesheet;
- KHTMLZoomFactorAction *m_paIncZoomFactor;
- KHTMLZoomFactorAction *m_paDecZoomFactor;
- KAction *m_paLoadImages;
- KAction *m_paFind;
- KAction *m_paPrintFrame;
- KAction *m_paSelectAll;
- KAction *m_paDebugDOMTree;
- KAction *m_paDebugRenderTree;
-
- KParts::PartManager *m_manager;
-
- QString m_popupMenuXML;
- KHTMLPart::GUIProfile m_guiProfile;
-#endif
int m_zoomFactor;
-#if !APPLE_CHANGES
- int m_findPos;
- DOM::NodeImpl *m_findNode;
-#endif
QString m_strSelectedURL;
QString m_strSelectedURLTarget;
@@ -367,10 +297,6 @@
khtml::ETextGranularity m_selectionGranularity;
bool m_beganSelectingText;
-#if !APPLE_CHANGES
- QString m_overURL;
- QString m_overURLTarget;
-#endif
khtml::SelectionController m_selection;
khtml::SelectionController m_dragCaret;
@@ -399,27 +325,6 @@
QPoint m_dragLastPos;
#endif
-#if !APPLE_CHANGES
- QCursor m_linkCursor;
- QTimer m_scrollTimer;
-
- unsigned m_loadedObjects;
- unsigned m_totalObjectCount;
- unsigned int m_jobPercent;
-
- KHTMLFind *m_findDialog;
-
- struct findState
- {
- findState()
- { caseSensitive = false; direction = false; }
- QString text;
- bool caseSensitive;
- bool direction;
- };
-
- findState m_lastFindState;
-#endif
//QGuardedPtr<KParts::Part> m_activeFrame;
KParts::Part * m_activeFrame;
1.153 +0 -654 WebCore/khtml/khtmlview.cpp
Index: khtmlview.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtmlview.cpp,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -r1.152 -r1.153
--- khtmlview.cpp 3 Nov 2005 19:12:03 -0000 1.152
+++ khtmlview.cpp 21 Nov 2005 01:19:48 -0000 1.153
@@ -64,9 +64,7 @@
#include <kurldrag.h>
#include <qobjectlist.h>
-#if APPLE_CHANGES
#include "KWQAccObjectCache.h"
-#endif
#define PAINT_BUFFER_HEIGHT 128
@@ -110,11 +108,6 @@
underMouse = 0;
clickNode = 0;
reset();
-#if !APPLE_CHANGES
- tp=0;
- paintBuffer=0;
- formCompletions=0;
-#endif
layoutTimerId = 0;
delayedLayout = false;
mousePressed = false;
@@ -123,21 +116,12 @@
#endif
doFullRepaint = true;
isTransparent = false;
-#if APPLE_CHANGES
vmode = hmode = QScrollView::Auto;
firstLayout = true;
needToInitScrollBars = true;
-#else
- prevScrollbarVisible = true;
-#endif
}
~KHTMLViewPrivate()
{
-#if !APPLE_CHANGES
- delete formCompletions;
- delete tp; tp = 0;
- delete paintBuffer; paintBuffer =0;
-#endif
if (underMouse)
underMouse->deref();
@@ -157,23 +141,10 @@
useSlowRepaints = false;
dragTarget.reset();
borderTouched = false;
-#if !APPLE_CHANGES
-#ifndef KHTML_NO_SCROLLBARS
- vmode = QScrollView::Auto;
- hmode = QScrollView::Auto;
-#else
- vmode = QScrollView::AlwaysOff;
- hmode = QScrollView::AlwaysOff;
-#endif
-#endif
scrollBarMoved = false;
ignoreWheelEvents = false;
borderX = 30;
borderY = 30;
-#if !APPLE_CHANGES
- clickX = -1;
- clickY = -1;
-#endif
prevMouseX = -1;
prevMouseY = -1;
clickCount = 0;
@@ -188,17 +159,11 @@
layoutSchedulingEnabled = true;
layoutSuppressed = false;
layoutCount = 0;
-#if APPLE_CHANGES
firstLayout = true;
-#endif
if (repaintRects)
repaintRects->clear();
}
-#if !APPLE_CHANGES
- QPainter *tp;
- QPixmap *paintBuffer;
-#endif
NodeImpl *underMouse;
bool borderTouched:1;
@@ -208,19 +173,11 @@
QScrollView::ScrollBarMode vmode;
QScrollView::ScrollBarMode hmode;
-#if !APPLE_CHANGES
- bool prevScrollbarVisible;
-#endif
bool linkPressed;
bool useSlowRepaints;
bool ignoreWheelEvents;
int borderX, borderY;
-#if !APPLE_CHANGES
- KSimpleConfig *formCompletions;
-
- int clickX, clickY;
-#endif
int clickCount;
NodeImpl *clickNode;
@@ -233,10 +190,8 @@
bool layoutSuppressed;
int layoutCount;
-#if APPLE_CHANGES
bool firstLayout;
bool needToInitScrollBars;
-#endif
bool mousePressed;
bool isTransparent;
#ifndef QT_NO_TOOLTIP
@@ -276,15 +231,9 @@
m_medium = "screen";
m_part = part;
-#if APPLE_CHANGES
m_part->ref();
-#endif
d = new KHTMLViewPrivate;
-#if !APPLE_CHANGES
- QScrollView::setVScrollBarMode(d->vmode);
- QScrollView::setHScrollBarMode(d->hmode);
-#endif
connect(kapp, SIGNAL(kdisplayPaletteChanged()), this, SLOT(slotPaletteChanged()));
connect(this, SIGNAL(contentsMoving(int, int)), this, SLOT(slotScrollBarMoved()));
@@ -307,9 +256,7 @@
KHTMLView::~KHTMLView()
{
-#if APPLE_CHANGES
resetScrollBars();
-#endif
assert(_refCount == 0);
@@ -321,9 +268,7 @@
if (doc)
doc->detach();
-#if APPLE_CHANGES
m_part->deref();
-#endif
}
delete d; d = 0;
@@ -337,7 +282,6 @@
}
}
-#if APPLE_CHANGES
void KHTMLView::resetScrollBars()
{
// Reset the document's scrollbars back to our defaults before we yield the floor.
@@ -347,14 +291,9 @@
QScrollView::setHScrollBarMode(d->hmode);
suppressScrollBars(false);
}
-#endif
void KHTMLView::init()
{
-#if !APPLE_CHANGES
- if(!d->paintBuffer) d->paintBuffer = new QPixmap(PAINT_BUFFER_HEIGHT, PAINT_BUFFER_HEIGHT);
- if(!d->tp) d->tp = new QPainter();
-#endif
setFocusPolicy(QWidget::StrongFocus);
viewport()->setFocusPolicy( QWidget::WheelFocus );
@@ -367,9 +306,6 @@
setAcceptDrops(true);
-#if !APPLE_CHANGES
- resizeContents(visibleWidth(), visibleHeight());
-#endif
}
void KHTMLView::clear()
@@ -390,16 +326,7 @@
killTimers();
emit cleared();
-#if APPLE_CHANGES
suppressScrollBars(true);
-#else
- QScrollView::setHScrollBarMode(d->hmode);
- if (d->vmode==Auto)
- QScrollView::setVScrollBarMode(d->prevScrollbarVisible?AlwaysOn:Auto);
- else
- QScrollView::setVScrollBarMode(d->vmode);
- resizeContents(visibleWidth(), visibleHeight());
-#endif
}
void KHTMLView::hideEvent(QHideEvent* e)
@@ -418,24 +345,12 @@
{
QScrollView::resizeEvent(e);
-#if !APPLE_CHANGES
- int w = visibleWidth();
- int h = visibleHeight();
-
- layout();
-
- // this is to make sure we get the right width even if the scrolbar has dissappeared
- // due to the size change.
- if(visibleHeight() != h || visibleWidth() != w)
- layout();
-#endif
if ( m_part && m_part->xmlDocImpl() )
m_part->xmlDocImpl()->dispatchWindowEvent( EventNames::resizeEvent, false, false );
KApplication::sendPostedEvents(viewport(), QEvent::Paint);
}
-#if APPLE_CHANGES
void KHTMLView::initScrollBars()
{
if (!d->needToInitScrollBars)
@@ -443,53 +358,7 @@
d->needToInitScrollBars = false;
setScrollBarsMode(hScrollBarMode());
}
-#endif
-
-#if !APPLE_CHANGES
-
-// this is to get rid of a compiler virtual overload mismatch warning. do not remove
-void KHTMLView::drawContents( QPainter*)
-{
-}
-
-void KHTMLView::drawContents( QPainter *p, int ex, int ey, int ew, int eh )
-{
- //kdDebug( 6000 ) << "drawContents x=" << ex << ",y=" << ey << ",w=" << ew << ",h=" << eh << endl;
- if(!m_part->xmlDocImpl() || !m_part->xmlDocImpl()->renderer()) {
- p->fillRect(ex, ey, ew, eh, palette().normal().brush(QColorGroup::Base));
- return;
- }
- if ( d->paintBuffer->width() < visibleWidth() )
- d->paintBuffer->resize(visibleWidth(),PAINT_BUFFER_HEIGHT);
-
- int py=0;
- while (py < eh) {
- int ph = eh-py < PAINT_BUFFER_HEIGHT ? eh-py : PAINT_BUFFER_HEIGHT;
- d->tp->begin(d->paintBuffer);
- d->tp->translate(-ex, -ey-py);
- d->tp->fillRect(ex, ey+py, ew, ph, palette().normal().brush(QColorGroup::Base));
- m_part->xmlDocImpl()->renderer()->print(d->tp, ex, ey+py, ew, ph, 0, 0);
-#ifdef BOX_DEBUG
- if (m_part->xmlDocImpl()->focusNode())
- {
- d->tp->setBrush(Qt::NoBrush);
- d->tp->drawRect(m_part->xmlDocImpl()->focusNode()->getRect());
- }
-#endif
- d->tp->end();
-
- p->drawPixmap(ex, ey+py, *d->paintBuffer, 0, 0, ew, ph);
- py += PAINT_BUFFER_HEIGHT;
- }
-
- // EDIT FIXME: KDE needs to draw the caret here.
-
- khtml::DrawContentsEvent event( p, ex, ey, ew, eh );
- QApplication::sendEvent( m_part, &event );
-
-}
-#endif // !APPLE_CHANGES
void KHTMLView::setMarginWidth(int w)
{
@@ -634,7 +503,6 @@
if (d->repaintRects)
d->repaintRects->clear();
-#if APPLE_CHANGES
// Now set our scrollbar state for the layout.
ScrollBarMode currentHMode = hScrollBarMode();
ScrollBarMode currentVMode = vScrollBarMode();
@@ -663,10 +531,6 @@
suppressScrollBars(false, true);
}
-#else
- QScrollView::setHScrollBarMode(hMode);
- QScrollView::setVScrollBarMode(vMode);
-#endif
int oldHeight = _height;
int oldWidth = _width;
@@ -713,14 +577,10 @@
}
d->layoutCount++;
-#if APPLE_CHANGES
if (KWQAccObjectCache::accessibilityEnabled())
root->document()->getAccObjectCache()->postNotification(root, "AXLayoutComplete");
-#endif
-#if APPLE_CHANGES
updateDashboardRegions();
-#endif
if (root->needsLayout()) {
//qDebug("needs layout, delaying repaint");
@@ -729,14 +589,11 @@
}
setStaticBackground(d->useSlowRepaints);
-#if APPLE_CHANGES
if (didFirstLayout) {
m_part->didFirstLayout();
}
-#endif
}
-#if APPLE_CHANGES
void KHTMLView::updateDashboardRegions()
{
DOM::DocumentImpl* document = m_part->xmlDocImpl();
@@ -747,7 +604,6 @@
KWQ(m_part)->dashboardRegionsChanged();
}
}
-#endif
//
// Event Handling
@@ -770,16 +626,6 @@
DOM::NodeImpl::MouseEvent mev( _mouse->stateAfter(), DOM::NodeImpl::MousePress );
m_part->xmlDocImpl()->prepareMouseEvent( false, xm, ym, &mev );
-#if !APPLE_CHANGES
- if (d->clickCount > 0 &&
- QPoint(d->clickX-xm,d->clickY-ym).manhattanLength() <= QApplication::startDragDistance())
- d->clickCount++;
- else {
- d->clickCount = 1;
- d->clickX = xm;
- d->clickY = ym;
- }
-#else
if (KWQ(m_part)->passSubframeEventToSubframe(mev)) {
invalidateClick();
return;
@@ -791,7 +637,6 @@
d->clickNode = mev.innerNode.get();
if (d->clickNode)
d->clickNode->ref();
-#endif
bool swallowEvent = dispatchMouseEvent(mousedownEvent,mev.innerNode.get(),true,
d->clickCount,_mouse,true,DOM::NodeImpl::MousePress);
@@ -799,7 +644,6 @@
if (!swallowEvent) {
khtml::MousePressEvent event( _mouse, xm, ym, mev.url, mev.target, mev.innerNode.get() );
QApplication::sendEvent( m_part, &event );
-#if APPLE_CHANGES
// Many AK widgets run their own event loops and consume events while the mouse is down.
// When they finish, currentEvent is the mouseUp that they exited on. We need to update
// the khtml state with this mouseUp, which khtml never saw.
@@ -808,7 +652,6 @@
if (KWQ(m_part)->lastEventIsMouseUp()) {
d->mousePressed = false;
}
-#endif
#if !KHTML_NO_CPLUSPLUS_DOM
emit m_part->nodeActivated(mev.innerNode.get());
#endif
@@ -826,15 +669,12 @@
//kdDebug( 6000 ) << "mouseDblClickEvent: x=" << xm << ", y=" << ym << endl;
-#if APPLE_CHANGES
// We get this instead of a second mouse-up
d->mousePressed = false;
-#endif
DOM::NodeImpl::MouseEvent mev( _mouse->stateAfter(), DOM::NodeImpl::MouseDblClick );
m_part->xmlDocImpl()->prepareMouseEvent( false, xm, ym, &mev );
-#if APPLE_CHANGES
if (KWQ(m_part)->passSubframeEventToSubframe(mev))
return;
@@ -854,23 +694,6 @@
khtml::MouseDoubleClickEvent event2( _mouse, xm, ym, mev.url, mev.target, mev.innerNode.get() );
QApplication::sendEvent( m_part, &event2 );
}
-#else
- // We do the same thing as viewportMousePressEvent() here, since the DOM does not treat
- // single and double-click events as separate (only the detail, i.e. number of clicks differs)
- // In other words an even detail value for a mouse click event means a double click, and an
- // odd detail value means a single click
- bool swallowEvent = dispatchMouseEvent(mousedownEvent,mev.innerNode.get(),true,
- d->clickCount,_mouse,true,DOM::NodeImpl::MouseDblClick);
-
- if (!swallowEvent) {
- khtml::MouseDoubleClickEvent event( _mouse, xm, ym, mev.url, mev.target, mev.innerNode.get() );
- QApplication::sendEvent( m_part, &event );
-
- // ###
- //if ( url.length() )
- //emit doubleClick( url.qstring(), _mouse->button() );
- }
-#endif
invalidateClick();
}
@@ -898,20 +721,12 @@
// was pressed, rather than updating for nodes the mouse moves over as you hold the mouse down.
DOM::NodeImpl::MouseEvent mev( _mouse->stateAfter(), DOM::NodeImpl::MouseMove );
m_part->xmlDocImpl()->prepareMouseEvent(d->mousePressed && m_part->mouseDownMayStartSelect(), d->mousePressed, xm, ym, &mev );
-#if APPLE_CHANGES
if (KWQ(m_part)->passSubframeEventToSubframe(mev))
return;
-#endif
bool swallowEvent = dispatchMouseEvent(mousemoveEvent,mev.innerNode.get(),false,
0,_mouse,true,DOM::NodeImpl::MouseMove);
-#if !APPLE_CHANGES
- if (d->clickCount > 0 &&
- QPoint(d->clickX-xm,d->clickY-ym).manhattanLength() > QApplication::startDragDistance()) {
- d->clickCount = 0; // moving the mouse outside the threshold invalidates the click
- }
-#endif
// execute the scheduled script. This is to make sure the mouseover events come after the mouseout events
m_part->executeScheduledScript();
@@ -953,52 +768,28 @@
c = KCursor::sizeAllCursor();
break;
case CURSOR_E_RESIZE:
-#if APPLE_CHANGES
c = KCursor::eastResizeCursor();
break;
-#endif
case CURSOR_W_RESIZE:
-#if APPLE_CHANGES
c = KCursor::westResizeCursor();
-#else
- c = KCursor::sizeHorCursor();
-#endif
break;
case CURSOR_N_RESIZE:
-#if APPLE_CHANGES
c = KCursor::northResizeCursor();
break;
-#endif
case CURSOR_S_RESIZE:
-#if APPLE_CHANGES
c = KCursor::southResizeCursor();
-#else
- c = KCursor::sizeVerCursor();
-#endif
break;
case CURSOR_NE_RESIZE:
-#if APPLE_CHANGES
c = KCursor::northEastResizeCursor();
break;
-#endif
case CURSOR_SW_RESIZE:
-#if APPLE_CHANGES
c = KCursor::southWestResizeCursor();
-#else
- c = KCursor::sizeBDiagCursor();
-#endif
break;
case CURSOR_NW_RESIZE:
-#if APPLE_CHANGES
c = KCursor::northWestResizeCursor();
break;
-#endif
case CURSOR_SE_RESIZE:
-#if APPLE_CHANGES
c = KCursor::southEastResizeCursor();
-#else
- c = KCursor::sizeFDiagCursor();
-#endif
break;
case CURSOR_TEXT:
c = KCursor::ibeamCursor();
@@ -1059,18 +850,13 @@
DOM::NodeImpl::MouseEvent mev( _mouse->stateAfter(), DOM::NodeImpl::MouseRelease );
m_part->xmlDocImpl()->prepareMouseEvent( false, xm, ym, &mev );
-#if APPLE_CHANGES
if (KWQ(m_part)->passSubframeEventToSubframe(mev))
return;
-#endif
bool swallowEvent = dispatchMouseEvent(mouseupEvent,mev.innerNode.get(),true,
d->clickCount,_mouse,false,DOM::NodeImpl::MouseRelease);
if (d->clickCount > 0 && mev.innerNode == d->clickNode
-#if !APPLE_CHANGES
- && QPoint(d->clickX-xm,d->clickY-ym).manhattanLength() <= QApplication::startDragDistance()
-#endif
)
dispatchMouseEvent(clickEvent,mev.innerNode.get(),true,
d->clickCount,_mouse,true,DOM::NodeImpl::MouseRelease);
@@ -1093,93 +879,6 @@
}
}
-#if !APPLE_CHANGES
- int offs = (clipper()->height() < 30) ? clipper()->height() : 30;
- if (_ke->state()&ShiftButton)
- switch(_ke->key())
- {
- case Key_Space:
- if ( d->vmode == QScrollView::AlwaysOff )
- _ke->accept();
- else
- scrollBy( 0, -clipper()->height() - offs );
- break;
- }
- else
- switch ( _ke->key() )
- {
- case Key_Down:
- case Key_J:
- if ( d->vmode == QScrollView::AlwaysOff )
- _ke->accept();
- else
- scrollBy( 0, 10 );
- break;
-
- case Key_Space:
- case Key_Next:
- if ( d->vmode == QScrollView::AlwaysOff )
- _ke->accept();
- else
- scrollBy( 0, clipper()->height() - offs );
- break;
-
- case Key_Up:
- case Key_K:
- if ( d->vmode == QScrollView::AlwaysOff )
- _ke->accept();
- else
- scrollBy( 0, -10 );
- break;
-
- case Key_Prior:
- if ( d->vmode == QScrollView::AlwaysOff )
- _ke->accept();
- else
- scrollBy( 0, -clipper()->height() + offs );
- break;
- case Key_Right:
- case Key_L:
- if ( d->hmode == QScrollView::AlwaysOff )
- _ke->accept();
- else
- scrollBy( 10, 0 );
- break;
- case Key_Left:
- case Key_H:
- if ( d->hmode == QScrollView::AlwaysOff )
- _ke->accept();
- else
- scrollBy( -10, 0 );
- break;
- case Key_Enter:
- case Key_Return:
- // ### FIXME:
- // or even better to HTMLAnchorElementImpl::event()
- if (m_part->xmlDocImpl()) {
- NodeImpl *n = m_part->xmlDocImpl()->focusNode();
- if (n)
- n->setActive();
- }
- break;
- case Key_Home:
- if ( d->vmode == QScrollView::AlwaysOff )
- _ke->accept();
- else
- setContentsPos( 0, 0 );
- break;
- case Key_End:
- if ( d->vmode == QScrollView::AlwaysOff )
- _ke->accept();
- else
- setContentsPos( 0, contentsHeight() - visibleHeight() );
- break;
- default:
- _ke->ignore();
- return;
- }
- _ke->accept();
-#endif
}
void KHTMLView::keyReleaseEvent(QKeyEvent *_ke)
@@ -1200,43 +899,15 @@
void KHTMLView::contentsContextMenuEvent ( QContextMenuEvent *_ce )
{
// ### what kind of c*** is that ?
-#if 0
- if (!m_part->xmlDocImpl()) return;
- int xm = _ce->x();
- int ym = _ce->y();
-
- DOM::NodeImpl::MouseEvent mev( _ce->state(), DOM::NodeImpl::MouseMove ); // ### not a mouse event!
- m_part->xmlDocImpl()->prepareMouseEvent( xm, ym, &mev );
-
- NodeImpl *targetNode = mev.innerNode.get();
- if (targetNode && targetNode->renderer() && targetNode->renderer()->isWidget()) {
- int absx = 0;
- int absy = 0;
- targetNode->renderer()->absolutePosition(absx,absy);
- QPoint pos(xm-absx,ym-absy);
-
- QWidget *w = static_cast<RenderWidget*>(targetNode->renderer())->widget();
- QContextMenuEvent cme(_ce->reason(),pos,_ce->globalPos(),_ce->state());
- setIgnoreEvents(true);
- QApplication::sendEvent(w,&cme);
- setIgnoreEvents(false);
- }
-#endif
}
bool KHTMLView::dispatchDragEvent(const AtomicString &eventType, DOM::NodeImpl *dragTarget, const QPoint &loc, DOM::ClipboardImpl *clipboard)
{
int clientX, clientY;
viewportToContents(loc.x(), loc.y(), clientX, clientY);
-#if APPLE_CHANGES
QPoint screenLoc = viewportToGlobal(loc);
int screenX = screenLoc.x();
int screenY = screenLoc.y();
-#else
-#warning Need implementation of converting event location to screen location
- int screenX = loc.x();
- int screenY = loc.y();
-#endif
bool ctrlKey = 0; // FIXME - set up modifiers, grab from AK or CG
bool altKey = 0;
bool shiftKey = 0;
@@ -1303,45 +974,6 @@
return accept;
}
-#if !APPLE_CHANGES
-
-bool KHTMLView::focusNextPrevChild( bool next )
-{
- // Now try to find the next child
- if (m_part->xmlDocImpl()) {
- focusNextPrevNode(next);
- if (m_part->xmlDocImpl()->focusNode() != 0)
- return true; // focus node found
- }
-
- // If we get here, there is no next/previous child to go to, so pass up to the next/previous child in our parent
- if (m_part->parentPart() && m_part->parentPart()->view()) {
- return m_part->parentPart()->view()->focusNextPrevChild(next);
- }
-
- return QWidget::focusNextPrevChild(next);
-}
-
-void KHTMLView::doAutoScroll()
-{
- QPoint pos = QCursor::pos();
- pos = viewport()->mapFromGlobal( pos );
-
- int xm, ym;
- viewportToContents(pos.x(), pos.y(), xm, ym);
-
- pos = QPoint(pos.x() - viewport()->x(), pos.y() - viewport()->y());
- if ( (pos.y() < 0) || (pos.y() > visibleHeight()) ||
- (pos.x() < 0) || (pos.x() > visibleWidth()) )
- {
- DocumentImpl *doc = m_part->xmlDocImpl();
- if (doc && doc->renderer()) {
- doc->renderer()->enclosingLayer()->scrollRectToVisible(QRect(xm, ym, 0, 5));
- }
- }
-}
-
-#endif
DOM::NodeImpl *KHTMLView::nodeUnderMouse() const
{
@@ -1508,24 +1140,6 @@
emit m_part->nodeActivated(newFocusNode);
#endif
-#if 0
- if (newFocusNode) {
-
- // this does not belong here. it should run a query on the tree (Dirk)
- // I'll fix this very particular part of the code soon when I cleaned
- // up the positioning code
- // If the newly focussed node is a link, notify the part
-
- HTMLAnchorElementImpl *anchor = 0;
- if ((newFocusNode->id() == ID_A || newFocusNode->id() == ID_AREA))
- anchor = static_cast<HTMLAnchorElementImpl *>(newFocusNode);
-
- if (anchor && !anchor->areaHref().isNull())
- m_part->overURL(anchor->areaHref().qstring(), 0);
- else
- m_part->overURL(QString(), 0);
- }
-#endif
}
void KHTMLView::setMediaType( const QString &medium )
@@ -1535,167 +1149,13 @@
QString KHTMLView::mediaType() const
{
-#if APPLE_CHANGES
// See if we have an override type.
QString overrideType = KWQ(m_part)->overrideMediaType();
if (!overrideType.isNull())
return overrideType;
-#endif
return m_medium;
}
-#if !APPLE_CHANGES
-
-void KHTMLView::print()
-{
- if(!m_part->xmlDocImpl()) return;
- khtml::RenderCanvas *root = static_cast<khtml::RenderCanvas *>(m_part->xmlDocImpl()->renderer());
- if(!root) return;
-
- // this only works on Unix - we assume 72dpi
- KPrinter *printer = new KPrinter(QPrinter::PrinterResolution);
- printer->addDialogPage(new KHTMLPrintSettings());
- if(printer->setup(this)) {
- viewport()->setCursor( waitCursor ); // only viewport(), no QApplication::, otherwise we get the busy cursor in kdeprint's dialogs
- // set up KPrinter
- printer->setFullPage(false);
- printer->setCreator("KDE 3.0 HTML Library");
- QString docname = m_part->xmlDocImpl()->URL();
- if ( !docname.isEmpty() )
- printer->setDocName(docname);
-
- QPainter *p = new QPainter;
- p->begin( printer );
- khtml::setPrintPainter( p );
-
- m_part->xmlDocImpl()->setPaintDevice( printer );
- QString oldMediaType = mediaType();
- setMediaType( "print" );
- // We ignore margin settings for html and body when printing
- // and use the default margins from the print-system
- // (In Qt 3.0.x the default margins are hardcoded in Qt)
- m_part->xmlDocImpl()->setPrintStyleSheet( printer->option("kde-khtml-printfriendly") == "true" ?
- "* { background-image: none !important;"
- " background-color: white !important;"
- " color: black !important; }"
- "body { margin: 0px !important; }"
- "html { margin: 0px !important; }" :
- "body { margin: 0px !important; }"
- "html { margin: 0px !important; }"
- );
-
-
- QPaintDeviceMetrics metrics( printer );
-
- // this is a simple approximation... we layout the document
- // according to the width of the page, then just cut
- // pages without caring about the content. We should do better
- // in the future, but for the moment this is better than no
- // printing support
- kdDebug(6000) << "printing: physical page width = " << metrics.width()
- << " height = " << metrics.height() << endl;
- root->setPrintingMode(true);
- root->setWidth(metrics.width());
-
- m_part->xmlDocImpl()->styleSelector()->computeFontSizes(&metrics);
- m_part->xmlDocImpl()->updateStyleSelector();
- root->setPrintImages( printer->option("kde-khtml-printimages") == "true");
- root->setNeedsLayoutAndMinMaxRecalc();
- root->layout();
-
- // ok. now print the pages.
- kdDebug(6000) << "printing: html page width = " << root->docWidth()
- << " height = " << root->docHeight() << endl;
- kdDebug(6000) << "printing: margins left = " << printer->margins().width()
- << " top = " << printer->margins().height() << endl;
- kdDebug(6000) << "printing: paper width = " << metrics.width()
- << " height = " << metrics.height() << endl;
- // if the width is too large to fit on the paper we just scale
- // the whole thing.
- int pageHeight = metrics.height();
- int pageWidth = metrics.width();
- p->setClipRect(0,0, pageWidth, pageHeight);
- if(root->docWidth() > metrics.width()) {
- double scale = ((double) metrics.width())/((double) root->docWidth());
-#ifndef QT_NO_TRANSFORMATIONS
- p->scale(scale, scale);
-#endif
- pageHeight = (int) (pageHeight/scale);
- pageWidth = (int) (pageWidth/scale);
- }
- kdDebug(6000) << "printing: scaled html width = " << pageWidth
- << " height = " << pageHeight << endl;
- int top = 0;
- while(top < root->docHeight()) {
- if(top > 0) printer->newPage();
- root->setTruncatedAt(top+pageHeight);
-
- root->print(p, 0, top, pageWidth, pageHeight, 0, 0);
- if (top + pageHeight >= root->docHeight())
- break; // Stop if we have printed everything
-
- p->translate(0, top - root->truncatedAt());
- top = root->truncatedAt();
- }
-
- p->end();
- delete p;
-
- // and now reset the layout to the usual one...
- root->setPrintingMode(false);
- khtml::setPrintPainter( 0 );
- setMediaType( oldMediaType );
- m_part->xmlDocImpl()->setPaintDevice( this );
- m_part->xmlDocImpl()->styleSelector()->computeFontSizes(m_part->xmlDocImpl()->paintDeviceMetrics());
- m_part->xmlDocImpl()->updateStyleSelector();
- viewport()->unsetCursor();
- }
- delete printer;
-}
-
-void KHTMLView::slotPaletteChanged()
-{
- if(!m_part->xmlDocImpl()) return;
- DOM::DocumentImpl *document = m_part->xmlDocImpl();
- if (!document->isHTMLDocument()) return;
- khtml::RenderCanvas *root = static_cast<khtml::RenderCanvas *>(document->renderer());
- if(!root) return;
- root->style()->resetPalette();
- NodeImpl *body = static_cast<HTMLDocumentImpl*>(document)->body();
- if(!body) return;
- body->setChanged(true);
- body->recalcStyle( NodeImpl::Force );
-}
-
-void KHTMLView::paint(QPainter *p, const QRect &rc, int yOff, bool *more)
-{
- if(!m_part->xmlDocImpl()) return;
- khtml::RenderCanvas *root = static_cast<khtml::RenderCanvas *>(m_part->xmlDocImpl()->renderer());
- if(!root) return;
-
- m_part->xmlDocImpl()->setPaintDevice(p->device());
- root->setPrintingMode(true);
- root->setWidth(rc.width());
-
- p->save();
- p->setClipRect(rc);
- p->translate(rc.left(), rc.top());
- double scale = ((double) rc.width()/(double) root->docWidth());
- int height = (int) ((double) rc.height() / scale);
-#ifndef QT_NO_TRANSFORMATIONS
- p->scale(scale, scale);
-#endif
-
- root->print(p, 0, yOff, root->docWidth(), height, 0, 0);
- if (more)
- *more = yOff + height < root->docHeight();
- p->restore();
-
- root->setPrintingMode(false);
- m_part->xmlDocImpl()->setPaintDevice( this );
-}
-
-#endif // !APPLE_CHANGES
void KHTMLView::useSlowRepaints()
{
@@ -1710,13 +1170,8 @@
d->vmode = mode;
d->hmode = mode;
-#if APPLE_CHANGES
QScrollView::setScrollBarsMode(mode);
#else
- QScrollView::setVScrollBarMode(mode);
- QScrollView::setHScrollBarMode(mode);
-#endif
-#else
Q_UNUSED( mode );
#endif
}
@@ -1743,56 +1198,9 @@
void KHTMLView::restoreScrollBar ( )
{
-#if APPLE_CHANGES
suppressScrollBars(false);
-#else
- int ow = visibleWidth();
- QScrollView::setVScrollBarMode(d->vmode);
- if (visibleWidth() != ow)
- layout();
- d->prevScrollbarVisible = verticalScrollBar()->isVisible();
-#endif
}
-#if !APPLE_CHANGES
-
-QStringList KHTMLView::formCompletionItems(const QString &name) const
-{
- if (!m_part->settings()->isFormCompletionEnabled())
- return QStringList();
- if (!d->formCompletions)
- d->formCompletions = new KSimpleConfig(locateLocal("data", "khtml/formcompletions"));
- return d->formCompletions->readListEntry(name);
-}
-
-void KHTMLView::addFormCompletionItem(const QString &name, const QString &value)
-{
- if (!m_part->settings()->isFormCompletionEnabled())
- return;
- // don't store values that are all numbers or just numbers with
- // dashes or spaces as those are likely credit card numbers or
- // something similar
- bool cc_number(true);
- for (unsigned int i = 0; i < value.length(); ++i)
- {
- QChar c(value[i]);
- if (!c.isNumber() && c != '-' && !c.isSpace())
- {
- cc_number = false;
- break;
- }
- }
- if (cc_number)
- return;
- QStringList items = formCompletionItems(name);
- if (!items.contains(value))
- items.prepend(value);
- while ((int)items.count() > m_part->settings()->maxFormCompletionItems())
- items.remove(items.fromLast());
- d->formCompletions->writeEntry(name, items);
-}
-
-#endif
bool KHTMLView::dispatchMouseEvent(const AtomicString &eventType, DOM::NodeImpl *targetNode, bool cancelable,
int detail,QMouseEvent *_mouse, bool setUnder,
@@ -1891,72 +1299,10 @@
}
}
-#if !APPLE_CHANGES
- if ( d->ignoreWheelEvents && !verticalScrollBar()->isVisible() && m_part->parentPart() ) {
- if ( m_part->parentPart()->view() )
- m_part->parentPart()->view()->wheelEvent( e );
- e->ignore();
- }
- else if ( d->vmode == QScrollView::AlwaysOff ) {
- e->accept();
- }
- else {
- d->scrollBarMoved = true;
- QScrollView::viewportWheelEvent( e );
- }
-#endif
}
#endif
-#if !APPLE_CHANGES
-void KHTMLView::dragEnterEvent( QDragEnterEvent* ev )
-{
- // Handle drops onto frames (#16820)
- // Drops on the main html part is handled by Konqueror (and shouldn't do anything
- // in e.g. kmail, so not handled here).
- if ( m_part->parentPart() )
- {
- // Duplicated from KonqView::eventFilter
- if ( QUriDrag::canDecode( ev ) )
- {
- KURL::List lstDragURLs;
- bool ok = KURLDrag::decode( ev, lstDragURLs );
- QObjectList *children = this->queryList( "QWidget" );
-
- if ( ok &&
- !lstDragURLs.first().url().contains( "javascript:", false ) && // ### this looks like a hack to me
- ev->source() != this &&
- children &&
- children->findRef( ev->source() ) == -1 )
- ev->acceptAction();
-
- delete children;
- }
- }
- QScrollView::dragEnterEvent( ev );
-}
-
-void KHTMLView::dropEvent( QDropEvent *ev )
-{
- // Handle drops onto frames (#16820)
- // Drops on the main html part is handled by Konqueror (and shouldn't do anything
- // in e.g. kmail, so not handled here).
- if ( m_part->parentPart() )
- {
- KURL::List lstDragURLs;
- bool ok = KURLDrag::decode( ev, lstDragURLs );
-
- KHTMLPart* part = m_part->parentPart();
- while ( part && part->parentPart() )
- part = part->parentPart();
- KParts::BrowserExtension *ext = part->browserExtension();
- if ( ok && ext && lstDragURLs.first().isValid() )
- emit ext->openURLRequest( lstDragURLs.first() );
- }
- QScrollView::dropEvent( ev );
-}
-#endif // !APPLE_CHANGES
void KHTMLView::focusInEvent( QFocusEvent *e )
{
1.49 +0 -19 WebCore/khtml/khtmlview.h
Index: khtmlview.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtmlview.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- khtmlview.h 31 Aug 2005 04:38:35 -0000 1.48
+++ khtmlview.h 21 Nov 2005 01:19:49 -0000 1.49
@@ -88,9 +88,7 @@
friend class khtml::RenderWidget;
friend class khtml::CSSStyleSelector;
friend void khtml::applyRule(DOM::CSSProperty *prop);
-#if APPLE_CHANGES
friend class KWQKHTMLPart;
-#endif
public:
/**
@@ -161,9 +159,7 @@
void addRepaintInfo(khtml::RenderObject* o, const QRect& r);
-#if APPLE_CHANGES
void resetScrollBars();
-#endif
void clear();
@@ -171,18 +167,11 @@
void cleared();
protected:
-#if APPLE_CHANGES
public:
void clearPart();
-#endif
virtual void resizeEvent ( QResizeEvent * event );
virtual void showEvent ( QShowEvent * );
virtual void hideEvent ( QHideEvent *);
-#if !APPLE_CHANGES
- virtual bool focusNextPrevChild( bool next );
- virtual void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph );
- virtual void drawContents( QPainter* );
-#endif
virtual void viewportMousePressEvent( QMouseEvent * );
virtual void focusInEvent( QFocusEvent * );
@@ -193,10 +182,6 @@
#ifndef QT_NO_WHEELEVENT
virtual void viewportWheelEvent(QWheelEvent*);
#endif
-#if !APPLE_CHANGES
- virtual void dragEnterEvent( QDragEnterEvent* );
- virtual void dropEvent( QDropEvent* );
-#endif
void keyPressEvent( QKeyEvent *_ke );
void keyReleaseEvent ( QKeyEvent *_ke );
@@ -219,7 +204,6 @@
bool haveDelayedLayoutScheduled();
bool layoutPending();
-#if APPLE_CHANGES
QWidget *topLevelWidget() const;
QPoint mapToGlobal(const QPoint &) const;
// maps "viewport" (actually Cocoa window coords) to screen coords
@@ -228,7 +212,6 @@
void initScrollBars();
void updateDashboardRegions();
-#endif
void ref() { ++_refCount; }
void deref() { if (!--_refCount) delete this; }
@@ -289,9 +272,7 @@
void applyOverflowToViewport(khtml::RenderObject* o, ScrollBarMode& hMode, ScrollBarMode& vMode);
-#if APPLE_CHANGES
virtual bool isKHTMLView() const;
-#endif
// ------------------------------------- member variables ------------------------------------
private:
1.40 +0 -27 WebCore/khtml/css/css_computedstyle.cpp
Index: css_computedstyle.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/css_computedstyle.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- css_computedstyle.cpp 2 Nov 2005 08:52:39 -0000 1.39
+++ css_computedstyle.cpp 21 Nov 2005 01:19:51 -0000 1.40
@@ -34,11 +34,9 @@
#include "rendering/render_style.h"
#include "rendering/render_object.h"
-#if APPLE_CHANGES
#import <kxmlcore/Assertions.h>
#import "KWQFontFamily.h"
#import "KWQLogging.h"
-#endif
using khtml::EBackgroundBox;
using khtml::EBorderStyle;
@@ -1189,30 +1187,6 @@
case CSS_PROP_PADDING:
// FIXME: unimplemented
break;
-#if !APPLE_CHANGES
- case CSS_PROP_SCROLLBAR_FACE_COLOR:
- // FIXME: unimplemented
- break;
- case CSS_PROP_SCROLLBAR_SHADOW_COLOR:
- // FIXME: unimplemented
- break;
- case CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR:
- // FIXME: unimplemented
- break;
- case CSS_PROP_SCROLLBAR_3DLIGHT_COLOR:
- // FIXME: unimplemented
- break;
- case CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR:
- // FIXME: unimplemented
- break;
- case CSS_PROP_SCROLLBAR_TRACK_COLOR:
- // FIXME: unimplemented
- break;
- case CSS_PROP_SCROLLBAR_ARROW_COLOR:
- // FIXME: unimplemented
- break;
-#endif
-#if APPLE_CHANGES
case CSS_PROP__KHTML_DASHBOARD_REGION: {
QValueList<StyleDashboardRegion> regions = style->dashboardRegions();
uint i, count = regions.count();
@@ -1239,7 +1213,6 @@
}
return new CSSPrimitiveValueImpl(firstRegion);
}
-#endif
}
ERROR("unimplemented propertyID: %d", propertyID);
1.81 +0 -89 WebCore/khtml/css/css_valueimpl.cpp
Index: css_valueimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/css_valueimpl.cpp,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -r1.80 -r1.81
--- css_valueimpl.cpp 14 Nov 2005 22:09:07 -0000 1.80
+++ css_valueimpl.cpp 21 Nov 2005 01:19:51 -0000 1.81
@@ -79,42 +79,6 @@
return getPropertyID(buffer, len);
}
-#if 0
-
-// Too risky to quote all legal identifiers right now.
-// Post-Tiger we should use this function or something like it.
-
-// Return true if this string qualifies as an identifier (from the point of view of CSS syntax).
-static bool isLegalIdentifier(const DOMString &string)
-{
- int len = string.length();
- if (len == 0) {
- return false;
- }
- QChar *p = string.unicode();
- int i = 0;
- if (p[0] == '-') {
- ++i;
- }
- if (i == len) {
- return false;
- }
- ushort code = p[i].unicode();
- if (!(code >= 0x80 || code == '_' || isalpha(code))) {
- return false;
- }
- ++i;
- while (i != len) {
- code = p[i].unicode();
- if (!(code >= 0x80 || code == '-' || code == '_' || isalnum(code))) {
- return false;
- }
- ++i;
- }
- return true;
-}
-
-#endif
// Quotes the string if it needs quoting.
// We use single quotes for now beause markup.cpp uses double quotes.
@@ -448,10 +412,6 @@
CSSParser parser(strictParsing);
bool success = parser.parseValue(this, propertyID, value, important);
if (!success) {
-#if !APPLE_CHANGES
- kdDebug( 6080 ) << "CSSMutableStyleDeclarationImpl::setProperty invalid property: [" << getPropertyName(id).qstring()
- << "] value: [" << value.qstring() << "]"<< endl;
-#endif
exceptionCode = CSSException::SYNTAX_ERR + CSSException::_EXCEPTION_OFFSET;
} else if (notifyChanged)
setChanged();
@@ -838,13 +798,9 @@
int CSSPrimitiveValueImpl::computeLength( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics )
{
double result = computeLengthFloat( style, devMetrics );
-#if APPLE_CHANGES
// This conversion is imprecise, often resulting in values of, e.g., 44.99998. We
// need to go ahead and round if we're really close to the next integer value.
int intResult = (int)(result + (result < 0 ? -0.01 : +0.01));
-#else
- int intResult = (int)result;
-#endif
return intResult;
}
@@ -852,13 +808,9 @@
double multiplier )
{
double result = multiplier * computeLengthFloat( style, devMetrics );
-#if APPLE_CHANGES
// This conversion is imprecise, often resulting in values of, e.g., 44.99998. We
// need to go ahead and round if we're really close to the next integer value.
int intResult = (int)(result + (result < 0 ? -0.01 : +0.01));
-#else
- int intResult = (int)result;
-#endif
return intResult;
}
@@ -887,12 +839,7 @@
// our actual constructed rendering font.
{
QFontMetrics fm = style->fontMetrics();
-#if APPLE_CHANGES
factor = fm.xHeight();
-#else
- QRect b = fm.boundingRect('x');
- factor = b.height();
-#endif
break;
}
case CSSPrimitiveValue::CSS_PX:
@@ -1096,7 +1043,6 @@
text += m_value.pair->second()->cssText();
break;
-#if APPLE_CHANGES
case CSSPrimitiveValue::CSS_DASHBOARD_REGION: {
DashboardRegionImpl *region = getDashboardRegionValue();
while (region) {
@@ -1119,7 +1065,6 @@
}
break;
}
-#endif
}
return text;
}
@@ -1285,45 +1230,11 @@
static const QRegExp parenReg(" \\(.*\\)$");
static const QRegExp braceReg(" \\[.*\\]$");
-#if APPLE_CHANGES
parsedFontName = string;
// a language tag is often added in braces at the end. Remove it.
parsedFontName.replace(parenReg, "");
// remove [Xft] qualifiers
parsedFontName.replace(braceReg, "");
-#else
- const QString &available = KHTMLSettings::availableFamilies();
-
- QString face = string.lower();
- // a languge tag is often added in braces at the end. Remove it.
- face = face.replace(parenReg, "");
- // remove [Xft] qualifiers
- face = face.replace(braceReg, "");
- //kdDebug(0) << "searching for face '" << face << "'" << endl;
-
- int pos = available.find( face, 0, false );
- if( pos == -1 ) {
- QString str = face;
- int p = face.find(' ');
- // Arial Blk --> Arial
- // MS Sans Serif --> Sans Serif
- if ( p != -1 ) {
- if(p > 0 && (int)str.length() - p > p + 1)
- str = str.mid( p+1 );
- else
- str.truncate( p );
- pos = available.find( str, 0, false);
- }
- }
-
- if ( pos != -1 ) {
- int pos1 = available.findRev( ',', pos ) + 1;
- pos = available.find( ',', pos );
- if ( pos == -1 )
- pos = available.length();
- parsedFontName = available.mid( pos1, pos - pos1 );
- }
-#endif // !APPLE_CHANGES
}
DOM::DOMString FontFamilyValueImpl::cssText() const
1.52 +0 -2 WebCore/khtml/css/css_valueimpl.h
Index: css_valueimpl.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/css_valueimpl.h,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- css_valueimpl.h 3 Oct 2005 21:12:07 -0000 1.51
+++ css_valueimpl.h 21 Nov 2005 01:19:51 -0000 1.52
@@ -290,7 +290,6 @@
CSSPrimitiveValueImpl *m_second;
};
-#if APPLE_CHANGES
class DashboardRegionImpl : public RectImpl {
public:
@@ -315,7 +314,6 @@
unsigned int m_isRectangle:1;
};
-#endif
class CSSImageValueImpl : public CSSPrimitiveValueImpl, public khtml::CachedObjectClient
{
1.112 +0 -40 WebCore/khtml/css/cssparser.cpp
Index: cssparser.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/cssparser.cpp,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -r1.111 -r1.112
--- cssparser.cpp 20 Nov 2005 21:34:12 -0000 1.111
+++ cssparser.cpp 21 Nov 2005 01:19:51 -0000 1.112
@@ -42,9 +42,7 @@
#include <stdlib.h>
-#if APPLE_CHANGES
void qFatal ( const char * msg ) {}
-#endif
ValueList::ValueList()
{
@@ -514,12 +512,10 @@
return parseShape( propId, important );
break;
-#if APPLE_CHANGES
case CSS_PROP__KHTML_DASHBOARD_REGION: // <dashboard-region> | <dashboard-region>
if ( value->unit == Value::Function || id == CSS_VAL_NONE)
return parseDashboardRegions( propId, important );
break;
-#endif
/* Start of supported CSS properties with validation. This is needed for parseShortHand to work
* correctly and allows optimization in khtml::applyRule(..)
@@ -872,38 +868,6 @@
else
valid_primitive = ( !id && validUnit( value, FNumber|FLength|FPercent, strict ) );
break;
-#if 0
- // removed from CSS 2.1
- case CSS_PROP_COUNTER_INCREMENT: // [ <identifier> <integer>? ]+ | none | inherit
- case CSS_PROP_COUNTER_RESET: // [ <identifier> <integer>? ]+ | none | inherit
- if ( id == CSS_VAL_NONE )
- valid_primitive = true;
- else {
- CSSValueListImpl *list = new CSSValueListImpl;
- int pos=0, pos2;
- while( 1 )
- {
- pos2 = value.find(',', pos);
- QString face = value.mid(pos, pos2-pos);
- face = face.stripWhiteSpace();
- if(face.length() == 0) break;
- // ### single quoted is missing...
- if(face[0] == '\"') face.remove(0, 1);
- if(face[face.length()-1] == '\"') face = face.left(face.length()-1);
- //kdDebug( 6080 ) << "found face '" << face << "'" << endl;
- list->append(new CSSPrimitiveValueImpl(DOMString(face), CSSPrimitiveValue::CSS_STRING));
- pos = pos2 + 1;
- if(pos2 == -1) break;
- }
- //kdDebug( 6080 ) << "got " << list->length() << " faces" << endl;
- if(list->length()) {
- parsedValue = list;
- valueList->next();
- } else
- delete list;
- break;
- }
-#endif
case CSS_PROP_FONT_FAMILY:
// [[ <family-name> | <generic-family> ],]* [<family-name> | <generic-family>] | inherit
{
@@ -1172,7 +1136,6 @@
// End of CSS3 properties
-#if APPLE_CHANGES
// Apple specific properties. These will never be standardized and are purely to
// support custom WebKit-based Apple applications.
case CSS_PROP__KHTML_LINE_CLAMP:
@@ -1182,7 +1145,6 @@
if (id == CSS_VAL_AUTO || id == CSS_VAL_NONE)
valid_primitive = true;
break;
-#endif
/* shorthand properties */
case CSS_PROP_BACKGROUND:
@@ -1824,7 +1786,6 @@
return args->current();
}
-#if APPLE_CHANGES
bool CSSParser::parseDashboardRegions( int propId, bool important )
{
bool valid = true;
@@ -1948,7 +1909,6 @@
return valid;
}
-#endif
bool CSSParser::parseShape( int propId, bool important )
{
1.223 +0 -159 WebCore/khtml/css/cssstyleselector.cpp
Index: cssstyleselector.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/cssstyleselector.cpp,v
retrieving revision 1.222
retrieving revision 1.223
diff -u -r1.222 -r1.223
--- cssstyleselector.cpp 20 Nov 2005 21:34:13 -0000 1.222
+++ cssstyleselector.cpp 21 Nov 2005 01:19:51 -0000 1.223
@@ -1696,12 +1696,8 @@
{ CSS_VAL_TEAL, 0xFF008080 },
{ CSS_VAL_WHITE, 0xFFFFFFFF },
{ CSS_VAL_YELLOW, 0xFFFFFF00 },
-#if !APPLE_CHANGES
- { CSS_VAL_INVERT, invertedColor },
-#endif
{ CSS_VAL_TRANSPARENT, transparentColor },
{ CSS_VAL_GREY, 0xFF808080 },
-#if APPLE_CHANGES
{ CSS_VAL_ACTIVEBORDER, 0xFFE0E0E0 },
{ CSS_VAL_ACTIVECAPTION, 0xFF000000 },
{ CSS_VAL_APPWORKSPACE, 0xFF000000 },
@@ -1730,88 +1726,9 @@
{ CSS_VAL_WINDOW, 0xFFFFFFFF },
{ CSS_VAL_WINDOWFRAME, 0xFFFFFFFF },
{ CSS_VAL_WINDOWTEXT, 0xFF000000 },
-#endif
{ 0, 0 }
};
-#if !APPLE_CHANGES
-
-struct uiColors {
- int css_value;
- const char * configGroup;
- const char * configEntry;
-QPalette::ColorGroup group;
-QColorGroup::ColorRole role;
-};
-
-const char * const wmgroup = "WM";
-const char * const generalgroup = "General";
-
-/* Mapping system settings to CSS 2
-* Tried hard to get an appropriate mapping - schlpbch
-*/
-static const uiColors uimap[] = {
- // Active window border.
- { CSS_VAL_ACTIVEBORDER, wmgroup, "background", QPalette::Active, QColorGroup::Light },
- // Active window caption.
- { CSS_VAL_ACTIVECAPTION, wmgroup, "background", QPalette::Active, QColorGroup::Text },
- // Text in caption, size box, and scrollbar arrow box.
- { CSS_VAL_CAPTIONTEXT, wmgroup, "activeForeground", QPalette::Active, QColorGroup::Text },
- // Face color for three-dimensional display elements.
- { CSS_VAL_BUTTONFACE, wmgroup, 0, QPalette::Inactive, QColorGroup::Button },
- // Dark shadow for three-dimensional display elements (for edges facing away from the light source).
- { CSS_VAL_BUTTONHIGHLIGHT, wmgroup, 0, QPalette::Inactive, QColorGroup::Light },
- // Shadow color for three-dimensional display elements.
- { CSS_VAL_BUTTONSHADOW, wmgroup, 0, QPalette::Inactive, QColorGroup::Shadow },
- // Text on push buttons.
- { CSS_VAL_BUTTONTEXT, wmgroup, "buttonForeground", QPalette::Inactive, QColorGroup::ButtonText },
- // Dark shadow for three-dimensional display elements.
- { CSS_VAL_THREEDDARKSHADOW, wmgroup, 0, QPalette::Inactive, QColorGroup::Dark },
- // Face color for three-dimensional display elements.
- { CSS_VAL_THREEDFACE, wmgroup, 0, QPalette::Inactive, QColorGroup::Button },
- // Highlight color for three-dimensional display elements.
- { CSS_VAL_THREEDHIGHLIGHT, wmgroup, 0, QPalette::Inactive, QColorGroup::Light },
- // Light color for three-dimensional display elements (for edges facing the light source).
- { CSS_VAL_THREEDLIGHTSHADOW, wmgroup, 0, QPalette::Inactive, QColorGroup::Midlight },
- // Dark shadow for three-dimensional display elements.
- { CSS_VAL_THREEDSHADOW, wmgroup, 0, QPalette::Inactive, QColorGroup::Shadow },
-
- // Inactive window border.
- { CSS_VAL_INACTIVEBORDER, wmgroup, "background", QPalette::Disabled, QColorGroup::Background },
- // Inactive window caption.
- { CSS_VAL_INACTIVECAPTION, wmgroup, "inactiveBackground", QPalette::Disabled, QColorGroup::Background },
- // Color of text in an inactive caption.
- { CSS_VAL_INACTIVECAPTIONTEXT, wmgroup, "inactiveForeground", QPalette::Disabled, QColorGroup::Text },
- { CSS_VAL_GRAYTEXT, wmgroup, 0, QPalette::Disabled, QColorGroup::Text },
-
- // Menu background
- { CSS_VAL_MENU, generalgroup, "background", QPalette::Inactive, QColorGroup::Background },
- // Text in menus
- { CSS_VAL_MENUTEXT, generalgroup, "foreground", QPalette::Inactive, QColorGroup::Background },
-
- // Text of item(s) selected in a control.
- { CSS_VAL_HIGHLIGHT, generalgroup, "selectBackground", QPalette::Inactive, QColorGroup::Background },
-
- // Text of item(s) selected in a control.
- { CSS_VAL_HIGHLIGHTTEXT, generalgroup, "selectForeground", QPalette::Inactive, QColorGroup::Background },
-
- // Background color of multiple document interface.
- { CSS_VAL_APPWORKSPACE, generalgroup, "background", QPalette::Inactive, QColorGroup::Text },
-
- // Scroll bar gray area.
- { CSS_VAL_SCROLLBAR, generalgroup, "background", QPalette::Inactive, QColorGroup::Background },
-
- // Window background.
- { CSS_VAL_WINDOW, generalgroup, "windowBackground", QPalette::Inactive, QColorGroup::Background },
- // Window frame.
- { CSS_VAL_WINDOWFRAME, generalgroup, "windowBackground", QPalette::Inactive, QColorGroup::Background },
- // WindowText
- { CSS_VAL_WINDOWTEXT, generalgroup, "windowForeground", QPalette::Inactive, QColorGroup::Text },
- { CSS_VAL_TEXT, generalgroup, 0, QPalette::Inactive, QColorGroup::Text },
- { 0, 0, 0, QPalette::NColorGroups, QColorGroup::NColorRoles }
-};
-
-#endif // !APPLE_CHANGES
static QColor colorForCSSValue( int css_value )
{
@@ -1822,36 +1739,7 @@
if ( col->css_value )
return col->color;
-#if APPLE_CHANGES
return QColor();
-#else
- const uiColors *uicol = uimap;
- while ( uicol->css_value && uicol->css_value != css_value )
- ++uicol;
- if ( !uicol->css_value ) {
- if ( css_value == CSS_VAL_INFOBACKGROUND )
- return QToolTip::palette().inactive().background();
- else if ( css_value == CSS_VAL_INFOTEXT )
- return QToolTip::palette().inactive().foreground();
- else if ( css_value == CSS_VAL_BACKGROUND ) {
- KConfig bckgrConfig("kdesktoprc", true, false); // No multi-screen support
- bckgrConfig.setGroup("Desktop0");
- // Desktop background.
- return bckgrConfig.readColorEntry("Color1", &qApp->palette().disabled().background());
- }
- return invalidColor;
- }
-
- const QPalette &pal = qApp->palette();
- QColor c = pal.color( uicol->group, uicol->role );
- if ( uicol->configEntry ) {
- KConfig *globalConfig = KGlobal::config();
- globalConfig->setGroup( uicol->configGroup );
- c = globalConfig->readColorEntry( uicol->configEntry, &c );
- }
-
- return c;
-#endif
}
void CSSStyleSelector::applyDeclarations(bool applyFirst, bool isImportant,
@@ -1875,9 +1763,7 @@
case CSS_PROP_FONT_STYLE:
case CSS_PROP_FONT_FAMILY:
case CSS_PROP_FONT_WEIGHT:
-#if APPLE_CHANGES
case CSS_PROP__KHTML_TEXT_SIZE_ADJUST:
-#endif
// these have to be applied first, because other properties use the computed
// values of these porperties.
first = true;
@@ -2460,15 +2346,6 @@
case CSS_PROP_COLOR:
case CSS_PROP_OUTLINE_COLOR:
// this property is an extension used to get HTML4 <font> right.
-#if !APPLE_CHANGES
- case CSS_PROP_SCROLLBAR_FACE_COLOR:
- case CSS_PROP_SCROLLBAR_SHADOW_COLOR:
- case CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR:
- case CSS_PROP_SCROLLBAR_3DLIGHT_COLOR:
- case CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR:
- case CSS_PROP_SCROLLBAR_TRACK_COLOR:
- case CSS_PROP_SCROLLBAR_ARROW_COLOR:
-#endif
{
QColor col;
if (isInherit) {
@@ -2511,38 +2388,6 @@
style->setColor(col); break;
case CSS_PROP_OUTLINE_COLOR:
style->setOutlineColor(col); break;
-#if !APPLE_CHANGES
- case CSS_PROP_SCROLLBAR_FACE_COLOR:
- style->setPaletteColor(QPalette::Active, QColorGroup::Button, col);
- style->setPaletteColor(QPalette::Inactive, QColorGroup::Button, col);
- break;
- case CSS_PROP_SCROLLBAR_SHADOW_COLOR:
- style->setPaletteColor(QPalette::Active, QColorGroup::Shadow, col);
- style->setPaletteColor(QPalette::Inactive, QColorGroup::Shadow, col);
- break;
- case CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR:
- style->setPaletteColor(QPalette::Active, QColorGroup::Light, col);
- style->setPaletteColor(QPalette::Inactive, QColorGroup::Light, col);
- break;
- case CSS_PROP_SCROLLBAR_3DLIGHT_COLOR:
- break;
- case CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR:
- style->setPaletteColor(QPalette::Active, QColorGroup::Dark, col);
- style->setPaletteColor(QPalette::Inactive, QColorGroup::Dark, col);
- break;
- case CSS_PROP_SCROLLBAR_TRACK_COLOR:
- style->setPaletteColor(QPalette::Active, QColorGroup::Base, col);
- style->setPaletteColor(QPalette::Inactive, QColorGroup::Base, col);
- style->setPaletteColor(QPalette::Active, QColorGroup::Mid, col);
- style->setPaletteColor(QPalette::Inactive, QColorGroup::Mid, col);
- style->setPaletteColor(QPalette::Active, QColorGroup::Background, col);
- style->setPaletteColor(QPalette::Inactive, QColorGroup::Background, col);
- break;
- case CSS_PROP_SCROLLBAR_ARROW_COLOR:
- style->setPaletteColor(QPalette::Active, QColorGroup::ButtonText, col);
- style->setPaletteColor(QPalette::Inactive, QColorGroup::ButtonText, col);
- break;
-#endif
default:
return;
}
@@ -4075,7 +3920,6 @@
break;
}
-#if APPLE_CHANGES
// Apple-specific changes. Do not merge these properties into KHTML.
case CSS_PROP__KHTML_LINE_CLAMP: {
HANDLE_INHERIT_AND_INITIAL(lineClamp, LineClamp)
@@ -4123,7 +3967,6 @@
break;
}
-#endif
default:
return;
@@ -4274,7 +4117,6 @@
layer->setBackgroundYPosition(l);
}
-#if APPLE_CHANGES
void CSSStyleSelector::checkForTextSizeAdjust()
{
if (style->textSizeAdjust())
@@ -4284,7 +4126,6 @@
newFontDef.computedSize = newFontDef.specifiedSize;
style->setFontDef(newFontDef);
}
-#endif
void CSSStyleSelector::checkForGenericFamilyChange(RenderStyle* aStyle, RenderStyle* aParentStyle)
{
1.45 +0 -2 WebCore/khtml/css/cssstyleselector.h
Index: cssstyleselector.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/cssstyleselector.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- cssstyleselector.h 20 Nov 2005 21:34:13 -0000 1.44
+++ cssstyleselector.h 21 Nov 2005 01:19:52 -0000 1.45
@@ -153,9 +153,7 @@
/* This function fixes up the default font size if it detects that the
current generic font family has changed. -dwh */
void checkForGenericFamilyChange(RenderStyle* aStyle, RenderStyle* aParentStyle);
-#if APPLE_CHANGES
void checkForTextSizeAdjust();
-#endif
void adjustRenderStyle(RenderStyle* style, DOM::ElementImpl *e);
1.16 +0 -2 WebCore/khtml/dom/dom_node.h
Index: dom_node.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/dom_node.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- dom_node.h 25 Oct 2005 16:39:24 -0000 1.15
+++ dom_node.h 21 Nov 2005 01:19:54 -0000 1.16
@@ -918,9 +918,7 @@
friend class Node;
friend class Document;
friend class HTMLDocument;
-#if APPLE_CHANGES
friend class NodeListImpl;
-#endif
public:
NodeList();
1.47 +0 -2 WebCore/khtml/ecma/kjs_binding.cpp
Index: kjs_binding.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_binding.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- kjs_binding.cpp 13 Nov 2005 18:52:36 -0000 1.46
+++ kjs_binding.cpp 21 Nov 2005 01:19:54 -0000 1.47
@@ -215,7 +215,6 @@
return false;
}
-#if APPLE_CHANGES
bool ScriptInterpreter::isGlobalObject(ValueImp *v)
{
@@ -248,7 +247,6 @@
return result;
}
-#endif
//////
1.35 +0 -4 WebCore/khtml/ecma/kjs_binding.h
Index: kjs_binding.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_binding.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- kjs_binding.h 13 Nov 2005 18:52:36 -0000 1.34
+++ kjs_binding.h 21 Nov 2005 01:19:54 -0000 1.35
@@ -26,9 +26,7 @@
#include <qvariant.h>
#include <kjs/lookup.h>
-#if APPLE_CHANGES
#include <JavaScriptCore/runtime.h>
-#endif
class KHTMLPart;
@@ -105,13 +103,11 @@
DOM::EventImpl *getCurrentEvent() const { return m_evt; }
-#if APPLE_CHANGES
virtual bool isGlobalObject(ValueImp *v);
virtual Interpreter *interpreterForGlobalObject (const ValueImp *imp);
virtual bool isSafeScript (const Interpreter *target);
virtual void *createLanguageInstanceForValue (ExecState *exec, int language, ObjectImp *value, const Bindings::RootObject *origin, const Bindings::RootObject *current);
void *createObjcInstanceForValue (ExecState *exec, ObjectImp *value, const Bindings::RootObject *origin, const Bindings::RootObject *current);
-#endif
private:
KHTMLPart* m_part;
1.40 +0 -21 WebCore/khtml/ecma/kjs_css.cpp
Index: kjs_css.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_css.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- kjs_css.cpp 3 Oct 2005 21:12:12 -0000 1.39
+++ kjs_css.cpp 21 Nov 2005 01:19:54 -0000 1.40
@@ -414,27 +414,6 @@
// IE also supports retrieving a stylesheet by name, using the name/id of the <style> tag
// (this is consistent with all the other collections)
-#if 0
- // Bad implementation because DOM::StyleSheet doesn't inherit DOM::Node
- // so we can't use DOMNamedNodesCollection.....
- // We could duplicate it for stylesheets though - worth it ?
- // Other problem of this implementation: it doesn't look for the ID attribute!
- DOM::NameNodeListImpl namedList( m_doc.documentElement().handle(), p.domString() );
- int len = namedList.length();
- if ( len ) {
- QValueList<DOM::Node> styleSheets;
- for ( int i = 0 ; i < len ; ++i ) {
- DOM::HTMLStyleElement elem = DOM::Node(namedList.item(i));
- if (!elem.isNull())
- styleSheets.append(elem.sheet());
- }
- if ( styleSheets.count() == 1 ) // single result
- return getDOMStyleSheet(exec, styleSheets[0]);
- else if ( styleSheets.count() > 1 ) {
- return new DOMNamedItemsCollection(exec,styleSheets);
- }
- }
-#endif
// ### Bad implementation because returns a single element (are IDs always unique?)
// and doesn't look for name attribute (see implementation above).
// But unicity of stylesheet ids is good practice anyway ;)
1.109 +0 -72 WebCore/khtml/ecma/kjs_dom.cpp
Index: kjs_dom.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_dom.cpp,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -r1.108 -r1.109
--- kjs_dom.cpp 16 Nov 2005 09:43:12 -0000 1.108
+++ kjs_dom.cpp 21 Nov 2005 01:19:55 -0000 1.109
@@ -48,9 +48,7 @@
#include "html_objectimpl.h"
-#if APPLE_CHANGES
#include <JavaScriptCore/runtime_object.h>
-#endif
using namespace DOM::HTMLNames;
@@ -386,10 +384,8 @@
return getListener(resizeEvent);
case OnScroll:
return getListener(scrollEvent);
-#if APPLE_CHANGES
case OnSearch:
return getListener(searchEvent);
-#endif
case OnSelect:
return getListener(selectEvent);
case OnSelectStart:
@@ -1791,37 +1787,6 @@
{
// We use the token as the value to return directly
return Number((unsigned int)token);
-#if 0
- switch (token) {
- case ELEMENT_NODE:
- return Number((unsigned int)DOM::Node::ELEMENT_NODE);
- case ATTRIBUTE_NODE:
- return Number((unsigned int)DOM::Node::ATTRIBUTE_NODE);
- case TEXT_NODE:
- return Number((unsigned int)DOM::Node::TEXT_NODE);
- case CDATA_SECTION_NODE:
- return Number((unsigned int)DOM::Node::CDATA_SECTION_NODE);
- case ENTITY_REFERENCE_NODE:
- return Number((unsigned int)DOM::Node::ENTITY_REFERENCE_NODE);
- case ENTITY_NODE:
- return Number((unsigned int)DOM::Node::ENTITY_NODE);
- case PROCESSING_INSTRUCTION_NODE:
- return Number((unsigned int)DOM::Node::PROCESSING_INSTRUCTION_NODE);
- case COMMENT_NODE:
- return Number((unsigned int)DOM::Node::COMMENT_NODE);
- case DOCUMENT_NODE:
- return Number((unsigned int)DOM::Node::DOCUMENT_NODE);
- case DOCUMENT_TYPE_NODE:
- return Number((unsigned int)DOM::Node::DOCUMENT_TYPE_NODE);
- case DOCUMENT_FRAGMENT_NODE:
- return Number((unsigned int)DOM::Node::DOCUMENT_FRAGMENT_NODE);
- case NOTATION_NODE:
- return Number((unsigned int)DOM::Node::NOTATION_NODE);
- default:
- kdWarning() << "NodeConstructor::getValueProperty unhandled token " << token << endl;
- return NULL;
- }
-#endif
}
ObjectImp *getNodeConstructor(ExecState *exec)
@@ -1862,43 +1827,6 @@
{
// We use the token as the value to return directly
return Number((unsigned int)token);
-#if 0
- switch (token) {
- case INDEX_SIZE_ERR:
- return Number((unsigned int)DOM::DOMException::INDEX_SIZE_ERR);
- case DOMSTRING_SIZE_ERR:
- return Number((unsigned int)DOM::DOMException::DOMSTRING_SIZE_ERR);
- case HIERARCHY_REQUEST_ERR:
- return Number((unsigned int)DOM::DOMException::HIERARCHY_REQUEST_ERR);
- case WRONG_DOCUMENT_ERR:
- return Number((unsigned int)DOM::DOMException::WRONG_DOCUMENT_ERR);
- case INVALID_CHARACTER_ERR:
- return Number((unsigned int)DOM::DOMException::INVALID_CHARACTER_ERR);
- case NO_DATA_ALLOWED_ERR:
- return Number((unsigned int)DOM::DOMException::NO_DATA_ALLOWED_ERR);
- case NO_MODIFICATION_ALLOWED_ERR:
- return Number((unsigned int)DOM::DOMException::NO_MODIFICATION_ALLOWED_ERR);
- case NOT_FOUND_ERR:
- return Number((unsigned int)DOM::DOMException::NOT_FOUND_ERR);
- case NOT_SUPPORTED_ERR:
- return Number((unsigned int)DOM::DOMException::NOT_SUPPORTED_ERR);
- case INUSE_ATTRIBUTE_ERR:
- return Number((unsigned int)DOM::DOMException::INUSE_ATTRIBUTE_ERR);
- case INVALID_STATE_ERR:
- return Number((unsigned int)DOM::DOMException::INVALID_STATE_ERR);
- case SYNTAX_ERR:
- return Number((unsigned int)DOM::DOMException::SYNTAX_ERR);
- case INVALID_MODIFICATION_ERR:
- return Number((unsigned int)DOM::DOMException::INVALID_MODIFICATION_ERR);
- case NAMESPACE_ERR:
- return Number((unsigned int)DOM::DOMException::NAMESPACE_ERR);
- case INVALID_ACCESS_ERR:
- return Number((unsigned int)DOM::DOMException::INVALID_ACCESS_ERR);
- default:
- kdWarning() << "DOMExceptionConstructor::getValueProperty unhandled token " << token << endl;
- return NULL;
- }
-#endif
}
ObjectImp *getDOMExceptionConstructor(ExecState *exec)
1.146 +0 -8 WebCore/khtml/ecma/kjs_html.cpp
Index: kjs_html.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_html.cpp,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -r1.145 -r1.146
--- kjs_html.cpp 10 Nov 2005 22:55:15 -0000 1.145
+++ kjs_html.cpp 21 Nov 2005 01:19:55 -0000 1.146
@@ -62,9 +62,7 @@
#include <qpixmap.h>
#include <qpainter.h>
-#if APPLE_CHANGES
#include <ApplicationServices/ApplicationServices.h>
-#endif
using namespace DOM::HTMLNames;
using namespace DOM::EventNames;
@@ -1370,7 +1368,6 @@
}
}
}
-#if APPLE_CHANGES
else if (element.hasLocalName(embedTag) || element.hasLocalName(objectTag) ||
element.hasLocalName(appletTag)) {
if (propertyName == "__apple_runtime_object") {
@@ -1386,7 +1383,6 @@
}
}
}
-#endif
const HashTable* table = classInfo()->propHashTable; // get the right hashtable
const HashEntry* entry = Lookup::findEntry(table, propertyName);
@@ -2507,7 +2503,6 @@
return Undefined();
}
}
-#if APPLE_CHANGES
else if (element.hasLocalName(canvasTag)) {
if (id == KJS::HTMLElement::GetContext) {
if (args.size() == 0 || (args.size() == 1 && args[0]->toString(exec).qstring().lower() == "2d")) {
@@ -2516,7 +2511,6 @@
return Undefined();
}
}
-#endif
return Undefined();
}
@@ -2543,7 +2537,6 @@
return;
}
}
-#if APPLE_CHANGES
else if (element.hasLocalName(embedTag) || element.hasLocalName(objectTag) || element.hasLocalName(appletTag)) {
if (ValueImp *runtimeObject = getRuntimeObject(exec, &element)) {
ObjectImp *imp = static_cast<ObjectImp *>(runtimeObject);
@@ -2551,7 +2544,6 @@
return imp->put(exec, propertyName, value);
}
}
-#endif
const HashTable* table = classInfo()->propHashTable; // get the right hashtable
const HashEntry* entry = Lookup::findEntry(table, propertyName);
1.59 +0 -2 WebCore/khtml/ecma/kjs_html.h
Index: kjs_html.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_html.h,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- kjs_html.h 2 Nov 2005 08:52:42 -0000 1.58
+++ kjs_html.h 21 Nov 2005 01:19:56 -0000 1.59
@@ -27,9 +27,7 @@
#include <qguardedptr.h>
#include "misc/loader_client.h"
-#if APPLE_CHANGES
#include <ApplicationServices/ApplicationServices.h>
-#endif
namespace DOM {
class HTMLCollectionImpl;
1.37 +0 -31 WebCore/khtml/ecma/kjs_navigator.cpp
Index: kjs_navigator.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_navigator.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- kjs_navigator.cpp 3 Oct 2005 21:12:13 -0000 1.36
+++ kjs_navigator.cpp 21 Nov 2005 01:19:56 -0000 1.37
@@ -34,9 +34,7 @@
#include "kjs_binding.h"
#include "khtml_part.h"
-#if APPLE_CHANGES
#include "KWQKCookieJar.h"
-#endif
namespace KJS {
@@ -170,12 +168,7 @@
ValueImp *Navigator::getValueProperty(ExecState *exec, int token) const
{
-#if APPLE_CHANGES
QString userAgent = KWQ(m_part)->userAgent();
-#else
- KURL url = m_part->url();
- QString userAgent = KProtocolManager::userAgentForHost(url.host());
-#endif
switch (token) {
case AppCodeName:
return String("Mozilla");
@@ -193,44 +186,26 @@
//kdDebug() << "appName -> IE" << endl;
return String("Microsoft Internet Explorer");
}
-#if APPLE_CHANGES
// FIXME: Should we define a fallback result here besides "Konqueror"?
return Undefined();
-#else
- //kdDebug() << "appName -> Konqueror" << endl;
- return String("Konqueror");
-#endif
case AppVersion:
// We assume the string is something like Mozilla/version (properties)
return String(userAgent.mid(userAgent.find('/') + 1));
case Product:
-#if APPLE_CHANGES
// When acting normal, we pretend to be "Gecko".
if (userAgent.find("Mozilla/5.0") >= 0 && userAgent.find("compatible") == -1) {
return String("Gecko");
}
// When spoofing as IE, we use Undefined().
return Undefined();
-#else
- return String("Konqueror/khtml");
-#endif
case ProductSub:
return String("20030107");
case Vendor:
-#if APPLE_CHANGES
return String("Apple Computer, Inc.");
-#else
- return String("KDE");
-#endif
case Language:
-#if APPLE_CHANGES
// We don't have an implementation of KGlobal::locale(). We do however
// have a static method on KLocale to access the current language.
return String(KLocale::language());
-#else
- return String(KGlobal::locale()->language() == "C" ?
- QString::fromLatin1("en") : KGlobal::locale()->language());
-#endif
case UserAgent:
return String(userAgent);
case Platform:
@@ -247,11 +222,7 @@
case _MimeTypes:
return new MimeTypes(exec);
case CookieEnabled:
-#if APPLE_CHANGES
return Boolean(KWQKCookieJar::cookieEnabled());
-#else
- return Boolean(true); /// ##### FIXME
-#endif
default:
kdWarning() << "Unhandled token in DOMEvent::getValueProperty : " << token << endl;
return NULL;
@@ -346,9 +317,7 @@
delete mimes;
plugins = 0;
mimes = 0;
-#if APPLE_CHANGES
RefreshPlugins(reload);
-#endif
}
1.25 +0 -8 WebCore/khtml/ecma/kjs_proxy.cpp
Index: kjs_proxy.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_proxy.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- kjs_proxy.cpp 3 Oct 2005 21:12:13 -0000 1.24
+++ kjs_proxy.cpp 21 Nov 2005 01:19:56 -0000 1.25
@@ -129,11 +129,7 @@
int lineNumber = comp.value()->toObject(m_script->globalExec())->get(m_script->globalExec(), "line")->toInt32(m_script->globalExec());
UString sourceURL = comp.value()->toObject(m_script->globalExec())->get(m_script->globalExec(), "sourceURL")->toString(m_script->globalExec());
-#if APPLE_CHANGES
KWQ(m_part)->addMessageToConsole(errorMessage.qstring(), lineNumber, sourceURL.qstring());
-#else
- kdWarning(6070) << "Script threw exception: " << errorMessage.qstring() << endl;
-#endif
}
return QVariant();
}
@@ -271,11 +267,7 @@
//m_script->enableDebug();
globalObject->put(m_script->globalExec(), "debug", new TestFunctionImp(), Internal);
-#if APPLE_CHANGES
QString userAgent = KWQ(m_part)->userAgent();
-#else
- QString userAgent = KProtocolManager::userAgentForHost(m_part->url().host());
-#endif
if (userAgent.find(QString::fromLatin1("Microsoft")) >= 0 ||
userAgent.find(QString::fromLatin1("MSIE")) >= 0)
m_script->setCompatMode(Interpreter::IECompat);
1.189 +0 -140 WebCore/khtml/ecma/kjs_window.cpp
Index: kjs_window.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_window.cpp,v
retrieving revision 1.188
retrieving revision 1.189
diff -u -r1.188 -r1.189
--- kjs_window.cpp 19 Nov 2005 01:26:44 -0000 1.188
+++ kjs_window.cpp 21 Nov 2005 01:19:57 -0000 1.189
@@ -38,10 +38,8 @@
#include <qstyle.h>
#include "rendering/render_canvas.h"
-#if APPLE_CHANGES
#include "KWQLogging.h"
#include "KWQKConfigBase.h"
-#endif
#include <kjs/collector.h>
#include "kjs_proxy.h"
#include "kjs_navigator.h"
@@ -501,28 +499,9 @@
static bool allowPopUp(ExecState *exec, Window *window)
{
-#if APPLE_CHANGES
return window->part()
&& (window->part()->settings()->JavaScriptCanOpenWindowsAutomatically()
|| static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture());
-#else
- KConfig config("konquerorrc");
- config.setGroup("Java/JavaScript Settings");
- switch (config.readUnsignedNumEntry("WindowOpenPolicy", 0)) { // 0=allow, 1=ask, 2=deny, 3=smart
- default:
- case 0: // allow
- return true;
- case 1: // ask
- return KMessageBox::questionYesNo(widget,
- i18n("This site is trying to open up a new browser window using Javascript.\n"
- "Do you want to allow this?"),
- i18n("Confirmation: Javascript Popup")) == KMessageBox::Yes;
- case 2: // deny
- return false;
- case 3: // smart
- return static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
- }
-#endif
}
static QMap<QString, QString> parseFeatures(ExecState *exec, ValueImp *featuresArg)
@@ -803,29 +782,19 @@
case ScreenLeft:
case ScreenX: {
if (m_part->view()) {
-#if APPLE_CHANGES
// We want to use frameGeometry here instead of mapToGlobal because it goes through
// the windowFrame method of the WebKit's UI delegate. Also we don't want to try
// to do anything relative to the screen the window is on, so the code below is no
// good of us anyway.
return Number(m_part->view()->topLevelWidget()->frameGeometry().x());
-#else
- QRect sg = QApplication::desktop()->screenGeometry(QApplication::desktop()->screenNumber(m_part->view()));
- return Number(m_part->view()->mapToGlobal(QPoint(0,0)).x() + sg.x());
-#endif
} else
return Undefined();
}
case ScreenTop:
case ScreenY: {
if (m_part->view()) {
-#if APPLE_CHANGES
// See comment above in ScreenX.
return Number(m_part->view()->topLevelWidget()->frameGeometry().y());
-#else
- QRect sg = QApplication::desktop()->screenGeometry(QApplication::desktop()->screenNumber(m_part->view()));
- return Number(m_part->view()->mapToGlobal(QPoint(0,0)).y() + sg.y());
-#endif
} else
return Undefined();
}
@@ -889,9 +858,7 @@
switch (token) {
case Document:
if (!m_part->xmlDocImpl()) {
-#if APPLE_CHANGES
KWQ(m_part)->createEmptyDocument();
-#endif
m_part->begin();
m_part->write("<HTML><BODY>");
m_part->end();
@@ -941,10 +908,8 @@
return getListener(exec,resizeEvent);
case Onscroll:
return getListener(exec,scrollEvent);
-#if APPLE_CHANGES
case Onsearch:
return getListener(exec,searchEvent);
-#endif
case Onselect:
return getListener(exec,selectEvent);
case Onsubmit:
@@ -1126,12 +1091,8 @@
if (!dstUrl.startsWith("javascript:", false) || isSafeScript(exec))
{
bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
-#if APPLE_CHANGES
// We want a new history item if this JS was called via a user gesture
m_part->scheduleLocationChange(dstUrl, p->referrer(), !userGesture, userGesture);
-#else
- m_part->scheduleLocationChange(dstUrl, p->referrer(), false /*don't lock history*/, userGesture);
-#endif
}
}
return;
@@ -1224,12 +1185,10 @@
if (isSafeScript(exec))
setListener(exec,scrollEvent,value);
return;
-#if APPLE_CHANGES
case Onsearch:
if (isSafeScript(exec))
setListener(exec,searchEvent,value);
return;
-#endif
case Onselect:
if (isSafeScript(exec))
setListener(exec,selectEvent,value);
@@ -1248,11 +1207,7 @@
return;
case Name:
if (isSafeScript(exec))
-#if APPLE_CHANGES
m_part->setName( value->toString(exec).qstring() );
-#else
- m_part->setName( value->toString(exec).qstring().local8Bit().data() );
-#endif
return;
default:
break;
@@ -1283,7 +1238,6 @@
winq->clearTimeout(timerId);
}
-#if APPLE_CHANGES
bool Window::hasTimeouts()
{
return winq->hasTimeouts();
@@ -1298,17 +1252,12 @@
{
return winq->resumeTimeouts(sa, key);
}
-#endif
void Window::scheduleClose()
{
kdDebug(6070) << "Window::scheduleClose window.close() " << m_part << endl;
Q_ASSERT(winq);
-#if APPLE_CHANGES
KWQ(m_part)->scheduleClose();
-#else
- QTimer::singleShot( 0, winq, SLOT( timeoutClose() ) );
-#endif
}
static bool shouldLoadAsEmptyDocument(const KURL &url)
@@ -1426,7 +1375,6 @@
if ( actDomain == thisDomain )
return true;
-#if APPLE_CHANGES
if (Interpreter::shouldPrintExceptions()) {
printf("Unsafe JavaScript attempt to access frame with URL %s from frame with URL %s. Domains must match.\n",
thisDocument->URL().latin1(), actDocument->URL().latin1());
@@ -1435,7 +1383,6 @@
message.sprintf("Unsafe JavaScript attempt to access frame with URL %s from frame with URL %s. Domains must match.\n",
thisDocument->URL().latin1(), actDocument->URL().latin1());
KWQ(m_part)->addMessageToConsole(message, 1, QString());
-#endif
kdWarning(6070) << "Javascript: access denied for current frame '" << actDomain.qstring() << "' to frame '" << thisDomain.qstring() << "'" << endl;
return false;
@@ -1546,39 +1493,17 @@
case Window::Alert:
if (part && part->xmlDocImpl())
part->xmlDocImpl()->updateRendering();
-#if APPLE_CHANGES
KWQ(part)->runJavaScriptAlert(str);
-#else
- KMessageBox::error(widget, QStyleSheet::convertFromPlainText(str), "JavaScript");
-#endif
return Undefined();
case Window::Confirm:
if (part && part->xmlDocImpl())
part->xmlDocImpl()->updateRendering();
-#if APPLE_CHANGES
return Boolean(KWQ(part)->runJavaScriptConfirm(str));
-#else
- return Boolean((KMessageBox::warningYesNo(widget, QStyleSheet::convertFromPlainText(str), "JavaScript",
- i18n("OK"), i18n("Cancel")) == KMessageBox::Yes));
-#endif
case Window::Prompt:
if (part && part->xmlDocImpl())
part->xmlDocImpl()->updateRendering();
bool ok;
-#if APPLE_CHANGES
ok = KWQ(part)->runJavaScriptPrompt(str, args.size() >= 2 ? args[1]->toString(exec).qstring() : QString::null, str2);
-#else
- if (args.size() >= 2)
- str2 = QInputDialog::getText(i18n("Konqueror: Prompt"),
- QStyleSheet::convertFromPlainText(str),
- QLineEdit::Normal,
- args[1]->toString(exec).qstring(), &ok);
- else
- str2 = QInputDialog::getText(i18n("Konqueror: Prompt"),
- QStyleSheet::convertFromPlainText(str),
- QLineEdit::Normal,
- QString::null, &ok);
-#endif
if ( ok )
return String(str2);
else
@@ -1587,35 +1512,20 @@
{
KConfig *config = new KConfig("konquerorrc");
config->setGroup("Java/JavaScript Settings");
-#if !APPLE_CHANGES
- int policy = config->readUnsignedNumEntry( "WindowOpenPolicy", 0 ); // 0=allow, 1=ask, 2=deny, 3=smart
-#else
int policy = config->readUnsignedNumEntry( part->settings(), "WindowOpenPolicy", 0 ); // 0=allow, 1=ask, 2=deny, 3=smart
-#endif
delete config;
if ( policy == 1 ) {
-#if !APPLE_CHANGES
- if ( KMessageBox::questionYesNo(widget,
- i18n( "This site is trying to open up a new browser "
- "window using Javascript.\n"
- "Do you want to allow this?" ),
- i18n( "Confirmation: Javascript Popup" ) ) == KMessageBox::Yes )
-#endif
policy = 0;
} else if ( policy == 3 ) // smart
{
// window.open disabled unless from a key/mouse event
if (static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture())
-#if !APPLE_CHANGES
- policy = 0;
-#else
{
policy = 0;
LOG(PopupBlocking, "Allowed JavaScript window open of %s", args[0]->toString(exec).qstring().ascii());
} else {
LOG(PopupBlocking, "Blocked JavaScript window open of %s", args[0]->toString(exec).qstring().ascii());
}
-#endif
}
QString frameName = args[1]->isUndefinedOrNull() ? QString("_blank") : args[1]->toString(exec).qstring();
@@ -1637,9 +1547,7 @@
winargs.menuBarVisible = false;
winargs.toolBarsVisible = false;
winargs.statusBarVisible = false;
-#if APPLE_CHANGES
winargs.scrollbarsVisible = true;
-#endif
QStringList flist = QStringList::split(',', features);
QStringList::ConstIterator it = flist.begin();
while (it != flist.end()) {
@@ -1665,9 +1573,7 @@
if (d < screen.x() || d > screen.right())
d = screen.x(); // only safe choice until size is determined
winargs.x = (int)d;
-#if APPLE_CHANGES
winargs.xSet = true;
-#endif
}
} else if (key == "top" || key == "screeny") {
bool ok;
@@ -1677,41 +1583,29 @@
if (d < screen.y() || d > screen.bottom())
d = screen.y(); // only safe choice until size is determined
winargs.y = (int)d;
-#if APPLE_CHANGES
winargs.ySet = true;
-#endif
}
} else if (key == "height") {
bool ok;
double d = val.toDouble(&ok);
if ((d != 0 || ok) && !isnan(d)) {
-#if !APPLE_CHANGES
- d += 2*qApp->style().pixelMetric( QStyle::PM_DefaultFrameWidth ) + 2;
-#endif
if (d > screen.height()) // should actually check workspace
d = screen.height();
if (d < 100)
d = 100;
winargs.height = (int)d;
-#if APPLE_CHANGES
winargs.heightSet = true;
-#endif
}
} else if (key == "width") {
bool ok;
double d = val.toDouble(&ok);
if ((d != 0 || ok) && !isnan(d)) {
-#if !APPLE_CHANGES
- d += 2*qApp->style().pixelMetric( QStyle::PM_DefaultFrameWidth ) + 2;
-#endif
if (d > screen.width()) // should actually check workspace
d = screen.width();
if (d < 100)
d = 100;
winargs.width = (int)d;
-#if APPLE_CHANGES
winargs.widthSet = true;
-#endif
}
} else {
goto boolargs;
@@ -1735,10 +1629,8 @@
winargs.resizable = (val == "1" || val == "yes");
else if (key == "fullscreen")
winargs.fullscreen = (val == "1" || val == "yes");
-#if APPLE_CHANGES
else if (key == "scrollbars")
winargs.scrollbarsVisible = !(val == "0" || val == "no");
-#endif
}
}
@@ -1805,7 +1697,6 @@
khtmlpart->xmlDocImpl()->setBaseURL( oldDoc->baseURL() );
}
}
-#if APPLE_CHANGES
if (!url.isEmpty()) {
const Window* window = Window::retrieveWindow(khtmlpart);
if (!url.url().startsWith("javascript:", false) || (window && window->isSafeScript(exec))) {
@@ -1813,25 +1704,14 @@
khtmlpart->scheduleLocationChange(url.url(), activePart->referrer(), false, userGesture);
}
}
-#else
- uargs.serviceType = QString::null;
- if (uargs.frameName == "_blank")
- uargs.frameName = QString::null;
- if (!url.isEmpty()) {
- uargs.metaData()["referrer"] = activePart->referrer();
- emit khtmlpart->browserExtension()->openURLRequest(url,uargs);
- }
-#endif
return Window::retrieve(khtmlpart); // global object
} else
return Undefined();
}
}
-#if APPLE_CHANGES
case Window::Print:
part->print();
return Undefined();
-#endif
case Window::ScrollBy:
window->updateLayout();
if(args.size() >= 2 && widget)
@@ -1962,11 +1842,7 @@
return Undefined();
return window->selection();
case Window::Blur:
-#if APPLE_CHANGES
KWQ(part)->unfocusWindow();
-#else
- // TODO
-#endif
return Undefined();
case Window::Close:
/* From http://developer.netscape.com/docs/manuals/js/client/jsref/window.htm :
@@ -1985,11 +1861,7 @@
// has more than one entry in the history (NS does that too).
History history(exec,part);
if ( history.get( exec, lengthPropertyName )->toInt32(exec) <= 1
-#if APPLE_CHANGES
// FIXME: How are we going to handle this?
-#else
- || KMessageBox::questionYesNo( window->part()->view(), i18n("Close window?"), i18n("Confirmation Required") ) == KMessageBox::Yes
-#endif
)
(const_cast<Window*>(window))->scheduleClose();
}
@@ -2220,12 +2092,10 @@
}
}
-#if APPLE_CHANGES
bool WindowQObject::hasTimeouts()
{
return scheduledActions.count();
}
-#endif
const ClassInfo FrameArray::info = { "FrameArray", 0, &FrameArrayTable, 0 };
@@ -2446,12 +2316,8 @@
KHTMLPart* activePart = Window::retrieveActive(exec)->part();
if (!url.url().startsWith("javascript:", false) || (window && window->isSafeScript(exec))) {
bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
-#if APPLE_CHANGES
// We want a new history item if this JS was called via a user gesture
m_part->scheduleLocationChange(url.url(), activePart->referrer(), !userGesture, userGesture);
-#else
- m_part->scheduleLocationChange(url.url(), activePart->referrer(), false /*don't lock history*/, userGesture);
-#endif
}
}
@@ -2512,12 +2378,8 @@
QString dstUrl = p->xmlDocImpl()->completeURL(args[0]->toString(exec).qstring());
if (!dstUrl.startsWith("javascript:", false) || (window && window->isSafeScript(exec))) {
bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
-#if APPLE_CHANGES
// We want a new history item if this JS was called via a user gesture
part->scheduleLocationChange(dstUrl, p->referrer(), !userGesture, userGesture);
-#else
- part->scheduleLocationChange(dstUrl, p->referrer(), false /*don't lock history*/, userGesture);
-#endif
}
}
break;
@@ -2711,7 +2573,6 @@
{
assert(token == Visible);
switch (m_type) {
-#if APPLE_CHANGES
case Locationbar:
return Boolean(KWQ(m_part)->locationbarVisible());
case Menubar:
@@ -2724,7 +2585,6 @@
return Boolean(KWQ(m_part)->statusbarVisible());
case Toolbar:
return Boolean(KWQ(m_part)->toolbarVisible());
-#endif
default:
return Boolean(false);
}
1.58 +0 -4 WebCore/khtml/ecma/kjs_window.h
Index: kjs_window.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_window.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- kjs_window.h 19 Nov 2005 01:26:45 -0000 1.57
+++ kjs_window.h 21 Nov 2005 01:19:57 -0000 1.58
@@ -101,7 +101,6 @@
int installTimeout(const UString &handler, int t, bool singleShot);
int installTimeout(ValueImp *function, List &args, int t, bool singleShot);
void clearTimeout(int timerId);
-#ifdef APPLE_CHANGES
bool hasTimeouts();
QMap<int, ScheduledAction*> *pauseTimeouts(const void *key);
void resumeTimeouts(QMap<int, ScheduledAction*>*sa, const void *key);
@@ -109,7 +108,6 @@
KJS::Interpreter *interpreter() const;
static bool isSafeScript (const KJS::ScriptInterpreter *origin, const KJS::ScriptInterpreter *target);
-#endif
void scheduleClose();
bool isSafeScript(ExecState *exec) const;
@@ -207,11 +205,9 @@
int installTimeout(const UString &handler, int t, bool singleShot);
int installTimeout(ValueImp *func, List args, int t, bool singleShot);
void clearTimeout(int timerId, bool delAction = true);
-#ifdef APPLE_CHANGES
bool hasTimeouts();
QMap<int, ScheduledAction*> *WindowQObject::pauseTimeouts(const void *key);
void WindowQObject::resumeTimeouts(QMap<int, ScheduledAction*> *sa, const void *key);
-#endif
public slots:
void timeoutClose();
1.45 +0 -35 WebCore/khtml/ecma/xmlhttprequest.cpp
Index: xmlhttprequest.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/xmlhttprequest.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- xmlhttprequest.cpp 27 Oct 2005 23:15:00 -0000 1.44
+++ xmlhttprequest.cpp 21 Nov 2005 01:19:57 -0000 1.45
@@ -38,9 +38,7 @@
#include <qobject.h>
#include <qregexp.h>
-#ifdef APPLE_CHANGES
#include "KWQLoader.h"
-#endif
#include "xmlhttprequest.lut.h"
@@ -74,17 +72,10 @@
jsObject = _jsObject;
}
-#if APPLE_CHANGES
void XMLHttpRequestQObject::slotData( KIO::Job* job, const char *data, int size )
{
jsObject->slotData(job, data, size);
}
-#else
-void XMLHttpRequestQObject::slotData( KIO::Job* job, const QByteArray &data )
-{
- jsObject->slotData(job, data);
-}
-#endif
void XMLHttpRequestQObject::slotFinished( KIO::Job* job )
{
@@ -340,11 +331,6 @@
aborted = false;
-#if !APPLE_CHANGES
- if (!async) {
- return;
- }
-#endif
if (method.lower() == "post" && (url.protocol().lower() == "http" || url.protocol().lower() == "https") ) {
// FIXME: determine post encoding correctly by looking in headers for charset
@@ -358,7 +344,6 @@
job->addMetaData("customHTTPHeader", requestHeaders);
}
-#if APPLE_CHANGES
if (!async) {
QByteArray data;
KURL finalURL;
@@ -370,7 +355,6 @@
return;
}
-#endif
{
InterpreterLock lock;
@@ -379,23 +363,14 @@
qObject->connect( job, SIGNAL( result( KIO::Job* ) ),
SLOT( slotFinished( KIO::Job* ) ) );
-#if APPLE_CHANGES
qObject->connect( job, SIGNAL( data( KIO::Job*, const char*, int ) ),
SLOT( slotData( KIO::Job*, const char*, int ) ) );
-#else
- qObject->connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ),
- SLOT( slotData( KIO::Job*, const QByteArray& ) ) );
-#endif
qObject->connect( job, SIGNAL(redirection(KIO::Job*, const KURL& ) ),
SLOT( slotRedirection(KIO::Job*, const KURL&) ) );
addToRequestsByDocument();
-#ifdef APPLE_CHANGES
KWQServeRequest(khtml::Cache::loader(), doc->docLoader(), job);
-#else
- KIO::Scheduler::scheduleJob( job );
-#endif
}
void XMLHttpRequest::abort()
@@ -518,7 +493,6 @@
return String(statusText);
}
-#if APPLE_CHANGES
void XMLHttpRequest::processSyncLoadResults(const QByteArray &data, const KURL &finalURL, const QString &headers)
{
if (!urlMatchesDocumentDomain(finalURL)) {
@@ -543,7 +517,6 @@
slotFinished(0);
}
-#endif
void XMLHttpRequest::slotFinished(KIO::Job *)
{
@@ -572,11 +545,7 @@
}
}
-#if APPLE_CHANGES
void XMLHttpRequest::slotData( KIO::Job*, const char *data, int len )
-#else
-void XMLHttpRequest::slotData(KIO::Job*, const QByteArray &_data)
-#endif
{
if (state < Loaded) {
responseHeaders = job->queryMetaData("HTTP-Headers");
@@ -584,10 +553,6 @@
changeState(Loaded);
}
-#if !APPLE_CHANGES
- const char *data = (const char *)_data.data();
- int len = (int)_data.size();
-#endif
if ( decoder == NULL ) {
decoder = new Decoder;
1.21 +0 -10 WebCore/khtml/ecma/xmlhttprequest.h
Index: xmlhttprequest.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/xmlhttprequest.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- xmlhttprequest.h 27 Sep 2005 22:37:05 -0000 1.20
+++ xmlhttprequest.h 21 Nov 2005 01:19:57 -0000 1.21
@@ -90,17 +90,11 @@
XMLHttpRequestQObject *qObject;
-#if APPLE_CHANGES
void slotData( KIO::Job* job, const char *data, int size );
-#else
- void slotData( KIO::Job* job, const QByteArray &data );
-#endif
void slotFinished( KIO::Job* );
void slotRedirection( KIO::Job*, const KURL& );
-#if APPLE_CHANGES
void processSyncLoadResults(const QByteArray &data, const KURL &finalURL, const QString &headers);
-#endif
void open(const QString& _method, const KURL& _url, bool _async);
void send(const QString& _body);
@@ -149,11 +143,7 @@
XMLHttpRequestQObject(XMLHttpRequest *_jsObject);
public slots:
-#if APPLE_CHANGES
void slotData( KIO::Job* job, const char *data, int size );
-#else
- void slotData( KIO::Job* job, const QByteArray &data );
-#endif
void slotFinished( KIO::Job* job );
void slotRedirection( KIO::Job* job, const KURL& url);
1.102 +0 -39 WebCore/khtml/editing/SelectionController.cpp
Index: SelectionController.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/SelectionController.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- SelectionController.cpp 8 Nov 2005 08:10:55 -0000 1.101
+++ SelectionController.cpp 21 Nov 2005 01:20:01 -0000 1.102
@@ -45,11 +45,7 @@
#include "xml/dom_textimpl.h"
#include "xml/dom2_rangeimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
#define EDIT_DEBUG 0
@@ -1070,41 +1066,6 @@
fprintf(stderr, "-----------------------------------\n");
}
-#if 0
- int back = 0;
- r = m_start.node()->renderer();
- for (int i = 0; i < context; i++, back++) {
- if (r->previousRenderer())
- r = r->previousRenderer();
- else
- break;
- }
- for (int i = 0; i < back; i++) {
- debugRenderer(r, false);
- r = r->nextRenderer();
- }
-
-
- fprintf(stderr, "\n");
-
- if (m_start.node() == m_end.node())
- debugRenderer(m_start.node()->renderer(), true);
- else
- for (r = m_start.node()->renderer(); r && r != m_end.node()->renderer(); r = r->nextRenderer())
- debugRenderer(r, true);
-
- fprintf(stderr, "\n");
-
- r = m_end.node()->renderer();
- for (int i = 0; i < context; i++) {
- if (r->nextRenderer()) {
- r = r->nextRenderer();
- debugRenderer(r, false);
- }
- else
- break;
- }
-#endif
fprintf(stderr, "================================\n");
}
1.4 +0 -4 WebCore/khtml/editing/append_node_command.cpp
Index: append_node_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/append_node_command.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- append_node_command.cpp 3 Oct 2005 21:12:18 -0000 1.3
+++ append_node_command.cpp 21 Nov 2005 01:20:01 -0000 1.4
@@ -28,11 +28,7 @@
#include "xml/dom_nodeimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::NodeImpl;
1.18 +0 -4 WebCore/khtml/editing/apply_style_command.cpp
Index: apply_style_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/apply_style_command.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- apply_style_command.cpp 7 Nov 2005 19:59:22 -0000 1.17
+++ apply_style_command.cpp 21 Nov 2005 01:20:01 -0000 1.18
@@ -41,11 +41,7 @@
#include "xml/dom_textimpl.h"
#include "xml/dom2_rangeimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using namespace DOM::HTMLNames;
1.11 +0 -4 WebCore/khtml/editing/break_blockquote_command.cpp
Index: break_blockquote_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/break_blockquote_command.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- break_blockquote_command.cpp 3 Nov 2005 02:20:15 -0000 1.10
+++ break_blockquote_command.cpp 21 Nov 2005 01:20:02 -0000 1.11
@@ -33,11 +33,7 @@
#include "xml/dom_elementimpl.h"
#include "xml/dom_textimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using namespace DOM::HTMLNames;
1.19 +0 -4 WebCore/khtml/editing/composite_edit_command.cpp
Index: composite_edit_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/composite_edit_command.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- composite_edit_command.cpp 14 Nov 2005 22:09:07 -0000 1.18
+++ composite_edit_command.cpp 21 Nov 2005 01:20:02 -0000 1.19
@@ -52,11 +52,7 @@
#include "xml/dom2_rangeimpl.h"
#include "xml/dom_textimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using namespace DOM::HTMLNames;
1.5 +0 -4 WebCore/khtml/editing/delete_from_text_node_command.cpp
Index: delete_from_text_node_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/delete_from_text_node_command.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- delete_from_text_node_command.cpp 3 Oct 2005 21:12:18 -0000 1.4
+++ delete_from_text_node_command.cpp 21 Nov 2005 01:20:02 -0000 1.5
@@ -28,11 +28,7 @@
#include "xml/dom_textimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::TextImpl;
1.23 +0 -5 WebCore/khtml/editing/delete_selection_command.cpp
Index: delete_selection_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/delete_selection_command.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- delete_selection_command.cpp 14 Nov 2005 19:53:48 -0000 1.22
+++ delete_selection_command.cpp 21 Nov 2005 01:20:02 -0000 1.23
@@ -39,13 +39,8 @@
#include "xml/dom_textimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
#include "KWQLogging.h"
-#else
-#define ASSERT(assertion) assert(assertion)
-#define LOG(channel, formatAndArgs...) ((void)0)
-#endif
using namespace DOM::HTMLNames;
1.11 +0 -4 WebCore/khtml/editing/edit_command.cpp
Index: edit_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/edit_command.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- edit_command.cpp 17 Nov 2005 01:04:34 -0000 1.10
+++ edit_command.cpp 21 Nov 2005 01:20:02 -0000 1.11
@@ -34,11 +34,7 @@
#include "css/css_valueimpl.h"
#include "css/css_computedstyle.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::Position;
1.262 +0 -9 WebCore/khtml/editing/htmlediting.cpp
Index: htmlediting.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/htmlediting.cpp,v
retrieving revision 1.261
retrieving revision 1.262
diff -u -r1.261 -r1.262
--- htmlediting.cpp 9 Nov 2005 19:56:47 -0000 1.261
+++ htmlediting.cpp 21 Nov 2005 01:20:02 -0000 1.262
@@ -84,19 +84,10 @@
using DOM::TextImpl;
using DOM::TreeWalkerImpl;
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
#include "KWQLogging.h"
#include "KWQKHTMLPart.h"
#include "KWQRegExp.h"
-#else
-#define ASSERT(assertion) ((void)0)
-#define ASSERT_WITH_MESSAGE(assertion, formatAndArgs...) ((void)0)
-#define ASSERT_NOT_REACHED() ((void)0)
-#define LOG(channel, formatAndArgs...) ((void)0)
-#define ERROR(formatAndArgs...) ((void)0)
-#define ASSERT(assertion) assert(assertion)
-#endif
namespace khtml {
1.5 +0 -4 WebCore/khtml/editing/insert_into_text_node_command.cpp
Index: insert_into_text_node_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/insert_into_text_node_command.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- insert_into_text_node_command.cpp 3 Oct 2005 21:12:19 -0000 1.4
+++ insert_into_text_node_command.cpp 21 Nov 2005 01:20:03 -0000 1.5
@@ -28,11 +28,7 @@
#include "xml/dom_textimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::TextImpl;
1.10 +0 -5 WebCore/khtml/editing/insert_line_break_command.cpp
Index: insert_line_break_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/insert_line_break_command.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- insert_line_break_command.cpp 9 Nov 2005 19:56:48 -0000 1.9
+++ insert_line_break_command.cpp 21 Nov 2005 01:20:03 -0000 1.10
@@ -37,13 +37,8 @@
#include "xml/dom_textimpl.h"
#include "khtml_part.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
#include "KWQLogging.h"
-#else
-#define ASSERT(assertion) assert(assertion)
-#define LOG(channel, formatAndArgs...) ((void)0)
-#endif
using namespace DOM::HTMLNames;
1.4 +0 -4 WebCore/khtml/editing/insert_node_before_command.cpp
Index: insert_node_before_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/insert_node_before_command.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- insert_node_before_command.cpp 3 Oct 2005 21:12:19 -0000 1.3
+++ insert_node_before_command.cpp 21 Nov 2005 01:20:03 -0000 1.4
@@ -28,11 +28,7 @@
#include "xml/dom_nodeimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::NodeImpl;
1.10 +0 -5 WebCore/khtml/editing/insert_paragraph_separator_command.cpp
Index: insert_paragraph_separator_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/insert_paragraph_separator_command.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- insert_paragraph_separator_command.cpp 3 Oct 2005 21:12:19 -0000 1.9
+++ insert_paragraph_separator_command.cpp 21 Nov 2005 01:20:03 -0000 1.10
@@ -37,13 +37,8 @@
#include "xml/dom_elementimpl.h"
#include "xml/dom_textimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
#include "KWQLogging.h"
-#else
-#define ASSERT(assertion) assert(assertion)
-#define LOG(channel, formatAndArgs...) ((void)0)
-#endif
using namespace DOM::HTMLNames;
1.14 +0 -5 WebCore/khtml/editing/insert_text_command.cpp
Index: insert_text_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/insert_text_command.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- insert_text_command.cpp 9 Nov 2005 19:56:48 -0000 1.13
+++ insert_text_command.cpp 21 Nov 2005 01:20:03 -0000 1.14
@@ -36,13 +36,8 @@
#include "xml/dom_position.h"
#include "xml/dom_textimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
#include "KWQLogging.h"
-#else
-#define ASSERT(assertion) assert(assertion)
-#define LOG(channel, formatAndArgs...) ((void)0)
-#endif
using DOM::DocumentImpl;
using DOM::NodeImpl;
1.4 +0 -4 WebCore/khtml/editing/join_text_nodes_command.cpp
Index: join_text_nodes_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/join_text_nodes_command.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- join_text_nodes_command.cpp 3 Oct 2005 21:12:19 -0000 1.3
+++ join_text_nodes_command.cpp 21 Nov 2005 01:20:03 -0000 1.4
@@ -29,11 +29,7 @@
#include "xml/dom_docimpl.h"
#include "xml/dom_textimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::TextImpl;
1.35 +0 -2 WebCore/khtml/editing/jsediting.cpp
Index: jsediting.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/jsediting.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- jsediting.cpp 3 Nov 2005 02:20:15 -0000 1.34
+++ jsediting.cpp 21 Nov 2005 01:20:03 -0000 1.35
@@ -34,9 +34,7 @@
#include "SelectionController.h"
#include <kxmlcore/HashMap.h>
-#if APPLE_CHANGES
#include "KWQKHTMLPart.h"
-#endif
using khtml::TypingCommand;
1.40 +0 -9 WebCore/khtml/editing/markup.cpp
Index: markup.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/markup.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- markup.cpp 31 Oct 2005 19:04:43 -0000 1.39
+++ markup.cpp 21 Nov 2005 01:20:04 -0000 1.40
@@ -59,17 +59,8 @@
using DOM::RangeImpl;
using DOM::TextImpl;
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
#include "KWQLogging.h"
-#else
-#define ASSERT(assertion) ((void)0)
-#define ASSERT_WITH_MESSAGE(assertion, formatAndArgs...) ((void)0)
-#define ASSERT_NOT_REACHED() ((void)0)
-#define LOG(channel, formatAndArgs...) ((void)0)
-#define ERROR(formatAndArgs...) ((void)0)
-#define ASSERT(assertion) assert(assertion)
-#endif
namespace khtml {
1.4 +0 -4 WebCore/khtml/editing/merge_identical_elements_command.cpp
Index: merge_identical_elements_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/merge_identical_elements_command.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- merge_identical_elements_command.cpp 3 Oct 2005 21:12:20 -0000 1.3
+++ merge_identical_elements_command.cpp 21 Nov 2005 01:20:04 -0000 1.4
@@ -29,11 +29,7 @@
#include "xml/dom_docimpl.h"
#include "xml/dom_elementimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::ElementImpl;
1.6 +0 -4 WebCore/khtml/editing/move_selection_command.cpp
Index: move_selection_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/move_selection_command.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- move_selection_command.cpp 3 Oct 2005 21:12:20 -0000 1.5
+++ move_selection_command.cpp 21 Nov 2005 01:20:04 -0000 1.6
@@ -29,11 +29,7 @@
#include "xml/dom_docimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::DocumentFragmentImpl;
1.6 +0 -4 WebCore/khtml/editing/rebalance_whitespace_command.cpp
Index: rebalance_whitespace_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/rebalance_whitespace_command.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- rebalance_whitespace_command.cpp 3 Oct 2005 21:12:20 -0000 1.5
+++ rebalance_whitespace_command.cpp 21 Nov 2005 01:20:04 -0000 1.6
@@ -31,11 +31,7 @@
#include "xml/dom_docimpl.h"
#include "xml/dom_textimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DOMString;
using DOM::DocumentImpl;
1.4 +0 -4 WebCore/khtml/editing/remove_css_property_command.cpp
Index: remove_css_property_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/remove_css_property_command.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- remove_css_property_command.cpp 3 Oct 2005 21:12:20 -0000 1.3
+++ remove_css_property_command.cpp 21 Nov 2005 01:20:04 -0000 1.4
@@ -28,11 +28,7 @@
#include "css/css_valueimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::CSSStyleDeclarationImpl;
using DOM::DOMString;
1.6 +0 -4 WebCore/khtml/editing/remove_node_attribute_command.cpp
Index: remove_node_attribute_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/remove_node_attribute_command.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- remove_node_attribute_command.cpp 3 Oct 2005 21:12:20 -0000 1.5
+++ remove_node_attribute_command.cpp 21 Nov 2005 01:20:04 -0000 1.6
@@ -28,11 +28,7 @@
#include "xml/dom_elementimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::ElementImpl;
1.4 +0 -4 WebCore/khtml/editing/remove_node_command.cpp
Index: remove_node_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/remove_node_command.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- remove_node_command.cpp 3 Oct 2005 21:12:20 -0000 1.3
+++ remove_node_command.cpp 21 Nov 2005 01:20:05 -0000 1.4
@@ -28,11 +28,7 @@
#include "xml/dom_nodeimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::NodeImpl;
1.4 +0 -4 WebCore/khtml/editing/remove_node_preserving_children_command.cpp
Index: remove_node_preserving_children_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/remove_node_preserving_children_command.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- remove_node_preserving_children_command.cpp 3 Oct 2005 21:12:20 -0000 1.3
+++ remove_node_preserving_children_command.cpp 21 Nov 2005 01:20:05 -0000 1.4
@@ -28,11 +28,7 @@
#include "xml/dom_nodeimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::NodeImpl;
1.19 +0 -4 WebCore/khtml/editing/replace_selection_command.cpp
Index: replace_selection_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/replace_selection_command.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- replace_selection_command.cpp 9 Nov 2005 19:56:48 -0000 1.18
+++ replace_selection_command.cpp 21 Nov 2005 01:20:05 -0000 1.19
@@ -42,11 +42,7 @@
#include "css/css_computedstyle.h"
#include "css/cssproperties.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using namespace DOM::HTMLNames;
1.6 +0 -4 WebCore/khtml/editing/set_node_attribute_command.cpp
Index: set_node_attribute_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/set_node_attribute_command.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- set_node_attribute_command.cpp 3 Oct 2005 21:12:20 -0000 1.5
+++ set_node_attribute_command.cpp 21 Nov 2005 01:20:05 -0000 1.6
@@ -28,11 +28,7 @@
#include "xml/dom_elementimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::ElementImpl;
1.4 +0 -4 WebCore/khtml/editing/split_element_command.cpp
Index: split_element_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/split_element_command.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- split_element_command.cpp 3 Oct 2005 21:12:21 -0000 1.3
+++ split_element_command.cpp 21 Nov 2005 01:20:05 -0000 1.4
@@ -28,11 +28,7 @@
#include "xml/dom_elementimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::ElementImpl;
1.6 +0 -4 WebCore/khtml/editing/split_text_node_command.cpp
Index: split_text_node_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/split_text_node_command.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- split_text_node_command.cpp 3 Oct 2005 21:12:21 -0000 1.5
+++ split_text_node_command.cpp 21 Nov 2005 01:20:05 -0000 1.6
@@ -29,11 +29,7 @@
#include "xml/dom_docimpl.h"
#include "xml/dom_textimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::TextImpl;
1.5 +0 -4 WebCore/khtml/editing/split_text_node_containing_element.cpp
Index: split_text_node_containing_element.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/split_text_node_containing_element.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- split_text_node_containing_element.cpp 3 Oct 2005 21:12:21 -0000 1.4
+++ split_text_node_containing_element.cpp 21 Nov 2005 01:20:05 -0000 1.5
@@ -30,11 +30,7 @@
#include "xml/dom_elementimpl.h"
#include "rendering/render_object.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::TextImpl;
1.5 +0 -4 WebCore/khtml/editing/typing_command.cpp
Index: typing_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/typing_command.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- typing_command.cpp 3 Oct 2005 21:12:21 -0000 1.4
+++ typing_command.cpp 21 Nov 2005 01:20:05 -0000 1.5
@@ -36,11 +36,7 @@
#include "visible_position.h"
#include "visible_units.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::DOMString;
1.63 +0 -5 WebCore/khtml/editing/visible_position.cpp
Index: visible_position.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/visible_position.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- visible_position.cpp 8 Nov 2005 08:10:55 -0000 1.62
+++ visible_position.cpp 21 Nov 2005 01:20:06 -0000 1.63
@@ -35,13 +35,8 @@
#include "xml/dom_nodeimpl.h"
#include "xml/dom_textimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
#include "KWQLogging.h"
-#else
-#define ASSERT(assertion) assert(assertion)
-#define LOG(channel, formatAndArgs...) ((void)0)
-#endif
using namespace DOM::HTMLNames;
1.4 +0 -4 WebCore/khtml/editing/wrap_contents_in_dummy_span_command.cpp
Index: wrap_contents_in_dummy_span_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/wrap_contents_in_dummy_span_command.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- wrap_contents_in_dummy_span_command.cpp 3 Oct 2005 21:12:21 -0000 1.3
+++ wrap_contents_in_dummy_span_command.cpp 21 Nov 2005 01:20:06 -0000 1.4
@@ -29,11 +29,7 @@
#include "apply_style_command.h"
#include "xml/dom_elementimpl.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
-#else
-#define ASSERT(assertion) assert(assertion)
-#endif
using DOM::DocumentImpl;
using DOM::ElementImpl;
1.75 +0 -67 WebCore/khtml/html/html_documentimpl.cpp
Index: html_documentimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/html_documentimpl.cpp,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- html_documentimpl.cpp 8 Nov 2005 08:10:58 -0000 1.74
+++ html_documentimpl.cpp 21 Nov 2005 01:20:12 -0000 1.75
@@ -89,9 +89,7 @@
#include <stdlib.h>
#include <qptrstack.h>
-#if APPLE_CHANGES
#include "KWQKCookieJar.h"
-#endif
// Turn off inlining to avoid warning with newer gcc.
@@ -137,13 +135,7 @@
DOMString HTMLDocumentImpl::referrer() const
{
if ( part() )
-#if APPLE_CHANGES
return KWQ(part())->incomingReferrer();
-#else
- // This is broken; returns the referrer used for links within this page (basically
- // the same as the URL), not the referrer used for loading this page itself.
- return part()->referrer();
-#endif
return DOMString();
}
@@ -156,71 +148,12 @@
DOMString HTMLDocumentImpl::cookie() const
{
-#if APPLE_CHANGES
return KWQKCookieJar::cookie(URL());
-#else
- long windowId = 0;
- KHTMLView *v = view ();
-
- if ( v && v->topLevelWidget() )
- windowId = v->topLevelWidget()->winId();
-
- QCString replyType;
- QByteArray params, reply;
- QDataStream stream(params, IO_WriteOnly);
- stream << URL() << windowId;
- if (!kapp->dcopClient()->call("kcookiejar", "kcookiejar",
- "findDOMCookies(QString, int)", params,
- replyType, reply)) {
- // Maybe it wasn't running (e.g. we're opening local html files)
- KApplication::startServiceByDesktopName( "kcookiejar");
- if (!kapp->dcopClient()->call("kcookiejar", "kcookiejar",
- "findDOMCookies(QString)", params, replyType, reply)) {
- kdWarning(6010) << "Can't communicate with cookiejar!" << endl;
- return DOMString();
- }
- }
-
- QDataStream stream2(reply, IO_ReadOnly);
- if(replyType != "QString") {
- kdError(6010) << "DCOP function findDOMCookies(...) returns "
- << replyType << ", expected QString" << endl;
- return DOMString();
- }
-
- QString result;
- stream2 >> result;
- return DOMString(result);
-#endif // APPLE_CHANGES
}
void HTMLDocumentImpl::setCookie( const DOMString & value )
{
-#if APPLE_CHANGES
return KWQKCookieJar::setCookie(URL(), m_policyBaseURL.qstring(), value.qstring());
-#else
- long windowId = 0;
- KHTMLView *v = view ();
-
- if ( v && v->topLevelWidget() )
- windowId = v->topLevelWidget()->winId();
-
- QByteArray params;
- QDataStream stream(params, IO_WriteOnly);
- QString fake_header("Set-Cookie: ");
- fake_header.append(value.qstring());
- fake_header.append("\n");
- stream << URL() << fake_header.utf8() << windowId;
- if (!kapp->dcopClient()->send("kcookiejar", "kcookiejar",
- "addCookies(QString,QCString,long int)", params))
- {
- // Maybe it wasn't running (e.g. we're opening local html files)
- KApplication::startServiceByDesktopName( "kcookiejar");
- if (!kapp->dcopClient()->send("kcookiejar", "kcookiejar",
- "addCookies(QString,QCString,long int)", params))
- kdWarning(6010) << "Can't communicate with cookiejar!" << endl;
- }
-#endif
}
void HTMLDocumentImpl::setBody(HTMLElementImpl *_body, int &exceptioncode)
1.205 +0 -214 WebCore/khtml/html/html_formimpl.cpp
Index: html_formimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/html_formimpl.cpp,v
retrieving revision 1.204
retrieving revision 1.205
diff -u -r1.204 -r1.205
--- html_formimpl.cpp 17 Nov 2005 23:17:00 -0000 1.204
+++ html_formimpl.cpp 21 Nov 2005 01:20:12 -0000 1.205
@@ -134,7 +134,6 @@
imgElements[i]->m_form = 0;
}
-#if APPLE_CHANGES
bool HTMLFormElementImpl::formWouldHaveSecureSubmission(const DOMString &url)
{
@@ -144,18 +143,15 @@
return getDocument()->completeURL(url.qstring()).startsWith("https:", false);
}
-#endif
void HTMLFormElementImpl::attach()
{
HTMLElementImpl::attach();
-#if APPLE_CHANGES
// note we don't deal with calling secureFormRemoved() on detach, because the timing
// was such that it cleared our state too early
if (formWouldHaveSecureSubmission(m_url))
getDocument()->secureFormAdded();
-#endif
}
void HTMLFormElementImpl::insertedIntoDocument()
@@ -188,7 +184,6 @@
return len;
}
-#if APPLE_CHANGES
void HTMLFormElementImpl::submitClick()
{
@@ -207,7 +202,6 @@
prepareSubmit();
}
-#endif // APPLE_CHANGES
static QCString encodeCString(const QCString& e)
{
@@ -307,26 +301,6 @@
return result;
}
-#if !APPLE_CHANGES
-
-void HTMLFormElementImpl::i18nData()
-{
- QString foo1 = i18n( "You're about to send data to the Internet "
- "via an unencrypted connection. It might be possible "
- "for others to see this information.\n"
- "Do you want to continue?");
- QString foo2 = i18n("KDE Web browser");
- QString foo3 = i18n("When you send a password unencrypted to the Internet, "
- "it might be possible for others to capture it as plain text.\n"
- "Do you want to continue?");
- QString foo5 = i18n("Your data submission is redirected to "
- "an insecure site. The data is sent unencrypted.\n"
- "Do you want to continue?");
- QString foo6 = i18n("The page contents expired. You can repost the form"
- "data by using <a href=\"javascript:go(0);\">Reload</a>");
-}
-
-#endif
bool HTMLFormElementImpl::formData(FormData &form_data) const
{
@@ -359,9 +333,6 @@
if(!codec)
codec = QTextCodec::codecForLocale();
-#if !APPLE_CHANGES
- QStringList fileUploads;
-#endif
for (unsigned i = 0; i < formElements.count(); ++i) {
HTMLGenericFormElementImpl* current = formElements[i];
@@ -405,9 +376,6 @@
static_cast<HTMLInputElementImpl*>(current)->inputType() == HTMLInputElementImpl::FILE)
{
QString path = static_cast<HTMLInputElementImpl*>(current)->value().qstring();
-#if !APPLE_CHANGES
- if (path.length()) fileUploads << path;
-#endif
// FIXME: This won't work if the filename includes a " mark,
// or control characters like CR or LF. This also does strange
@@ -419,12 +387,7 @@
if(!static_cast<HTMLInputElementImpl*>(current)->value().isEmpty())
{
-#if APPLE_CHANGES
QString mimeType = part ? KWQ(part)->mimeTypeForFileName(path) : QString();
-#else
- KMimeType::Ptr ptr = KMimeType::findByURL(KURL(path));
- QString mimeType = ptr->name();
-#endif
if (!mimeType.isEmpty()) {
hstr += "\r\nContent-Type: ";
hstr += mimeType.ascii();
@@ -437,36 +400,18 @@
// append body
form_data.appendData(hstr.data(), hstr.length());
-#if APPLE_CHANGES
const FormDataListItem &item = *it;
size_t dataSize = item.m_data.size();
if (dataSize != 0)
form_data.appendData(item.m_data, dataSize - 1);
else if (!item.m_path.isEmpty())
form_data.appendFile(item.m_path);
-#else
- form_data.appendData((*it).m_data, (*it).m_data.size() - 1);
-#endif
form_data.appendData("\r\n", 2);
}
}
}
}
-#if !APPLE_CHANGES
- if (fileUploads.count()) {
- int result = KMessageBox::warningContinueCancelList( 0,
- i18n("You're about to transfer the following files from "
- "your local computer to the Internet.\n"
- "Do you really want to continue?"),
- fileUploads);
-
-
- if (result == KMessageBox::Cancel) {
- return false;
- }
- }
-#endif
if (m_multipart)
enc_string = ("--" + m_boundary.qstring() + "--\r\n").ascii();
@@ -541,12 +486,9 @@
HTMLGenericFormElementImpl* firstSuccessfulSubmitButton = 0;
bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button?
-#if APPLE_CHANGES
KWQ(part)->clearRecordedFormValues();
-#endif
for (unsigned i = 0; i < formElements.count(); ++i) {
HTMLGenericFormElementImpl* current = formElements[i];
-#if APPLE_CHANGES
// Our app needs to get form values for password fields for doing password autocomplete,
// so we are more lenient in pushing values, and let the app decide what to save when.
if (current->hasLocalName(inputTag)) {
@@ -560,15 +502,6 @@
static_cast<RenderLineEdit*>(input->renderer())->addSearchResult();
}
}
-#else
- if (current->id() == ID_INPUT &&
- static_cast<HTMLInputElementImpl*>(current)->inputType() == HTMLInputElementImpl::TEXT &&
- static_cast<HTMLInputElementImpl*>(current)->autoComplete() )
- {
- HTMLInputElementImpl *input = static_cast<HTMLInputElementImpl *>(current);
- view->addFormCompletionItem(input->name().qstring(), input->value().qstring());
- }
-#endif
if (needButtonActivation) {
if (current->isActivatedSubmit()) {
@@ -631,12 +564,9 @@
void HTMLFormElementImpl::parseMappedAttribute(MappedAttributeImpl *attr)
{
if (attr->name() == actionAttr)
-#if APPLE_CHANGES
{
bool oldURLWasSecure = formWouldHaveSecureSubmission(m_url);
-#endif
m_url = khtml::parseURL(attr->value());
-#if APPLE_CHANGES
bool newURLIsSecure = formWouldHaveSecureSubmission(m_url);
if (m_attached && (oldURLWasSecure != newURLIsSecure))
@@ -645,7 +575,6 @@
else
getDocument()->secureFormRemoved();
}
-#endif
else if (attr->name() == targetAttr) {
m_target = attr->value();
} else if (attr->name() == methodAttr) {
@@ -1028,13 +957,9 @@
return static_cast<RenderWidget*>(m_render)->widget() &&
(static_cast<RenderWidget*>(m_render)->widget()->focusPolicy() & QWidget::ClickFocus);
}
-#if APPLE_CHANGES
// For <input type=image> and <button>, we will assume no mouse focusability. This is
// consistent with OS X behavior for buttons.
return false;
-#else
- return true;
-#endif
}
return false;
}
@@ -1052,18 +977,8 @@
ext->editableWidgetFocused(widget);
}
-#if APPLE_CHANGES
// We don't want this default key event handling, we'll count on
// Cocoa event dispatch if the event doesn't get blocked.
-#else
- if (evt->type()==keydownEvent ||
- evt->type()==keyupEvent)
- {
- KeyboardEventImpl * k = static_cast<KeyboardEventImpl *>(evt);
- if (k->keyVal() == QChar('\n').unicode() && m_render && m_render->isWidget() && k->qKeyEvent)
- QApplication::sendEvent(static_cast<RenderWidget *>(m_render)->widget(), k->qKeyEvent);
- }
-#endif
if (evt->type()==DOMFocusOutEvent && isEditable() && part && m_render && m_render->isWidget()) {
KHTMLPartBrowserExtension *ext = static_cast<KHTMLPartBrowserExtension *>(part->browserExtension());
@@ -1427,12 +1342,10 @@
newType = BUTTON;
else if ( strcasecmp( t, "khtml_isindex" ) == 0 )
newType = ISINDEX;
-#if APPLE_CHANGES
else if ( strcasecmp( t, "search" ) == 0 )
newType = SEARCH;
else if ( strcasecmp( t, "range" ) == 0 )
newType = RANGE;
-#endif
else
newType = TEXT;
@@ -1493,10 +1406,8 @@
case HIDDEN: return "hidden";
case IMAGE: return "image";
case BUTTON: return "button";
-#if APPLE_CHANGES
case SEARCH: return "search";
case RANGE: return "range";
-#endif
case ISINDEX: return "";
}
return "";
@@ -1539,9 +1450,7 @@
switch (m_type) {
case TEXT:
case PASSWORD:
-#if APPLE_CHANGES
case SEARCH:
-#endif
return true;
default:
break;
@@ -1555,9 +1464,7 @@
switch (m_type) {
case PASSWORD:
-#if APPLE_CHANGES
case SEARCH:
-#endif
case TEXT:
return static_cast<RenderLineEdit *>(m_render)->selectionStart();
default:
@@ -1572,9 +1479,7 @@
switch (m_type) {
case PASSWORD:
-#if APPLE_CHANGES
case SEARCH:
-#endif
case TEXT:
return static_cast<RenderLineEdit *>(m_render)->selectionEnd();
default:
@@ -1589,9 +1494,7 @@
switch (m_type) {
case PASSWORD:
-#if APPLE_CHANGES
case SEARCH:
-#endif
case TEXT:
static_cast<RenderLineEdit *>(m_render)->setSelectionStart(start);
break;
@@ -1606,9 +1509,7 @@
switch (m_type) {
case PASSWORD:
-#if APPLE_CHANGES
case SEARCH:
-#endif
case TEXT:
static_cast<RenderLineEdit *>(m_render)->setSelectionEnd(end);
break;
@@ -1626,9 +1527,7 @@
static_cast<RenderFileButton*>(m_render)->select();
break;
case PASSWORD:
-#if APPLE_CHANGES
case SEARCH:
-#endif
case TEXT:
static_cast<RenderLineEdit*>(m_render)->select();
break;
@@ -1638,9 +1537,7 @@
case IMAGE:
case ISINDEX:
case RADIO:
-#if APPLE_CHANGES
case RANGE:
-#endif
case RESET:
case SUBMIT:
break;
@@ -1653,9 +1550,7 @@
switch (m_type) {
case PASSWORD:
-#if APPLE_CHANGES
case SEARCH:
-#endif
case TEXT:
static_cast<RenderLineEdit *>(m_render)->setSelectionRange(start, end);
break;
@@ -1676,12 +1571,10 @@
HTMLGenericFormElementImpl::click(sendMouseEvents, showPressedLook);
break;
case FILE:
-#if APPLE_CHANGES
if (renderer()) {
static_cast<RenderFileButton *>(renderer())->click(sendMouseEvents);
break;
}
-#endif
HTMLGenericFormElementImpl::click(sendMouseEvents, showPressedLook);
break;
case CHECKBOX:
@@ -1689,10 +1582,8 @@
case IMAGE:
case ISINDEX:
case PASSWORD:
-#if APPLE_CHANGES
case SEARCH:
case RANGE:
-#endif
case TEXT:
HTMLGenericFormElementImpl::click(sendMouseEvents, showPressedLook);
break;
@@ -1707,9 +1598,7 @@
break;
case TEXT:
case PASSWORD:
-#if APPLE_CHANGES
case SEARCH:
-#endif
case ISINDEX:
focus();
break;
@@ -1720,9 +1609,7 @@
case IMAGE:
case BUTTON:
case FILE:
-#if APPLE_CHANGES
case RANGE:
-#endif
// focus
focus();
@@ -1851,10 +1738,8 @@
{
case TEXT:
case PASSWORD:
-#if APPLE_CHANGES
case SEARCH:
case RANGE:
-#endif
case ISINDEX:
case CHECKBOX:
case RADIO:
@@ -1875,9 +1760,7 @@
{
case TEXT:
case PASSWORD:
-#if APPLE_CHANGES
case SEARCH:
-#endif
case ISINDEX: return new (arena) RenderLineEdit(this);
case CHECKBOX:
case RADIO:
@@ -1888,9 +1771,7 @@
return new (arena) RenderButton(this);
case IMAGE: return new (arena) RenderImageButton(this);
case FILE: return new (arena) RenderFileButton(this);
- #if APPLE_CHANGES
case RANGE: return new (arena) RenderSlider(this);
-#endif
case HIDDEN: break;
}
assert(false);
@@ -1940,12 +1821,10 @@
}
}
-#if APPLE_CHANGES
// note we don't deal with calling passwordFieldRemoved() on detach, because the timing
// was such that it cleared our state too early
if (m_type == PASSWORD)
getDocument()->passwordFieldAdded();
-#endif
}
void HTMLInputElementImpl::detach()
@@ -1966,11 +1845,7 @@
if (alt.isNull())
alt = getAttribute(valueAttr);
if (alt.isEmpty())
-#if APPLE_CHANGES
alt = inputElementAltText();
-#else
- alt = i18n( "Submit" );
-#endif
return alt;
}
@@ -2004,10 +1879,8 @@
switch (m_type) {
case HIDDEN:
case TEXT:
-#if APPLE_CHANGES
case SEARCH:
case RANGE:
-#endif
case PASSWORD:
// always successful
encoding.appendData(name(), value());
@@ -2062,49 +1935,8 @@
return true;
}
-#if APPLE_CHANGES
encoding.appendFile(name(), value());
return true;
-#else
- KURL fileurl("file:///");
- fileurl.setPath(value().qstring());
- KIO::UDSEntry filestat;
-
- if (!KIO::NetAccess::stat(fileurl, filestat)) {
- KMessageBox::sorry(0L, i18n("Error fetching file for submission:\n%1").arg(KIO::NetAccess::lastErrorString()));
- return false;
- }
-
- KFileItem fileitem(filestat, fileurl, true, false);
- if (fileitem.isDir()) {
- return false;
- }
-
- QString local;
- if ( KIO::NetAccess::download(fileurl, local) )
- {
- QFile file(local);
- if (file.open(IO_ReadOnly))
- {
- QCString filearray(file.size()+1);
- int readbytes = file.readBlock( filearray.data(), file.size());
- if ( readbytes >= 0 )
- filearray[readbytes] = '\0';
- file.close();
-
- encoding.appendData(name(), filearray);
- KIO::NetAccess::removeTempFile( local );
-
- return true;
- }
- return false;
- }
- else {
- KMessageBox::sorry(0L, i18n("Error fetching file for submission:\n%1").arg(KIO::NetAccess::lastErrorString()));
- return false;
- }
- break;
-#endif
}
case ISINDEX:
encoding.appendData(name(), value());
@@ -2174,19 +2006,11 @@
if (v.isEmpty()) {
switch (m_type) {
case RESET:
-#if APPLE_CHANGES
v = resetButtonDefaultLabel();
-#else
- v = i18n("Reset");
-#endif
break;
case SUBMIT:
-#if APPLE_CHANGES
v = submitButtonDefaultLabel();
-#else
- v = i18n("Submit");
-#endif
break;
case BUTTON:
@@ -2197,10 +2021,8 @@
case ISINDEX:
case PASSWORD:
case RADIO:
-#if APPLE_CHANGES
case RANGE:
case SEARCH:
-#endif
case TEXT:
break;
}
@@ -2241,17 +2063,13 @@
case HIDDEN:
case IMAGE:
case RADIO:
-#if APPLE_CHANGES
case RANGE:
-#endif
case RESET:
case SUBMIT:
return false;
case ISINDEX:
case PASSWORD:
-#if APPLE_CHANGES
case SEARCH:
-#endif
case TEXT:
return true;
}
@@ -2372,7 +2190,6 @@
}
}
-#if APPLE_CHANGES
// Use key press event here since sending simulated mouse events
// on key down blocks the proper sending of the key press event.
if (evt->type() == keypressEvent && evt->isKeyboardEvent()) {
@@ -2477,7 +2294,6 @@
evt->setDefaultHandled();
}
}
-#endif
HTMLGenericFormElementImpl::defaultEventHandler(evt);
}
@@ -2920,14 +2736,10 @@
QString HTMLSelectElementImpl::state()
{
-#if !APPLE_CHANGES
- QString state;
-#endif
QMemArray<HTMLElementImpl*> items = listItems();
int l = items.count();
-#if APPLE_CHANGES
QChar stateChars[l];
for(int i = 0; i < l; i++)
@@ -2936,12 +2748,6 @@
else
stateChars[i] = '.';
QString state(stateChars, l);
-#else /* APPLE_CHANGES not defined */
- state.fill('.', l);
- for(int i = 0; i < l; i++)
- if(items[i]->id() == ID_OPTION && static_cast<HTMLOptionElementImpl*>(items[i])->selected())
- state[i] = 'X';
-#endif /* APPLE_CHANGES not defined */
return HTMLGenericFormElementImpl::state() + state;
}
@@ -2956,12 +2762,8 @@
QString state = _state;
if(!state.isEmpty() && !state.contains('X') && !m_multiple) {
qWarning("should not happen in restoreState!");
-#if APPLE_CHANGES
// KWQString doesn't support this operation. Should never get here anyway.
//state[0] = 'X';
-#else
- state[0] = 'X';
-#endif
}
QMemArray<HTMLElementImpl*> items = listItems();
@@ -3276,7 +3078,6 @@
bool HTMLKeygenElementImpl::appendFormData(FormDataList& encoded_values, bool)
{
-#if APPLE_CHANGES
// Only RSA is supported at this time.
if (!m_keyType.isNull() && strcasecmp(m_keyType, "rsa")) {
return false;
@@ -3287,21 +3088,6 @@
}
encoded_values.appendData(name(), value.utf8());
return true;
-#else
- bool successful = false;
-
- // pop up the fancy certificate creation dialog here
- KSSLKeyGen *kg = new KSSLKeyGen(static_cast<RenderWidget *>(m_render)->widget(), "Key Generator", true);
-
- kg->setKeySize(0);
- successful = (QDialog::Accepted == kg->exec());
-
- delete kg;
-
- encoded_values.appendData(name(), "deadbeef");
-
- return successful;
-#endif
}
// -------------------------------------------------------------------------
1.96 +0 -6 WebCore/khtml/html/html_formimpl.h
Index: html_formimpl.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/html_formimpl.h,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- html_formimpl.h 11 Nov 2005 02:15:35 -0000 1.95
+++ html_formimpl.h 21 Nov 2005 01:20:13 -0000 1.96
@@ -43,9 +43,7 @@
class RenderSelect;
class RenderLineEdit;
class RenderFileButton;
-#if APPLE_CHANGES
class RenderSlider;
-#endif
}
namespace DOM {
@@ -299,10 +297,8 @@
friend class khtml::RenderLineEdit;
friend class khtml::RenderFileButton;
-#if APPLE_CHANGES
friend class HTMLSelectElementImpl;
friend class khtml::RenderSlider;
-#endif
public:
// do not change the order!
@@ -318,10 +314,8 @@
HIDDEN,
IMAGE,
BUTTON
-#if APPLE_CHANGES
,SEARCH,
RANGE
-#endif
};
HTMLInputElementImpl(DocumentImpl *doc, HTMLFormElementImpl *f = 0);
1.55 +0 -4 WebCore/khtml/html/html_imageimpl.cpp
Index: html_imageimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/html_imageimpl.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- html_imageimpl.cpp 8 Nov 2005 08:10:59 -0000 1.54
+++ html_imageimpl.cpp 21 Nov 2005 01:20:13 -0000 1.55
@@ -102,11 +102,9 @@
if (oldImage)
oldImage->deref(this);
}
-#if APPLE_CHANGES
khtml::RenderImage *renderer = static_cast<khtml::RenderImage*>(element()->renderer());
if (renderer)
renderer->resetAnimation();
-#endif
}
void HTMLImageLoader::dispatchLoadEvent()
@@ -228,10 +226,8 @@
setHTMLEventListener(loadEvent,
getDocument()->createHTMLEventListener(attr->value().qstring(), this));
}
-#if APPLE_CHANGES
else if (attr->name() == compositeAttr)
_compositeOperator = attr->value().qstring();
-#endif
else if (attr->name() == nameAttr) {
DOMString newNameAttr = attr->value();
if (inDocument() && getDocument()->isHTMLDocument()) {
1.54 +0 -4 WebCore/khtml/html/html_inlineimpl.cpp
Index: html_inlineimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/html_inlineimpl.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- html_inlineimpl.cpp 8 Nov 2005 08:10:59 -0000 1.53
+++ html_inlineimpl.cpp 21 Nov 2005 01:20:13 -0000 1.54
@@ -96,11 +96,7 @@
bool HTMLAnchorElementImpl::isMouseFocusable() const
{
-#if APPLE_CHANGES
return false;
-#else
- return isFocusable();
-#endif
}
bool HTMLAnchorElementImpl::isKeyboardFocusable() const
1.89 +0 -42 WebCore/khtml/html/html_objectimpl.cpp
Index: html_objectimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/html_objectimpl.cpp,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -r1.88 -r1.89
--- html_objectimpl.cpp 8 Nov 2005 08:11:00 -0000 1.88
+++ html_objectimpl.cpp 21 Nov 2005 01:20:13 -0000 1.89
@@ -50,9 +50,7 @@
#include "java/kjavaappletcontext.h"
#endif
-#if APPLE_CHANGES
#include "KWQKHTMLPart.h"
-#endif
using namespace khtml;
@@ -209,36 +207,13 @@
}
bool HTMLAppletElementImpl::getMember(const QString & name, JType & type, QString & val) {
-#if APPLE_CHANGES
- return false;
-#else
-#ifndef Q_WS_QWS // We don't have Java in Qt Embedded
- if ( !m_render || !m_render->isApplet() )
- return false;
- KJavaAppletWidget *w = static_cast<KJavaAppletWidget*>(static_cast<RenderApplet*>(m_render)->widget());
- return (w && w->applet() && w->applet()->getMember(name, type, val));
-#else
return false;
-#endif
-#endif
}
bool HTMLAppletElementImpl::callMember(const QString & name, const QStringList & args, JType & type, QString & val) {
-#if APPLE_CHANGES
- return false;
-#else
-#ifndef Q_WS_QWS // We don't have Java in Qt Embedded
- if ( !m_render || !m_render->isApplet() )
- return false;
- KJavaAppletWidget *w = static_cast<KJavaAppletWidget*>(static_cast<RenderApplet*>(m_render)->widget());
- return (w && w->applet() && w->applet()->callMember(name, args, type, val));
-#else
return false;
-#endif
-#endif
}
-#if APPLE_CHANGES
KJS::Bindings::Instance *HTMLAppletElementImpl::getAppletInstance() const
{
KHTMLPart* part = getDocument()->part();
@@ -275,7 +250,6 @@
{
return m_allParamsAvailable;
}
-#endif
DOMString HTMLAppletElementImpl::align() const
{
@@ -402,7 +376,6 @@
return newChild->hasTagName(paramTag) || HTMLElementImpl::checkDTD(newChild);
}
-#if APPLE_CHANGES
KJS::Bindings::Instance *HTMLEmbedElementImpl::getEmbedInstance() const
{
KHTMLPart* part = getDocument()->part();
@@ -426,7 +399,6 @@
}
return embedInstance;
}
-#endif
bool HTMLEmbedElementImpl::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
{
@@ -554,11 +526,7 @@
// -------------------------------------------------------------------------
HTMLObjectElementImpl::HTMLObjectElementImpl(DocumentImpl *doc)
-#if APPLE_CHANGES
: HTMLElementImpl(objectTag, doc), m_imageLoader(0), objectInstance(0)
-#else
-: HTMLElementImpl(objectTag, doc), m_imageLoader(0)
-#endif
{
needWidgetUpdate = false;
m_useFallbackContent = false;
@@ -576,7 +544,6 @@
return newChild->hasTagName(paramTag) || HTMLElementImpl::checkDTD(newChild);
}
-#if APPLE_CHANGES
KJS::Bindings::Instance *HTMLObjectElementImpl::getObjectInstance() const
{
KHTMLPart* part = getDocument()->part();
@@ -603,7 +570,6 @@
return objectInstance;
}
-#endif
HTMLFormElementImpl *HTMLObjectElementImpl::form() const
{
@@ -716,16 +682,8 @@
if (!part || !part->pluginsEnabled()) {
return false;
}
-#if APPLE_CHANGES
// Eventually we will merge with the better version of this check on the tip of tree.
// Until then, just leave it out.
-#else
- KURL u = getDocument()->completeURL(url);
- for (KHTMLPart* part = w->part()->parentPart(); part; part = part->parentPart())
- if (part->url() == u) {
- return false;
- }
-#endif
return true;
}
1.40 +0 -14 WebCore/khtml/html/html_objectimpl.h
Index: html_objectimpl.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/html_objectimpl.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- html_objectimpl.h 8 Nov 2005 08:11:01 -0000 1.39
+++ html_objectimpl.h 21 Nov 2005 01:20:14 -0000 1.40
@@ -28,9 +28,7 @@
#include "xml/dom_stringimpl.h"
#include "java/kjavaappletcontext.h"
-#if APPLE_CHANGES
#include <JavaScriptCore/runtime.h>
-#endif
class QStringList;
@@ -91,11 +89,9 @@
DOMString width() const;
void setWidth(const DOMString &);
-#if APPLE_CHANGES
virtual bool allParamsAvailable();
void setupApplet() const;
KJS::Bindings::Instance *getAppletInstance() const;
-#endif
virtual void insertedIntoDocument();
virtual void removedFromDocument();
@@ -106,10 +102,8 @@
private:
DOMString oldNameAttr;
DOMString oldIdAttr;
-#if APPLE_CHANGES
mutable KJS::Bindings::Instance *appletInstance;
bool m_allParamsAvailable;
-#endif
};
// -------------------------------------------------------------------------
@@ -135,9 +129,7 @@
virtual bool isURLAttribute(AttributeImpl *attr) const;
-#if APPLE_CHANGES
KJS::Bindings::Instance *getEmbedInstance() const;
-#endif
QString url;
QString pluginPage;
@@ -145,9 +137,7 @@
private:
DOMString oldNameAttr;
-#if APPLE_CHANGES
mutable KJS::Bindings::Instance *embedInstance;
-#endif
};
// -------------------------------------------------------------------------
@@ -241,9 +231,7 @@
void setComplete(bool complete);
bool isDocNamedItem() const { return m_docNamedItem; }
-#if APPLE_CHANGES
KJS::Bindings::Instance *getObjectInstance() const;
-#endif
QString serviceType;
QString url;
@@ -256,9 +244,7 @@
void updateDocNamedItem();
DOMString oldIdAttr;
DOMString oldNameAttr;
-#if APPLE_CHANGES
mutable KJS::Bindings::Instance *objectInstance;
-#endif
bool m_complete;
bool m_docNamedItem;
};
1.68 +0 -48 WebCore/khtml/html/html_tableimpl.cpp
Index: html_tableimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/html_tableimpl.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- html_tableimpl.cpp 8 Nov 2005 08:11:01 -0000 1.67
+++ html_tableimpl.cpp 21 Nov 2005 01:20:14 -0000 1.68
@@ -60,10 +60,6 @@
foot = 0;
firstBody = 0;
-#if 0
- rules = None;
- frame = Void;
-#endif
padding = 1;
@@ -449,13 +445,6 @@
DOMString v = QString::number( border );
addCSSLength(attr, CSS_PROP_BORDER_WIDTH, v );
}
-#if 0
- // wanted by HTML4 specs
- if (m_noBorder)
- frame = Void, rules = None;
- else
- frame = Box, rules = All;
-#endif
} else if (attr->name() == bgcolorAttr) {
addCSSColor(attr, CSS_PROP_BACKGROUND_COLOR, attr->value());
} else if (attr->name() == bordercolorAttr) {
@@ -473,39 +462,7 @@
if (!url.isEmpty())
addCSSImageProperty(attr, CSS_PROP_BACKGROUND_IMAGE, getDocument()->completeURL(url));
} else if (attr->name() == frameAttr) {
-#if 0
- if ( strcasecmp( attr->value(), "void" ) == 0 )
- frame = Void;
- else if ( strcasecmp( attr->value(), "border" ) == 0 )
- frame = Box;
- else if ( strcasecmp( attr->value(), "box" ) == 0 )
- frame = Box;
- else if ( strcasecmp( attr->value(), "hsides" ) == 0 )
- frame = Hsides;
- else if ( strcasecmp( attr->value(), "vsides" ) == 0 )
- frame = Vsides;
- else if ( strcasecmp( attr->value(), "above" ) == 0 )
- frame = Above;
- else if ( strcasecmp( attr->value(), "below" ) == 0 )
- frame = Below;
- else if ( strcasecmp( attr->value(), "lhs" ) == 0 )
- frame = Lhs;
- else if ( strcasecmp( attr->value(), "rhs" ) == 0 )
- frame = Rhs;
-#endif
} else if (attr->name() == rulesAttr) {
-#if 0
- if ( strcasecmp( attr->value(), "none" ) == 0 )
- rules = None;
- else if ( strcasecmp( attr->value(), "groups" ) == 0 )
- rules = Groups;
- else if ( strcasecmp( attr->value(), "rows" ) == 0 )
- rules = Rows;
- else if ( strcasecmp( attr->value(), "cols" ) == 0 )
- rules = Cols;
- else if ( strcasecmp( attr->value(), "all" ) == 0 )
- rules = All;
-#endif
} else if (attr->name() == cellspacingAttr) {
if (!attr->value().isEmpty())
addCSSLength(attr, CSS_PROP_BORDER_SPACING, attr->value());
@@ -521,11 +478,6 @@
}
} else if (attr->name() == colsAttr) {
// ###
-#if 0
- int c;
- c = attr->val()->toInt();
- addColumns(c-totalCols);
-#endif
} else if (attr->name() == vspaceAttr) {
addCSSLength(attr, CSS_PROP_MARGIN_TOP, attr->value());
addCSSLength(attr, CSS_PROP_MARGIN_BOTTOM, attr->value());
1.122 +0 -4 WebCore/khtml/html/htmlparser.cpp
Index: htmlparser.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/htmlparser.cpp,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -r1.121 -r1.122
--- htmlparser.cpp 8 Nov 2005 08:11:02 -0000 1.121
+++ htmlparser.cpp 21 Nov 2005 01:20:14 -0000 1.122
@@ -1319,11 +1319,7 @@
isIndex->setAttributeMap(attrs);
isIndex->setAttribute(typeAttr, "khtml_isindex");
-#if APPLE_CHANGES
DOMString text = searchableIndexIntroduction();
-#else
- DOMString text = i18n("This is a searchable index. Enter search keywords: ");
-#endif
if (attrs) {
if (AttributeImpl *a = attrs->getAttributeItem(promptAttr))
text = a->value().domString() + " ";
1.126 +0 -2 WebCore/khtml/html/htmltokenizer.cpp
Index: htmltokenizer.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/htmltokenizer.cpp,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -r1.125 -r1.126
--- htmltokenizer.cpp 8 Nov 2005 08:11:02 -0000 1.125
+++ htmltokenizer.cpp 21 Nov 2005 01:20:15 -0000 1.126
@@ -488,10 +488,8 @@
HTMLTokenizer::State HTMLTokenizer::scriptExecution(const QString& str, State state,
QString scriptURL, int baseLine)
{
-#if APPLE_CHANGES
if (!view || !view->part())
return state;
-#endif
bool oldscript = state.inScript();
m_executingScript++;
state.setInScript(false);
1.47 +0 -4 WebCore/khtml/html/htmltokenizer.h
Index: htmltokenizer.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/htmltokenizer.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- htmltokenizer.h 8 Nov 2005 08:11:03 -0000 1.46
+++ htmltokenizer.h 21 Nov 2005 01:20:15 -0000 1.47
@@ -38,11 +38,9 @@
#include "html/html_elementimpl.h"
#include "xml/dom_docimpl.h"
-#if APPLE_CHANGES
#ifdef __OBJC__
#define id id_AVOID_KEYWORD
#endif
-#endif
class KCharsets;
class HTMLParser;
@@ -384,8 +382,6 @@
}
-#if APPLE_CHANGES
#undef id
-#endif
#endif // HTMLTOKENIZER
1.46 +0 -78 WebCore/khtml/misc/decoder.cpp
Index: decoder.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/misc/decoder.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- decoder.cpp 3 Oct 2005 21:12:35 -0000 1.45
+++ decoder.cpp 21 Nov 2005 01:20:19 -0000 1.46
@@ -302,7 +302,6 @@
if(enc.isNull() || enc.isEmpty())
return;
-#if APPLE_CHANGES
QTextCodec *codec = (type == EncodingFromMetaTag || type == EncodingFromXMLHeader)
? QTextCodec::codecForNameEightBitOnly(enc)
: QTextCodec::codecForName(enc);
@@ -310,21 +309,6 @@
enc = codec->name();
visualRTL = codec->usesVisualOrdering();
}
-#else
- if(enc == "visual") // hebrew visually ordered
- enc = "iso8859-8";
- bool b;
- QTextCodec *codec = KGlobal::charsets()->codecForName(enc, b);
- if (!b)
- codec = 0;
-
- if (codec && codec->mibEnum() == 11) {
- // visually ordered unless one of the following
- if( !(enc == "iso-8859-8-i" || enc == "iso_8859-8-i"
- || enc == "csiso88598i" || enc == "logical") )
- visualRTL = true;
- }
-#endif
if( codec ) { // in case the codec didn't exist, we keep the old one (fixes some sites specifying invalid codecs)
m_codec = codec;
@@ -461,22 +445,7 @@
kdDebug(6005) << "looking for charset definition" << endl;
#endif
{ // extra level of braces to keep indenting matching original for better diff'ing
-#if APPLE_CHANGES
buffer.append(data, len);
-#else
- if(m_codec->mibEnum() != 1000) // utf16
- {
- // ### hack for a bug in QTextCodec. It cut's the input stream
- // in case there are \0 in it. ZDNET has them inside... :-(
- char *d = const_cast<char *>(data);
- int i = len - 1;
- while(i >= 0) {
- if(*(d+i) == 0) *(d+i) = ' ';
- i--;
- }
- }
- buffer += QCString(data, len+1);
-#endif
// we still don't have an encoding, and are in the head
// the following tags are allowed in <head>:
// SCRIPT|STYLE|META|LINK|OBJECT|TITLE|BASE
@@ -491,13 +460,8 @@
bool withinTitle = false;
-#if APPLE_CHANGES
const char *ptr = buffer.latin1();
const char *pEnd = ptr + buffer.length();
-#else
- const char *ptr = buffer.data();
- const char *pEnd = buffer.length();
-#endif
while(ptr != pEnd)
{
if(*ptr == '<') {
@@ -529,11 +493,7 @@
goto found;
} else if (ptr[0] == 0 && ptr[1] == '?' && ptr[2] == 0 && ptr[3] == 'x' && ptr[4] == 0 && ptr[5] == 'm' && ptr[6] == 0 && ptr[7] == 'l') {
// UTF-16 without BOM
-#if APPLE_CHANGES
setEncoding(((ptr - buffer.latin1()) % 2) ? "UTF-16LE" : "UTF-16BE", AutoDetectedEncoding);
-#else
- setEncoding(((ptr - buffer.data()) % 2) ? "UTF-16LE" : "UTF-16BE", AutoDetectedEncoding);
-#endif
goto found;
}
@@ -615,12 +575,8 @@
}
found:
-#if APPLE_CHANGES
// Do the auto-detect if our default encoding is one of the Japanese ones.
if (m_type != UserChosenEncoding && m_type != AutoDetectedEncoding && m_codec && m_codec->isJapanese())
-#else
- if (m_type == DefaultEncoding && KGlobal::locale()->languageList()[0] == "ja")
-#endif
{
#ifdef DECODE_DEBUG
kdDebug( 6005 ) << "Decoder: use auto-detect (" << strlen(data) << ")" << endl;
@@ -665,7 +621,6 @@
}
QString out;
-#if APPLE_CHANGES
if (!buffer.isEmpty()) {
if (!lookForMetaTag)
buffer.append(data, len);
@@ -674,46 +629,13 @@
} else {
out = m_decoder->toUnicode(data, len);
}
-#else
- if(!buffer.isEmpty() && enc != "ISO-10646-UCS-2") {
- out = m_decoder->toUnicode(buffer.latin1(), buffer.length());
- buffer = "";
- } else {
- if(m_codec->mibEnum() != 1000) // utf16
- {
- // ### hack for a bug in QTextCodec. It cut's the input stream
- // in case there are \0 in it. ZDNET has them inside... :-(
- char *d = const_cast<char *>(data);
- int i = len - 1;
- while(i >= 0) {
- if(*(d+i) == 0) *(d+i) = ' ';
- i--;
- }
- }
- out = m_decoder->toUnicode(data, len);
- }
-
- if (out.isNull()) {
- fprintf(stderr, "ERROR: decoded string is null\n");
- } else if (out.length() == 0) {
- fprintf(stderr, "ERROR: decoded string length == 0\n");
- }
- // the hell knows, why the output does sometimes have a QChar::null at
- // the end...
- else if(out[out.length()-1] == QChar::null)
- out.truncate(out.length() - 1);
-#endif
return out;
}
QString Decoder::flush() const
{
-#if APPLE_CHANGES
return m_decoder->toUnicode(buffer.latin1(), buffer.length(), true);
-#else
- return m_decoder->toUnicode(buffer.latin1(), buffer.length());
-#endif
}
// -----------------------------------------------------------------------------
1.10 +0 -4 WebCore/khtml/misc/decoder.h
Index: decoder.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/misc/decoder.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- decoder.h 3 Jun 2003 19:47:45 -0000 1.9
+++ decoder.h 21 Nov 2005 01:20:19 -0000 1.10
@@ -66,13 +66,9 @@
QCString enc;
EncodingType m_type;
-#if APPLE_CHANGES
// Our version of QString works well for all-8-bit characters, and allows null characters.
// This works better than QCString when there are null characters involved.
QString buffer;
-#else
- QCString buffer;
-#endif
bool body;
bool beginning;
1.23 +0 -18 WebCore/khtml/misc/helper.cpp
Index: helper.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/misc/helper.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- helper.cpp 3 Oct 2005 21:12:35 -0000 1.22
+++ helper.cpp 21 Nov 2005 01:20:19 -0000 1.23
@@ -24,9 +24,7 @@
#include "config.h"
#include "helper.h"
-#if APPLE_CHANGES
#include "KWQTextUtilities.h"
-#endif
namespace khtml {
@@ -39,38 +37,22 @@
void findWordBoundary(const QChar *chars, int len, int position, int *start, int *end)
{
-#if APPLE_CHANGES
KWQFindWordBoundary(chars, len, position, start, end);
-#else
- // KDE implementation
-#endif
}
int nextWordFromIndex(const QChar *chars, int len, int position, bool forward)
{
-#if APPLE_CHANGES
return KWQFindNextWordFromIndex(chars, len, position, forward);
-#else
- // KDE implementation
-#endif
}
void findSentenceBoundary(const QChar *chars, int len, int position, int *start, int *end)
{
-#if APPLE_CHANGES
KWQFindSentenceBoundary(chars, len, position, start, end);
-#else
- // KDE implementation
-#endif
}
int nextSentenceFromIndex(const QChar *chars, int len, int position, bool forward)
{
-#if APPLE_CHANGES
return KWQFindNextSentenceFromIndex(chars, len, position, forward);
-#else
- // KDE implementation
-#endif
}
}
1.12 +0 -4 WebCore/khtml/misc/helper.h
Index: helper.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/misc/helper.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- helper.h 6 Jan 2005 18:20:50 -0000 1.11
+++ helper.h 21 Nov 2005 01:20:19 -0000 1.12
@@ -33,10 +33,6 @@
namespace khtml
{
const QRgb transparentColor = 0x00000000;
-#if !APPLE_CHANGES
- const QRgb invertedColor = 0x00000002; // This really makes no sense. This is a valid color value, so why
- // is it being given special meaning? -dwh
-#endif
extern QPainter *printpainter;
void setPrintPainter(QPainter *printer);
1.81 +0 -683 WebCore/khtml/misc/loader.cpp
Index: loader.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/misc/loader.cpp,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -r1.80 -r1.81
--- loader.cpp 24 Oct 2005 21:52:01 -0000 1.80
+++ loader.cpp 21 Nov 2005 01:20:20 -0000 1.81
@@ -62,17 +62,13 @@
#include "xbl/xbl_docimpl.h"
#endif
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
#include "KWQLoader.h"
-#endif
using namespace khtml;
using namespace DOM;
-#if APPLE_CHANGES
static bool cacheDisabled;
-#endif
// Call this "walker" instead of iterator so people won't expect Qt or STL-style iterator interface.
// Just keep calling next() on this. It's safe from deletions of the current item
@@ -90,10 +86,8 @@
if(m_deleted) abort();
Cache::removeFromLRUList(this);
m_deleted = true;
-#if APPLE_CHANGES
setResponse(0);
setAllData(0);
-#endif
}
void CachedObject::finish()
@@ -352,146 +346,6 @@
// ------------------------------------------------------------------------------------------
-#if !APPLE_CHANGES
-
-namespace khtml
-{
-
- class ImageSource : public QDataSource
- {
- public:
- ImageSource(QByteArray buf);
-
- /**
- * Overload QDataSource::readyToSend() and returns the number
- * of bytes ready to send if not eof instead of returning -1.
- */
- int readyToSend();
-
- /*!
- Reads and sends a block of data.
- */
- void sendTo(QDataSink*, int count);
-
- /**
- * Sets the EOF state.
- */
- void setEOF( bool state );
-
- /*!
- KHTMLImageSource's is rewindable.
- */
- bool rewindable() const;
-
- /*!
- Enables rewinding. No special action is taken.
- */
- void enableRewind(bool on);
-
- /*
- Calls reset() on the QIODevice.
- */
- void rewind();
-
- /*
- Indicates that the buffered data is no longer
- needed.
- */
- void cleanBuffer();
-
- QByteArray buffer;
- unsigned int pos;
- private:
- bool eof : 1;
- bool rew : 1;
- bool rewable : 1;
- };
-}
-
-
-ImageSource::ImageSource(QByteArray buf)
-{
- buffer = buf;
- rew = false;
- pos = 0;
- eof = false;
- rewable = true;
-}
-
-int ImageSource::readyToSend()
-{
- if(eof && pos == buffer.size())
- return -1;
-
- return buffer.size() - pos;
-}
-
-void ImageSource::sendTo(QDataSink* sink, int n)
-{
- sink->receive((const uchar*)&buffer.at(pos), n);
-
- pos += n;
-
- // buffer is no longer needed
- if(eof && pos == buffer.size() && !rewable)
- {
- buffer.resize(0);
- pos = 0;
- }
-}
-
-void ImageSource::setEOF( bool state )
-{
- eof = state;
-}
-
-// ImageSource's is rewindable.
-bool ImageSource::rewindable() const
-{
- return rewable;
-}
-
-// Enables rewinding. No special action is taken.
-void ImageSource::enableRewind(bool on)
-{
- rew = on;
-}
-
-// Calls reset() on the QIODevice.
-void ImageSource::rewind()
-{
- pos = 0;
- if (!rew) {
- QDataSource::rewind();
- } else
- ready();
-}
-
-void ImageSource::cleanBuffer()
-{
- // if we need to be able to rewind, buffer is needed
- if(rew)
- return;
-
- rewable = false;
-
- // buffer is no longer needed
- if(eof && pos == buffer.size())
- {
- buffer.resize(0);
- pos = 0;
- }
-}
-
-static QString buildAcceptHeader()
-{
- QString result = KImageIO::mimeTypes( KImageIO::Reading ).join(", ");
- if (result.right(2) == ", ")
- result = result.left(result.length()-2);
- return result;
-}
-
-#endif // APPLE_CHANGES
static bool crossDomain(const QString &a, const QString &b)
{
@@ -518,7 +372,6 @@
}
// -------------------------------------------------------------------------------------
-#if APPLE_CHANGES
void CachedImageCallback::notifyUpdate()
{
if (cachedImage) {
@@ -607,26 +460,16 @@
}
cachedImage = 0;
}
-#endif
CachedImage::CachedImage(DocLoader* dl, const DOMString &url, KIO::CacheControl _cachePolicy, time_t _expireDate)
: QObject(), CachedObject(url, Image, _cachePolicy, _expireDate)
-#if APPLE_CHANGES
, m_dataSize(0)
-#endif
{
-#if !APPLE_CHANGES
- static const QString &acceptHeader = KGlobal::staticQString( buildAcceptHeader() );
-#endif
m = 0;
p = 0;
pixPart = 0;
bg = 0;
-#if !APPLE_CHANGES
- bgColor = qRgba( 0, 0, 0, 0xFF );
- typeChecked = false;
-#endif
isFullyTransparent = false;
errorOccured = false;
monochrome = false;
@@ -634,16 +477,11 @@
m_status = Unknown;
imgSource = 0;
m_loading = true;
-#if !APPLE_CHANGES
- setAccept( acceptHeader );
-#endif
m_showAnimations = dl->showAnimations();
-#if APPLE_CHANGES
if (QPixmap::shouldUseThreadedDecoding())
m_decoderCallback = new CachedImageCallback(this);
else
m_decoderCallback = 0;
-#endif
}
CachedImage::~CachedImage()
@@ -690,83 +528,7 @@
const QPixmap &CachedImage::tiled_pixmap(const QColor& newc)
{
-#if APPLE_CHANGES
return pixmap();
-#else
- static QRgb bgTransparant = qRgba( 0, 0, 0, 0xFF );
- if ( (bgColor != bgTransparant) && (bgColor != newc.rgb()) ) {
- delete bg; bg = 0;
- }
-
- if (bg)
- return *bg;
-
- const QPixmap &r = pixmap();
-
- if (r.isNull()) return r;
-
- // no error indication for background images
- if(errorOccured) return *Cache::nullPixmap;
-
- bool isvalid = newc.isValid();
- QSize s(pixmap_size());
- int w = r.width();
- int h = r.height();
- if ( w*h < 8192 )
- {
- if ( r.width() < BGMINWIDTH )
- w = ((BGMINWIDTH / s.width())+1) * s.width();
- if ( r.height() < BGMINHEIGHT )
- h = ((BGMINHEIGHT / s.height())+1) * s.height();
- }
- if ( (w != r.width()) || (h != r.height()) || (isvalid && r.mask()))
- {
- QPixmap pix = r;
- if ( w != r.width() || (isvalid && pix.mask()))
- {
- bg = new QPixmap(w, r.height());
- QPainter p(bg);
- if(isvalid) p.fillRect(0, 0, w, r.height(), newc);
- p.drawTiledPixmap(0, 0, w, r.height(), pix);
- if(!isvalid && pix.mask())
- {
- // unfortunately our anti-transparency trick doesn't work here
- // we need to create a mask.
- QBitmap newmask(w, r.height());
- QPainter pm(&newmask);
- pm.drawTiledPixmap(0, 0, w, r.height(), *pix.mask());
- bg->setMask(newmask);
- bgColor = bgTransparant;
- }
- else
- bgColor= newc.rgb();
- pix = *bg;
- }
- if ( h != r.height() )
- {
- delete bg;
- bg = new QPixmap(w, h);
- QPainter p(bg);
- if(isvalid) p.fillRect(0, 0, w, h, newc);
- p.drawTiledPixmap(0, 0, w, h, pix);
- if(!isvalid && pix.mask())
- {
- // unfortunately our anti-transparency trick doesn't work here
- // we need to create a mask.
- QBitmap newmask(w, h);
- QPainter pm(&newmask);
- pm.drawTiledPixmap(0, 0, w, h, *pix.mask());
- bg->setMask(newmask);
- bgColor = bgTransparant;
- }
- else
- bgColor= newc.rgb();
- }
- return *bg;
- }
-
- return r;
-#endif
}
const QPixmap &CachedImage::pixmap( ) const
@@ -774,29 +536,8 @@
if(errorOccured)
return *Cache::brokenPixmap;
-#if APPLE_CHANGES
if (p)
return *p;
-#else
- if(m)
- {
- if(m->framePixmap().size() != m->getValidRect().size() && m->getValidRect().size().isValid())
- {
- // pixmap is not yet completely loaded, so we
- // return a clipped version. asserting here
- // that the valid rect is always from 0/0 to fullwidth/ someheight
- if(!pixPart) pixPart = new QPixmap(m->getValidRect().size());
-
- (*pixPart) = m->framePixmap();
- pixPart->resize(m->getValidRect().size());
- return *pixPart;
- }
- else
- return m->framePixmap();
- }
- else if(p)
- return *p;
-#endif // APPLE_CHANGES
return *Cache::nullPixmap;
}
@@ -821,161 +562,32 @@
c->setPixmap(p, r, this);
}
-#if !APPLE_CHANGES
-
-void CachedImage::movieUpdated( const QRect& r )
-{
-#ifdef CACHE_DEBUG
- qDebug("movie updated %d/%d/%d/%d, pixmap size %d/%d", r.x(), r.y(), r.right(), r.bottom(),
- m->framePixmap().size().width(), m->framePixmap().size().height());
-#endif
-
- do_notify(m->framePixmap(), r);
-}
-
-void CachedImage::movieStatus(int status)
-{
-#ifdef CACHE_DEBUG
- qDebug("movieStatus(%d)", status);
-#endif
-
- // ### the html image objects are supposed to send the load event after every frame (according to
- // netscape). We have a problem though where an image is present, and js code creates a new Image object,
- // which uses the same CachedImage, the one in the document is not supposed to be notified
-
- // just another Qt 2.2.0 bug. we cannot call
- // QMovie::frameImage if we're after QMovie::EndOfMovie
- if(status == QMovie::EndOfFrame)
- {
- const QImage& im = m->frameImage();
- monochrome = ( ( im.depth() <= 8 ) && ( im.numColors() - int( im.hasAlphaBuffer() ) <= 2 ) );
- for (int i = 0; monochrome && i < im.numColors(); ++i)
- if (im.colorTable()[i] != qRgb(0xff, 0xff, 0xff) &&
- im.colorTable()[i] != qRgb(0x00, 0x00, 0x00))
- monochrome = false;
- if((im.width() < 5 || im.height() < 5) && im.hasAlphaBuffer()) // only evaluate for small images
- {
- QImage am = im.createAlphaMask();
- if(am.depth() == 1)
- {
- bool solid = false;
- for(int y = 0; y < am.height(); y++)
- for(int x = 0; x < am.width(); x++)
- if(am.pixelIndex(x, y)) {
- solid = true;
- break;
- }
- isFullyTransparent = (!solid);
- }
- }
-
- // we have to delete our tiled bg variant here
- // because the frame has changed (in order to keep it in sync)
- delete bg;
- bg = 0;
- }
-
-
- if((status == QMovie::EndOfMovie && (!m || m->frameNumber() <= 1)) ||
- ((status == QMovie::EndOfLoop) && (m_showAnimations == KHTMLSettings::KAnimationLoopOnce)) ||
- ((status == QMovie::EndOfFrame) && (m_showAnimations == KHTMLSettings::KAnimationDisabled))
- )
- {
- if(imgSource)
- {
- setShowAnimations( KHTMLSettings::KAnimationDisabled );
-
- // monochrome alphamasked images are usually about 10000 times
- // faster to draw, so this is worth the hack
- if (p && monochrome && p->depth() > 1 )
- {
- QPixmap* pix = new QPixmap;
- pix->convertFromImage( p->convertToImage().convertDepth( 1 ), MonoOnly|AvoidDither );
- if ( p->mask() )
- pix->setMask( *p->mask() );
- delete p;
- p = pix;
- monochrome = false;
- }
- }
-
- CachedObjectClientWalker w(m_clients);
- while (CachedObjectClient *c = w.next())
- c->notifyFinished(this);
- }
-
- if((status == QMovie::EndOfFrame) || (status == QMovie::EndOfMovie))
- {
-#ifdef CACHE_DEBUG
- QRect r(valid_rect());
- qDebug("movie Status frame update %d/%d/%d/%d, pixmap size %d/%d", r.x(), r.y(), r.right(), r.bottom(),
- pixmap().size().width(), pixmap().size().height());
-#endif
- do_notify(pixmap(), valid_rect());
- }
-}
-
-void CachedImage::movieResize(const QSize& /*s*/)
-{
-// do_notify(m->framePixmap(), QRect());
-}
-
-#endif // APPLE_CHANGES
void CachedImage::setShowAnimations( KHTMLSettings::KAnimationAdvice showAnimations )
{
m_showAnimations = showAnimations;
-#if !APPLE_CHANGES
- if ( (m_showAnimations == KHTMLSettings::KAnimationDisabled) && imgSource ) {
- imgSource->cleanBuffer();
- delete p;
- p = new QPixmap(m->framePixmap());
-
- m->disconnectUpdate( this, SLOT( movieUpdated( const QRect &) ));
- m->disconnectStatus( this, SLOT( movieStatus( int ) ));
- m->disconnectResize( this, SLOT( movieResize( const QSize& ) ) );
- QTimer::singleShot(0, this, SLOT( deleteMovie()));
- imgSource = 0;
- }
-#endif
-}
-
-#if !APPLE_CHANGES
-
-void CachedImage::deleteMovie()
-{
- delete m; m = 0;
}
-#endif // APPLE_CHANGES
void CachedImage::clear()
{
delete m; m = 0;
delete p; p = 0;
delete bg; bg = 0;
-#if !APPLE_CHANGES
- bgColor = qRgba( 0, 0, 0, 0xff );
-#endif
delete pixPart; pixPart = 0;
formatType = 0;
-#if !APPLE_CHANGES
- typeChecked = false;
-#endif
setSize(0);
// No need to delete imageSource - QMovie does it for us
imgSource = 0;
-#if APPLE_CHANGES
if (m_decoderCallback) {
m_decoderCallback->clear();
m_decoderCallback->deref();
m_decoderCallback = 0;
}
-#endif
}
void CachedImage::data ( QBuffer &_buffer, bool eof )
@@ -984,57 +596,6 @@
kdDebug( 6060 ) << this << "in CachedImage::data(buffersize " << _buffer.buffer().size() <<", eof=" << eof << endl;
#endif
-#if !APPLE_CHANGES
- if ( !typeChecked )
- {
- formatType = QImageDecoder::formatName( (const uchar*)_buffer.buffer().data(), _buffer.size());
-
- typeChecked = true;
-
- if ( formatType ) // movie format exists
- {
- imgSource = new ImageSource( _buffer.buffer());
- m = new QMovie( imgSource, 8192 );
- m->connectUpdate( this, SLOT( movieUpdated( const QRect &) ));
- m->connectStatus( this, SLOT( movieStatus(int)));
- m->connectResize( this, SLOT( movieResize( const QSize& ) ) );
- }
- }
-
- if ( imgSource )
- {
- imgSource->setEOF(eof);
- imgSource->maybeReady();
- }
-
- if(eof)
- {
- // QMovie currently doesn't support all kinds of image formats
- // so we need to use a QPixmap here when we finished loading the complete
- // picture and display it then all at once.
- if(typeChecked && !formatType)
- {
-#ifdef CACHE_DEBUG
- kdDebug(6060) << "CachedImage::data(): reloading as pixmap:" << endl;
-#endif
- p = new QPixmap( _buffer.buffer() );
- // set size of image.
-#ifdef CACHE_DEBUG
- kdDebug(6060) << "CachedImage::data(): image is null: " << p->isNull() << endl;
-#endif
- if(p->isNull())
- {
- errorOccured = true;
- do_notify(pixmap(), QRect(0, 0, 16, 16)); // load "broken image" icon
- }
- else
- do_notify(*p, p->rect());
- }
-
- QSize s = pixmap_size();
- setSize(s.width() * s.height() * 2);
- }
-#else // APPLE_CHANGES
bool canDraw = false;
m_dataSize = _buffer.size();
@@ -1074,7 +635,6 @@
checkNotify();
}
}
-#endif // APPLE_CHANGES
}
void CachedImage::error( int /*err*/, const char */*text*/ )
@@ -1084,15 +644,10 @@
#endif
clear();
-#if !APPLE_CHANGES
- typeChecked = true;
-#endif
errorOccured = true;
do_notify(pixmap(), QRect(0, 0, 16, 16));
-#if APPLE_CHANGES
m_loading = false;
checkNotify();
-#endif
}
void CachedImage::checkNotify()
@@ -1288,9 +843,7 @@
m_doc = doc;
m_loadInProgress = false;
-#if APPLE_CHANGES
Cache::init();
-#endif
Cache::docloader->append( this );
}
@@ -1341,21 +894,15 @@
KURL fullURL = m_doc->completeURL( url.qstring() );
if ( m_part && m_part->onlyLocalReferences() && fullURL.protocol() != "file") return 0;
-#if APPLE_CHANGES
if (KWQCheckIfReloading(this)) {
setCachePolicy(KIO::CC_Reload);
}
-#endif
bool reload = needReload(fullURL);
-#if APPLE_CHANGES
CachedImage *cachedObject = Cache::requestImage(this, fullURL, reload, m_expireDate);
KWQCheckCacheObjectStatus(this, cachedObject);
return cachedObject;
-#else
- return Cache::requestImage(this, fullURL, reload, m_expireDate);
-#endif
}
CachedCSSStyleSheet *DocLoader::requestStyleSheet( const DOM::DOMString &url, const QString& charset)
@@ -1363,21 +910,15 @@
KURL fullURL = m_doc->completeURL( url.qstring() );
if ( m_part && m_part->onlyLocalReferences() && fullURL.protocol() != "file") return 0;
-#if APPLE_CHANGES
if (KWQCheckIfReloading(this)) {
setCachePolicy(KIO::CC_Reload);
}
-#endif
bool reload = needReload(fullURL);
-#if APPLE_CHANGES
CachedCSSStyleSheet *cachedObject = Cache::requestStyleSheet(this, url, reload, m_expireDate, charset);
KWQCheckCacheObjectStatus(this, cachedObject);
return cachedObject;
-#else
- return Cache::requestStyleSheet(this, url, reload, m_expireDate, charset);
-#endif
}
CachedScript *DocLoader::requestScript( const DOM::DOMString &url, const QString& charset)
@@ -1385,21 +926,15 @@
KURL fullURL = m_doc->completeURL( url.qstring() );
if ( m_part && m_part->onlyLocalReferences() && fullURL.protocol() != "file") return 0;
-#if APPLE_CHANGES
if (KWQCheckIfReloading(this)) {
setCachePolicy(KIO::CC_Reload);
}
-#endif
bool reload = needReload(fullURL);
-#if APPLE_CHANGES
CachedScript *cachedObject = Cache::requestScript(this, url, reload, m_expireDate, charset);
KWQCheckCacheObjectStatus(this, cachedObject);
return cachedObject;
-#else
- return Cache::requestScript(this, url, reload, m_expireDate, charset);
-#endif
}
#ifdef KHTML_XSLT
@@ -1409,20 +944,14 @@
if (m_part && m_part->onlyLocalReferences() && fullURL.protocol() != "file") return 0;
-#if APPLE_CHANGES
if (KWQCheckIfReloading(this))
setCachePolicy(KIO::CC_Reload);
-#endif
bool reload = needReload(fullURL);
-#if APPLE_CHANGES
CachedXSLStyleSheet *cachedObject = Cache::requestXSLStyleSheet(this, url, reload, m_expireDate);
KWQCheckCacheObjectStatus(this, cachedObject);
return cachedObject;
-#else
- return Cache::requestXSLStyleSheet(this, url, reload, m_expireDate);
-#endif
}
#endif
@@ -1434,21 +963,15 @@
// FIXME: Is this right for XBL?
if (m_part && m_part->onlyLocalReferences() && fullURL.protocol() != "file") return 0;
-#if APPLE_CHANGES
if (KWQCheckIfReloading(this)) {
setCachePolicy(KIO::CC_Reload);
}
-#endif
bool reload = needReload(fullURL);
-#if APPLE_CHANGES
CachedXBLDocument *cachedObject = Cache::requestXBLDocument(this, url, reload, m_expireDate);
KWQCheckCacheObjectStatus(this, cachedObject);
return cachedObject;
-#else
- return Cache::requestXBLDocument(this, url, reload, m_expireDate);
-#endif
}
#endif
@@ -1510,16 +1033,12 @@
{
m_requestsPending.setAutoDelete( true );
m_requestsLoading.setAutoDelete( true );
-#if APPLE_CHANGES
kwq = new KWQLoader(this);
-#endif
}
Loader::~Loader()
{
-#if APPLE_CHANGES
delete kwq;
-#endif
}
void Loader::load(DocLoader* dl, CachedObject *object, bool incremental)
@@ -1545,11 +1064,7 @@
#endif
KURL u(req->object->url().qstring());
-#if APPLE_CHANGES
KIO::TransferJob* job = KIO::get( u, false, false /*no GUI*/, true);
-#else
- KIO::TransferJob* job = KIO::get( u, false, false /*no GUI*/);
-#endif
job->addMetaData("cache", getCacheControlString(req->object->cachePolicy()));
if (!req->object->accept().isEmpty())
@@ -1567,13 +1082,8 @@
job->addMetaData("cross-domain", "true");
}
-#if APPLE_CHANGES
connect( job, SIGNAL( result( KIO::Job *, NSData *) ), this, SLOT( slotFinished( KIO::Job *, NSData *) ) );
-#else
- connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotFinished( KIO::Job * ) ) );
-#endif
-#if APPLE_CHANGES
connect( job, SIGNAL( data( KIO::Job*, const char *, int)),
SLOT( slotData( KIO::Job*, const char *, int)));
connect( job, SIGNAL( receivedResponse( KIO::Job *, NSURLResponse *)), SLOT( slotReceivedResponse( KIO::Job *, NSURLResponse *)) );
@@ -1587,52 +1097,8 @@
}
m_requestsLoading.insert(job, req);
}
-#else
- connect( job, SIGNAL( data( KIO::Job*, const QByteArray &)),
- SLOT( slotData( KIO::Job*, const QByteArray &)));
-
- if ( req->object->schedule() )
- KIO::Scheduler::scheduleJob( job );
-
- m_requestsLoading.insert(job, req);
-#endif // APPLE_CHANGES
}
-#if !APPLE_CHANGES
-void Loader::slotFinished( KIO::Job* job)
-{
- Request *r = m_requestsLoading.take( job );
- KIO::TransferJob* j = static_cast<KIO::TransferJob*>(job);
-
- if ( !r )
- return;
-
- if (j->error() || j->isErrorPage())
- {
- kdDebug(6060) << "Loader::slotFinished, with error. job->error()= " << j->error() << " job->isErrorPage()=" << j->isErrorPage() << endl;
- r->object->error( job->error(), job->errorText().ascii() );
- emit requestFailed( r->m_docLoader, r->object );
- }
- else
- {
- r->object->data(r->m_buffer, true);
- emit requestDone( r->m_docLoader, r->object );
- time_t expireDate = j->queryMetaData("expire-date").toLong();
-kdDebug(6060) << "Loader::slotFinished, url = " << j->url().url() << " expires " << ctime(&expireDate) << endl;
- r->object->setExpireDate(expireDate, false);
- }
-
- r->object->finish();
-
-#ifdef CACHE_DEBUG
- kdDebug( 6060 ) << "Loader:: JOB FINISHED " << r->object << ": " << r->object->url().qstring() << endl;
-#endif
-
- delete r;
-
- servePendingRequests();
-}
-#else // APPLE_CHANGES
void Loader::slotFinished( KIO::Job* job, NSData *allData)
{
Request *r = m_requestsLoading.take( job );
@@ -1682,9 +1148,7 @@
servePendingRequests();
}
-#endif
-#if APPLE_CHANGES
void Loader::slotReceivedResponse(KIO::Job* job, NSURLResponse *response)
{
@@ -1712,13 +1176,8 @@
}
}
-#endif
-#if APPLE_CHANGES
void Loader::slotData( KIO::Job*job, const char *data, int size )
-#else
-void Loader::slotData( KIO::Job*job, const QByteArray &data )
-#endif
{
Request *r = m_requestsLoading[job];
if(!r) {
@@ -1729,11 +1188,7 @@
if ( !r->m_buffer.isOpen() )
r->m_buffer.open( IO_WriteOnly );
-#if APPLE_CHANGES
r->m_buffer.writeBlock( data, size );
-#else
- r->m_buffer.writeBlock( data.data(), data.size() );
-#endif
if (r->multipart)
r->object->data( r->m_buffer, true ); // the loader delivers the data in a multipart section all at once, send eof
@@ -1756,12 +1211,10 @@
if (!lIt.current()->multipart)
res++;
-#if APPLE_CHANGES
QPtrListIterator<Request> bdIt( m_requestsBackgroundDecoding );
for (; bdIt.current(); ++bdIt )
if ( bdIt.current()->m_docLoader == dl )
res++;
-#endif
if (dl->loadInProgress())
res++;
@@ -1805,7 +1258,6 @@
++lIt;
}
-#if APPLE_CHANGES
QPtrListIterator<Request> bdIt( m_requestsBackgroundDecoding );
while ( bdIt.current() )
{
@@ -1819,10 +1271,8 @@
else
++bdIt;
}
-#endif
}
-#if APPLE_CHANGES
void Loader::removeBackgroundDecodingRequest (Request *r)
{
bool present = m_requestsBackgroundDecoding.containsRef(r);
@@ -1830,7 +1280,6 @@
m_requestsBackgroundDecoding.remove (r);
}
}
-#endif
KIO::Job *Loader::jobForRequest( const DOM::DOMString &url ) const
{
@@ -1847,14 +1296,12 @@
return 0;
}
-#if APPLE_CHANGES
bool Loader::isKHTMLLoader() const
{
return true;
}
-#endif
// ----------------------------------------------------------------------------
@@ -1894,11 +1341,7 @@
nullPixmap = new QPixmap;
if ( !brokenPixmap )
-#if APPLE_CHANGES
brokenPixmap = KWQLoadPixmap("missing_image");
-#else
- brokenPixmap = new QPixmap(KHTMLFactory::instance()->iconLoader()->loadIcon("file_broken", KIcon::Desktop, 16, KIcon::DisabledState));
-#endif
if ( !m_loader )
m_loader = new Loader();
@@ -1938,23 +1381,11 @@
else
cachePolicy = KIO::CC_Verify;
-#if APPLE_CHANGES
// Checking if the URL is malformed is lots of extra work for little benefit.
-#else
- if( kurl.isMalformed() )
- {
-#ifdef CACHE_DEBUG
- kdDebug( 6060 ) << "Cache: Malformed url: " << kurl.url() << endl;
-#endif
- return 0;
- }
-#endif
-#if APPLE_CHANGES
if (!dl->doc()->shouldCreateRenderers()){
return 0;
}
-#endif
CachedObject *o = 0;
if (!reload)
@@ -1966,22 +1397,15 @@
#endif
CachedImage *im = new CachedImage(dl, url.url(), cachePolicy, _expireDate);
if ( dl && dl->autoloadImages() ) Cache::loader()->load(dl, im, true);
-#if APPLE_CHANGES
if (cacheDisabled)
im->setFree(true);
else {
-#endif
cache->insert( url.url(), im );
moveToHeadOfLRUList(im);
-#if APPLE_CHANGES
}
-#endif
o = im;
}
-#if !APPLE_CHANGES
- o->setExpireDate(_expireDate, true);
-#endif
if(o->type() != CachedObject::Image)
{
@@ -2001,9 +1425,7 @@
moveToHeadOfLRUList(o);
if ( dl ) {
dl->m_docObjects.remove( o );
-#if APPLE_CHANGES
if (!cacheDisabled)
-#endif
dl->m_docObjects.append( o );
}
return static_cast<CachedImage *>(o);
@@ -2025,15 +1447,7 @@
cachePolicy = KIO::CC_Verify;
}
-#if APPLE_CHANGES
// Checking if the URL is malformed is lots of extra work for little benefit.
-#else
- if( kurl.isMalformed() )
- {
- kdDebug( 6060 ) << "Cache: Malformed url: " << kurl.url() << endl;
- return 0;
- }
-#endif
CachedObject *o = cache->find(kurl.url());
if(!o)
@@ -2042,22 +1456,15 @@
kdDebug( 6060 ) << "Cache: new: " << kurl.url() << endl;
#endif
CachedCSSStyleSheet *sheet = new CachedCSSStyleSheet(dl, kurl.url(), cachePolicy, _expireDate, charset);
-#if APPLE_CHANGES
if (cacheDisabled)
sheet->setFree(true);
else {
-#endif
cache->insert( kurl.url(), sheet );
moveToHeadOfLRUList(sheet);
-#if APPLE_CHANGES
}
-#endif
o = sheet;
}
-#if !APPLE_CHANGES
- o->setExpireDate(_expireDate, true);
-#endif
if(o->type() != CachedObject::CSSStyleSheet)
{
@@ -2077,9 +1484,7 @@
moveToHeadOfLRUList(o);
if ( dl ) {
dl->m_docObjects.remove( o );
-#if APPLE_CHANGES
if (!cacheDisabled)
-#endif
dl->m_docObjects.append( o );
}
return static_cast<CachedCSSStyleSheet *>(o);
@@ -2111,15 +1516,7 @@
cachePolicy = KIO::CC_Verify;
}
-#if APPLE_CHANGES
// Checking if the URL is malformed is lots of extra work for little benefit.
-#else
- if( kurl.isMalformed() )
- {
- kdDebug( 6060 ) << "Cache: Malformed url: " << kurl.url() << endl;
- return 0;
- }
-#endif
CachedObject *o = cache->find(kurl.url());
if(!o)
@@ -2128,22 +1525,15 @@
kdDebug( 6060 ) << "Cache: new: " << kurl.url() << endl;
#endif
CachedScript *script = new CachedScript(dl, kurl.url(), cachePolicy, _expireDate, charset);
-#if APPLE_CHANGES
if (cacheDisabled)
script->setFree(true);
else {
-#endif
cache->insert( kurl.url(), script );
moveToHeadOfLRUList(script);
-#if APPLE_CHANGES
}
-#endif
o = script;
}
-#if !APPLE_CHANGES
- o->setExpireDate(_expireDate, true);
-#endif
if(!(o->type() == CachedObject::Script))
{
@@ -2164,9 +1554,7 @@
moveToHeadOfLRUList(o);
if ( dl ) {
dl->m_docObjects.remove( o );
-#if APPLE_CHANGES
if (!cacheDisabled)
-#endif
dl->m_docObjects.append( o );
}
return static_cast<CachedScript *>(o);
@@ -2198,14 +1586,7 @@
cachePolicy = KIO::CC_Verify;
}
-#if APPLE_CHANGES
// Checking if the URL is malformed is lots of extra work for little benefit.
-#else
- if(kurl.isMalformed()) {
- kdDebug( 6060 ) << "Cache: Malformed url: " << kurl.url() << endl;
- return 0;
- }
-#endif
CachedObject *o = cache->find(kurl.url());
if (!o) {
@@ -2213,22 +1594,15 @@
kdDebug( 6060 ) << "Cache: new: " << kurl.url() << endl;
#endif
CachedXSLStyleSheet* doc = new CachedXSLStyleSheet(dl, kurl.url(), cachePolicy, _expireDate);
-#if APPLE_CHANGES
if (cacheDisabled)
doc->setFree(true);
else {
-#endif
cache->insert(kurl.url(), doc);
moveToHeadOfLRUList(doc);
-#if APPLE_CHANGES
}
-#endif
o = doc;
}
-#if !APPLE_CHANGES
- o->setExpireDate(_expireDate, true);
-#endif
if (o->type() != CachedObject::XSLStyleSheet) {
#ifdef CACHE_DEBUG
@@ -2247,9 +1621,7 @@
moveToHeadOfLRUList(o);
if (dl) {
dl->m_docObjects.remove( o );
-#if APPLE_CHANGES
if (!cacheDisabled)
-#endif
dl->m_docObjects.append( o );
}
return static_cast<CachedXSLStyleSheet*>(o);
@@ -2272,15 +1644,7 @@
cachePolicy = KIO::CC_Verify;
}
-#if APPLE_CHANGES
// Checking if the URL is malformed is lots of extra work for little benefit.
-#else
- if( kurl.isMalformed() )
- {
- kdDebug( 6060 ) << "Cache: Malformed url: " << kurl.url() << endl;
- return 0;
- }
-#endif
CachedObject *o = cache->find(kurl.url());
if(!o)
@@ -2289,22 +1653,15 @@
kdDebug( 6060 ) << "Cache: new: " << kurl.url() << endl;
#endif
CachedXBLDocument* doc = new CachedXBLDocument(dl, kurl.url(), cachePolicy, _expireDate);
-#if APPLE_CHANGES
if (cacheDisabled)
doc->setFree(true);
else {
-#endif
cache->insert(kurl.url(), doc);
moveToHeadOfLRUList(doc);
-#if APPLE_CHANGES
}
-#endif
o = doc;
}
-#if !APPLE_CHANGES
- o->setExpireDate(_expireDate, true);
-#endif
if(o->type() != CachedObject::XBL)
{
@@ -2324,9 +1681,7 @@
moveToHeadOfLRUList(o);
if ( dl ) {
dl->m_docObjects.remove( o );
-#if APPLE_CHANGES
if (!cacheDisabled)
-#endif
dl->m_docObjects.append( o );
}
return static_cast<CachedXBLDocument*>(o);
@@ -2365,42 +1720,6 @@
#endif
}
-#if 0
-
-void Cache::checkLRUAndUncacheableListIntegrity()
-{
- int count = 0;
-
- {
- int size = 0;
- CachedObject *prev = 0;
- for (CachedObject *o = m_headOfLRUList; o; o = o->m_nextInLRUList) {
- ASSERT(o->allowInLRUList());
- ASSERT(o->status() != CachedObject::Uncacheable);
- ASSERT(o->m_prevInLRUList == prev);
- size += o->size();
- prev = o;
- ++count;
- }
- ASSERT(m_tailOfLRUList == prev);
- ASSERT(m_totalSizeOfLRUList == size);
- }
-
- {
- CachedObject *prev = 0;
- for (CachedObject *o = m_headOfUncacheableList; o; o = o->m_nextInLRUList) {
- ASSERT(o->allowInLRUList());
- ASSERT(o->status() == CachedObject::Uncacheable);
- ASSERT(o->m_prevInLRUList == prev);
- prev = o;
- ++count;
- }
- }
-
- ASSERT(m_countOfLRUAndUncacheableLists == count);
-}
-
-#endif
void Cache::setSize( int bytes )
{
@@ -2619,7 +1938,6 @@
#include "loader.moc"
-#if APPLE_CHANGES
Cache::Statistics Cache::getStatistics()
{
@@ -2693,4 +2011,3 @@
flushAll();
}
-#endif // APPLE_CHANGES
1.47 +0 -27 WebCore/khtml/misc/loader.h
Index: loader.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/misc/loader.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- loader.h 8 Nov 2005 08:11:09 -0000 1.46
+++ loader.h 21 Nov 2005 01:20:20 -0000 1.47
@@ -68,7 +68,6 @@
class DocumentImpl;
};
-#if APPLE_CHANGES
class KWQLoader;
@@ -80,7 +79,6 @@
class NSURLResponse;
#endif
-#endif
namespace khtml
{
@@ -141,10 +139,8 @@
m_free = false;
m_cachePolicy = _cachePolicy;
m_request = 0;
-#if APPLE_CHANGES
m_response = 0;
m_allData = 0;
-#endif
m_expireDate = _expireDate;
m_deleted = false;
m_expireDateChanged = false;
@@ -197,12 +193,10 @@
void setRequest(Request *_request);
-#if APPLE_CHANGES
NSURLResponse *response() const { return m_response; }
void setResponse(NSURLResponse *response);
NSData *allData() const { return m_allData; }
void setAllData (NSData *data);
-#endif
bool canDelete() const { return (m_clients.count() == 0 && !m_request); }
@@ -227,10 +221,8 @@
DOM::DOMString m_url;
QString m_accept;
Request *m_request;
-#if APPLE_CHANGES
NSURLResponse *m_response;
NSData *m_allData;
-#endif
Type m_type;
Status m_status;
private:
@@ -312,7 +304,6 @@
class ImageSource;
-#if APPLE_CHANGES
class CachedImage;
class CachedImageCallback
@@ -334,7 +325,6 @@
uint refCount;
bool headerReceived;
};
-#endif
/**
* a cached image
@@ -404,7 +394,6 @@
friend class Cache;
-#if APPLE_CHANGES
public:
int dataSize() const { return m_dataSize; }
CachedImageCallback *decoderCallback() const { return m_decoderCallback; }
@@ -413,7 +402,6 @@
int m_dataSize;
CachedImageCallback *m_decoderCallback;
-#endif
};
#ifdef KHTML_XSLT
@@ -553,16 +541,12 @@
int numRequests( DocLoader* dl ) const;
void cancelRequests( DocLoader* dl );
-#if APPLE_CHANGES
void removeBackgroundDecodingRequest (Request *r);
-#endif
// may return 0L
KIO::Job *jobForRequest( const DOM::DOMString &url ) const;
-#if APPLE_CHANGES
KWQLoader *kwq;
-#endif
signals:
friend class CachedImageCallback;
@@ -572,28 +556,19 @@
void requestFailed( khtml::DocLoader* dl, khtml::CachedObject *obj );
protected slots:
-#if APPLE_CHANGES
void slotFinished( KIO::Job * , NSData *allData);
void slotData( KIO::Job *, const char *data, int size );
void slotReceivedResponse ( KIO::Job *, NSURLResponse *response );
-#else
- void slotFinished( KIO::Job * );
- void slotData( KIO::Job *, const QByteArray & );
-#endif
private:
void servePendingRequests();
-#if APPLE_CHANGES
virtual bool isKHTMLLoader() const;
-#endif
QPtrList<Request> m_requestsPending;
QPtrDict<Request> m_requestsLoading;
-#if APPLE_CHANGES
QPtrList<Request> m_requestsBackgroundDecoding;
-#endif
#ifdef HAVE_LIBJPEG
KJPEGFormatType m_jpegloader;
@@ -694,7 +669,6 @@
static void removeCacheEntry( CachedObject *object );
-#if APPLE_CHANGES
struct TypeStatistic {
int count;
int size;
@@ -718,7 +692,6 @@
static Statistics getStatistics();
static void flushAll();
static void setCacheDisabled(bool);
-#endif
static void insertInLRUList(CachedObject *);
static void removeFromLRUList(CachedObject *);
1.8 +0 -4 WebCore/khtml/misc/stringit.h
Index: stringit.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/misc/stringit.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- stringit.h 20 Jul 2004 08:12:08 -0000 1.7
+++ stringit.h 21 Nov 2005 01:20:20 -0000 1.8
@@ -44,11 +44,7 @@
TokenizerSubstring() : m_length(0), m_current(0) {}
TokenizerSubstring(const QString &str) : m_string(str), m_length(str.length()) {
-#if APPLE_CHANGES
m_current = m_length == 0 ? 0 : m_string.stableUnicode();
-#else
- m_current = m_length == 0 ? 0 : m_string.unicode();
-#endif
}
1.36 +0 -68 WebCore/khtml/rendering/render_applet.cpp
Index: render_applet.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_applet.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- render_applet.cpp 25 Aug 2005 23:13:53 -0000 1.35
+++ render_applet.cpp 21 Nov 2005 01:20:22 -0000 1.36
@@ -54,16 +54,8 @@
context = part->createJavaContext();
}
-#if APPLE_CHANGES
m_context = context;
m_args = args;
-#else
- if ( context ) {
- //kdDebug(6100) << "RenderApplet::RenderApplet, setting QWidget" << endl;
- setQWidget( new KJavaAppletWidget(context, _view->viewport()) );
- processArguments(args);
- }
-#endif
}
RenderApplet::~RenderApplet()
@@ -126,58 +118,12 @@
calcHeight();
KJavaAppletWidget *tmp = static_cast<KJavaAppletWidget*>(m_widget);
-#if APPLE_CHANGES
// The applet's QWidget gets created lazily upon first layout.
if (!tmp)
createWidgetIfNecessary();
-#else
- if ( tmp ) {
- NodeImpl *child = element()->firstChild();
-
- while(child) {
-
- if(child->id() == ID_PARAM) {
- HTMLParamElementImpl *p = static_cast<HTMLParamElementImpl *>(child);
- if(tmp->applet())
- tmp->applet()->setParameter( p->name(), p->value());
- }
- child = child->nextSibling();
- }
- //kdDebug(6100) << "setting applet widget to size: " << m_width << ", " << m_height << endl;
- m_widget->resize(m_width - borderLeft() - borderRight() - paddingLeft() - paddingRight(),
- m_height - borderTop() - borderBottom() - paddingTop() - paddingBottom());
- tmp->showApplet();
- }
-#endif
setNeedsLayout(false);
}
-#if !APPLE_CHANGES
-void RenderApplet::processArguments(const QMap<QString, QString> &args)
-{
- KJavaAppletWidget *w = static_cast<KJavaAppletWidget*>(m_widget);
- KJavaApplet* applet = w ? w->applet() : 0;
-
- if ( applet ) {
- applet->setBaseURL( args[QString::fromLatin1("baseURL") ] );
- applet->setAppletClass( args[QString::fromLatin1("code") ] );
-
- QString str = args[QString::fromLatin1("codeBase") ];
- if( !str.isEmpty() )
- applet->setCodeBase( str );
-
- str = args[QString::fromLatin1("name") ];
- if( !str.isNull() )
- applet->setAppletName( str );
- else
- applet->setAppletName( args[QString::fromLatin1("code") ] );
-
- str = args[QString::fromLatin1("archive") ];
- if( !str.isEmpty() )
- applet->setArchives( args[QString::fromLatin1("archive") ] );
- }
-}
-#endif
RenderEmptyApplet::RenderEmptyApplet(DOM::NodeImpl* node)
: RenderWidget(node)
@@ -185,13 +131,7 @@
// init RenderObject attributes
setInline(true);
-#if APPLE_CHANGES
// FIXME: Figure out how to handle this.
-#else
- QLabel* label = new QLabel(i18n("Java Applet is not loaded. (Java interpreter disabled)"), node->getDocument()->view()->viewport());
- label->setAlignment( Qt::AlignCenter | Qt::WordBreak );
- setQWidget(label);
-#endif
}
int RenderEmptyApplet::intrinsicWidth() const
@@ -213,14 +153,6 @@
calcHeight();
// updateWidgetPositions will size the widget, so we don't need to do that here.
-#if !APPLE_CHANGES
- if(m_widget)
- {
- //kdDebug(6100) << "RenderEmptyApplet::layout, m_width = " << m_width << ", m_height = " << m_height << endl;
- m_widget->resize(m_width-borderLeft()-borderRight()-paddingLeft()-paddingRight(),
- m_height-borderTop()-borderBottom()-paddingTop()-paddingBottom());
- }
-#endif
setNeedsLayout(false);
}
1.8 +0 -6 WebCore/khtml/rendering/render_applet.h
Index: render_applet.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_applet.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- render_applet.h 26 Feb 2004 23:10:44 -0000 1.7
+++ render_applet.h 21 Nov 2005 01:20:22 -0000 1.8
@@ -44,9 +44,7 @@
virtual const char *renderName() const { return "RenderApplet"; }
-#if APPLE_CHANGES
void createWidgetIfNecessary();
-#endif
virtual void layout();
virtual int intrinsicWidth() const;
@@ -57,12 +55,8 @@
{ return static_cast<DOM::HTMLElementImpl*>(RenderObject::element()); }
private:
-#if APPLE_CHANGES
KJavaAppletContext *m_context;
QMap<QString, QString> m_args;
-#else
- void processArguments( const QMap<QString, QString> &args );
-#endif
};
class RenderEmptyApplet : public RenderWidget
1.35 +0 -4 WebCore/khtml/rendering/render_canvas.cpp
Index: render_canvas.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_canvas.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- render_canvas.cpp 19 Oct 2005 09:15:13 -0000 1.34
+++ render_canvas.cpp 21 Nov 2005 01:20:22 -0000 1.35
@@ -27,9 +27,7 @@
#include "khtmlview.h"
#include <kdebug.h>
-#if APPLE_CHANGES
#include "khtml_part.h"
-#endif
using namespace khtml;
@@ -623,7 +621,6 @@
return w;
}
-#if APPLE_CHANGES
// 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 RenderCanvas::setBestTruncatedAt(int y, RenderObject *forRenderer, bool forcedBreak)
@@ -645,4 +642,3 @@
m_bestTruncatedAt = y;
}
}
-#endif
1.13 +0 -4 WebCore/khtml/rendering/render_canvas.h
Index: render_canvas.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_canvas.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- render_canvas.h 19 Oct 2005 09:15:14 -0000 1.12
+++ render_canvas.h 21 Nov 2005 01:20:23 -0000 1.13
@@ -69,7 +69,6 @@
bool printingMode() const { return m_printingMode; }
void setPrintImages(bool enable) { m_printImages = enable; }
bool printImages() const { return m_printImages; }
-#if APPLE_CHANGES
void setTruncatedAt(int y) { m_truncatedAt = y; m_bestTruncatedAt = m_truncatorWidth = 0; m_forcedPageBreak = false; }
void setBestTruncatedAt(int y, RenderObject *forRenderer, bool forcedBreak = false);
int bestTruncatedAt() const { return m_bestTruncatedAt; }
@@ -78,9 +77,6 @@
int m_truncatorWidth;
bool m_forcedPageBreak;
public:
-#else
- void setTruncatedAt(int y) { m_truncatedAt = y; }
-#endif
int truncatedAt() const { return m_truncatedAt; }
virtual void setWidth( int width ) { m_rootWidth = m_width = width; }
1.78 +0 -10 WebCore/khtml/rendering/render_container.cpp
Index: render_container.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_container.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- render_container.cpp 24 Oct 2005 22:33:54 -0000 1.77
+++ render_container.cpp 21 Nov 2005 01:20:23 -0000 1.78
@@ -37,10 +37,8 @@
#include <kdebug.h>
#include <assert.h>
-#if APPLE_CHANGES
// For accessibility
#include "KWQAccObjectCache.h"
-#endif
using DOM::Position;
using namespace khtml;
@@ -120,14 +118,12 @@
//kdDebug( 6040 ) << "adding cell" << endl;
if ( !isTableRow() )
needsTable = true;
-#if APPLE_CHANGES
// I'm not 100% sure this is the best way to fix this, but without this
// change we recurse infinitely when trying to render the CSS2 test page:
// http://www.bath.ac.uk/%7Epy8ieh/internet/eviltests/htmlbodyheadrendering2.html.
// See Radar 2925291.
if ( isTableCell() && !firstChild() && !newChild->isTableCell() )
needsTable = false;
-#endif
break;
case NONE:
kdDebug( 6000 ) << "error in RenderObject::addChild()!!!!" << endl;
@@ -199,10 +195,8 @@
oldChild->setNextSibling(0);
oldChild->setParent(0);
-#if APPLE_CHANGES
if (KWQAccObjectCache::accessibilityEnabled())
document()->getAccObjectCache()->childrenChanged(this);
-#endif
return oldChild;
}
@@ -354,10 +348,8 @@
if (!newChild->isFloatingOrPositioned() && childrenInline())
dirtyLinesFromChangedChild(newChild);
-#if APPLE_CHANGES
if (KWQAccObjectCache::accessibilityEnabled())
document()->getAccObjectCache()->childrenChanged(this);
-#endif
}
void RenderContainer::insertChildNode(RenderObject* child, RenderObject* beforeChild)
@@ -394,10 +386,8 @@
if (!child->isFloatingOrPositioned() && childrenInline())
dirtyLinesFromChangedChild(child);
-#if APPLE_CHANGES
if (KWQAccObjectCache::accessibilityEnabled())
document()->getAccObjectCache()->childrenChanged(this);
-#endif
}
void RenderContainer::layout()
1.30 +0 -2 WebCore/khtml/rendering/render_flexbox.cpp
Index: render_flexbox.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_flexbox.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- render_flexbox.cpp 26 Oct 2005 06:08:03 -0000 1.29
+++ render_flexbox.cpp 21 Nov 2005 01:20:23 -0000 1.30
@@ -690,7 +690,6 @@
child = iterator.next();
}
-#if APPLE_CHANGES
// We confine the line clamp ugliness to vertical flexible boxes (thus keeping it out of
// mainstream block layout) and put it all inside APPLE_CHANGES to denote that this is not
// really part of the XUL box model.
@@ -781,7 +780,6 @@
}
}
}
-#endif
// We do 2 passes. The first pass is simply to lay everyone out at
// their preferred widths. The second pass handles flexing the children.
1.174 +0 -4 WebCore/khtml/rendering/render_flow.cpp
Index: render_flow.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_flow.cpp,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -r1.173 -r1.174
--- render_flow.cpp 24 Oct 2005 22:33:54 -0000 1.173
+++ render_flow.cpp 21 Nov 2005 01:20:23 -0000 1.174
@@ -412,11 +412,9 @@
// This means the paint order of outlines will be wrong, although this is a minor issue.
QPtrDictIterator<RenderFlow> objects(*i.outlineObjects);
for (objects.toFirst(); objects.current(); ++objects) {
-#ifdef APPLE_CHANGES
if (objects.current()->style()->outlineStyleIsAuto())
objects.current()->paintFocusRing(i.p, _tx, _ty);
else
-#endif
objects.current()->paintOutlines(i.p, _tx, _ty);
}
i.outlineObjects->clear();
@@ -658,7 +656,6 @@
return QRect(_x, _y, width, height);
}
-#if APPLE_CHANGES
void RenderFlow::addFocusRingRects(QPainter *p, int _tx, int _ty)
{
// Only paint focus ring around outermost contenteditable element.
@@ -699,7 +696,6 @@
p->drawFocusRing();
p->clearFocusRing();
}
-#endif
void RenderFlow::paintOutlines(QPainter *p, int _tx, int _ty)
{
1.63 +0 -2 WebCore/khtml/rendering/render_flow.h
Index: render_flow.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_flow.h,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- render_flow.h 6 Oct 2005 00:53:57 -0000 1.62
+++ render_flow.h 21 Nov 2005 01:20:24 -0000 1.63
@@ -83,10 +83,8 @@
virtual QRect caretRect(int offset, EAffinity affinity = UPSTREAM, int *extraWidthToEndOfLine = 0);
-#ifdef APPLE_CHANGES
virtual void addFocusRingRects(QPainter *painter, int _tx, int _ty);
void paintFocusRing(QPainter *p, int tx, int ty);
-#endif
void paintOutlineForLine(QPainter *p, int tx, int ty, const QRect &prevLine, const QRect &thisLine, const QRect &nextLine);
void paintOutlines(QPainter *p, int tx, int ty);
1.132 +0 -413 WebCore/khtml/rendering/render_form.cpp
Index: render_form.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_form.cpp,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -r1.131 -r1.132
--- render_form.cpp 11 Nov 2005 17:44:27 -0000 1.131
+++ render_form.cpp 21 Nov 2005 01:20:24 -0000 1.132
@@ -46,10 +46,8 @@
#include <kdebug.h>
-#if APPLE_CHANGES
#include "KWQFileButton.h"
#include "KWQSlider.h"
-#endif
using namespace khtml;
using namespace DOM;
@@ -68,26 +66,18 @@
short RenderFormElement::baselinePosition( bool f, bool isRootLineBox ) const
{
-#if APPLE_CHANGES
return marginTop() + widget()->baselinePosition(m_height);
-#else
- return RenderWidget::baselinePosition( f, isRootLineBox ) - 2 - style()->fontMetrics().descent();
-#endif
}
void RenderFormElement::setStyle(RenderStyle* s)
{
-#if APPLE_CHANGES
if (canHaveIntrinsicMargins())
addIntrinsicMarginsIfAllowed(s);
-#endif
RenderWidget::setStyle(s);
-#if APPLE_CHANGES
// Do not paint a background or border for Aqua form elements
setShouldPaintBackgroundOrBorder(false);
-#endif
m_widget->setFont(style()->font());
}
@@ -96,71 +86,7 @@
{
m_widget->setEnabled(!element()->disabled());
-#if APPLE_CHANGES
m_widget->setPalette(QPalette(style()->backgroundColor(), style()->color()));
-#else
- QColor color = style()->color();
- QColor backgroundColor = style()->backgroundColor();
-
- if ( color.isValid() || backgroundColor.isValid() ) {
- QPalette pal(m_widget->palette());
-
- int contrast_ = KGlobalSettings::contrast();
- int highlightVal = 100 + (2*contrast_+4)*16/10;
- int lowlightVal = 100 + (2*contrast_+4)*10;
-
- if (backgroundColor.isValid()) {
- for ( int i = 0; i < QPalette::NColorGroups; i++ ) {
- pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Background, backgroundColor );
- pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Light, backgroundColor.light(highlightVal) );
- pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Dark, backgroundColor.dark(lowlightVal) );
- pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Mid, backgroundColor.dark(120) );
- pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Midlight, backgroundColor.light(110) );
- pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Button, backgroundColor );
- pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Base, backgroundColor );
- }
- }
- if ( color.isValid() ) {
- struct ColorSet {
- QPalette::ColorGroup cg;
- QColorGroup::ColorRole cr;
- };
- const struct ColorSet toSet [] = {
- { QPalette::Active, QColorGroup::Foreground },
- { QPalette::Active, QColorGroup::ButtonText },
- { QPalette::Active, QColorGroup::Text },
- { QPalette::Inactive, QColorGroup::Foreground },
- { QPalette::Inactive, QColorGroup::ButtonText },
- { QPalette::Inactive, QColorGroup::Text },
- { QPalette::Disabled,QColorGroup::ButtonText },
- { QPalette::NColorGroups, QColorGroup::NColorRoles },
- };
- const ColorSet *set = toSet;
- while( set->cg != QPalette::NColorGroups ) {
- pal.setColor( set->cg, set->cr, color );
- ++set;
- }
-
- QColor disfg = color;
- int h, s, v;
- disfg.hsv( &h, &s, &v );
- if (v > 128)
- // dark bg, light fg - need a darker disabled fg
- disfg = disfg.dark(lowlightVal);
- else if (disfg != Qt::black)
- // light bg, dark fg - need a lighter disabled fg - but only if !black
- disfg = disfg.light(highlightVal);
- else
- // black fg - use darkgrey disabled fg
- disfg = Qt::darkGray;
- pal.setColor(QPalette::Disabled,QColorGroup::Foreground,disfg);
- }
-
- m_widget->setPalette(pal);
- }
- else
- m_widget->unsetPalette();
-#endif
}
void RenderFormElement::layout()
@@ -174,12 +100,6 @@
calcWidth();
calcHeight();
-#if !APPLE_CHANGES
- if ( m_widget )
- resizeWidget(m_widget,
- m_width-borderLeft()-borderRight()-paddingLeft()-paddingRight(),
- m_height-borderLeft()-borderRight()-paddingLeft()-paddingRight());
-#endif
setNeedsLayout(false);
}
@@ -217,7 +137,6 @@
return AlignLeft;
}
-#if APPLE_CHANGES
void RenderFormElement::addIntrinsicMarginsIfAllowed(RenderStyle* _style)
{
@@ -252,7 +171,6 @@
// do nothing
}
-#endif
// -------------------------------------------------------------------------------
@@ -264,43 +182,12 @@
// -------------------------------------------------------------------------------
-#if !APPLE_CHANGES
-
-LineEditWidget::LineEditWidget(QWidget *parent)
- : KLineEdit(parent)
-{
- setMouseTracking(true);
-}
-
-bool LineEditWidget::event( QEvent *e )
-{
- if ( e->type() == QEvent::AccelAvailable && isReadOnly() ) {
- QKeyEvent* ke = (QKeyEvent*) e;
- if ( ke->state() & ControlButton ) {
- switch ( ke->key() ) {
- case Key_Left:
- case Key_Right:
- case Key_Up:
- case Key_Down:
- case Key_Home:
- case Key_End:
- ke->accept();
- default:
- break;
- }
- }
- }
- return KLineEdit::event( e );
-}
-
-#endif
// -----------------------------------------------------------------------------
RenderLineEdit::RenderLineEdit(HTMLInputElementImpl *element)
: RenderFormElement(element), m_updating(false)
{
-#if APPLE_CHANGES
QLineEdit::Type type;
switch (element->inputType()) {
case HTMLInputElementImpl::PASSWORD:
@@ -315,30 +202,13 @@
KLineEdit *edit = new KLineEdit(type);
if (type == QLineEdit::Search)
edit->setLiveSearch(false);
-#else
- LineEditWidget *edit = new LineEditWidget(view()->viewport());
-#endif
connect(edit,SIGNAL(returnPressed()), this, SLOT(slotReturnPressed()));
connect(edit, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));
connect(edit,SIGNAL(textChanged(const QString &)),this,SLOT(slotTextChanged(const QString &)));
connect(edit,SIGNAL(clicked()),this,SLOT(slotClicked()));
-#if APPLE_CHANGES
connect(edit,SIGNAL(performSearch()), this, SLOT(slotPerformSearch()));
-#endif
-#if !APPLE_CHANGES
- if(element->inputType() == HTMLInputElementImpl::PASSWORD)
- edit->setEchoMode( QLineEdit::Password );
-
- if ( element->autoComplete() ) {
- QStringList completions = view()->formCompletionItems(element->name().qstring());
- if (completions.count()) {
- edit->completionObject()->setItems(completions);
- edit->setContextMenuEnabled(true);
- }
- }
-#endif
setQWidget(edit);
}
@@ -356,12 +226,6 @@
void RenderLineEdit::slotReturnPressed()
{
-#if !APPLE_CHANGES
- // don't submit the form when return was pressed in a completion-popup
- KCompletionBox *box = widget()->completionBox(false);
- if ( box && box->isVisible() && box->currentItem() != -1 )
- return;
-#endif
// Emit onChange if necessary
// Works but might not be enough, dirk said he had another solution at
@@ -373,7 +237,6 @@
fe->submitClick();
}
-#if APPLE_CHANGES
void RenderLineEdit::slotPerformSearch()
{
// Fire the "search" DOM event.
@@ -385,7 +248,6 @@
if (widget())
widget()->addSearchResult();
}
-#endif
void RenderLineEdit::handleFocusOut()
{
@@ -399,24 +261,11 @@
{
KHTMLAssert( !minMaxKnown() );
-#if APPLE_CHANGES
// Let the widget tell us how big it wants to be.
m_updating = true;
int size = element()->size();
QSize s(widget()->sizeForCharacterWidth(size > 0 ? size : 20));
m_updating = false;
-#else
- const QFontMetrics &fm = style()->fontMetrics();
- QSize s;
-
- int size = element()->size();
-
- int h = fm.lineSpacing();
- int w = fm.width( 'x' ) * (size > 0 ? size : 17); // "some"
- s = QSize(w + 2 + 2*widget()->frameWidth(),
- kMax(h, 14) + 2 + 2*widget()->frameWidth())
- .expandedTo(QApplication::globalStrut());
-#endif
setIntrinsicWidth( s.width() );
setIntrinsicHeight( s.height() );
@@ -437,9 +286,7 @@
KLineEdit *w = widget();
w->setAlignment(textAlignment());
-#if APPLE_CHANGES
w->setWritingDirection(style()->direction() == RTL ? QPainter::RTL : QPainter::LTR);
-#endif
}
void RenderLineEdit::updateFromElement()
@@ -475,7 +322,6 @@
w->setReadOnly(e->readOnly());
-#if APPLE_CHANGES
// Handle updating the search attributes.
w->setPlaceholderString(e->getAttribute(placeholderAttr).qstring());
if (w->type() == QLineEdit::Search) {
@@ -483,7 +329,6 @@
w->setAutoSaveName(e->getAttribute(autosaveAttr).qstring());
w->setMaxResults(e->maxResults());
}
-#endif
RenderFormElement::updateFromElement();
}
@@ -695,50 +540,19 @@
RenderFileButton::RenderFileButton(HTMLInputElementImpl *element)
: RenderFormElement(element)
{
-#if APPLE_CHANGES
KWQFileButton *w = new KWQFileButton(view()->part());
connect(w, SIGNAL(textChanged(const QString &)),this,SLOT(slotTextChanged(const QString &)));
connect(w, SIGNAL(clicked()), this, SLOT(slotClicked()));
setQWidget(w);
-#else
- QHBox *w = new QHBox(view()->viewport());
-
- m_edit = new LineEditWidget(w);
-
- connect(m_edit, SIGNAL(returnPressed()), this, SLOT(slotReturnPressed()));
- connect(m_edit, SIGNAL(textChanged(const QString &)),this,SLOT(slotTextChanged(const QString &)));
-
- m_button = new QPushButton(i18n("Browse..."), w);
- m_button->setFocusPolicy(QWidget::ClickFocus);
- connect(m_button,SIGNAL(clicked()), this, SLOT(slotClicked()));
-
- w->setStretchFactor(m_edit, 2);
- w->setFocusProxy(m_edit);
-
- setQWidget(w);
-#endif
}
void RenderFileButton::calcMinMaxWidth()
{
KHTMLAssert( !minMaxKnown() );
-#if APPLE_CHANGES
// Let the widget tell us how big it wants to be.
int size = element()->size();
QSize s(static_cast<KWQFileButton *>(widget())->sizeForCharacterWidth(size > 0 ? size : 20));
-#else
- const QFontMetrics &fm = style()->fontMetrics();
- QSize s;
- int size = element()->size();
-
- int h = fm.lineSpacing();
- int w = fm.width( 'x' ) * (size > 0 ? size : 17); // "some"
- w += 6 + fm.width( m_button->text() ) + 2*fm.width( ' ' );
- s = QSize(w + 2 + 2*m_edit->frameWidth(),
- kMax(h, 14) + 2 + 2*m_edit->frameWidth())
- .expandedTo(QApplication::globalStrut());
-#endif
setIntrinsicWidth( s.width() );
setIntrinsicHeight( s.height() );
@@ -746,45 +560,15 @@
RenderFormElement::calcMinMaxWidth();
}
-#if !APPLE_CHANGES
-
-void RenderFileButton::handleFocusOut()
-{
- if ( m_edit && m_edit->edited() ) {
- element()->onChange();
- m_edit->setEdited( false );
- }
-}
-
-#endif
void RenderFileButton::slotClicked()
{
-#if APPLE_CHANGES
RenderFormElement::slotClicked();
-#else
- QString file_name = KFileDialog::getOpenFileName(QString::null, QString::null, 0, i18n("Browse..."));
- if (!file_name.isNull()) {
- element()->m_value = DOMString(file_name);
- m_edit->setText(file_name);
- }
-#endif
}
void RenderFileButton::updateFromElement()
{
-#if APPLE_CHANGES
static_cast<KWQFileButton *>(widget())->setFilename(element()->value().qstring());
-#else
- m_edit->blockSignals(true);
- m_edit->setText(element()->value().qstring());
- m_edit->blockSignals(false);
- int ml = element()->maxLength();
- if ( ml <= 0 || ml > 1024 )
- ml = 1024;
- m_edit->setMaxLength( ml );
- m_edit->setEdited( false );
-#endif
RenderFormElement::updateFromElement();
}
@@ -803,19 +587,14 @@
void RenderFileButton::select()
{
-#if !APPLE_CHANGES
- m_edit->selectAll();
-#endif
}
-#if APPLE_CHANGES
void RenderFileButton::click(bool sendMouseEvents)
{
static_cast<KWQFileButton *>(widget())->click(sendMouseEvents);
}
-#endif
// -------------------------------------------------------------------------
@@ -844,49 +623,11 @@
bool ComboBoxWidget::event(QEvent *e)
{
-#if !APPLE_CHANGES
- if (e->type()==QEvent::KeyPress)
- {
- QKeyEvent *ke = static_cast<QKeyEvent *>(e);
- switch(ke->key())
- {
- case Key_Return:
- case Key_Enter:
- popup();
- ke->accept();
- return true;
- default:
- return KComboBox::event(e);
- }
- }
-#endif
return KComboBox::event(e);
}
bool ComboBoxWidget::eventFilter(QObject *dest, QEvent *e)
{
-#if !APPLE_CHANGES
- if (dest==listBox() && e->type()==QEvent::KeyPress)
- {
- QKeyEvent *ke = static_cast<QKeyEvent *>(e);
- bool forward = false;
- switch(ke->key())
- {
- case Key_Tab:
- forward=true;
- case Key_BackTab:
- // ugly hack. emulate popdownlistbox() (private in QComboBox)
- // we re-use ke here to store the reference to the generated event.
- ke = new QKeyEvent(QEvent::KeyPress, Key_Escape, 0, 0);
- QApplication::sendEvent(dest,ke);
- focusNextPrevChild(forward);
- delete ke;
- return true;
- default:
- return KComboBox::eventFilter(dest, e);
- }
- }
-#endif
return KComboBox::eventFilter(dest, e);
}
@@ -908,7 +649,6 @@
setQWidget(createComboBox());
}
-#if APPLE_CHANGES
void RenderSelect::setWidgetWritingDirection()
{
@@ -925,7 +665,6 @@
setWidgetWritingDirection();
}
-#endif
void RenderSelect::updateFromElement()
{
@@ -949,9 +688,7 @@
setQWidget(createListBox());
else
setQWidget(createComboBox());
-#if APPLE_CHANGES
setWidgetWritingDirection();
-#endif
}
if (m_useListBox && oldMultiple != m_multiple) {
@@ -984,21 +721,10 @@
// We want to collapse our whitespace too. This will match other browsers.
label = label.simplifyWhiteSpace();
-#if APPLE_CHANGES
if (m_useListBox)
static_cast<KListBox*>(m_widget)->appendGroupLabel(label);
else
static_cast<KComboBox*>(m_widget)->appendGroupLabel(label);
-#else
- if(m_useListBox) {
- QListBoxText *item = new QListBoxText(label);
- static_cast<KListBox*>(m_widget)
- ->insertItem(item, listIndex);
- item->setSelectable(false);
- }
- else
- static_cast<KComboBox*>(m_widget)->insertItem(label, listIndex);
-#endif
}
else if (listItems[listIndex]->hasTagName(optionTag)) {
QString itemText = static_cast<HTMLOptionElementImpl*>(listItems[listIndex])->text().qstring();
@@ -1012,17 +738,10 @@
if (listItems[listIndex]->parentNode()->hasTagName(optgroupTag))
itemText.prepend(" ");
-#if APPLE_CHANGES
if (m_useListBox)
static_cast<KListBox*>(m_widget)->appendItem(itemText);
else
static_cast<KComboBox*>(m_widget)->appendItem(itemText);
-#else
- if(m_useListBox)
- static_cast<KListBox*>(m_widget)->insertItem(itemText, listIndex);
- else
- static_cast<KComboBox*>(m_widget)->insertItem(itemText, listIndex);
-#endif
}
else if (listItems[listIndex]->hasTagName(hrTag)) {
if (!m_useListBox) {
@@ -1033,10 +752,8 @@
KHTMLAssert(false);
m_selectionChanged = true;
}
-#if APPLE_CHANGES
if (m_useListBox)
static_cast<KListBox*>(m_widget)->doneAppendingItems();
-#endif
setNeedsLayoutAndMinMaxRecalc();
m_optionsChanged = false;
}
@@ -1051,7 +768,6 @@
RenderFormElement::updateFromElement();
}
-#if APPLE_CHANGES
short RenderSelect::baselinePosition( bool f, bool isRootLineBox ) const
{
@@ -1063,7 +779,6 @@
return RenderFormElement::baselinePosition( f, isRootLineBox );
}
-#endif
void RenderSelect::calcMinMaxWidth()
{
@@ -1094,16 +809,6 @@
if(m_useListBox) {
KListBox* w = static_cast<KListBox*>(m_widget);
-#if !APPLE_CHANGES
- QListBoxItem* p = w->firstItem();
- int width = 0;
- int height = 0;
- while(p) {
- width = kMax(width, p->width(p->listBox()));
- height = kMax(height, p->height(p->listBox()));
- p = p->next();
- }
-#endif
int size = m_size;
// check if multiple and size was not given or invalid
@@ -1114,18 +819,10 @@
if(size < 1)
size = kMin(static_cast<KListBox*>(m_widget)->count(), 10U);
-#if APPLE_CHANGES
// Let the widget tell us how big it wants to be.
QSize s(w->sizeForNumberOfLines(size));
setIntrinsicWidth( s.width() );
setIntrinsicHeight( s.height() );
-#else
- width += 2*w->frameWidth() + w->verticalScrollBar()->sizeHint().width();
- height = size*height + 2*w->frameWidth();
-
- setIntrinsicWidth( width );
- setIntrinsicHeight( height );
-#endif
}
else {
QSize s(m_widget->sizeHint());
@@ -1280,58 +977,19 @@
// -------------------------------------------------------------------------
-#if !APPLE_CHANGES
-
-TextAreaWidget::TextAreaWidget(QWidget* parent)
- : KTextEdit(parent)
-{
-}
-
-bool TextAreaWidget::event( QEvent *e )
-{
- if ( e->type() == QEvent::AccelAvailable && isReadOnly() ) {
- QKeyEvent* ke = (QKeyEvent*) e;
- if ( ke->state() & ControlButton ) {
- switch ( ke->key() ) {
- case Key_Left:
- case Key_Right:
- case Key_Up:
- case Key_Down:
- case Key_Home:
- case Key_End:
- ke->accept();
- default:
- break;
- }
- }
- }
- return KTextEdit::event( e );
-}
-
-#endif
// -------------------------------------------------------------------------
RenderTextArea::RenderTextArea(HTMLTextAreaElementImpl *element)
: RenderFormElement(element), m_dirty(false)
{
-#if APPLE_CHANGES
QTextEdit *edit = new KTextEdit(view());
-#else
- QTextEdit *edit = new TextAreaWidget(view());
-#endif
if (element->wrap() != HTMLTextAreaElementImpl::ta_NoWrap)
edit->setWordWrap(QTextEdit::WidgetWidth);
else
edit->setWordWrap(QTextEdit::NoWrap);
-#if !APPLE_CHANGES
- KCursor::setAutoHideCursor(edit->viewport(), true);
- edit->setTextFormat(QTextEdit::PlainText);
- edit->setAutoMask(true);
- edit->setMouseTracking(true);
-#endif
setQWidget(edit);
@@ -1360,18 +1018,7 @@
KHTMLAssert( !minMaxKnown() );
QTextEdit* w = static_cast<QTextEdit*>(m_widget);
-#if APPLE_CHANGES
QSize size(w->sizeWithColumnsAndRows(kMax(element()->cols(), 1), kMax(element()->rows(), 1)));
-#else
- const QFontMetrics &m = style()->fontMetrics();
- w->setTabStopWidth(8 * m.width(" "));
- QSize size( kMax(element()->cols(), 1)*m.width('x') + w->frameWidth() +
- w->verticalScrollBar()->sizeHint().width(),
- kMax(element()->rows(), 1)*m.height() + w->frameWidth()*2 +
- (w->wordWrap() == QTextEdit::NoWrap ?
- w->horizontalScrollBar()->sizeHint().height() : 0)
- );
-#endif
setIntrinsicWidth( size.width() );
setIntrinsicHeight( size.height() );
@@ -1394,9 +1041,7 @@
w->setAlignment(textAlignment());
w->setLineHeight(RenderObject::lineHeight(true));
-#if APPLE_CHANGES
w->setWritingDirection(style()->direction() == RTL ? QPainter::RTL : QPainter::LTR);
-#endif
QScrollView::ScrollBarMode scrollMode = QScrollView::Auto;
switch (style()->overflow()) {
@@ -1416,12 +1061,7 @@
if (element()->wrap() != HTMLTextAreaElementImpl::ta_NoWrap)
horizontalScrollMode = QScrollView::AlwaysOff;
-#if APPLE_CHANGES
w->setScrollBarModes(horizontalScrollMode, scrollMode);
-#else
- w->setHScrollBarMode(horizontalScrollMode);
- w->setVScrollBarMode(scrollMode);
-#endif
}
void RenderTextArea::updateFromElement()
@@ -1430,9 +1070,7 @@
QTextEdit* w = static_cast<QTextEdit*>(m_widget);
w->setReadOnly(e->readOnly());
-#if APPLE_CHANGES
w->setDisabled(e->disabled());
-#endif
e->updateValue();
if (!e->valueMatchesRenderer()) {
@@ -1460,26 +1098,7 @@
QTextEdit* w = static_cast<QTextEdit*>(m_widget);
if (element()->wrap() == HTMLTextAreaElementImpl::ta_Physical) {
-#if APPLE_CHANGES
txt = w->textWithHardLineBreaks();
-#else
- // yeah, QTextEdit has no accessor for getting the visually wrapped text
- for (int p=0; p < w->paragraphs(); ++p) {
- int pl = w->paragraphLength(p);
- int ll = 0;
- int lindex = w->lineOfChar(p, 0);
- QString paragraphText = w->text(p);
- for (int l = 0; l < pl; ++l) {
- if (lindex != w->lineOfChar(p, l)) {
- paragraphText.insert(l+ll++, QString::fromLatin1("\n"));
- lindex = w->lineOfChar(p, l);
- }
- }
- txt += paragraphText;
- if (p < w->paragraphs() - 1)
- txt += QString::fromLatin1("\n");
- }
-#endif
}
else
txt = w->text();
@@ -1497,49 +1116,25 @@
int RenderTextArea::selectionStart()
{
QTextEdit *textEdit = static_cast<QTextEdit *>(m_widget);
-#if APPLE_CHANGES
return textEdit->selectionStart();
-#else
- // FIXME: I have no way to test Qt, so I'll
- // leave this alone for now
-#error Unimplemented method
-#endif
}
int RenderTextArea::selectionEnd()
{
QTextEdit *textEdit = static_cast<QTextEdit *>(m_widget);
-#if APPLE_CHANGES
return textEdit->selectionEnd();
-#else
- // FIXME: I have no way to test Qt, so I'll
- // leave this alone for now
-#error Unimplemented method
-#endif
}
void RenderTextArea::setSelectionStart(int start)
{
QTextEdit *textEdit = static_cast<QTextEdit *>(m_widget);
-#if APPLE_CHANGES
textEdit->setSelectionStart(start);
-#else
- // FIXME: I have no way to test Qt, so I'll
- // leave this alone for now
-#error Unimplemented method
-#endif
}
void RenderTextArea::setSelectionEnd(int end)
{
QTextEdit *textEdit = static_cast<QTextEdit *>(m_widget);
-#if APPLE_CHANGES
textEdit->setSelectionEnd(end);
-#else
- // FIXME: I have no way to test Qt, so I'll
- // leave this alone for now
-#error Unimplemented method
-#endif
}
void RenderTextArea::select()
@@ -1550,13 +1145,7 @@
void RenderTextArea::setSelectionRange(int start, int end)
{
QTextEdit *textEdit = static_cast<QTextEdit *>(m_widget);
-#if APPLE_CHANGES
textEdit->setSelectionRange(start, end-start);
-#else
- // FIXME: I have no way to test Qt, so I'll
- // leave this alone for now
-#error Unimplemented method
-#endif
}
void RenderTextArea::slotSelectionChanged()
@@ -1572,7 +1161,6 @@
// ---------------------------------------------------------------------------
-#if APPLE_CHANGES
RenderSlider::RenderSlider(HTMLInputElementImpl* element)
:RenderFormElement(element)
{
@@ -1653,6 +1241,5 @@
RenderFormElement::slotClicked();
}
-#endif
#include "render_form.moc"
1.58 +0 -18 WebCore/khtml/rendering/render_form.h
Index: render_form.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_form.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- render_form.h 21 Oct 2005 21:27:47 -0000 1.57
+++ render_form.h 21 Nov 2005 01:20:24 -0000 1.58
@@ -68,7 +68,6 @@
virtual bool isFormElement() const { return true; }
-#if APPLE_CHANGES
// Aqua form controls never have border/padding.
int borderTop() const { return 0; }
int borderBottom() const { return 0; }
@@ -88,7 +87,6 @@
void addIntrinsicMarginsIfAllowed(RenderStyle* _style);
virtual bool canHaveIntrinsicMargins() const { return false; }
int intrinsicMargin() const { return 2; }
-#endif
virtual void setStyle(RenderStyle *);
virtual void updateFromElement();
@@ -103,10 +101,8 @@
virtual void slotClicked();
virtual void slotSelectionChanged();
-#if APPLE_CHANGES
// Hack to make KWQSlot code work.
virtual void slotTextChanged(const QString &string);
-#endif
protected:
virtual bool isEditable() const { return false; }
@@ -134,10 +130,8 @@
RenderLineEdit(DOM::HTMLInputElementImpl *element);
virtual void calcMinMaxWidth();
-#if APPLE_CHANGES
int calcReplacedHeight() const { return intrinsicHeight(); }
virtual bool canHaveIntrinsicMargins() const { return true; }
-#endif
virtual const char *renderName() const { return "RenderLineEdit"; }
virtual void updateFromElement();
@@ -159,11 +153,9 @@
void slotReturnPressed();
void slotTextChanged(const QString &string);
void slotSelectionChanged();
-#if APPLE_CHANGES
void slotPerformSearch();
public:
void addSearchResult();
-#endif
protected:
virtual void handleFocusOut();
@@ -278,11 +270,9 @@
virtual const char *renderName() const { return "RenderSelect"; }
-#if APPLE_CHANGES
short baselinePosition( bool f, bool b ) const;
int calcReplacedHeight() const { if (!m_useListBox) return intrinsicHeight(); return RenderFormElement::calcReplacedHeight(); }
virtual bool canHaveIntrinsicMargins() const { return true; }
-#endif
virtual void calcMinMaxWidth();
virtual void layout();
@@ -292,9 +282,7 @@
bool selectionChanged() { return m_selectionChanged; }
void setSelectionChanged(bool _selectionChanged) { m_selectionChanged = _selectionChanged; }
virtual void updateFromElement();
-#if APPLE_CHANGES
virtual void setStyle(RenderStyle *);
-#endif
void updateSelection();
@@ -304,9 +292,7 @@
protected:
KListBox *createListBox();
ComboBoxWidget *createComboBox();
-#if APPLE_CHANGES
void setWidgetWritingDirection();
-#endif
unsigned m_size;
bool m_multiple;
@@ -363,9 +349,7 @@
void select();
void setSelectionRange(int, int);
-#if APPLE_CHANGES
virtual bool canHaveIntrinsicMargins() const { return true; }
-#endif
protected slots:
void slotTextChanged();
@@ -381,7 +365,6 @@
// -------------------------------------------------------------------------
-#if APPLE_CHANGES
class RenderSlider : public RenderFormElement
{
public:
@@ -399,7 +382,6 @@
void slotSliderValueChanged();
void slotClicked();
};
-#endif
}; //namespace
1.85 +0 -40 WebCore/khtml/rendering/render_frames.cpp
Index: render_frames.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_frames.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- render_frames.cpp 12 Nov 2005 02:32:21 -0000 1.84
+++ render_frames.cpp 21 Nov 2005 01:20:24 -0000 1.85
@@ -559,70 +559,43 @@
}
else if (m_resizing || evt->type() == mouseupEvent) {
-#if APPLE_CHANGES
KHTMLView *v = canvas()->view();
QPainter paint;
v->disableFlushDrawing();
v->lockDrawingFocus();
-#else
- QPainter paint( canvas()->view() );
-#endif
paint.setPen( Qt::gray );
paint.setBrush( Qt::gray );
-#if !APPLE_CHANGES
- paint.setRasterOp( Qt::XorROP );
-#endif
QRect r(xPos(), yPos(), width(), height());
const int rBord = 3;
int sw = element()->border();
int p = m_resizing ? (m_vSplit > -1 ? _x : _y) : -1;
if (m_vSplit > -1) {
if ( m_oldpos >= 0 )
-#if APPLE_CHANGES
v->updateContents( m_oldpos + sw/2 - rBord , r.y(), 2*rBord, r.height(), true );
-#else
- paint.drawRect( m_oldpos + sw/2 - rBord , r.y(),
- 2*rBord, r.height() );
-#endif
if ( p >= 0 ){
-#if APPLE_CHANGES
paint.setPen( Qt::NoPen );
paint.setBrush( Qt::gray );
v->setDrawingAlpha((float)0.25);
paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() );
v->setDrawingAlpha((float)1.0);
-#else
- paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() );
-#endif
}
} else {
if ( m_oldpos >= 0 )
-#if APPLE_CHANGES
v->updateContents( r.x(), m_oldpos + sw/2 - rBord, r.width(), 2*rBord, true );
-#else
- paint.drawRect( r.x(), m_oldpos + sw/2 - rBord,
- r.width(), 2*rBord );
-#endif
if ( p >= 0 ){
-#if APPLE_CHANGES
paint.setPen( Qt::NoPen );
paint.setBrush( Qt::gray );
v->setDrawingAlpha((float)0.25);
paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord );
v->setDrawingAlpha((float)1.0);
-#else
- paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord );
-#endif
}
}
m_oldpos = p;
-#if APPLE_CHANGES
v->unlockDrawingFocus();
v->enableFlushDrawing();
-#endif
}
return res;
@@ -736,15 +709,10 @@
QScrollView *view = static_cast<QScrollView *>(m_widget);
if(!element()->m_frameBorder || !(static_cast<HTMLFrameSetElementImpl *>(element()->parentNode()))->frameBorder())
view->setFrameStyle(QFrame::NoFrame);
-#if APPLE_CHANGES
// Qt creates QScrollView w/ a default style of QFrame::StyledPanel | QFrame::Sunken.
else
view->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
-#else
- view->setHScrollBarMode(element()->scrolling );
- view->setVScrollBarMode(element()->scrolling );
-#endif
if(view->inherits("KHTMLView")) {
#ifdef DEBUG_LAYOUT
@@ -987,10 +955,6 @@
KHTMLAssert( needsLayout() );
KHTMLAssert( minMaxKnown() );
-#if !APPLE_CHANGES
- int m_oldwidth = m_width;
- int m_oldheight = m_height;
-#endif
calcWidth();
calcHeight();
@@ -1021,10 +985,6 @@
}
view->setFrameStyle(frameStyle);
-#if !APPLE_CHANGES
- view->setVScrollBarMode(scroll);
- view->setHScrollBarMode(scroll);
-#endif
if(view->inherits("KHTMLView")) {
#ifdef DEBUG_LAYOUT
1.89 +0 -74 WebCore/khtml/rendering/render_image.cpp
Index: render_image.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_image.cpp,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -r1.88 -r1.89
--- render_image.cpp 27 Oct 2005 22:35:57 -0000 1.88
+++ render_image.cpp 21 Nov 2005 01:20:25 -0000 1.89
@@ -168,18 +168,12 @@
}
}
-#if APPLE_CHANGES
// Stop the previous image, if it may be animating.
pix.stopAnimations();
-#endif
-#if APPLE_CHANGES
pix.decreaseUseCount();
-#endif
pix = p;
-#if APPLE_CHANGES
p.increaseUseCount();
-#endif
if (needlayout) {
if (!selfNeedsLayout())
@@ -188,42 +182,19 @@
setMinMaxKnown(false);
}
else {
-#if APPLE_CHANGES
// FIXME: We always just do a complete repaint, since we always pass in the full pixmap
// rect at the moment anyway.
resizeCache = QPixmap();
repaintRectangle(QRect(borderLeft()+paddingLeft(), borderTop()+paddingTop(), contentWidth(), contentHeight()));
-#else
- // FIXME: This code doesn't handle scaling properly, since it doesn't scale |r|.
- bool completeRepaint = !resizeCache.isNull();
- int cHeight = contentHeight();
- int scaledHeight = intrinsicHeight() ? ((o->valid_rect().height()*cHeight)/intrinsicHeight()) : 0;
-
- // don't bog down X server doing xforms
- if(completeRepaint && cHeight >= 5 && o->valid_rect().height() < intrinsicHeight() &&
- (scaledHeight / (cHeight/5) == resizeCache.height() / (cHeight/5)))
- return;
-
- resizeCache = QPixmap(); // for resized animations
- if(completeRepaint)
- repaintRectangle(QRect(borderLeft()+paddingLeft(), borderTop()+paddingTop(), contentWidth(), contentHeight()));
- else
- {
- repaintRectangle(QRect(r.x() + borderLeft() + paddingLeft(), r.y() + borderTop() + paddingTop(),
- r.width(), r.height()));
- }
-#endif
}
}
-#if APPLE_CHANGES
void RenderImage::resetAnimation()
{
pix.resetAnimation();
if (!needsLayout())
repaint();
}
-#endif
void RenderImage::paint(PaintInfo& i, int _tx, int _ty)
{
@@ -246,7 +217,6 @@
if (!shouldPaintWithinRoot(i))
return;
-#if APPLE_CHANGES
bool isPrinting = (i.p->device()->devType() == QInternal::Printer);
bool drawSelectionTint = (selectionState() != SelectionNone) && !isPrinting;
if (i.phase == PaintActionSelection) {
@@ -255,7 +225,6 @@
}
drawSelectionTint = false;
}
-#endif
int cWidth = contentWidth();
int cHeight = contentHeight();
@@ -275,7 +244,6 @@
if(cWidth > 2 && cHeight > 2)
{
-#if APPLE_CHANGES
if ( !berrorPic ) {
p->setPen (Qt::lightGray);
p->setBrush (Qt::NoBrush);
@@ -320,39 +288,13 @@
} else if (usableWidth >= textWidth && cHeight >= fm.height())
p->drawText(ax, ay+ascent, tabWidth(), 0, 0 /* ignored */, 0 /* ignored */, Qt::WordBreak /* not supported */, text );
}
-#else /* not APPLE_CHANGES */
- if ( !berrorPic ) {
- //qDebug("qDrawShadePanel %d/%d/%d/%d", _tx + leftBorder, _ty + topBorder, cWidth, cHeight);
- qDrawShadePanel( p, _tx + leftBorder + leftPad, _ty + topBorder + topPad, cWidth, cHeight,
- KApplication::palette().inactive(), true, 1 );
- }
- if(berrorPic && !pix.isNull() && (cWidth >= pix.width()+4) && (cHeight >= pix.height()+4) )
- {
- QRect r(pix.rect());
- r = r.intersect(QRect(0, 0, cWidth-4, cHeight-4));
- p->drawPixmap( QPoint( _tx + leftBorder + leftPad+2, _ty + topBorder + topPad+2), pix, r );
- }
- if(!alt.isEmpty()) {
- QString text = alt.qstring();
- text.replace('\\', backslashAsCurrencySymbol());
- p->setFont(style()->font());
- p->setPen( style()->color() );
- int ax = _tx + leftBorder + leftPad + 2;
- int ay = _ty + topBorder + topPad + 2;
- const QFontMetrics &fm = style()->fontMetrics();
- if (cWidth>5 && cHeight>=fm.height())
- p->drawText(ax, ay+1, tabWidth(), 0, cWidth - 4, cHeight - 4, Qt::WordBreak, text );
- }
-#endif /* APPLE_CHANGES not defined */
}
}
else if (image && !image->isTransparent()) {
if ( (cWidth != intrinsicWidth() || cHeight != intrinsicHeight()) &&
pix.width() > 0 && pix.height() > 0 && image->valid_rect().isValid())
{
-#if APPLE_CHANGES
QSize tintSize;
-#endif
if (resizeCache.isNull() && cWidth && cHeight)
{
QRect scaledrect(image->valid_rect());
@@ -384,22 +326,16 @@
p->drawPixmap( QPoint( _tx + leftBorder + leftPad, _ty + topBorder + topPad),
resizeCache, scaledrect );
-#if APPLE_CHANGES
tintSize = s;
-#endif
} else {
p->drawPixmap( QPoint( _tx + leftBorder + leftPad, _ty + topBorder + topPad), resizeCache );
-#if APPLE_CHANGES
tintSize = resizeCache.rect().size();
-#endif
}
-#if APPLE_CHANGES
if (drawSelectionTint) {
QBrush brush(selectionColor(p));
QRect selRect(selectionRect());
p->fillRect(selRect.x(), selRect.y(), selRect.width(), selRect.height(), brush);
}
-#endif
}
else
{
@@ -429,13 +365,11 @@
else {
p->drawPixmap(offs, pix, rect);
}
-#if APPLE_CHANGES
if (drawSelectionTint) {
QBrush brush(selectionColor(p));
QRect selRect(selectionRect());
p->fillRect(selRect.x(), selRect.y(), selRect.width(), selRect.height(), brush);
}
-#endif
}
}
}
@@ -469,14 +403,6 @@
// We don't want to impose a constraint on image size here. But there also
// is a bug somewhere that causes the scaled height to be used with the
// original width, causing the image to be compressed vertically.
-#if !APPLE_CHANGES
- // limit total size to not run out of memory when doing the xform call.
- if ( m_width * m_height > 2048*2048 ) {
- float scale = sqrt( m_width*m_height / ( 2048.*2048. ) );
- m_width = (int) (m_width/scale);
- m_height = (int) (m_height/scale);
- }
-#endif
if ( m_width != oldwidth || m_height != oldheight )
resizeCache = QPixmap();
1.29 +0 -2 WebCore/khtml/rendering/render_image.h
Index: render_image.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_image.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- render_image.h 9 Jul 2005 20:19:17 -0000 1.28
+++ render_image.h 21 Nov 2005 01:20:25 -0000 1.29
@@ -81,9 +81,7 @@
DOM::HTMLMapElementImpl* imageMap();
-#if APPLE_CHANGES
void resetAnimation();
-#endif
private:
bool isWidthSpecified() const;
1.125 +0 -36 WebCore/khtml/rendering/render_layer.cpp
Index: render_layer.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_layer.cpp,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -r1.124 -r1.125
--- render_layer.cpp 17 Nov 2005 00:32:31 -0000 1.124
+++ render_layer.cpp 21 Nov 2005 01:20:25 -0000 1.125
@@ -58,9 +58,7 @@
#include <qscrollbar.h>
#include <qptrvector.h>
-#if APPLE_CHANGES
#include "KWQKHTMLPart.h" // For Dashboard.
-#endif
// These match the numbers we use over in WebKit (WebFrameView.m).
#define LINE_STEP 40
@@ -74,9 +72,7 @@
namespace khtml {
-#ifdef APPLE_CHANGES
QScrollBar* RenderLayer::gScrollBar = 0;
-#endif
#ifndef NDEBUG
static bool inRenderLayerDestroy;
@@ -533,11 +529,9 @@
RenderCanvas *canvas = renderer()->canvas();
if (canvas) {
-#if APPLE_CHANGES
// Update dashboard regions, scrolling may change the clip of a
// particular region.
canvas->view()->updateDashboardRegions();
-#endif
m_object->canvas()->updateWidgetPositions();
}
@@ -852,11 +846,9 @@
setHasHorizontalScrollbar(needHorizontalBar);
setHasVerticalScrollbar(needVerticalBar);
-#if APPLE_CHANGES
// Force an update since we know the scrollbars have changed things.
if (m_object->document()->hasDashboardRegions())
m_object->document()->setDashboardRegionsDirty(true);
-#endif
m_object->repaint();
@@ -876,40 +868,26 @@
int pageStep = (clientWidth-PAGE_KEEP);
if (pageStep < 0) pageStep = clientWidth;
m_hBar->setSteps(LINE_STEP, pageStep);
-#ifdef APPLE_CHANGES
m_hBar->setKnobProportion(clientWidth, m_scrollWidth);
-#else
- m_hBar->setRange(0, m_scrollWidth-clientWidth);
- m_object->repaintRectangle(QRect(m_object->borderLeft(), m_object->borderTop() + clientHeight(),
- horizontalScrollbarHeight(),
- m_object->width() - m_object->borderLeft() - m_object->borderRight()));
-#endif
}
if (m_vBar) {
int clientHeight = m_object->clientHeight();
int pageStep = (clientHeight-PAGE_KEEP);
if (pageStep < 0) pageStep = clientHeight;
m_vBar->setSteps(LINE_STEP, pageStep);
-#ifdef APPLE_CHANGES
m_vBar->setKnobProportion(clientHeight, m_scrollHeight);
-#else
- m_vBar->setRange(0, m_scrollHeight-clientHeight);
-#endif
m_object->repaintRectangle(QRect(m_object->borderLeft() + m_object->clientWidth(),
m_object->borderTop(), verticalScrollbarWidth(),
m_object->height() - m_object->borderTop() - m_object->borderBottom()));
}
-#if APPLE_CHANGES
// Force an update since we know the scrollbars have changed things.
if (m_object->document()->hasDashboardRegions())
m_object->document()->setDashboardRegionsDirty(true);
-#endif
m_object->repaint();
}
-#if APPLE_CHANGES
void
RenderLayer::paintScrollbars(QPainter* p, const QRect& damageRect)
{
@@ -930,7 +908,6 @@
if (m_vBar)
m_vBar->paint(p, damageRect);
}
-#endif
bool RenderLayer::scroll(KWQScrollDirection direction, KWQScrollGranularity granularity, float multiplier)
{
@@ -966,16 +943,7 @@
p->save();
-#if APPLE_CHANGES
p->addClip(clipRect);
-#else
- QRect clippedRect = p->xForm(clipRect);
- QRegion creg(clippedRect);
- QRegion old = p->clipRegion();
- if (!old.isNull())
- creg = old.intersect(creg);
- p->setClipRegion(creg);
-#endif
}
@@ -1026,12 +994,10 @@
// Paint the background.
RenderObject::PaintInfo info(p, damageRect, PaintActionBlockBackground, paintingRootForRenderer);
renderer()->paint(info, x - renderer()->xPos(), y - renderer()->yPos() + renderer()->borderTopExtra());
-#if APPLE_CHANGES
// Our scrollbar widgets paint exactly when we tell them to, so that they work properly with
// z-index. We paint after we painted the background/border, so that the scrollbars will
// sit above the background/border.
paintScrollbars(p, damageRect);
-#endif
// Restore the clip.
restoreClip(p, paintDirtyRect, damageRect);
}
@@ -1095,10 +1061,8 @@
bool
RenderLayer::hitTest(RenderObject::NodeInfo& info, int x, int y)
{
-#if APPLE_CHANGES
// Clear our our scrollbar variable
RenderLayer::gScrollBar = 0;
-#endif
QRect damageRect(m_x, m_y, width(), height());
RenderLayer* insideLayer = hitTestLayer(this, info, x, y, damageRect);
1.58 +0 -6 WebCore/khtml/rendering/render_layer.h
Index: render_layer.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_layer.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- render_layer.h 3 Nov 2005 20:00:57 -0000 1.57
+++ render_layer.h 21 Nov 2005 01:20:25 -0000 1.58
@@ -185,9 +185,7 @@
static ScrollBehavior getPartialBehavior(const ScrollAlignment& s) { return s.m_rectPartial; }
static ScrollBehavior getHiddenBehavior(const ScrollAlignment& s) { return s.m_rectHidden; }
-#ifdef APPLE_CHANGES
static QScrollBar* gScrollBar;
-#endif
RenderLayer(RenderObject* object);
~RenderLayer();
@@ -257,9 +255,7 @@
int horizontalScrollbarHeight();
void moveScrollbarsAside();
void positionScrollbars(const QRect& absBounds);
-#ifdef APPLE_CHANGES
void paintScrollbars(QPainter* p, const QRect& damageRect);
-#endif
void updateScrollInfoAfterLayout();
void slotValueChanged(int);
void updateScrollPositionFromScrollbars();
@@ -394,11 +390,9 @@
bool m_scrollDimensionsDirty : 1;
bool m_zOrderListsDirty : 1;
-#if APPLE_CHANGES
bool m_usedTransparency : 1; // Tracks whether we need to close a transparent layer, i.e., whether
// we ended up painting this layer or any descendants (and therefore need to
// blend).
-#endif
Marquee* m_marquee; // Used by layers with overflow:marquee
};
1.57 +0 -4 WebCore/khtml/rendering/render_line.cpp
Index: render_line.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_line.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- render_line.cpp 2 Nov 2005 08:52:45 -0000 1.56
+++ render_line.cpp 21 Nov 2005 01:20:25 -0000 1.57
@@ -961,7 +961,6 @@
}
}
-#if APPLE_CHANGES
// Set up the appropriate text-shadow effect for the decoration.
// FIXME: Support multiple shadow effects. Need more from the CG API before we can do this.
bool setShadow = false;
@@ -970,7 +969,6 @@
styleToUse->textShadow()->blur, styleToUse->textShadow()->color);
setShadow = true;
}
-#endif
// We must have child boxes and have decorations defined.
_tx += borderLeft() + paddingLeft();
@@ -996,10 +994,8 @@
p->drawLineForText(_tx, _ty, 2*m_baseline/3, w);
}
-#if APPLE_CHANGES
if (setShadow)
p->clearShadow();
-#endif
}
}
1.73 +0 -4 WebCore/khtml/rendering/render_list.cpp
Index: render_list.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_list.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- render_list.cpp 6 Oct 2005 00:53:57 -0000 1.72
+++ render_list.cpp 21 Nov 2005 01:20:26 -0000 1.73
@@ -473,14 +473,10 @@
return;
default:
if (!m_item.isEmpty()) {
-#if APPLE_CHANGES
// Text should be drawn on the baseline, so we add in the ascent of the font.
// For some inexplicable reason, this works in Konqueror. I'm not sure why.
// - dwh
_ty += fm.ascent();
-#else
- //_ty += fm.ascent() - fm.height()/2 + 1;
-#endif
if (isInside()) {
if( style()->direction() == LTR) {
1.27 +0 -2 WebCore/khtml/rendering/render_list.h
Index: render_list.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_list.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- render_list.h 6 Oct 2005 00:53:58 -0000 1.26
+++ render_list.h 21 Nov 2005 01:20:26 -0000 1.27
@@ -119,9 +119,7 @@
void setNotInList(bool notInList) { _notInList = notInList; }
bool notInList() const { return _notInList; }
-#if APPLE_CHANGES
QString markerStringValue() { if (m_marker) return m_marker->m_item; return ""; }
-#endif
protected:
int predefVal;
1.226 +0 -33 WebCore/khtml/rendering/render_object.cpp
Index: render_object.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_object.cpp,v
retrieving revision 1.225
retrieving revision 1.226
diff -u -r1.225 -r1.226
--- render_object.cpp 7 Nov 2005 23:24:19 -0000 1.225
+++ render_object.cpp 21 Nov 2005 01:20:26 -0000 1.226
@@ -47,10 +47,8 @@
#include "render_flexbox.h"
#include "htmlnames.h"
-#if APPLE_CHANGES
// For accessibility
#include "KWQAccObjectCache.h"
-#endif
#include <assert.h>
@@ -1317,7 +1315,6 @@
return result;
}
-#if APPLE_CHANGES
void RenderObject::addFocusRingRects(QPainter *p, int _tx, int _ty)
{
// For blocks inside inlines, we go ahead and include margins so that we run right up to the
@@ -1332,7 +1329,6 @@
else
p->addFocusRingRect(_tx, _ty, width(), height());
}
-#endif
void RenderObject::paintOutline(QPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style)
{
@@ -1349,7 +1345,6 @@
int offset = style->outlineOffset();
-#ifdef APPLE_CHANGES
if (style->outlineStyleIsAuto()) {
if (!style->hasAppearance()) {
// Only paint the focus ring by hand if there is no custom appearance
@@ -1362,7 +1357,6 @@
}
return;
}
-#endif
_tx -= offset;
_ty -= offset;
@@ -1754,12 +1748,10 @@
// If our z-index changes value or our visibility changes,
// we need to dirty our stacking context's z-order list.
if (style) {
-#if APPLE_CHANGES
if (m_style->visibility() != style->visibility() ||
m_style->zIndex() != style->zIndex() ||
m_style->hasAutoZIndex() != style->hasAutoZIndex())
document()->setDashboardRegionsDirty(true);
-#endif
if ((m_style->hasAutoZIndex() != style->hasAutoZIndex() ||
m_style->zIndex() != style->zIndex() ||
@@ -2024,19 +2016,6 @@
return st == SelectionStart || st == SelectionEnd || st == SelectionBoth;
}
-#if 0
-static void checkFloats(RenderObject* o, RenderObject* f)
-{
- if (o->isRenderBlock()) {
- RenderBlock* b = static_cast<RenderBlock*>(o);
- if (b->containsFloat(f))
- assert(false);
- }
-
- for (RenderObject* c = o->firstChild(); c; c = c->nextSibling())
- checkFloats(c, f);
-}
-#endif
void RenderObject::removeFromObjectLists()
{
@@ -2049,10 +2028,6 @@
if (outermostBlock)
outermostBlock->markAllDescendantsWithFloatsForLayout(this);
-#if 0
- // Debugging code for float checking.
- checkFloats(canvas(), this);
-#endif
}
if (isPositioned()) {
@@ -2072,10 +2047,8 @@
void RenderObject::remove()
{
-#if APPLE_CHANGES
// Delete our accessibility object if we have one.
document()->getAccObjectCache()->detach(this);
-#endif
removeFromObjectLists();
@@ -2437,7 +2410,6 @@
{
}
-#if APPLE_CHANGES
QValueList<DashboardRegionValue> RenderObject::computeDashboardRegions()
{
QValueList<DashboardRegionValue> regions;
@@ -2499,7 +2471,6 @@
}
}
-#endif
void RenderObject::collectBorders(QValueList<CollapsedBorderValue>& borderStyles)
{
@@ -2524,9 +2495,6 @@
QChar RenderObject::backslashAsCurrencySymbol() const
{
-#if !APPLE_CHANGES
- return '\\';
-#else
NodeImpl *node = element();
if (!node)
return '\\';
@@ -2540,7 +2508,6 @@
if (!codec)
return '\\';
return codec->backslashAsCurrencySymbol();
-#endif
}
void RenderObject::setPixmap(const QPixmap&, const QRect&, CachedImage *image)
1.166 +0 -6 WebCore/khtml/rendering/render_object.h
Index: render_object.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_object.h,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -r1.165 -r1.166
--- render_object.h 7 Nov 2005 23:24:19 -0000 1.165
+++ render_object.h 21 Nov 2005 01:20:27 -0000 1.166
@@ -114,7 +114,6 @@
class InlineFlowBox;
class CollapsedBorderValue;
-#if APPLE_CHANGES
struct DashboardRegionValue
{
QString label;
@@ -127,7 +126,6 @@
return type == o.type && bounds == o.bounds && label == o.label;
}
};
-#endif
/**
@@ -465,11 +463,9 @@
virtual void updateWidgetPosition();
-#if APPLE_CHANGES
QValueList<DashboardRegionValue> RenderObject::computeDashboardRegions();
void addDashboardRegions (QValueList<DashboardRegionValue>& regions);
void collectDashboardRegions (QValueList<DashboardRegionValue>& regions);
-#endif
// does a query on the rendertree and finds the innernode
// and overURL for the given position
@@ -668,9 +664,7 @@
// the rect that will be painted if this object is passed as the paintingRoot
QRect paintingRootRect(QRect& topLevelRect);
-#if APPLE_CHANGES
virtual void addFocusRingRects(QPainter *painter, int _tx, int _ty);
-#endif
virtual int minWidth() const { return 0; }
virtual int maxWidth() const { return 0; }
1.94 +0 -9 WebCore/khtml/rendering/render_replaced.cpp
Index: render_replaced.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_replaced.cpp,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- render_replaced.cpp 11 Nov 2005 17:44:27 -0000 1.93
+++ render_replaced.cpp 21 Nov 2005 01:20:27 -0000 1.94
@@ -286,11 +286,6 @@
void RenderWidget::resizeWidget( QWidget *widget, int w, int h )
{
-#if !APPLE_CHANGES
- // ugly hack to limit the maximum size of the widget (as X11 has problems if it's bigger)
- h = kMin( h, 3072 );
- w = kMin( w, 2000 );
-#endif
if (element() && (widget->width() != w || widget->height() != h)) {
RenderArena *arena = ref();
@@ -347,14 +342,12 @@
setNeedsLayout(false);
}
-#if APPLE_CHANGES
void RenderWidget::sendConsumedMouseUp()
{
RenderArena *arena = ref();
element()->dispatchSimulatedMouseEvent(mouseupEvent);
deref(arena);
}
-#endif
void RenderWidget::slotWidgetDestructed()
{
@@ -369,10 +362,8 @@
m_widget->setFont(style()->font());
if (style()->visibility() != VISIBLE)
m_widget->hide();
-#if APPLE_CHANGES
else
m_widget->show();
-#endif
}
}
1.37 +0 -2 WebCore/khtml/rendering/render_replaced.h
Index: render_replaced.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_replaced.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- render_replaced.h 19 Oct 2005 09:15:14 -0000 1.36
+++ render_replaced.h 21 Nov 2005 01:20:27 -0000 1.37
@@ -98,9 +98,7 @@
virtual void setSelectionState(SelectionState s);
-#if APPLE_CHANGES
void sendConsumedMouseUp();
-#endif
virtual void updateWidgetPosition();
public slots:
1.74 +0 -33 WebCore/khtml/rendering/render_style.cpp
Index: render_style.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_style.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- render_style.cpp 6 Oct 2005 00:53:59 -0000 1.73
+++ render_style.cpp 21 Nov 2005 01:20:27 -0000 1.74
@@ -88,9 +88,6 @@
: hasClip(false),
textDecoration(RenderStyle::initialTextDecoration()),
colspan( 1 ), counter_increment( 0 ), counter_reset( 0 )
-#if !APPLE_CHANGES
- , palette( QApplication::palette() )
-#endif
{
}
@@ -101,9 +98,6 @@
: Shared<StyleVisualData>(),
clip( o.clip ), hasClip( o.hasClip ), textDecoration(o.textDecoration), colspan( o.colspan ),
counter_increment( o.counter_increment ), counter_reset( o.counter_reset )
-#if !APPLE_CHANGES
- , palette( o.palette )
-#endif
{
}
@@ -337,9 +331,7 @@
StyleCSS3NonInheritedData::StyleCSS3NonInheritedData()
:Shared<StyleCSS3NonInheritedData>(),
-#if APPLE_CHANGES
lineClamp(RenderStyle::initialLineClamp()),
-#endif
opacity(RenderStyle::initialOpacity()),
userDrag(RenderStyle::initialUserDrag()),
userSelect(RenderStyle::initialUserSelect()),
@@ -355,9 +347,7 @@
StyleCSS3NonInheritedData::StyleCSS3NonInheritedData(const StyleCSS3NonInheritedData& o)
:Shared<StyleCSS3NonInheritedData>(),
-#if APPLE_CHANGES
lineClamp(o.lineClamp),
-#endif
opacity(o.opacity), flexibleBox(o.flexibleBox), marquee(o.marquee),
userDrag(o.userDrag), userSelect(o.userSelect), textOverflow(o.textOverflow),
marginTopCollapse(o.marginTopCollapse), marginBottomCollapse(o.marginBottomCollapse),
@@ -396,18 +386,14 @@
#ifndef KHTML_NO_XBL
&& bindingsEquivalent(o)
#endif
-#if APPLE_CHANGES
&& lineClamp == o.lineClamp && m_dashboardRegions == o.m_dashboardRegions
-#endif
;
}
StyleCSS3InheritedData::StyleCSS3InheritedData()
:Shared<StyleCSS3InheritedData>(), textShadow(0), userModify(READ_ONLY), wordWrap(WBNORMAL),
nbspMode(NBNORMAL), khtmlLineBreak(LBNORMAL)
-#if APPLE_CHANGES
, textSizeAdjust(RenderStyle::initialTextSizeAdjust())
-#endif
{
}
@@ -420,9 +406,7 @@
wordWrap = o.wordWrap;
nbspMode = o.nbspMode;
khtmlLineBreak = o.khtmlLineBreak;
-#if APPLE_CHANGES
textSizeAdjust = o.textSizeAdjust;
-#endif
}
StyleCSS3InheritedData::~StyleCSS3InheritedData()
@@ -434,9 +418,7 @@
{
return (userModify == o.userModify) && shadowDataEquivalent(o) && (wordWrap == o.wordWrap) &&
(nbspMode == o.nbspMode) && (khtmlLineBreak == o.khtmlLineBreak)
-#if APPLE_CHANGES
&& (textSizeAdjust == o.textSizeAdjust)
-#endif
;
}
@@ -723,10 +705,8 @@
css3NonInheritedData->marginTopCollapse != other->css3NonInheritedData->marginTopCollapse ||
css3NonInheritedData->marginBottomCollapse != other->css3NonInheritedData->marginBottomCollapse ||
*css3NonInheritedData->flexibleBox.get() != *other->css3NonInheritedData->flexibleBox.get() ||
-#if APPLE_CHANGES
(css3NonInheritedData->lineClamp != other->css3NonInheritedData->lineClamp) ||
(css3InheritedData->textSizeAdjust != other->css3InheritedData->textSizeAdjust) ||
-#endif
(css3InheritedData->wordWrap != other->css3InheritedData->wordWrap) ||
(css3InheritedData->nbspMode != other->css3InheritedData->nbspMode) ||
(css3InheritedData->khtmlLineBreak != other->css3InheritedData->khtmlLineBreak) ||
@@ -808,11 +788,9 @@
borderRightWidth() != other->borderRightWidth())
return Layout;
-#if APPLE_CHANGES
// If regions change trigger a relayout to re-calc regions.
if (!(css3NonInheritedData->m_dashboardRegions == other->css3NonInheritedData->m_dashboardRegions))
return Layout;
-#endif
// Make sure these left/top/right/bottom checks stay below all layout checks and above
// all visible checks.
@@ -851,9 +829,6 @@
css3InheritedData->userModify != other->css3InheritedData->userModify ||
css3NonInheritedData->userSelect != other->css3NonInheritedData->userSelect ||
css3NonInheritedData->userDrag != other->css3NonInheritedData->userDrag
-#if !APPLE_CHANGES
- || !(visual->palette == other->visual->palette)
-#endif
)
return Repaint;
@@ -873,14 +848,6 @@
// SharedData::counter = 0;
}
-#if !APPLE_CHANGES
-
-void RenderStyle::setPaletteColor(QPalette::ColorGroup g, QColorGroup::ColorRole r, const QColor& c)
-{
- visual.access()->palette.setColor(g,r,c);
-}
-
-#endif
void RenderStyle::adjustBackgroundLayers()
{
1.98 +0 -28 WebCore/khtml/rendering/render_style.h
Index: render_style.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_style.h,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- render_style.h 2 Nov 2005 08:52:46 -0000 1.97
+++ render_style.h 21 Nov 2005 01:20:28 -0000 1.98
@@ -423,7 +423,6 @@
//------------------------------------------------
// Dashboard region attributes. Not inherited.
-#if APPLE_CHANGES
struct StyleDashboardRegion
{
QString label;
@@ -441,7 +440,6 @@
return type == o.type && offset == o.offset && label == o.label;
}
};
-#endif
//------------------------------------------------
// Random visual rendering model attributes. Not inherited.
@@ -480,9 +478,6 @@
colspan == o.colspan &&
counter_increment == o.counter_increment &&
counter_reset == o.counter_reset &&
-#if !APPLE_CHANGES
- palette == o.palette &&
-#endif
textDecoration == o.textDecoration);
}
bool operator!=( const StyleVisualData &o ) const {
@@ -498,9 +493,6 @@
short counter_increment; //ok, so these are not visual mode spesific
short counter_reset; //can't go to inherited, since these are not inherited
-#if !APPLE_CHANGES
- QPalette palette; //widget styling with IE attributes
-#endif
};
//------------------------------------------------
@@ -783,10 +775,8 @@
return !(*this == o);
}
-#if APPLE_CHANGES
int lineClamp; // An Apple extension. Not really CSS3 but not worth making a new struct over.
QValueList<StyleDashboardRegion> m_dashboardRegions;
-#endif
float opacity; // Whether or not we're transparent.
DataRef<StyleFlexibleBoxData> flexibleBox; // Flexible box properties
DataRef<StyleMarqueeData> marquee; // Marquee properties
@@ -825,9 +815,7 @@
EWordWrap wordWrap : 1; // Flag used for word wrap
ENBSPMode nbspMode : 1;
EKHTMLLineBreak khtmlLineBreak : 1;
-#if APPLE_CHANGES
bool textSizeAdjust : 1; // An Apple extension. Not really CSS3 but not worth making a new struct over.
-#endif
private:
StyleCSS3InheritedData &operator=(const StyleCSS3InheritedData &);
@@ -1402,11 +1390,9 @@
EMatchNearestMailBlockquoteColor matchNearestMailBlockquoteColor() const { return css3NonInheritedData->matchNearestMailBlockquoteColor; }
// End CSS3 Getters
-#if APPLE_CHANGES
// Apple-specific property getter methods
int lineClamp() const { return css3NonInheritedData->lineClamp; }
bool textSizeAdjust() const { return css3InheritedData->textSizeAdjust; }
-#endif
// attribute setter methods
@@ -1428,7 +1414,6 @@
void setMinHeight(Length v) { SET_VAR(box,min_height,v) }
void setMaxHeight(Length v) { SET_VAR(box,max_height,v) }
-#if APPLE_CHANGES
QValueList<StyleDashboardRegion> dashboardRegions() const { return css3NonInheritedData->m_dashboardRegions; }
void setDashboardRegions(QValueList<StyleDashboardRegion> regions) { SET_VAR(css3NonInheritedData,m_dashboardRegions,regions); }
void setDashboardRegion (int type, QString label, Length t, Length r, Length b, Length l, bool append) {
@@ -1444,7 +1429,6 @@
}
css3NonInheritedData.access()->m_dashboardRegions.append (region);
}
-#endif
void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); }
void resetBorderTop() { SET_VAR(surround, border.top, BorderValue()) }
@@ -1625,20 +1609,10 @@
void setMatchNearestMailBlockquoteColor(EMatchNearestMailBlockquoteColor c) { SET_VAR(css3NonInheritedData, matchNearestMailBlockquoteColor, c); }
// End CSS3 Setters
-#if APPLE_CHANGES
// Apple-specific property setters
void setLineClamp(int c) { SET_VAR(css3NonInheritedData, lineClamp, c); }
void setTextSizeAdjust(bool b) { SET_VAR(css3InheritedData, textSizeAdjust, b); }
-#endif
-#if !APPLE_CHANGES
- QPalette palette() const { return visual->palette; }
- void setPaletteColor(QPalette::ColorGroup g, QColorGroup::ColorRole r, const QColor& c);
- void resetPalette() // Called when the desktop color scheme changes.
- {
- const_cast<StyleVisualData *>(visual.get())->palette = QApplication::palette();
- }
-#endif
ContentData* contentData() { return content; }
bool contentDataEquivalent(RenderStyle* otherStyle);
@@ -1750,13 +1724,11 @@
static EMatchNearestMailBlockquoteColor initialMatchNearestMailBlockquoteColor() { return BCNORMAL; }
static EAppearance initialAppearance() { return NoAppearance; }
-#if APPLE_CHANGES
// Keep these at the end.
static int initialLineClamp() { return -1; }
static bool initialTextSizeAdjust() { return true; }
static const QValueList<StyleDashboardRegion>& initialDashboardRegions();
static const QValueList<StyleDashboardRegion>& noneDashboardRegions();
-#endif
};
1.93 +0 -6 WebCore/khtml/rendering/render_text.h
Index: render_text.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_text.h,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- render_text.h 8 Nov 2005 00:49:09 -0000 1.92
+++ render_text.h 21 Nov 2005 01:20:28 -0000 1.93
@@ -260,12 +260,10 @@
virtual InlineBox *inlineBox(int offset, EAffinity affinity = UPSTREAM);
-#if APPLE_CHANGES
int widthFromCache(const Font *, int start, int len, int tabWidth, int xpos) const;
bool shouldUseMonospaceCache(const Font *) const;
void cacheWidths();
bool allAscii() const;
-#endif
virtual int caretMinOffset() const;
virtual int caretMaxOffset() const;
@@ -277,9 +275,7 @@
bool atLineWrap(InlineTextBox *box, int offset);
bool containsReversedText() { return m_containsReversedText; }
-#if APPLE_CHANGES
public:
-#endif
InlineTextBox * findNextInlineTextBox( int offset, int &pos ) const;
protected: // members
@@ -307,11 +303,9 @@
bool m_containsReversedText : 1;
// 22 bits left
-#if APPLE_CHANGES
mutable bool m_allAsciiChecked:1;
mutable bool m_allAscii:1;
int m_monospaceCharacterWidth;
-#endif
};
// Used to represent a text substring of an element, e.g., for text runs that are split because of
1.274 +0 -72 WebCore/khtml/xml/dom_docimpl.cpp
Index: dom_docimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_docimpl.cpp,v
retrieving revision 1.273
retrieving revision 1.274
diff -u -r1.273 -r1.274
--- dom_docimpl.cpp 19 Nov 2005 02:36:25 -0000 1.273
+++ dom_docimpl.cpp 21 Nov 2005 01:20:39 -0000 1.274
@@ -89,10 +89,8 @@
using XBL::XBLBindingManager;
#endif
-#if APPLE_CHANGES
#include "KWQAccObjectCache.h"
#include "KWQLogging.h"
-#endif
#if SVG_SUPPORT
#include "dom_kdomdocumentwrapper.h"
@@ -377,7 +375,6 @@
#ifdef KHTML_XSLT
, m_transformSource(0)
#endif
-#if APPLE_CHANGES
, m_finishedParsing(this, SIGNAL(finishedParsing()))
, m_inPageCache(false)
, m_savedRenderer(0)
@@ -390,7 +387,6 @@
, m_dashboardRegionsDirty(false)
, m_selfOnlyRefCount(0)
, m_selectedRadioButtons(0)
-#endif
{
document.resetSkippingRef(this);
@@ -400,9 +396,7 @@
m_view = v;
m_renderArena = 0;
-#if APPLE_CHANGES
m_accCache = 0;
-#endif
if ( v ) {
m_docLoader = new DocLoader(v->part(), this );
@@ -493,10 +487,8 @@
DocumentImpl::~DocumentImpl()
{
assert(!m_render);
-#if APPLE_CHANGES
assert(!m_inPageCache);
assert(m_savedRenderer == 0);
-#endif
KJS::ScriptInterpreter::forgetAllDOMNodesForDocument(this);
@@ -538,12 +530,10 @@
delete m_bindingManager;
#endif
-#if APPLE_CHANGES
if (m_accCache){
delete m_accCache;
m_accCache = 0;
}
-#endif
if (m_decoder){
m_decoder->deref();
@@ -868,27 +858,7 @@
if (!p)
return;
-#if APPLE_CHANGES
KWQ(p)->setTitle(m_title);
-#else
- QString titleStr = m_title.qstring();
- for (int i = 0; i < titleStr.length(); ++i)
- if (titleStr[i] < ' ')
- titleStr[i] = ' ';
- titleStr = titleStr.stripWhiteSpace();
- titleStr.compose();
- if ( !p->parentPart() ) {
- if (titleStr.isNull() || titleStr.isEmpty()) {
- // empty title... set window caption as the URL
- KURL url = m_url;
- url.setRef(QString::null);
- url.setQuery(QString::null);
- titleStr = url.url();
- }
-
- emit p->setWindowCaption( KStringHandler::csqueeze( titleStr, 128 ) );
- }
-#endif
}
void DocumentImpl::setTitle(DOMString title, NodeImpl *titleElement)
@@ -1026,17 +996,13 @@
fontDef.family = *(f.firstFamily());
fontDef.italic = f.italic();
fontDef.weight = f.weight();
-#if APPLE_CHANGES
bool printing = m_paintDevice && (m_paintDevice->devType() == QInternal::Printer);
fontDef.usePrinterFont = printing;
-#endif
if (m_view) {
const KHTMLSettings *settings = m_view->part()->settings();
-#if APPLE_CHANGES
if (printing && !settings->shouldPrintBackgrounds()) {
_style->setForceBackgroundsToWhite(true);
}
-#endif
QString stdfont = settings->stdFontName();
if ( !stdfont.isEmpty() ) {
fontDef.family.setFamily(stdfont);
@@ -1094,12 +1060,6 @@
// kdDebug() << "UPDATERENDERING: "<<endl;
StyleChange change = NoChange;
-#if 0
- if ( m_styleSelectorDirty ) {
- recalcStyleSelector();
- change = Force;
- }
-#endif
recalcStyle( change );
// kdDebug() << "UPDATERENDERING time used="<<time.elapsed()<<endl;
@@ -1150,9 +1110,7 @@
void DocumentImpl::attach()
{
assert(!attached());
-#if APPLE_CHANGES
assert(!m_inPageCache);
-#endif
if ( m_view )
setPaintDevice( m_view );
@@ -1183,13 +1141,11 @@
// indicate destruction mode, i.e. attached() but m_render == 0
m_render = 0;
-#if APPLE_CHANGES
if (m_inPageCache) {
if ( render )
getAccObjectCache()->detach(render);
return;
}
-#endif
// Empty out these lists as a performance optimization, since detaching
// all the individual render objects will cause all the RenderImage
@@ -1241,7 +1197,6 @@
m_disconnectedNodesWithEventListeners.clear();
}
-#if APPLE_CHANGES
KWQAccObjectCache* DocumentImpl::getAccObjectCache()
{
// The only document that actually has a KWQAccObjectCache is the top-level
@@ -1278,7 +1233,6 @@
m_accCache = new KWQAccObjectCache;
return m_accCache;
}
-#endif
void DocumentImpl::setVisuallyOrdered()
{
@@ -1307,13 +1261,11 @@
}
}
-#if APPLE_CHANGES
// send the AXSelectedTextChanged notification only if the new selection is non-null,
// because null selections are only transitory (e.g. when starting an EditCommand, currently)
if (KWQAccObjectCache::accessibilityEnabled() && s.start().isNotNull() && s.end().isNotNull()) {
getAccObjectCache()->postNotificationToTopWebArea(renderer(), "AXSelectedTextChanged");
}
-#endif
}
@@ -1464,10 +1416,8 @@
if (view() && renderer() && (!renderer()->firstChild() || renderer()->needsLayout()))
view()->layout();
}
-#if APPLE_CHANGES
if (renderer() && KWQAccObjectCache::accessibilityEnabled())
getAccObjectCache()->postNotification(renderer(), "AXLoadComplete");
-#endif
}
void DocumentImpl::setParsing(bool b)
@@ -1857,12 +1807,8 @@
bool ok = false;
int delay = 0;
delay = str.toInt(&ok);
-#if APPLE_CHANGES
// We want a new history item if the refresh timeout > 1 second
if(ok && part) part->scheduleRedirection(delay, part->url().url(), delay <= 1);
-#else
- if(ok && part) part->scheduleRedirection(delay, part->url().url() );
-#endif
} else {
double delay = 0;
bool ok = false;
@@ -1876,12 +1822,8 @@
if ( str.length() && str[0] == '=' ) str = str.mid( 1 ).stripWhiteSpace();
str = parseURL( DOMString(str) ).qstring();
if ( ok && part )
-#if APPLE_CHANGES
// We want a new history item if the refresh timeout > 1 second
part->scheduleRedirection(delay, completeURL( str ), delay <= 1);
-#else
- part->scheduleRedirection(delay, completeURL( str ));
-#endif
}
}
else if(strcasecmp(equiv, "expires") == 0)
@@ -2045,10 +1987,6 @@
recalcStyleSelector();
recalcStyle(Force);
-#if 0
-
- m_styleSelectorDirty = true;
-#endif
#ifdef INSTRUMENT_LAYOUT_SCHEDULING
if (!ownerElement())
@@ -2198,7 +2136,6 @@
m_activeNode = newActiveNode;
}
-#if APPLE_CHANGES
bool DocumentImpl::relinquishesEditingFocus(NodeImpl *node)
{
@@ -2235,7 +2172,6 @@
setDashboardRegionsDirty (false);
}
-#endif
static QWidget *widgetForNode(NodeImpl *focusNode)
{
@@ -2256,10 +2192,8 @@
if (m_focusNode == newFocusNode)
return true;
-#if APPLE_CHANGES
if (m_focusNode && m_focusNode->isContentEditable() && !relinquishesEditingFocus(m_focusNode.get()))
return false;
-#endif
bool focusChangeBlocked = false;
SharedPtr<NodeImpl> oldFocusNode = m_focusNode;
@@ -2291,13 +2225,11 @@
}
if (newFocusNode) {
-#if APPLE_CHANGES
if (newFocusNode->isContentEditable() && !acceptsEditingFocus(newFocusNode)) {
// delegate blocks focus change
focusChangeBlocked = true;
goto SetFocusNodeDone;
}
-#endif
// Set focus on the new node
m_focusNode = newFocusNode;
m_focusNode->dispatchHTMLEvent(focusEvent, false, false);
@@ -2337,10 +2269,8 @@
}
}
-#if APPLE_CHANGES
if (!focusChangeBlocked && m_focusNode && KWQAccObjectCache::accessibilityEnabled())
getAccObjectCache()->handleFocusedUIElementChanged();
-#endif
SetFocusNodeDone:
updateRendering();
@@ -2726,7 +2656,6 @@
return *it;
}
-#if APPLE_CHANGES
void DocumentImpl::setDecoder(Decoder *decoder)
{
@@ -2826,7 +2755,6 @@
return result;
}
-#endif // APPLE_CHANGES
// ----------------------------------------------------------------------------
// Support for Javascript execCommand, and related methods
1.140 +0 -10 WebCore/khtml/xml/dom_docimpl.h
Index: dom_docimpl.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_docimpl.h,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -r1.139 -r1.140
--- dom_docimpl.h 19 Nov 2005 02:36:25 -0000 1.139
+++ dom_docimpl.h 21 Nov 2005 01:20:40 -0000 1.140
@@ -39,10 +39,8 @@
#include <kurl.h>
-#if APPLE_CHANGES
#include "KWQSignal.h"
#include "decoder.h"
-#endif
#include <kxmlcore/HashMap.h>
@@ -52,9 +50,7 @@
class KHTMLPart;
class RenderArena;
-#if APPLE_CHANGES
class KWQAccObjectCache;
-#endif
namespace khtml {
class CSSStyleSelector;
@@ -317,9 +313,7 @@
RenderArena* renderArena() { return m_renderArena; }
-#if APPLE_CHANGES
KWQAccObjectCache* getAccObjectCache();
-#endif
// to get visually ordered hebrew and arabic pages right
void setVisuallyOrdered();
@@ -701,9 +695,7 @@
QPtrDict< QValueList<DocumentMarker> > m_markers;
-#if APPLE_CHANGES
KWQAccObjectCache* m_accCache;
-#endif
QPtrList<HTMLImageLoader> m_imageLoadEventDispatchSoonList;
QPtrList<HTMLImageLoader> m_imageLoadEventDispatchingList;
@@ -732,7 +724,6 @@
int m_docID; // A unique document identifier used for things like document-specific mapped attributes.
-#if APPLE_CHANGES
public:
KWQSignal m_finishedParsing;
@@ -805,7 +796,6 @@
typedef HashMap<DOMStringImpl*, HTMLInputElementImpl*, PointerHash<DOMStringImpl*> > NameToInputMap;
typedef HashMap<HTMLFormElementImpl*, NameToInputMap*, PointerHash<HTMLFormElementImpl*> > FormToGroupMap;
FormToGroupMap* m_selectedRadioButtons;
-#endif
};
class DocumentFragmentImpl : public ContainerNodeImpl
1.92 +0 -14 WebCore/khtml/xml/dom_elementimpl.cpp
Index: dom_elementimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_elementimpl.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- dom_elementimpl.cpp 15 Nov 2005 02:05:43 -0000 1.91
+++ dom_elementimpl.cpp 21 Nov 2005 01:20:40 -0000 1.92
@@ -526,20 +526,6 @@
RenderStyle* _style = m_render ? m_render->style() : 0;
bool hasParentRenderer = parent() ? parent()->renderer() : false;
-#if 0
- const char* debug;
- switch(change) {
- case NoChange: debug = "NoChange";
- break;
- case NoInherit: debug= "NoInherit";
- break;
- case Inherit: debug = "Inherit";
- break;
- case Force: debug = "Force";
- break;
- }
- qDebug("recalcStyle(%d: %s)[%p: %s]", change, debug, this, tagName().qstring().latin1());
-#endif
if ( hasParentRenderer && (change >= Inherit || changed()) ) {
RenderStyle *newStyle = getDocument()->styleSelector()->styleForElement(this);
newStyle->ref();
1.62 +0 -4 WebCore/khtml/xml/dom_elementimpl.h
Index: dom_elementimpl.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_elementimpl.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- dom_elementimpl.h 17 Nov 2005 22:29:13 -0000 1.61
+++ dom_elementimpl.h 21 Nov 2005 01:20:41 -0000 1.62
@@ -32,11 +32,9 @@
#include "css/css_valueimpl.h"
#include "dom_qname.h"
-#if APPLE_CHANGES
#ifdef __OBJC__
#define id id_AVOID_KEYWORD
#endif
-#endif
#include "dom_atomicstringlist.h"
@@ -479,8 +477,6 @@
}; //namespace
-#if APPLE_CHANGES
#undef id
-#endif
#endif
1.214 +0 -13 WebCore/khtml/xml/dom_nodeimpl.cpp
Index: dom_nodeimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.cpp,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -r1.213 -r1.214
--- dom_nodeimpl.cpp 19 Nov 2005 02:36:25 -0000 1.213
+++ dom_nodeimpl.cpp 21 Nov 2005 01:20:41 -0000 1.214
@@ -58,13 +58,8 @@
#include "xbl/xbl_binding_manager.h"
#endif
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
#include "KWQLogging.h"
-#else
-#define ASSERT(assertion) assert(assertion)
-#define LOG(channel, formatAndArgs...) ((void)0)
-#endif
using namespace khtml;
@@ -914,16 +909,10 @@
keyboardEventImpl->ref();
bool r = dispatchEvent(keyboardEventImpl,exceptioncode,true);
-#if APPLE_CHANGES
// we want to return false if default is prevented (already taken care of)
// or if the element is default-handled by the DOM. Otherwise we let it just
// let it get handled by AppKit
if (keyboardEventImpl->defaultHandled())
-#else
- // the default event handler should accept() the internal QKeyEvent
- // to prevent the view from further evaluating it.
- if (!keyboardEventImpl->defaultPrevented() && !keyboardEventImpl->qKeyEvent->isAccepted())
-#endif
r = false;
keyboardEventImpl->deref();
@@ -1421,10 +1410,8 @@
void NodeImpl::createRendererIfNeeded()
{
-#if APPLE_CHANGES
if (!getDocument()->shouldCreateRenderers())
return;
-#endif
assert(!attached());
assert(!m_render);
1.82 +0 -5 WebCore/khtml/xml/dom_position.cpp
Index: dom_position.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_position.cpp,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- dom_position.cpp 8 Oct 2005 00:50:30 -0000 1.81
+++ dom_position.cpp 21 Nov 2005 01:20:42 -0000 1.82
@@ -47,13 +47,8 @@
#include "editing/visible_text.h"
#include "htmlnames.h"
-#if APPLE_CHANGES
#include <kxmlcore/Assertions.h>
#include "KWQLogging.h"
-#else
-#define ASSERT(assertion) assert(assertion)
-#define LOG(channel, formatAndArgs...) ((void)0)
-#endif
using khtml::EAffinity;
using khtml::InlineBox;
1.22 +0 -2 WebCore/khtml/xml/dom_textimpl.h
Index: dom_textimpl.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_textimpl.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- dom_textimpl.h 8 Nov 2005 08:11:13 -0000 1.21
+++ dom_textimpl.h 21 Nov 2005 01:20:42 -0000 1.22
@@ -30,10 +30,8 @@
namespace DOM {
class DocumentImpl;
-#if APPLE_CHANGES
class CharacterData;
class Text;
-#endif
class CharacterDataImpl : public NodeImpl
{
1.16 +0 -2 WebCore/khtml/xml/dom_xmlimpl.h
Index: dom_xmlimpl.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_xmlimpl.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- dom_xmlimpl.h 8 Nov 2005 08:11:14 -0000 1.15
+++ dom_xmlimpl.h 21 Nov 2005 01:20:42 -0000 1.16
@@ -35,9 +35,7 @@
class DocumentImpl;
class DOMString;
-#if APPLE_CHANGES
class ProcessingInstruction;
-#endif
class EntityImpl : public ContainerNodeImpl
{
1.52 +0 -17 WebCore/khtml/xml/xml_tokenizer.cpp
Index: xml_tokenizer.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/xml_tokenizer.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- xml_tokenizer.cpp 8 Nov 2005 08:11:14 -0000 1.51
+++ xml_tokenizer.cpp 21 Nov 2005 01:20:43 -0000 1.52
@@ -52,17 +52,13 @@
typedef HashMap<DOMStringImpl *, DOMStringImpl *> PrefixForNamespaceMap;
Tokenizer::Tokenizer() : m_parserStopped(false)
-#if APPLE_CHANGES
, m_finishedParsing(this, SIGNAL(finishedParsing()))
-#endif
{
}
void Tokenizer::finishedParsing()
{
-#if APPLE_CHANGES
m_finishedParsing.call();
-#endif
}
class XMLTokenizer : public Tokenizer, public CachedObjectClient
@@ -430,25 +426,12 @@
QString format;
switch (type) {
case warning:
-#if APPLE_CHANGES
format = QString("warning on line %2 at column %3: %1");
-#else
- format = i18n( "warning: %1 in line %2, column %3\n" );
-#endif
break;
case fatal:
-#if APPLE_CHANGES
// fall through
-#else
- format = i18n( "fatal error: %1 in line %2, column %3\n" );
- break;
-#endif
default:
-#if APPLE_CHANGES
format = QString("error on line %2 at column %3: %1");
-#else
- format = i18n( "error: %1 in line %2, column %3\n" );
-#endif
}
char *m;
1.23 +0 -4 WebCore/khtml/xml/xml_tokenizer.h
Index: xml_tokenizer.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/xml_tokenizer.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- xml_tokenizer.h 8 Nov 2005 08:11:14 -0000 1.22
+++ xml_tokenizer.h 21 Nov 2005 01:20:43 -0000 1.23
@@ -28,9 +28,7 @@
#include <qmap.h>
#include "misc/stringit.h"
-#if APPLE_CHANGES
#include "KWQSignal.h"
-#endif
class KHTMLView;
@@ -76,10 +74,8 @@
signals:
void finishedParsing();
-#if APPLE_CHANGES
private:
KWQSignal m_finishedParsing;
-#endif
};
Tokenizer *newXMLTokenizer(DOM::DocumentImpl *, KHTMLView * = 0);
More information about the webkit-changes
mailing list