18 years ago Reviewed by John
kocienda [Fri, 3 Dec 2004 17:31:30 +0000 (17:31 +0000)]
    Reviewed by John

        Terminology change in execCommand command identifiers. Specifically, the name of
        "InsertNewline" command has been changed to "InsertLineBreak". This matches the
        terminology used by AppKit. It is also more accurate, since the insertion of a
        "br" element is what the command does. The inspiration for this change is so the
        -insertNewline AppKit method can be mapped to insert a new "div" element in
        a document and avoid ambiguity with what the javascript editing command does.

        * khtml/editing/jsediting.cpp
        * layout-tests/editing/deleting/delete-tab-004.html
        * layout-tests/editing/editing.js
        * layout-tests/editing/inserting/insert-3654864-fix.html
        * layout-tests/editing/inserting/insert-3659587-fix.html
        * layout-tests/editing/inserting/insert-3775316-fix.html
        * layout-tests/editing/inserting/insert-3800346-fix.html
        * layout-tests/editing/inserting/insert-br-001.html
        * layout-tests/editing/inserting/insert-br-002.html
        * layout-tests/editing/inserting/insert-br-003.html
        * layout-tests/editing/inserting/insert-br-004.html
        * layout-tests/editing/inserting/insert-br-005.html
        * layout-tests/editing/inserting/insert-br-006.html
        * layout-tests/editing/inserting/insert-br-007.html
        * layout-tests/editing/inserting/insert-br-008.html
        * layout-tests/editing/inserting/insert-tab-004.html
        * layout-tests/editing/inserting/insert-text-with-newlines.html
        * layout-tests/editing/pasteboard/paste-text-010.html

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

18 years ago Reviewed by John
kocienda [Fri, 3 Dec 2004 00:33:24 +0000 (00:33 +0000)]
    Reviewed by John

        Fix for this bug:

        <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
        at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
        (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
        in a block and the document is in quirks mode, add an additional br to make the one in the
        replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
        * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
        * layout-tests/editing/inserting/insert-3786362-fix.html: Added.

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

18 years agoWebKit:
rjw [Fri, 3 Dec 2004 00:24:26 +0000 (00:24 +0000)]
Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images

Ensure that the document is cleared when leaving a non-HTML page.  This ensures that
the b/f cache won't incorrectly trash the previous state when restoring.

        Reviewed by John.

        * WebView.subproj/WebFrame.m:
        (-[WebFrame _setState:]):

Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images

Ensure that the document is cleared when leaving a non-HTML page.  This ensures that
the b/f cache won't incorrectly trash the previous state when restoring.

        Reviewed by John.

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
        (-[WebCoreBridge canCachePage]):
        (-[WebCoreBridge clear]):

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

18 years ago Reviewed by Richard
kocienda [Thu, 2 Dec 2004 23:08:11 +0000 (23:08 +0000)]
    Reviewed by Richard

        <rdar://problem/3748323> Problem with -[WebView editableDOMRangeForPoint:] (-isFlipped not taken into account?)
        <rdar://problem/3852590> REGRESSION (Mail): Dropped content appears in wrong place if Mail message is scrolled down

        When implementing drag and drop, moveDragCaretToPoint: and editableDOMRangeForPoint: are used in
        concert to track the mouse and determine a drop location, respectively. However, moveDragCaretToPoint:
        did a conversion of the passed-in point to the document view's coordinate space, whereas
        editableDOMRangeForPoint: did not. Now it does.

        Note that I will need to coordinate with Grant to have him roll out some code in Mail that
        attempts to work around this problem (unsuccessfully), and actually manages to block the
        real fix (which needs to be in WebKit).

        * WebView.subproj/WebView.m:
        (-[WebView editableDOMRangeForPoint:]): Convert the passed-in point to the document view's coordinate space.

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

18 years ago Fixed <rdar://problem/3895810> FATAL ERROR: <WebTextRenderer: 0x9328a20> unable...
rjw [Thu, 2 Dec 2004 22:17:22 +0000 (22:17 +0000)]
Fixed <rdar://problem/3895810> FATAL ERROR: <WebTextRenderer: 0x9328a20> unable to initialize with font "Times-Roman 16.00 pt. S ....

We have a hack to replace Times with Times New Roman if we fail
        to setup Times.  If we then fail to setup Times New Roman we
        don't attempt to further fallback to the system font.  Added
        that additional fallback.

        Reviewed by Ken.

        * WebCoreSupport.subproj/WebTextRenderer.m:
        (+[WebTextRenderer webFallbackFontFamily]):
        (-[WebTextRenderer initWithFont:usingPrinterFont:]):

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

18 years ago Fixed build problem on Tiger8A821. Private macro and function
rjw [Thu, 2 Dec 2004 21:37:50 +0000 (21:37 +0000)]
Fixed build problem on Tiger8A821.  Private macro and function
we were using have been deprecated,

        Reviewed by Vicki.

        * WebCoreSupport.subproj/WebTextRenderer.m:
        (-[WebTextRenderer initWithFont:usingPrinterFont:]):

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

18 years ago Reviewed by Richard
kocienda [Thu, 2 Dec 2004 21:04:14 +0000 (21:04 +0000)]
    Reviewed by Richard

        Fix for this bug:

        <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text

        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
        was found. This can happen in cases where the DOM was built from malformed markup (as in the case
        of this bug where there is content after the body tag). Did a little code clean up as well.
        (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.

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

18 years ago Reviewed by Chris
kocienda [Thu, 2 Dec 2004 19:05:07 +0000 (19:05 +0000)]
    Reviewed by Chris

        Fix for this bug:

        <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left

        * khtml/khtml_part.cpp:
        (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
        to figure out which end of the selection to extend.

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

18 years ago Reviewed by Ken Kocienda.
harrison [Thu, 2 Dec 2004 18:22:03 +0000 (18:22 +0000)]
    Reviewed by Ken Kocienda.

<rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.

        * khtml/editing/visible_text.cpp:
        Distinguish BR from whitespace.
        * khtml/editing/visible_text.h:
        Distinguish BR from whitespace.
        * khtml/editing/visible_units.cpp:
        Use UPSTREAM visible position now that SimplifiedBackwardsTextIterator distinguishes BR from whitespace.  Otherwise, double-clicking at end of line would result in caret selection at start of next line.

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

18 years ago Reviewed by John
kocienda [Thu, 2 Dec 2004 17:43:46 +0000 (17:43 +0000)]
    Reviewed by John

        Fix for this bug:

        <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24

        * khtml/xml/dom_position.cpp:
        (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
        of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
        exception trying to use a Position returned from this function to set the boundary point of a Range (which
        eventually led to the crash). Since this crash happened, it seems like this function was failing in its
        contract to return a range-compliant position, hence the need for this fix.

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

18 years ago Fixed: <rdar://problem/3879870> Flash Player unable to stop data stream from continu...
cblu [Wed, 1 Dec 2004 22:44:49 +0000 (22:44 +0000)]
Fixed: <rdar://problem/3879870> Flash Player unable to stop data stream from continuing to download by returning -1 from NPP_Write
Also improved and cleaned-up the plug-in stream termination code.

        Reviewed by john.

        * Plugins.subproj/WebBaseNetscapePluginStream.h:
        * Plugins.subproj/WebBaseNetscapePluginStream.m:
        (+[WebBaseNetscapePluginStream reasonForError:]): return NPRES_DONE for a nil error
        (-[WebBaseNetscapePluginStream _pluginCancelledConnectionError]): new, factored out from other methods
        (-[WebBaseNetscapePluginStream errorForReason:]): new
        (-[WebBaseNetscapePluginStream dealloc]): release MIME type
        (-[WebBaseNetscapePluginStream setMIMEType:]): new
        (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:]): call setMIMEType so we can use it in _pluginCancelledConnectionError, call renamed methods
        (-[WebBaseNetscapePluginStream _destroyStream]): prepended underscore, replaced some early returns with asserts as the callers are now smarter
        (-[WebBaseNetscapePluginStream _destroyStreamWithReason:]): prepended underscore, only call _destroyStream if there is an error or if the load is complete and there is no more data to be streamed
        (-[WebBaseNetscapePluginStream cancelLoadWithError:]): new, overridden by subclasses to cancel the actual NSURLConnection
        (-[WebBaseNetscapePluginStream destroyStreamWithError:]): new, calls _destroyStreamWithReason
        (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): call renamed methods
        (-[WebBaseNetscapePluginStream _deliverData]): prepended underscore, call cancelLoadAndDestroyStreamWithError if NPP_Write returns a negative number
        * Plugins.subproj/WebBaseNetscapePluginView.m:
        (-[WebBaseNetscapePluginView destroyStream:reason:]): call cancelLoadAndDestroyStreamWithError
        * Plugins.subproj/WebNetscapePluginRepresentation.m:
        (-[WebNetscapePluginRepresentation receivedError:withDataSource:]): call destroyStreamWithError
        (-[WebNetscapePluginRepresentation cancelLoadWithError:]): new, override method, tell the data source to stop loading
        * Plugins.subproj/WebNetscapePluginStream.m:
        (-[WebNetscapePluginStream cancelLoadWithError:]): new, override method, tell the loader to stop
        (-[WebNetscapePluginStream stop]): call cancelLoadAndDestroyStreamWithError
        (-[WebNetscapePluginConnectionDelegate isDone]): new
        (-[WebNetscapePluginConnectionDelegate didReceiveResponse:]): call cancelLoadAndDestroyStreamWithError
        (-[WebNetscapePluginConnectionDelegate didFailWithError:]): call destroyStreamWithError

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

18 years agoFix deployment build bustage
hyatt [Wed, 1 Dec 2004 22:11:05 +0000 (22:11 +0000)]
Fix deployment build bustage

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

18 years ago Reviewed by me
kocienda [Wed, 1 Dec 2004 21:59:51 +0000 (21:59 +0000)]
    Reviewed by me

        Moving code only.

        * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
        regard to other editing commands. The class had a name change ages ago, and it was never
        * khtml/editing/htmlediting.h: Ditto.

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

18 years ago Reviewed by Hyatt
kocienda [Wed, 1 Dec 2004 21:52:22 +0000 (21:52 +0000)]
    Reviewed by Hyatt

        Some improvements for paste, including some new code to annotate
        whitespace when writing to the pasteboard to ensure that the meaning
        of the markup on the pasteboard is unambiguous.

        There is also new code for reading this annotated markup from the pasteboard,
        removing the nodes that were added only to prevent ambiguity.

        * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
        The header should have been added earlier, but I did not do so.
        * khtml/editing/html_interchange.cpp: Added.
        * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
        Also fixed a bug in the code that counts blocks in a fragment.
        (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
        (khtml::ReplacementFragment::insertNodeBefore): New helper.
        (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
        for the replacement after deleting. This was causing a bug when pasting at the end of a block.
        * khtml/editing/htmlediting.h: Add some new declarations.
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::stringValueForRange): New helper.
        (NodeImpl::renderedText): New helper to return only the rendered text in a node.
        (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
        should be added. Called by the paste code.
        * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.

        New test to check the khtml::ReplaceSelectionCommand::doApply fix.
        * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-010.html: Added.

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

18 years ago Reviewed by Harrison.
kdecker [Wed, 1 Dec 2004 19:56:03 +0000 (19:56 +0000)]
    Reviewed by Harrison.

Fixed: <rdar://problem/3228878> potential performance problem in finding in large framesets

Got rid of O(N^2) conditions in _nextSibling and _previousSibling of where we were looking up self in the parent array of frames.

        * WebView.subproj/WebFrame.h: Added two new pointers, one for the previous kid and one for the next kid
        * WebView.subproj/WebFrame.m:
        (-[WebFrame _addChild:]): Updates the previous frame and the next frame after this child
        (-[WebFrame _removeChild:]): ditto
        (-[WebFrame _nextSibling]): just return the pointer now
        (-[WebFrame _previousSibling]): ditto

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

18 years ago * ChangeLog: removed conflict marker
cblu [Wed, 1 Dec 2004 01:25:04 +0000 (01:25 +0000)]
    * ChangeLog: removed conflict marker

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

18 years agoWebCore:
cblu [Wed, 1 Dec 2004 01:23:00 +0000 (01:23 +0000)]

<rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
<rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)

        Reviewed by darin.

        * khtml/misc/loader.cpp:
        (CachedObject::~CachedObject): release m_allData
        (CachedObject::setAllData): new
        (Loader::servePendingRequests): connect slotAllData
        (Loader::slotAllData): new
        (Cache::requestImage): tweak
        * khtml/misc/loader.h:
        (khtml::CachedObject::CachedObject): set allData to 0
        (khtml::CachedObject::allData): new
        * kwq/KWQKJobClasses.h:
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJob::TransferJob): set m_allData
        (KIO::TransferJob::emitAllData): new
        * kwq/KWQLoader.mm:
        (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
        * kwq/KWQResourceLoader.mm:
        (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
        * kwq/KWQSlot.mm:
        (KWQSlot::KWQSlot): support for slotAllData
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreResourceLoader.h:


<rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
<rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)

        Reviewed by darin.

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge objectLoadedFromCacheWithURL:response:data:]): renamed to pass all data for the resource, moved delegate code to new method
        (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): call renamed method
        * WebCoreSupport.subproj/WebSubresourceClient.m:
        (-[WebSubresourceClient didFinishLoading]): call renamed method
        * WebView.subproj/WebFrame.m:
        (-[WebFrame _opened]): call _sendResourceLoadDelegateMessagesForURL:response:length:, not objectLoadedFromCacheWithURL:response:data:
        (-[WebFrame _internalLoadDelegate]):
        (-[WebFrame _sendResourceLoadDelegateMessagesForURL:response:length:]): moved from objectLoadedFromCacheWithURL:response:data:
        * WebView.subproj/WebFrameInternal.h:

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

18 years ago Reviewed by John.
mjs [Wed, 1 Dec 2004 00:54:40 +0000 (00:54 +0000)]
    Reviewed by John.

<rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)

        * khtml/khtml_part.cpp:
(KHTMLPart::begin): call setParsing on document here after opening
- from now on we'll only set parsing to true for a document open
caused by page loading, not a programmatic one.
* khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::open): don't setParsing to true here any more.

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

18 years ago Reviewed by John.
mjs [Tue, 30 Nov 2004 23:12:25 +0000 (23:12 +0000)]
    Reviewed by John.

- fix recent regression from collection perf fixes.

        * khtml/html/html_miscimpl.cpp:
        (HTMLFormCollectionImpl::updateNameCache): Look up the name
attribute in the name cache, not the id cache (d'oh!)

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

18 years ago Reviewed by Ken.
darin [Tue, 30 Nov 2004 21:08:49 +0000 (21:08 +0000)]
    Reviewed by Ken.

        - rolled in a KDE fix for a problem that may underlie a number of crashes

        * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
        the KDE guys to fix a subtle problem. Code said "n = n =".

        - rolled in a KDE fix for a containingBlock crash

        * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
        elements that can not be a containingBlock. They said this fixes a crash, although I did not look
        into that further.

        - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)

        * kwq/KWQButton.mm:
        (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
        (-[KWQButton detachQButton]): Added.
        (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
        (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
        (-[KWQButton widget]): Added.
        (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
        (-[KWQButton resignFirstResponder]): Ditto.
        (-[KWQButton canBecomeKeyView]): Ditto.
        (QButton::QButton): Remove target and action setup; handled in KWQButton now.
        (QButton::~QButton): Call detachQButton instead of setTarget:nil.

        * kwq/KWQComboBox.mm:
        (QComboBox::~QComboBox): Call detachQComboBox.
        (-[KWQPopUpButtonCell detachQComboBox]): Added.
        (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
        (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
        (-[KWQPopUpButton action:]): Ditto.
        (-[KWQPopUpButton widget]): Tweaked.
        (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
        (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
        (-[KWQPopUpButton resignFirstResponder]): Ditto.
        (-[KWQPopUpButton canBecomeKeyView]): Ditto.

        * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.

        * kwq/KWQListBox.mm:
        (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.

        * kwq/KWQScrollBar.h: Removed m_scroller field.
        * kwq/KWQScrollBar.mm:
        (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
        (-[KWQScrollBar detachQScrollBar]): Added.
        (-[KWQScrollBar widget]): Added.
        (-[KWQScrollBar mouseDown:]): Added.  Calls QWidget::beforeMouseDown and afterMouseDown.
        (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
        (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
        (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
        (QScrollBar::setKnobProportion): Ditto.
        (QScrollBar::scrollbarHit): Ditto.

        * kwq/KWQScrollView.mm:
        (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
        hack where we don't remove right away when doing mouse tracking.
        (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
        the hack where we don't add right away when doing mouse tracking.

        * kwq/KWQSlider.h: Added destructor.
        * kwq/KWQSlider.mm:
        (-[KWQSlider initWithQSlider:]): Tweaked a little.
        (-[KWQSlider detachQSlider]): Added.
        (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
        (-[KWQSlider widget]): Added.
        (QSlider::~QSlider): Added. Calls detachQSlider.

        * kwq/KWQTextArea.h: Added detachQTextEdit method.
        * kwq/KWQTextArea.mm:
        (-[KWQTextArea detachQTextEdit]): Added.
        (-[KWQTextArea textDidChange:]): Added check for widget of 0.
        (-[KWQTextArea becomeFirstResponder]): Ditto.
        (-[KWQTextArea nextKeyView]): Ditto.
        (-[KWQTextArea previousKeyView]): Ditto.
        (-[KWQTextArea drawRect:]): Ditto.
        (-[KWQTextAreaTextView insertTab:]): Ditto.
        (-[KWQTextAreaTextView insertBacktab:]): Ditto.
        (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
        (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
        (-[KWQTextAreaTextView mouseDown:]): Ditto.
        (-[KWQTextAreaTextView keyDown:]): Ditto.
        (-[KWQTextAreaTextView keyUp:]): Ditto.

        * kwq/KWQTextEdit.h: Added ~QTextEdit.
        * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.

        * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
        * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.

        * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
        Added beforeMouseDown and afterMouseDown for use in widget implementations.
        Removed unused hasMouseTracking function.
        * kwq/KWQWidget.mm:
        (QWidget::QWidget): Initialize two new fields.
        (QWidget::~QWidget): Added code to remove view when widget is destroyed.
        (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
        (QWidget::addToSuperview): Added.
        (QWidget::removeFromSuperview): Added.
        (QWidget::beforeMouseDown): Added.
        (QWidget::afterMouseDown): Added.

        * khtml/rendering/render_layer.cpp:
        (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
        (RenderLayer::setHasVerticalScrollbar): Ditto.

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

18 years ago Reviewed by John
kocienda [Tue, 30 Nov 2004 16:33:40 +0000 (16:33 +0000)]
    Reviewed by John

        Fix for this bug:

        <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down

        * khtml/khtml_part.cpp:
        (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
        with no blink if it is.

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

18 years ago Reviewed by me
kocienda [Tue, 30 Nov 2004 15:30:29 +0000 (15:30 +0000)]
    Reviewed by me

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
        Seemed simple enough to land without review.

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

18 years ago Reviewed by Chris
kocienda [Tue, 30 Nov 2004 00:07:04 +0000 (00:07 +0000)]
    Reviewed by Chris

        Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
        are handled correctly now, including selections that span multiple blocks, and cases
        where content on the pasteboard ends in newlines (or what appear to be newlines to a
        user, really block ends or BRs). I also made one small, but important change in the
        copy code to annotate the markup written to the pasteboard to support these selections
        ending in newlines.

        New header that defines a couple of constants used in copying and pasting.

        * ForwardingHeaders/editing/html_interchange.h: Added.
        * khtml/editing/html_interchange.h: Added.

        Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
        as a new helper class, ReplacementFragment, which encapsulates information and functions
        pertaining to a document fragment that is being inserted into a document.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::firstChild): Simple accessor.
        (khtml::ReplacementFragment::lastChild): Ditto.
        (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
        the starting node to use for merging into the block containing the start of the selection.
        (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
        (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
        (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
        special annotation comment added in by the copy code.
        (khtml::ReplacementFragment::removeNode): Simple helper.
        (khtml::isComment): Simple helper.
        (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
        I would like to do better than this some day, but this check will hold us until I can do better.
        (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
        * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.

        This smaller set of changes markup generation to add the newline annotation described in the
        comment at the start of this entry.

        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
        (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
        comment annotations are added to the markup generated.
        * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
        DOM::RangeImpl::toHTML uses annotations when generating.

        New tests.

        * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-001.html: Added.
        * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-002.html: Added.
        * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-003.html: Added.
        * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-004.html: Added.
        * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-005.html: Added.
        * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-006.html: Added.
        * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-007.html: Added.
        * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-008.html: Added.
        * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-009.html: Added.

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

18 years ago Reviewed by John.
darin [Mon, 29 Nov 2004 23:13:01 +0000 (23:13 +0000)]
    Reviewed by John.

        - worked around bug in Panther where NSScroller calls _destinationFloatValueForScroller: on superview
          without first checking if it's implemented

        * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _destinationFloatValueForScroller:]):
        Implemented. Calls floatValue on the scroller.

        * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes.

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

18 years ago Reviewed by Harrison
kocienda [Mon, 29 Nov 2004 22:17:52 +0000 (22:17 +0000)]
    Reviewed by Harrison

        Made two small changes that make it possible for comments to have DOM nodes made for them
        when pasting. This relies on some earlier work I did some days ago.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::startMarkup): Get the string from the comment.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
        rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
        be included in the DOM.

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

18 years ago Reviewed by Harrison
kocienda [Mon, 29 Nov 2004 22:17:02 +0000 (22:17 +0000)]
    Reviewed by Harrison

        Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
        my improved paste code.

        * khtml/editing/visible_position.cpp:
        * khtml/editing/visible_position.h

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

18 years ago Reviewed by Harrison
kocienda [Mon, 29 Nov 2004 22:13:42 +0000 (22:13 +0000)]
    Reviewed by Harrison

        * khtml/xml/dom_position.cpp:
        (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
        specified from obeying that directive. The old code would stop at an outer block boundary in
        the case where that block had a block as its first child. The correct behavior is to drill into
        that inner block (and continue on drilling down, if possible), to find the correct position.

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

18 years ago Reviewed by Harrison
kocienda [Mon, 29 Nov 2004 22:11:14 +0000 (22:11 +0000)]
    Reviewed by Harrison

        Small improvements to the node-display debugging helpers.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
        * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.

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

18 years ago Reviewed by Harrison
kocienda [Mon, 29 Nov 2004 22:05:02 +0000 (22:05 +0000)]
    Reviewed by Harrison

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
        may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
        I discovered while improving the paste command, where the insertion poitn wound up in the wrong
        place after the delete.

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

18 years ago Reviewed by Harrison
kocienda [Mon, 29 Nov 2004 22:03:51 +0000 (22:03 +0000)]
    Reviewed by Harrison

        Add a new helper function to insert a paragraph separator. Will be used in my
        upcoming paste improvments.

        * khtml/editing/htmlediting.cpp: Added function
        * khtml/editing/htmlediting.h: Ditto.

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

18 years ago Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
rjw [Wed, 24 Nov 2004 01:06:47 +0000 (01:06 +0000)]
Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)

        Reviewed by Ken.

        * bindings/c/c_class.cpp:

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

18 years ago Added various comments.
harrison [Wed, 24 Nov 2004 00:07:18 +0000 (00:07 +0000)]
    Added various comments.

        * khtml/editing/htmlediting.cpp:

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

18 years ago Fixed: <rdar://problem/3890944> disable icon database for Dashboard
cblu [Tue, 23 Nov 2004 18:50:15 +0000 (18:50 +0000)]
Fixed: <rdar://problem/3890944> disable icon database for Dashboard

        Reviewed by kevin.

        * Misc.subproj/WebIconDatabase.h:
        * Misc.subproj/WebIconDatabase.m:
        (-[WebIconDatabase init]): don't create dictionaries if disabled
        (-[WebIconDatabase iconForURL:withSize:cache:]): return default icon if disabled
        (-[WebIconDatabase iconURLForURL:]): return nil if disabled
        (-[WebIconDatabase retainIconForURL:]): return if disabled
        (-[WebIconDatabase releaseIconForURL:]): ditto
        (-[WebIconDatabase delayDatabaseCleanup]): ditto
        (-[WebIconDatabase allowDatabaseCleanup]): ditto
        (-[WebIconDatabase _isEnabled]): new
        (-[WebIconDatabase _setIcon:forIconURL:]): assert if called when disabled, moved to own category implementation
        (-[WebIconDatabase _setHaveNoIconForIconURL:]): ditto
        (-[WebIconDatabase _setIconURL:forURL:]): ditto
        (-[WebIconDatabase _createFileDatabase]): tweak
        (-[WebIconDatabase _applicationWillTerminate:]): moved out of public code
        * Misc.subproj/WebIconDatabasePrivate.h:
        * Misc.subproj/WebIconLoader.m:
        * WebView.subproj/WebDataSource.m:
        (-[WebDataSource _updateIconDatabaseWithURL:]): assert if called when icon DB is disabled
        (-[WebDataSource _loadIcon]): don't load icon if icon DB is disabled

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

18 years ago Hit testing in table cells with top/bottom space from vertical alignment didn't...
hyatt [Tue, 23 Nov 2004 08:22:14 +0000 (08:22 +0000)]
Hit testing in table cells with top/bottom space from vertical alignment didn't work.  I forgot about the
super-secret yPos() lie that table cells do.  Use m_y instead of yPos().

        * khtml/rendering/render_block.cpp:

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

18 years ago Make sure you can use document.createElement to make a <canvas> element.
hyatt [Tue, 23 Nov 2004 07:58:56 +0000 (07:58 +0000)]
Make sure you can use document.createElement to make a <canvas> element.

        * khtml/xml/dom_docimpl.cpp:

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

18 years ago Reviewed by Dave.
mjs [Tue, 23 Nov 2004 07:45:14 +0000 (07:45 +0000)]
    Reviewed by Dave.

<rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
<rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
<rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
<rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)

* khtml/ecma/kjs_html.cpp:
        * khtml/html/html_formimpl.cpp:
        * khtml/html/html_formimpl.h:
        * khtml/html/html_miscimpl.cpp:
        * khtml/html/html_miscimpl.h:

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

18 years ago Make sure the WebCore cache grows at 512mb and at 1024mb exactly.
hyatt [Tue, 23 Nov 2004 07:23:40 +0000 (07:23 +0000)]
Make sure the WebCore cache grows at 512mb and at 1024mb exactly.

        Reviewed by mjs

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge getObjectCacheSize]):

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

18 years ago Improve the WebCore cache so that the maximum cacheable object size is scaled based...
hyatt [Tue, 23 Nov 2004 07:21:50 +0000 (07:21 +0000)]
Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache

        Reviewed by mjs

        * khtml/misc/loader.cpp:
        * khtml/misc/loader.h:

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

18 years agoFix mistake made with frameset hit testing from previous checkin.
hyatt [Tue, 23 Nov 2004 05:50:35 +0000 (05:50 +0000)]
Fix mistake made with frameset hit testing from previous checkin.

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

18 years ago Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painti...
hyatt [Tue, 23 Nov 2004 05:08:20 +0000 (05:08 +0000)]
Fix for 3673381, huge directory listing so slow it seems like a hang.  Rework painting and hit testing so that
it crawls the line box tree instead of the render tree.  This allows more precise intersection/containment testing
that lets us short circuit earlier when painting and hit testing.

        Reviewed by mjs

        * khtml/khtml_part.cpp:
        * khtml/rendering/render_block.cpp:
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_box.cpp:
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_canvas.cpp:
        * khtml/rendering/render_flow.cpp:
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_frames.cpp:
        * khtml/rendering/render_frames.h:
        * khtml/rendering/render_image.cpp:
        * khtml/rendering/render_image.h:
        * khtml/rendering/render_inline.cpp:
        * khtml/rendering/render_inline.h:
        * khtml/rendering/render_layer.cpp:
        * khtml/rendering/render_layer.h:
        * khtml/rendering/render_line.cpp:
        * khtml/rendering/render_line.h:
        * khtml/rendering/render_object.cpp:
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_table.cpp:
        * khtml/rendering/render_text.cpp:
        * khtml/rendering/render_text.h:
        * khtml/xml/dom2_eventsimpl.cpp:
        * khtml/xml/dom_docimpl.cpp:
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityHitTest:]):
        * kwq/KWQKHTMLPart.mm:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge elementAtPoint:]):
        (-[WebCoreBridge _positionForPoint:]):

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

18 years ago Fixed <rdar://problem/3891737> WebPreferences do not work if they are set before...
rjw [Tue, 23 Nov 2004 04:48:04 +0000 (04:48 +0000)]
Fixed <rdar://problem/3891737> WebPreferences do not work if they are set before set on the WebView

John found this problem and suggested the fix.

        Reviewed by John Louch.

        * WebView.subproj/WebView.m:
        (-[WebView setPreferences:]):

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

18 years agoRemove bogus printf.
hyatt [Tue, 23 Nov 2004 03:02:11 +0000 (03:02 +0000)]
Remove bogus printf.

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

18 years ago Reviewed by Ken.
mjs [Tue, 23 Nov 2004 02:06:13 +0000 (02:06 +0000)]
    Reviewed by Ken.

<rdar://problem/3889696> Enable conservative garbage collection for JavaScript

* kjs/collector.cpp:
        * kjs/collector.h:
        * kjs/internal.cpp:
        * kjs/value.h:

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

18 years ago Reviewed by Dave.
mjs [Tue, 23 Nov 2004 01:44:59 +0000 (01:44 +0000)]
    Reviewed by Dave.

<rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
<rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)

This avoids the O(N^2) penalty for named item traversal for form collections.

It also combines the item traversal logic for all non-form
collection operations into a single traverseNextItem
function. This avoids having 5 copies of the big switch statement
for this.

Also fixed a bug that prevented the last form element from being removed properly.

        * khtml/html/html_formimpl.cpp:
* khtml/dom/html_misc.cpp:
        * khtml/dom/html_misc.h:
        * khtml/ecma/kjs_html.cpp:
        * khtml/html/html_miscimpl.cpp:
        * khtml/html/html_miscimpl.h:

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

18 years agoWebCore:
kocienda [Mon, 22 Nov 2004 17:16:23 +0000 (17:16 +0000)]

        Reviewed by Harrison

        Change around the way we block the Javascript "Paste" command identifier from
        being available. Formerly, this was done with an ifdef we never compiled in.
        Now, this is done with a couple of cheap runtime checks. The advantage is that
        we can now compile this command into development builds, and still yet switch
        on the command in deployment builds through the use of WebCore SPI so we can
        write and run layout tests with all of our builds.

        * khtml/editing/jsediting.cpp:
        (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
        command being queried is the paste command.
        (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
        * khtml/editing/jsediting.h: Ditto.
        * khtml/khtml_part.cpp:
        (KHTMLPart::pasteFromPasteboard): Added.
        (KHTMLPart::canPaste): Added.
        * kwq/KWQKHTMLPart.mm:
        (KHTMLPart::canPaste): Added.
        * kwq/KWQRenderTreeDebug.cpp:
        (externalRepresentation): Turn on paste command.
        * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.


        Reviewed by Harrison

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge canPaste]): Call WebView _canPaste.
        * WebView.subproj/WebView.m:
        (-[WebView _canPaste]): Try to forward to document view's implementation. Only WebHTMLView
        answers right now. Returns NO otherwise.
        * WebView.subproj/WebViewInternal.h: Add _canPaste method to WebView.

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

18 years ago Back out the window closing fix, it seems to be causing crashes.
mjs [Mon, 22 Nov 2004 10:24:08 +0000 (10:24 +0000)]
Back  out the window closing fix, it seems to be causing crashes.

        * WebView.subproj/WebFrame.m:
        (-[WebFrame _detachFromParent]):

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

18 years ago Reviewed by Richard.
mjs [Mon, 22 Nov 2004 04:31:39 +0000 (04:31 +0000)]
    Reviewed by Richard.

<rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion

* khtml/html/html_miscimpl.cpp:

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

18 years agoWebKit:
mjs [Sat, 20 Nov 2004 22:10:56 +0000 (22:10 +0000)]

        Reviewed by John.

  <rdar://problem/3710101> _web_userVisibleString makes URL autocomplete roughly 2x slower

  * Misc.subproj/WebNSURLExtras.h:
        * Misc.subproj/WebNSURLExtras.m:
        (-[NSString _web_isUserVisibleURL]): New SPI to check if a URL
  string is already in user-visible form (i.e. converting it to an
  NSURL and then back via _web_userVisibleString would not change


        Reviewed by John,

<rdar://problem/3710101> _web_userVisibleString makes URL autocomplete roughly 2x slower

        * URLCompletionController.m:
        (_rawStringFromItem): use URLString from history item when possible, only convert
  to user visible string when we really have to.

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

18 years agoWebKit:
mjs [Sat, 20 Nov 2004 21:44:48 +0000 (21:44 +0000)]

        Reviewed by NOBODY (OOPS!).

<rdar://problem/3190977> closing window with many tabs in it can be quite slow

* WebView.subproj/WebFrame.m:
        (-[WebFrame _detachFromParent]): autorelease bridge instead of releasing it,
to make window and tab closing more responsive - this way the deallocation happens
after the windoow or tab appears to close.


        Reviewed by NOBODY (OOPS!).

        <rdar://problem/3190977> closing window with many tabs in it can be quite slow

* BrowserDocument.m:
        (-[BrowserDocument close]): Don't make an autorelease pool
here. This should not be needed for PLT world leak detection any
more, and it is necessary to make window closing responsive.

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

18 years ago Reviewed by Darin.
mjs [Sat, 20 Nov 2004 02:24:08 +0000 (02:24 +0000)]
    Reviewed by Darin.

<rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
<rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
<rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)

Many optimizations to HTMLFormCollection. Iterating it should not
be N^2 any more, though finding items by name could still be.

        * khtml/html/html_formimpl.cpp:
        * khtml/html/html_formimpl.h:
        * khtml/html/html_miscimpl.cpp:
        * khtml/html/html_miscimpl.h:
        * khtml/xml/dom_elementimpl.cpp:
        * kwq/KWQPtrVector.h:
        * kwq/KWQVectorImpl.h:
        * kwq/KWQVectorImpl.mm:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge elementWithName:inForm:]):
        (-[WebCoreBridge controlsInForm:]):

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

18 years ago Reviewed by Ken and Darin.
harrison [Sat, 20 Nov 2004 01:36:53 +0000 (01:36 +0000)]
    Reviewed by Ken and Darin.

        <rdar://problem/3856215> Cannot remove bold from the beginning of a message

        Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
        for the existing style, but in this case (hitting cmd-B with caret at top of
        file) there is nothing upstream.  Changed this to use the VisiblePosition
        deepEquivalent instead.

        * khtml/khtml_part.cpp:

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

18 years agoversioning for TOT, Safari 2.0 (v172+)
vicki [Sat, 20 Nov 2004 00:57:01 +0000 (00:57 +0000)]
versioning for TOT, Safari 2.0 (v172+)

The tree is OPEN!

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

18 years agoSafari-172 stamp
vicki [Sat, 20 Nov 2004 00:48:36 +0000 (00:48 +0000)]
Safari-172 stamp

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

18 years ago Fixed: <rdar://problem/3880387> REGRESSION: www.shockplay.com site gives "Unexpected...
cblu [Fri, 19 Nov 2004 23:21:58 +0000 (23:21 +0000)]
Fixed: <rdar://problem/3880387> REGRESSION: shockplay.com site gives "Unexpected server response"

        Reviewed by mjs.

        * Plugins.subproj/WebBaseNetscapePluginView.m:
        (-[NSData _web_locationAfterFirstBlankLine]): support both formats ("\r\n\n" and "\r\n\r\n") for separating header data from body data because Shockwave still sends the prior format

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

18 years ago Reviewed by Darin.
mjs [Fri, 19 Nov 2004 21:25:56 +0000 (21:25 +0000)]
    Reviewed by Darin.

<rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::close): Don't fire the onload handler if there is a
redirect pending. This is a very long-standing bug that was masked
by our previously incorrect redirect logic. It used to be that an
older redirect would always win. Recently we changed things so
that a newer redirect would win, but a script that causes a
redirect would stop parsing once complete (so if there are two
redirects in the same script, the latter wins). However, we should
have also prevented onload in this case. Testing with other
browsers shows that onload handlers do not run at all when there
is a pending redirect.

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

18 years ago Reviewed by Harrison
kocienda [Fri, 19 Nov 2004 19:58:31 +0000 (19:58 +0000)]
    Reviewed by Harrison

        Fix some object lifetime issues in these two commands. This fixes some crashes
        I am seeing in some new code I am working on, but have not yet reproduced otherwise.

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
        in the ancestor list. They are not ref'ed when put on list. D'uh.
        (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
        before putting them on the cloned nodes list. This are still deref'ed in the destructor.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
        destructor comment.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.

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

18 years agoWebCore:
kocienda [Fri, 19 Nov 2004 18:43:54 +0000 (18:43 +0000)]

        Reviewed by Harrison

        Fix for this bug:

        <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it

        * khtml/khtml_part.cpp:
        (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
        declaration given the current selection, and then sets the minimum necessary style as the typing
        style on the part.
        (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
        to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
        as well.
        * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
        * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
        (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.


        Reviewed by Harrison

        Fix for this bug:

        <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge respondToChangedContents]): No longer call through to WebKit to set the typing style. The call
        was part of the misguided use of the setTypingStyle: and typingStyle as a cache of what was stored on
        the WebCore side.
        (-[WebBridge respondToChangedSelection]): Ditto.
        * WebView.subproj/WebView.m:
        (-[WebViewPrivate dealloc]): Object no longer has typingStyle ivar.
        (-[WebView setTypingStyle:]): Call over the bridge to set typing style.
        (-[WebView typingStyle]): Call over the bridge to retrieve typing style.
        * WebView.subproj/WebViewInternal.h: Object no longer has typingStyle ivar.

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

18 years ago Reviewed by Darin.
sullivan [Fri, 19 Nov 2004 06:08:15 +0000 (06:08 +0000)]
    Reviewed by Darin.

        - fixed <rdar://problem/3886042> should save history file as binary XML so serialization,
        parsing, reading and writing is faster

        * History.subproj/WebHistory.m:
        (-[WebHistoryPrivate _saveHistoryGuts:URL:error:]):
        convert dictionary to binary data before saving

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

18 years ago Reviewed by Darin.
harrison [Fri, 19 Nov 2004 02:03:10 +0000 (02:03 +0000)]
    Reviewed by Darin.

        Back out Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered by Mail.app.
        Filed <rdar://problem/3886832> against Mail.app.

        * kwq/DOM-CSS.mm:
        (-[DOMCSSStyleDeclaration setProperty:::]):

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

18 years agoWebCore:
cblu [Fri, 19 Nov 2004 01:40:39 +0000 (01:40 +0000)]

Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably

        Reviewed by john.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form


Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably

        Reviewed by john.

        * FormCompletionController.m:
        (+[FormCompletionController firstFormInFrame:]): new, currentForm in WebCore used to do this work, but now currentForm just returns the current form
        (+[FormCompletionController currentOrFirstFrameAndForm:inWebView:]): renamed, if there is no current form, call firstFormInFrame
        (+[FormCompletionController autoFillInWebView:]): call renamed method
        (+[FormCompletionController autoFillPasswordInFrame:]): if there is no current form, find a password form from all the forms in the document rather than giving up when the first form is not a password form

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

18 years ago * WebView.subproj/WebHTMLRepresentation.m:
cblu [Fri, 19 Nov 2004 01:10:17 +0000 (01:10 +0000)]
    * WebView.subproj/WebHTMLRepresentation.m:
        (-[WebHTMLRepresentation currentForm]): removed stray ";"

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

18 years ago Reviewed by Chris.
mjs [Fri, 19 Nov 2004 00:49:09 +0000 (00:49 +0000)]
    Reviewed by Chris.

- fix recursive item traversal, use traverseNextNode() instead of
the buggy hand-rolled traversal.

        * khtml/xml/dom_nodeimpl.cpp:

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

18 years ago Reviewed by Ken.
darin [Fri, 19 Nov 2004 00:12:21 +0000 (00:12 +0000)]
    Reviewed by Ken.

        - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)

        * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
        Rolled in fix from KDE; make sure to set job to 0 before calling changeState.

        - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
        - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
        - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
        - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
          an entire category of leaks we have been fixing one by one recently
        - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
          stale RenderObject pointer, although I never saw it do that in practice
        - implemented the length and item methods for computed styles
        - implemented querying additional properties in computed styles (29 more)

        * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
        now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
        take a mutable style.
        * khtml/khtml_part.cpp:
        (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
        (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
        a computed style; also change some types to mutable style.
        (updateState): Update iteration of CSSProperty objects in a style declaration to use
        the new valuesIterator interface.
        (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
        (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
        (editingStyle): Change type to mutable style, and simplify the style-creation calls,
        including accomodating the exception code that setCssText has now.
        (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
        (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
        the style attributes really was a change, although it's not an important optimization it's
        good to do it right.

        * khtml/css/css_base.h: Remove unneeded setParsedValue method.
        * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
        calling it were already removing the old property explicitly, so the code in here to remove
        the property again was redundant.

        * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
        Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
        the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
        Before we had no guarantee the object would outlast us.
        (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
        exception to NO_MODIFICATION_ALLOWED_ERR.
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
        than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
        box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
        list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
        marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
        page-break-inside, position, unicode-bidi, widows, z-index.
        (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
        exception to NO_MODIFICATION_ALLOWED_ERR.
        (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
        (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
        (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
        (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
        (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
        (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.

        * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
        now a separate class rather than a typedef.
        * khtml/css/cssparser.h: Ditto.

        * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
        CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
        Removed a bunch of redundant stuff from other classes in this file too.
        (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
        (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
        (DOM::CSSProperty::operator=): Added.
        (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.

        * khtml/css/css_valueimpl.cpp:
        (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
        (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
        (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
        (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
        (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
        (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
        (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
        (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
        (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
        (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
        (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
        (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
        (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
        (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
        (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
        (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
        no styles in the list. Update to use QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
        parameter and set it.
        (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
        (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
        (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
        (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
        (DOM::CSSMutableStyleDeclarationImpl::copy): Added.

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue): Changed to use addParsedProperties.
        (CSSParser::parseDeclaration): Ditto.
        (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.

        * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
        * khtml/css/cssproperties.c: Regenerated.
        * khtml/css/cssproperties.h: Regenerated.

        * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
        Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.

        * khtml/dom/css_value.cpp:
        (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
        (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
        (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
        first doing getPropertyCSSValue and then doing cssText.
        (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
        (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
        (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
        (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
        (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
        (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
        (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).

        * khtml/dom/dom_node.h: Made isNull and handle functions inline.
        * khtml/dom/dom_node.cpp: Ditto.

        * khtml/editing/htmlediting.h: Change some types to mutable style.
        * khtml/editing/htmlediting.cpp:
        (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
        (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
        (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
        (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
        (khtml::EditCommand::setTypingStyle): Ditto.
        (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
        (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
        (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
        (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
        (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
        (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
        (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
        (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
        (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
        (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
        (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
        (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.

        * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
        * khtml/html/html_baseimpl.h: Change type to mutable style.
        * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.

        * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
        class as a base class, and change types to mutable style as needed.
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
        (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
        (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
        (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
        (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
        (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
        to appendChild.
        (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
        to replaceChild.

        * khtml/html/html_tableimpl.h: Change types to mutable style.
        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
        (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
        (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
        than using an explicit delete to make the node go away, and is required for compatibility with the
        changes to the NodeImpl functions.
        (KHTMLParser::insertNode): Ditto.
        (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
        the NodeImpl functions.

        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
        now that there's no need to make the property list explictly.

        * kwq/DOM-CSS.mm:
        (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
        (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
        (-[DOMCSSStyleDeclaration setProperty:::]): Dito.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
        function succeeded or not for ownership purposes.
        (NodeImpl::replaceChild): Ditto.
        (NodeImpl::appendChild): Ditto.
        (NodeBaseImpl::insertBefore): Ditto.
        (NodeBaseImpl::replaceChild): Ditto.
        (NodeBaseImpl::appendChild): Ditto.
        (NodeBaseImpl::addChild): Ditto.

        * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
        * WebCore-combined.exp: Regenerated.

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

18 years ago still even more build fixing
mjs [Fri, 19 Nov 2004 00:08:12 +0000 (00:08 +0000)]
    still even more build fixing

        * khtml/html/html_miscimpl.cpp:

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

18 years ago more build fixing
mjs [Thu, 18 Nov 2004 23:09:20 +0000 (23:09 +0000)]
    more build fixing

        * khtml/html/html_miscimpl.cpp:

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

18 years ago Fixed build problem.
mjs [Thu, 18 Nov 2004 22:38:02 +0000 (22:38 +0000)]
    Fixed build problem.

        * khtml/html/html_miscimpl.h:
        (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.

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

18 years ago Reviewed by Ken.
mjs [Thu, 18 Nov 2004 21:42:05 +0000 (21:42 +0000)]
    Reviewed by Ken.

- merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror

<rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
<rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)

This is also a start on fixing 5 other bugs, but those need additional work to make
HTMLFormCollection fast.

        * khtml/html/html_documentimpl.h:
        * khtml/html/html_formimpl.cpp:
        * khtml/html/html_formimpl.h:
        * khtml/html/html_imageimpl.cpp:
        * khtml/html/html_imageimpl.h:
        * khtml/html/html_miscimpl.cpp:
        * khtml/html/html_miscimpl.h:
        * khtml/html/htmlparser.cpp:
        * khtml/xml/dom_docimpl.cpp:
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_nodeimpl.cpp:

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

18 years ago Fixed development build failure.
cblu [Thu, 18 Nov 2004 20:50:45 +0000 (20:50 +0000)]
Fixed development build failure.

        * Misc.subproj/WebIconDatabase.m:
        (+[WebIconDatabase sharedIconDatabase]): call LOG not Log

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

18 years ago Reviewed by Chris.
kdecker [Thu, 18 Nov 2004 19:29:58 +0000 (19:29 +0000)]
    Reviewed by Chris.

fixed: <rdar://problem/3841842> getPropertyID expensive

        * kwq/DOM-CSS.mm:
        (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.

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

18 years ago <rdar://problem/3885708> save memory in icon DB by not using NSSets when holding...
cblu [Thu, 18 Nov 2004 18:20:03 +0000 (18:20 +0000)]
<rdar://problem/3885708> save memory in icon DB by not using NSSets when holding 1 object

        Reviewed by sullivan.

        * Misc.subproj/WebIconDatabase.m:
        (+[WebIconDatabase sharedIconDatabase]): added timing code
        (-[WebIconDatabase _clearDictionaries]): new
        (-[WebIconDatabase _loadIconDictionaries]): call _clearDictionaries in 2 places before we bail, use _web_setObjectUsingSetIfNecessary:forKey: when adding site URLs to the iconURLToURLs dictionary
        (-[WebIconDatabase _updateFileDatabase]): fixed comment
        (-[WebIconDatabase _setIconURL:forURL:]): use _web_setObjectUsingSetIfNecessary:forKey: when adding site URLs to the iconURLToURLs dictionary
        (-[WebIconDatabase _releaseIconForIconURLString:]): handle NSString objects retured from iconURLToURLs
        (-[NSMutableDictionary _web_setObjectUsingSetIfNecessary:forKey:]): new, puts a set on the dictionary when there are 2 or more object for s key

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

18 years ago Fixed <rdar://problem/3885073> REGRESSION: Tab images at top of news.com.com replica...
rjw [Thu, 18 Nov 2004 03:20:36 +0000 (03:20 +0000)]
Fixed <rdar://problem/3885073> REGRESSION: Tab images at top of news.com.com replicated and squished

Correctly account for scaled image size and clipping.

        Reviewed by Maciej.

        * WebCoreSupport.subproj/WebImageData.h:
        * WebCoreSupport.subproj/WebImageData.m:
        * WebCoreSupport.subproj/WebImageRenderer.m:
        (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:context:]):

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

18 years ago Reviewed by Richard.
mjs [Thu, 18 Nov 2004 02:48:09 +0000 (02:48 +0000)]
    Reviewed by Richard.

<rdar://problem/3885076> Don't make IDN calls for all-ascii URLs to save about 3 pages
at Safari startup.

        * Misc.subproj/WebNSURLExtras.m:
        (mapHostNames): If encoding and not decoding, then bail early if the URL is all ascii.
        (-[NSString _web_mapHostNameWithRange:encode:makeString:]): Remove earlier special-case
check for localhost, no longer needed.

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

18 years ago Improve responsiveness by being willing to break out of the tokenizer. (This patch...
hyatt [Thu, 18 Nov 2004 01:42:17 +0000 (01:42 +0000)]
Improve responsiveness by being willing to break out of the tokenizer.  (This patch was landed already
and subsequently backed out).

        Reviewed by kocienda

        * khtml/html/html_baseimpl.cpp:
        * khtml/html/htmltokenizer.cpp:
        * khtml/html/htmltokenizer.h:
        * khtml/khtmlview.cpp:
        * khtml/khtmlview.h:
        * khtml/xml/dom_docimpl.cpp:
        * khtml/xml/dom_docimpl.h:
        * kwq/KWQDateTime.mm:

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

18 years ago Reviewed by Ken Kocienda.
harrison [Thu, 18 Nov 2004 00:35:36 +0000 (00:35 +0000)]
    Reviewed by Ken Kocienda.

        Make sure previousLineStart is non-null before calling compareBoundaryPoints.
        Treat null case as meaning no post-move merge is needed.

        * khtml/editing/htmlediting.cpp:

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

18 years ago Fixed <rdar://problem/3863601> Legacy font cache code in [WebTextRendererFactory...
rjw [Wed, 17 Nov 2004 23:02:24 +0000 (23:02 +0000)]
Fixed <rdar://problem/3863601> Legacy font cache code in [WebTextRendererFactory createSharedFactory] may be unnecesary

and added call to SPI for

<rdar://problem/3884448> WebKit should turn on CG local font cache

currently disabled until a Tiger build shows up with the SPI.

        Reviewed by David Harrison.

        * WebCoreSupport.subproj/WebTextRendererFactory.m:
        (+[WebTextRendererFactory createSharedFactory]):

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

18 years ago Fixed <rdar://problem/3882212> REGRESSION: Images clipped instead of scaled
rjw [Wed, 17 Nov 2004 20:31:34 +0000 (20:31 +0000)]
    Fixed <rdar://problem/3882212> REGRESSION: Images clipped instead of scaled
        Fixed <rdar://problem/3884088> Crash terminating image load

        Also added code to turn off color correction for images created
        via CGImageSources.  This code is currently disabled because CG
        can't change the color space of images loaded progressively.
        Further, according to Dave Hayward, CG will no longer attempt
        to color correct images that don't have embedded profiles as of
        Tiger 8A306.

        Reviewed by Chris.

        * WebCoreSupport.subproj/WebImageData.m:
        (-[WebImageData _commonTermination]):
        (-[WebImageData dealloc]):
        (-[WebImageData _invalidateImageProperties]):
        (-[WebImageData imageAtIndex:]):
        (-[WebImageData incrementalLoadWithBytes:length:complete:]):
        (-[WebImageData propertiesAtIndex:]):

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

18 years ago Reviewed by NOBODY (OOPS!).
harrison [Wed, 17 Nov 2004 19:33:45 +0000 (19:33 +0000)]
    Reviewed by NOBODY (OOPS!).

        Added displayNode and displayTree methods for debugging.  Fixed comment typo in dispatchChildRemovalEvents.
        * khtml/xml/dom_nodeimpl.cpp:
        * khtml/xml/dom_nodeimpl.h:

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

18 years ago Fixed: <rdar://problem/3882034> REGRESSION: Context menu incorrect for PDF content
cblu [Wed, 17 Nov 2004 00:17:56 +0000 (00:17 +0000)]
Fixed: <rdar://problem/3882034> REGRESSION: Context menu incorrect for PDF content

        Reviewed by darin.

        * WebView.subproj/WebPDFView.m:
        (-[WebPDFView hitTest:]): return self if the current event is a context menu event
        (-[WebPDFView menuForEvent:]): use the PDFView subview

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

18 years ago Reviewed by Richard.
sullivan [Tue, 16 Nov 2004 19:52:26 +0000 (19:52 +0000)]
    Reviewed by Richard.

        - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)

        * khtml/khtml_part.cpp:
        delete the list we created when we're done with it

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

18 years ago Reviewed by John
kocienda [Tue, 16 Nov 2004 16:48:52 +0000 (16:48 +0000)]
    Reviewed by John

        It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
        Instead, I replaced this with a helper function that derefs DOM nodes stored in a
        QPtrList when the list goes out of scope.

        * khtml/editing/htmlediting.cpp:
        (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
        (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
        (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
        No longer set lists to autodelete.
         Call new derefNodesInList helper.
        * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
        of one before, but now it does.

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

18 years ago Reviewed by Chris and Darin.
harrison [Tue, 16 Nov 2004 01:34:11 +0000 (01:34 +0000)]
    Reviewed by Chris and Darin.

        <rdar://problem/3880304> Non-linear performance hit for style changes

        * khtml/xml/dom_nodeimpl.cpp:
        Return 0 rather than traversing beyond stayWithin when this == stayWithin.
        Add asserts that stayWithin is an ancestor of the returned node.

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

18 years ago Fixed <rdar://problem/3880561> Default string value of ObjC object in JS...
rjw [Tue, 16 Nov 2004 01:24:55 +0000 (01:24 +0000)]
    Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].

        Reviewed by Hyatt.

        * bindings/objc/objc_instance.mm:
        * bindings/objc/objc_utility.h:
        * bindings/objc/objc_utility.mm:

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

18 years ago Reviewed by Ken.
darin [Tue, 16 Nov 2004 01:04:13 +0000 (01:04 +0000)]
    Reviewed by Ken.

        - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
        since there's no guarantee it's already ref'd.
        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
        (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
        (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
        (CSSStyleDeclarationImpl::merge): Ditto.
        (CSSStyleDeclarationImpl::diff): Ditto.
        * khtml/editing/htmlediting.cpp:
        (khtml::StyleChange::currentlyHasStyle): Ditto.
        (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
        * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
        * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.

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

18 years ago Reviewed by Ken.
darin [Tue, 16 Nov 2004 00:47:54 +0000 (00:47 +0000)]
    Reviewed by Ken.

        Use separate mutable style and computed style types as appropriate.
        For now this should have no effect, but it prepares us for refactoring later.
        Also remove some unnecessary "DOM::" prefixes and in one case factor out
        some shared code.

        * khtml/khtml_part.cpp:
        * khtml/khtml_part.h:
        * khtml/khtmlpart_p.h:

        * khtml/css/css_base.h:
        * khtml/css/css_ruleimpl.cpp:
        * khtml/css/css_ruleimpl.h:
        * khtml/css/css_valueimpl.h:
        * khtml/css/cssparser.cpp:
        * khtml/css/cssparser.h:
        * khtml/css/cssstyleselector.cpp:
        * khtml/css/cssstyleselector.h:
        * khtml/css/parser.cpp:
        * khtml/css/parser.y:
        * khtml/dom/css_rule.h:
        * khtml/dom/css_stylesheet.h:
        * khtml/dom/css_value.h:
        * khtml/dom/dom2_views.cpp:
        * khtml/xml/dom2_viewsimpl.cpp:
        * khtml/xml/dom_docimpl.cpp:
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_xmlimpl.cpp:
        * khtml/xml/dom_xmlimpl.h:

        * khtml/dom/css_value.cpp:
        (DOM::throwException): Added.
        (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
        The real thing is coming with the next change to refactor.
        (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
        (DOM::CSSPrimitiveValue::setStringValue): Ditto.

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

18 years ago Reviewed by Ken.
darin [Tue, 16 Nov 2004 00:29:07 +0000 (00:29 +0000)]
    Reviewed by Ken.

        - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)

        * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
        dispatchSubtreeModifiedEvent, so it can be called in cases where only the
        node's attributes changed without sending a misleading childrenChanged call,
        but the childrenChanged call can happen at the exact right moment.
        * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
        (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
        the boolean true is passed in.

        * khtml/xml/dom_elementimpl.cpp:
        (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
        (NamedAttrMapImpl::removeAttribute): Ditto.

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

18 years ago Fixed: <rdar://problem/3880410> save 5 dirty pages by soft-linking against PDFKit...
cblu [Tue, 16 Nov 2004 00:25:11 +0000 (00:25 +0000)]
Fixed: <rdar://problem/3880410> save 5 dirty pages by soft-linking against PDFKit framework

        Reviewed by john.

        * WebKit.pbproj/project.pbxproj:
        * WebView.subproj/WebPDFRepresentation.m:
        (+[WebPDFRepresentation PDFDocumentClass]): new
        (-[WebPDFRepresentation finishedLoadingWithDataSource:]): use PDFDocumentClass
        * WebView.subproj/WebPDFView.h:
        * WebView.subproj/WebPDFView.m:
        (+[WebPDFView PDFKitBundle]): new
        (+[WebPDFView PDFViewClass]): new
        (-[WebPDFView initWithFrame:]): create a PDFView subview
        (-[WebPDFView dealloc]): release the PDFView subview
        (-[WebPDFView PDFSubview]): new

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

18 years ago Fixed: <rdar://problem/3879891> WebKit should link against PDFKit instead of Quartz
cblu [Mon, 15 Nov 2004 23:36:33 +0000 (23:36 +0000)]
Fixed: <rdar://problem/3879891> WebKit should link against PDFKit instead of Quartz

        Reviewed by darin.

        * WebKit.pbproj/project.pbxproj: link against PDFKit if it is present instead of Quartz.framework

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

18 years ago Reviewed by Ken.
sullivan [Mon, 15 Nov 2004 22:08:42 +0000 (22:08 +0000)]
    Reviewed by Ken.

        - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
        seen often in Mail and Blot

        * khtml/css/css_valueimpl.cpp:
        delete temporary list after we're done using it

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

18 years ago Fixed leak (3879883) that John found. Early return leaked
rjw [Mon, 15 Nov 2004 20:33:49 +0000 (20:33 +0000)]
Fixed leak (3879883) that John found.  Early return leaked
allocated instance.

        Reviewed by John.

        * khtml/css/css_computedstyle.cpp:

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

18 years ago Fixed missing retain of image property data.
rjw [Mon, 15 Nov 2004 20:29:17 +0000 (20:29 +0000)]
Fixed missing retain of image property data.

        Reviewed by John.

        * WebCoreSupport.subproj/WebImageData.h:
        * WebCoreSupport.subproj/WebImageData.m:
        (-[WebImageData dealloc]):
        (-[WebImageData _invalidateImages]):
        (-[WebImageData imageAtIndex:]):
        (-[WebImageData propertiesAtIndex:]):
        (-[WebImageData _frameDuration]):

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

18 years ago Reviewed by John
kocienda [Mon, 15 Nov 2004 19:53:33 +0000 (19:53 +0000)]
    Reviewed by John

        Fix for this bug:

        <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail

        Fixed a couple of object lifetime issues. The EditCommand class used to hold an
        EditCommandPtr to its parent, but this caused a a reference cycle in composite
        commands as the children held a ref to their parent. Now, the parent variable
        is a non-retained reference to an EditCommand *. It would be nice to have a
        weak reference to the parent or even override deref in composite commands (but I
        can't since deref() is not virtual). However, this should be OK since any
        dangling parent pointer is a sign of a bigger object lifetime problem that
        would need to be addressed anyway.

        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
        QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
        just assigning the list variable passed in to the local list variable, or the list will be
        * khtml/editing/htmlediting.cpp:
        (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
        (khtml::EditCommand::setEndingSelection): Ditto.
        (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
        Unrelated to the change, but saves some ref's and deref's.
        (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
        * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
        EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
        (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.

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

18 years ago Reviewed by Kevin.
mjs [Mon, 15 Nov 2004 19:50:06 +0000 (19:50 +0000)]
    Reviewed by Kevin.

<rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
        (NodeListImpl::recursiveLength): Adjusted for rename.
        (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
If the same offset is looked up again, just return it, otherwise, if looking up
a later offset, start at the last item and proceed from there.
        (NodeListImpl::itemById): Apply the special document optimization to all
nodes that are either a document or in a document - just walk up to make
sure the node found by ID has the root node as an ancestor.
        (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
        * khtml/xml/dom_nodeimpl.h: Prototype new stuff.

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

18 years ago Cache image properties and frame durations.
rjw [Mon, 15 Nov 2004 19:16:30 +0000 (19:16 +0000)]
Cache image properties and frame durations.
Create NSImage and TIFF representations from CGImage, lazily, as needed for
dragging and element info dictionary.

        Reviewed by John.

        * WebCoreSupport.subproj/WebImageData.h:
        * WebCoreSupport.subproj/WebImageData.m:
        (-[WebImageData dealloc]):
        (-[WebImageData size]):
        (-[WebImageData propertiesAtIndex:]):
        (-[WebImageData _frameDurationAt:]):
        (-[WebImageData _frameDuration]):
        * WebCoreSupport.subproj/WebImageRenderer.h:
        * WebCoreSupport.subproj/WebImageRenderer.m:
        (-[WebImageRenderer dealloc]):
        (-[WebImageRenderer TIFFRepresentation]):
        (-[WebImageRenderer image]):

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

18 years ago Reviewed by John.
mjs [Mon, 15 Nov 2004 18:53:42 +0000 (18:53 +0000)]
    Reviewed by John.

<rdar://problem/3879226> WebKit needlessly uses extra memory to store icon refcounts as NSNumbers

* Misc.subproj/WebIconDatabase.m:
        (-[WebIconDatabase init]):
        (-[WebIconDatabase _setIconURL:forURL:]):
        (-[WebIconDatabase _retainIconForIconURLString:]):
        (-[WebIconDatabase _releaseIconForIconURLString:]):
        (-[WebIconDatabase _retainFutureIconForURL:]):
        (-[WebIconDatabase _releaseFutureIconForURL:]):
        * Misc.subproj/WebIconDatabasePrivate.h:

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

18 years ago Reviewed by Ken.
sullivan [Mon, 15 Nov 2004 17:20:58 +0000 (17:20 +0000)]
    Reviewed by Ken.

        - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)

        * kwq/KWQKHTMLPart.mm:
        release mutable copy of string after we're done using it

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

18 years ago Reviewed by Ken.
sullivan [Mon, 15 Nov 2004 16:54:14 +0000 (16:54 +0000)]
    Reviewed by Ken.

        - fixed <rdar://problem/3879513> leak in [WebArchive _propertyListRepresentation] copying HTML to pasteboard

        * WebView.subproj/WebArchive.m:
        (-[WebArchive _propertyListRepresentation]):
        the array holding the subresources was not released after use, oops!

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

18 years ago Reviewed by mjs.
kdecker [Mon, 15 Nov 2004 05:18:01 +0000 (05:18 +0000)]
    Reviewed by mjs.

fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)

        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
        (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.

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

18 years ago Reviewed by Kevin.
mjs [Sun, 14 Nov 2004 02:07:49 +0000 (02:07 +0000)]
    Reviewed by Kevin.

<rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists

        * khtml/dom/dom_node.cpp:
        (NodeList::itemById): New method, just forward to impl.
        * khtml/dom/dom_node.h: Prototype it.
        * khtml/ecma/kjs_dom.cpp:
        (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
let the NodeList do it. The NodeList might be able to do it more efficiently.
        * khtml/xml/dom_nodeimpl.cpp:
(NodeListImpl::itemById): Optimize for the case where the NodeList
covers the whole document. In this case, just use getElementById,
then check that the element satisfies the list criteria.
        (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
        (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
        * khtml/xml/dom_nodeimpl.h:

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

18 years ago Reviewed by Gramps.
mjs [Sat, 13 Nov 2004 02:54:31 +0000 (02:54 +0000)]
    Reviewed by Gramps.

- fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
sometimes using a huge bogus length value.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeListImpl::NodeListImpl): Initialize isCacheValid.

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

18 years ago Reviewed by NOBODY (OOPS!).
mjs [Sat, 13 Nov 2004 02:53:52 +0000 (02:53 +0000)]
    Reviewed by NOBODY (OOPS!).

- fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
sometimes using a huge bogus length value.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeListImpl::NodeListImpl): Initialize isCacheValid.

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