1 2004-12-14 Chris Blumenberg <cblu@apple.com>
3 Fixed: <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
7 * khtml/editing/markup.cpp:
8 (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it
10 2004-12-14 David Hyatt <hyatt@apple.com>
12 Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position.
13 This is actually a regression from my positioned object DHTML optimization.
17 * khtml/rendering/render_object.cpp:
18 (RenderObject::setStyle):
20 2004-12-14 David Hyatt <hyatt@apple.com>
22 Make sure the class attribute works when newlines are present in the attribute.
26 * khtml/html/html_elementimpl.cpp:
27 (HTMLNamedAttrMapImpl::parseClassAttribute):
29 2004-12-14 David Hyatt <hyatt@apple.com>
31 Fix for 3724938, float element is duplicated and paints twice. The logic for when to paint floats was
32 actually fairly screwed up. This patch simplifies the logic and makes addOverhangingFloats easier to
33 read by splitting it into two separate functions.
37 * khtml/rendering/render_block.cpp:
38 (khtml::RenderBlock::layoutBlockChildren):
39 (khtml::RenderBlock::clearFloats):
40 (khtml::RenderBlock::addOverhangingFloats):
41 (khtml::RenderBlock::addIntrudingFloats):
42 * khtml/rendering/render_block.h:
44 2004-12-14 John Sullivan <sullivan@apple.com>
48 - added Undo action names for Cut, Paste, and Drag
50 * khtml/editing/htmlediting.h:
51 * khtml/editing/htmlediting.cpp:
52 (khtml::DeleteSelectionCommand::editingAction):
53 overridden to return HTMLEditActionCut
54 (khtml::MoveSelectionCommand::editingAction):
55 overridden to return HTMLEditActionDrag
56 (khtml::ReplaceSelectionCommand::editingAction):
57 overridden to return HTMLEditActionPaste
59 2004-12-14 John Sullivan <sullivan@apple.com>
63 - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu,
64 no specific action names
66 The remaining step is to make each EditCommand subclass override editingAction() to return an
67 appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
68 is not completely straightforward, so this next step isn't trivial.)
70 * khtml/editing/htmlediting.h:
71 new enum for HTMLEditAction
73 * khtml/editing/htmlediting.cpp:
74 (khtml::EditCommandPtr::editingAction):
75 new method, calls through to EditCommand
76 (khtml::EditCommand::editingAction):
77 new method for subclasses to override, returns HTMLEditActionUnspecified at this level
78 (khtml::TypingCommand::editingAction):
79 proof of concept override, returns HTMLEditActionTyping
82 declare new private bottleneck method registerCommandForUndoOrRedo
83 * kwq/KWQKHTMLPart.mm:
84 (KWQKHTMLPart::registerCommandForUndoOrRedo):
85 new bottleneck method to reduce code duplication; now calls over the bridge
86 to get the localized string to use for the Undo action name
87 (KWQKHTMLPart::registerCommandForUndo):
88 now calls new bottleneck method
89 (KWQKHTMLPart::registerCommandForRedo):
90 now calls new bottleneck method
92 * kwq/WebCoreBridge.h:
93 new enum for WebUndoAction, maps directly to HTMLEditAction.
94 Declaration of nameForUndoAction:
96 2004-12-14 Darin Adler <darin@apple.com>
100 - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)
102 * khtml/rendering/render_frames.cpp:
103 (RenderPart::~RenderPart): Check widget for nil.
104 (RenderPart::setWidget): Ditto.
105 (RenderFrame::slotViewCleared): Ditto.
106 (RenderPartObject::slotViewCleared): Ditto.
108 2004-12-13 Darin Adler <darin@apple.com>
112 - moved markup-related functions into new sources files in the editing directory
113 - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster
115 * ForwardingHeaders/editing/markup.h: Added.
116 * khtml/editing/markup.h: Added.
117 * khtml/editing/markup.cpp: Added.
119 * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.
121 * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
122 * khtml/html/html_elementimpl.cpp:
123 (HTMLElementImpl::innerHTML): Changed to call createMarkup.
124 (HTMLElementImpl::outerHTML): Ditto.
126 * khtml/ecma/kjs_window.cpp:
127 (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
128 (Window::retrieveActive): Ditto.
130 * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
131 * khtml/xml/dom_docimpl.h: Ditto.
133 * khtml/khtml_part.cpp:
134 (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
135 (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.
137 * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
138 still works even with the additional replace overloads added to QString.
139 * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.
141 * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
142 base pointer, because it used dynamic_cast in its implementation. Made the other version public.
143 * khtml/rendering/render_object.cpp: Ditto.
144 * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.
146 * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
147 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
148 the support code into markup.cpp.
150 * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
151 * khtml/xml/dom_nodeimpl.cpp: Ditto.
153 * khtml/xml/dom_position.cpp:
154 (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
155 so these return null positions rather than raising exceptions.
156 (DOM::endPosition): Ditto.
158 * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
159 * kwq/KWQFrame.h: Ditto.
160 * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
161 * kwq/KWQKPartsPart.h: Ditto.
162 * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
163 * kwq/KWQScrollView.h: Ditto.
164 * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
165 * kwq/KWQKHTMLPart.h: Ditto.
166 * kwq/KWQKHTMLPart.mm:
167 (KHTMLView::isKHTMLView): Ditto.
168 (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
169 replace overloads added to QString.
170 (KWQKHTMLPart::setStatusBarText): Ditto.
171 (KWQKHTMLPart::runJavaScriptAlert): Ditto.
172 (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
173 (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
174 (KWQKHTMLPart::attributedString): Ditto.
175 (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
176 (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).
178 * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
180 (QObject::inherits): Changed to not use dynamic cast.
181 (QObject::isKHTMLPart): Added. Returns false.
182 (QObject::isKHTMLView): Ditto.
183 (QObject::isKPartsReadOnlyPart): Ditto.
184 (QObject::isQFrame): Ditto.
185 (QObject::isQScrollView): Ditto.
187 * kwq/KWQRenderTreeDebug.cpp:
188 (write): Changed to use inherits rather than dynamic_cast.
189 (writeSelection): Ditto.
191 * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
192 than going straight on to the "no parameters at all" version.
195 * kwq/KWQString.mm: (QString::replace): Added overloads.
196 * kwq/WebCoreBridge.mm:
197 (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
198 (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
199 (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
200 the additional replace overloads added to QString.
201 (-[WebCoreBridge stringForRange:]): Ditto.
202 (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
203 (-[WebCoreBridge elementAtPoint:]): QChar conversion.
204 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
205 (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.
207 2004-12-13 Ken Kocienda <kocienda@apple.com>
213 <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
215 * khtml/editing/htmlediting.cpp:
216 (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
217 leading and trailing whitespace positions was reversed! I must have introduced this error recently
218 when changing around this code.
220 2004-12-13 David Hyatt <hyatt@apple.com>
222 Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing
223 and painting was using the wrong rect when setting up the x/y of the rect.
227 * khtml/rendering/render_block.cpp:
228 (khtml::RenderBlock::paint):
229 (khtml::RenderBlock::nodeAtPoint):
230 * khtml/rendering/render_object.h:
231 (khtml::RenderObject::floatRect):
233 2004-12-13 Ken Kocienda <kocienda@apple.com>
239 <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles
241 Code to figuire out the end node to merge was missing the font tag in the second paragraph
242 written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.
244 * khtml/editing/htmlediting.cpp:
245 (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
246 looking for the node that is the last inline in the last block of the fragment. The old algorithm was
247 insufficiently powerful.
248 (khtml::ReplacementFragment::enclosingBlock): New helper function.
249 * khtml/editing/htmlediting.h: Add declaration for new helper function.
250 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
251 * layout-tests/editing/pasteboard/paste-text-011.html: Added.
253 2004-12-13 Ken Kocienda <kocienda@apple.com>
257 WebCore side of fix for this bug:
259 <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace
261 Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
262 bug. This change involves our half of the needed changes.
264 Note that a lot of this change has to do with changing code to use a <br> element instead of
265 a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
266 other places, code to handle comments in markup can be removed since we do not use comments for
267 such annotations after this change.
269 * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
270 (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
271 (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
272 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
273 convertedSpaceSpanClassString to match other uses of the idiom used here.
274 (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
275 * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
276 (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
277 * khtml/html/html_elementimpl.cpp:
278 (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
279 annotate fragments with comments any longer.
280 * khtml/html/html_elementimpl.h: Ditto.
281 * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
282 (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
283 (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
285 * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
286 * kwq/WebCoreBridge.mm:
287 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
288 in DOM when calling createContextualFragment().
290 2004-12-10 John Sullivan <sullivan@apple.com>
292 fixed deployment build bustage that John Louch ran into
294 * kwq/KWQTextEdit.mm:
295 (QTextEdit::setScrollBarModes):
296 move bool declaration inside exception-handling block to avoid obscure
299 2004-12-10 Maciej Stachowiak <mjs@apple.com>
303 <rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
306 (QWidget::setFocus): Handle the case where setting focus removed
307 us from the superview - this can happen due to style changes on
310 2004-12-10 Ken Kocienda <kocienda@apple.com>
316 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
318 There are a number of interesting things we could do to fix this bug, including SPI and involving
319 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
320 will fix the bug in the general case until such time as we can come up with more specific
323 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
326 * khtml/editing/htmlediting.cpp:
327 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
328 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
329 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
330 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
332 2004-12-10 Darin Adler <darin@apple.com>
336 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
338 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
339 * khtml/rendering/render_form.cpp:
340 (RenderSubmitButton::rawText): Convert to QChar explicitly.
341 (RenderLineEdit::updateFromElement): Ditto.
342 (RenderLineEdit::slotTextChanged): Ditto.
343 (RenderSelect::updateFromElement): Ditto.
344 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
345 that requires a derived class. Now we don't use this class at all for WebCore, but they still
347 (TextAreaWidget::event): Moved out the ifdefs.
348 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
349 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
350 now done in setStyle.
351 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
352 that's needed and WebCore no longer has TextAreaWidget.
353 (RenderTextArea::calcMinMaxWidth): Ditto.
354 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
356 (RenderTextArea::updateFromElement): Use type QTextEdit.
357 (RenderTextArea::text): Ditto.
358 (RenderTextArea::select): Ditto.
360 * kwq/KWQTextArea.mm:
361 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
362 since it's now handled by QTextEdit.
363 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
365 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
366 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
367 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
369 2004-12-10 Ken Kocienda <kocienda@apple.com>
375 <rdar://problem/3915047> HItting return in empty document inserts <p> but
376 insertion point does not move
378 * khtml/editing/htmlediting.cpp:
379 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
380 code to insert the <p> element for the return is not detecting the fact
381 that the document is empty. Inserting a <p> into an empty body will not
382 "add a new line" as the user expects. With this change, we'll add a second
383 <p> when the root editable element has no rendered kids.
385 2004-12-10 Maciej Stachowiak <mjs@apple.com>
389 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
391 * khtml/html/html_miscimpl.cpp:
392 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
393 the initial one step, otherwise we might inadvertantly step
394 outside the collection base, thereby causing assertion failures or
397 2004-12-10 Ken Kocienda <kocienda@apple.com>
401 * khtml/editing/htmlediting.cpp:
402 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
403 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
404 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
405 should do nothing if the starting point for the selection is itself the starting block.
406 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
407 function, though the names and concepts are slightly different.
409 2004-12-10 Maciej Stachowiak <mjs@apple.com>
413 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
415 * khtml/dom/html_document.cpp:
416 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
417 * khtml/dom/html_document.h:
418 * khtml/ecma/kjs_html.cpp:
419 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
420 * khtml/html/html_miscimpl.cpp:
421 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
422 the items that can be accessed directly as a document propery, in particular forms, images,
423 objects, applets and embeds.
424 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
425 (HTMLFormCollectionImpl::updateNameCache): Ditto.
426 * khtml/html/html_miscimpl.h:
427 (DOM::HTMLCollectionImpl::): Added new type.
429 2004-12-10 Ken Kocienda <kocienda@apple.com>
435 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
437 * khtml/rendering/render_text.cpp:
438 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
440 2004-12-10 Ken Kocienda <kocienda@apple.com>
446 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
448 * khtml/editing/htmlediting.cpp:
449 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
450 that was removed from the document when pasting. This caused the disappearance. Now this
451 is detected, and the selection is shifted to a node that is in the document.
453 2004-12-09 Richard Williamson <rjw@apple.com>
455 Check to disable threaded decoding during
456 layout tests wasn't invoking function, just checking address of
457 function, which would always return true.
459 * kwq/WebCoreImageRendererFactory.m:
460 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
462 2004-12-09 David Hyatt <hyatt@apple.com>
464 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
467 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
468 all inlines when repainting.
472 * khtml/rendering/render_block.cpp:
473 (khtml::RenderBlock::layoutBlockChildren):
474 * khtml/rendering/render_flow.cpp:
475 (RenderFlow::getAbsoluteRepaintRect):
477 2004-12-09 David Hyatt <hyatt@apple.com>
479 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
480 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
481 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
482 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
486 * khtml/rendering/render_block.cpp:
487 (khtml::RenderBlock::getClearDelta):
488 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
489 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
490 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
491 * layout-tests/fast/block/margin-collapse/102-expected.txt:
492 * layout-tests/fast/block/margin-collapse/102.html:
494 2004-12-09 Richard Williamson <rjw@apple.com>
496 Fixed <rdar://problem/3914078> worldclock crashing gc related
498 Use ProtectedValue for Context2D instance members.
502 * khtml/ecma/kjs_html.h:
504 2004-12-09 John Sullivan <sullivan@apple.com>
508 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
510 * kwq/KWQAccObject.mm:
511 (-[KWQAccObject title]): moved image alt tag code out of here
512 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
513 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
514 that ordinary elements return; this means that ordinary elements that aren't images will return
515 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
517 (-[KWQAccObject accessibilityAttributeValue:]):
518 call accessibilityDescription when asked for AXDescription
520 2004-12-09 Ken Kocienda <kocienda@apple.com>
526 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
528 * khtml/editing/htmlediting.cpp:
529 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
530 been deleted. If this is the case, set the destination to the node the delete command provides in
531 its ending selection.
535 2004-12-09 Ken Kocienda <kocienda@apple.com>
541 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
543 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
544 callback may not be delivered before the program asks for the dimensions of an image in order to
545 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
546 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
548 * kwq/KWQRenderTreeDebug.cpp:
549 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
550 (externalRepresentation): Sets debuggingRenderTree flag to true;
551 * kwq/KWQRenderTreeDebug.h:
552 * kwq/WebCoreImageRendererFactory.m:
553 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
554 do threaded decoding in any case if the flag is set.
556 2004-12-09 Chris Blumenberg <cblu@apple.com>
558 Fix for busting XMLHTTPRequest.
560 Reviewed by kocienda.
562 * khtml/misc/loader.cpp:
563 (Loader::servePendingRequests): pass true for deliverAllData
565 (KIO::get): take deliverAllData param
566 (KIO::http_post): ditto
567 * kwq/KWQKJobClasses.h:
568 * kwq/KWQKJobClasses.mm:
569 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
570 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
572 2004-12-09 Ken Kocienda <kocienda@apple.com>
576 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
578 * khtml/xml/dom_nodeimpl.cpp:
579 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
581 2004-12-07 Richard Williamson <rjw@apple.com>
583 Support threaded image decoding on machines w/ > 2 CPUs.
585 Reviewed by Maciej and Chris.
587 * khtml/misc/loader.cpp:
588 (CachedImageCallback::notifyUpdate):
589 (CachedImageCallback::notifyFinished):
590 (CachedImageCallback::notifyDecodingError):
591 (CachedImageCallback::handleError):
592 (CachedImageCallback::clear):
593 (CachedImage::CachedImage):
594 (CachedImage::clear):
596 (CachedImage::checkNotify):
597 (Loader::servePendingRequests):
598 (Loader::slotFinished):
599 (Loader::numRequests):
600 (Loader::cancelRequests):
601 (Loader::removeBackgroundDecodingRequest):
602 * khtml/misc/loader.h:
603 (khtml::CachedImageCallback::CachedImageCallback):
604 (khtml::CachedImageCallback::ref):
605 (khtml::CachedImageCallback::deref):
606 (khtml::CachedImage::decoderCallback):
607 * khtml/rendering/render_object.cpp:
608 (RenderObject::setPixmap):
611 (-[WebImageCallback initWithCallback:khtml::]):
612 (-[WebImageCallback _commonTermination]):
613 (-[WebImageCallback dealloc]):
614 (-[WebImageCallback finalize]):
615 (-[WebImageCallback notify]):
616 (-[WebImageCallback setImageSourceStatus:]):
617 (-[WebImageCallback status]):
618 (QPixmap::shouldUseThreadedDecoding):
619 (QPixmap::receivedData):
620 * kwq/WebCoreImageRenderer.h:
621 * kwq/WebCoreImageRendererFactory.h:
622 * kwq/WebCoreImageRendererFactory.m:
623 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
624 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
626 2004-12-07 Ken Kocienda <kocienda@apple.com>
630 * khtml/editing/htmlediting.cpp:
631 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
632 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
633 after new block has been inserted, otherwise a crash can result. Shuffle down call
634 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
637 2004-12-07 Ken Kocienda <kocienda@apple.com>
643 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
645 * khtml/editing/htmlediting.cpp:
646 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
647 for determining the location for inserting content. Do not allow an insert before or after if the
648 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
649 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
650 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
652 2004-12-07 Darin Adler <darin@apple.com>
656 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
658 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
660 2004-12-07 Ken Kocienda <kocienda@apple.com>
664 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
665 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
667 * khtml/editing/html_interchange.h: Name change, as described above.
668 * khtml/editing/htmlediting.cpp:
669 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
670 * khtml/xml/dom2_rangeimpl.cpp:
671 (DOM::RangeImpl::toHTML): Ditto.
673 2004-12-07 Ken Kocienda <kocienda@apple.com>
677 Added a couple more layout tests.
679 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
680 * layout-tests/editing/deleting/delete-line-013.html: Added.
681 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
682 * layout-tests/editing/deleting/delete-line-014.html: Added.
684 2004-12-06 Maciej Stachowiak <mjs@apple.com>
688 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
691 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
692 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
693 (-[KWQListBoxScrollView widget]): See above.
694 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
695 afterMouseDown, to avoid triggering an assertion failure.
697 2004-12-06 David Hyatt <hyatt@apple.com>
699 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
700 made by me, kocienda and harrison to just remove it.
704 * khtml/rendering/bidi.cpp:
705 (khtml::RenderBlock::layoutInlineChildren):
706 * khtml/rendering/render_block.cpp:
707 (khtml:::RenderFlow):
708 * khtml/rendering/render_block.h:
709 * khtml/rendering/render_flow.cpp:
710 (RenderFlow::dirtyLinesFromChangedChild):
712 2004-12-06 David Hyatt <hyatt@apple.com>
714 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
715 not a damage rect that can be changed when intersected with the clip regions of the web page.
719 * khtml/rendering/render_canvas.h:
720 (khtml::RenderCanvas::printRect):
721 (khtml::RenderCanvas::setPrintRect):
722 * khtml/rendering/render_flow.cpp:
723 (RenderFlow::paintLines):
724 * khtml/rendering/render_list.cpp:
725 (RenderListMarker::paint):
726 * kwq/KWQKHTMLPart.mm:
727 (KWQKHTMLPart::adjustPageHeight):
729 2004-12-06 David Harrison <harrison@apple.com>
731 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
733 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
736 * khtml/rendering/render_flow.cpp:
737 (RenderFlow::dirtyLinesFromChangedChild):
738 Dirty the line above because new child can inval the cached line break position of previous line.
740 2004-12-06 David Hyatt <hyatt@apple.com>
742 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
743 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
744 3126929, handle top/left overflow.
746 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
748 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
749 regions and web pages) has been fixed.
753 * khtml/rendering/bidi.cpp:
754 (khtml::RenderBlock::computeHorizontalPositionsForLine):
755 (khtml::RenderBlock::checkLinesForOverflow):
756 * khtml/rendering/render_block.cpp:
757 (khtml:::RenderFlow):
758 (khtml::RenderBlock::overflowHeight):
759 (khtml::RenderBlock::overflowWidth):
760 (khtml::RenderBlock::overflowLeft):
761 (khtml::RenderBlock::overflowTop):
762 (khtml::RenderBlock::overflowRect):
763 (khtml::RenderBlock::layoutBlock):
764 (khtml::RenderBlock::layoutBlockChildren):
765 (khtml::RenderBlock::paint):
766 (khtml::RenderBlock::floatRect):
767 (khtml::RenderBlock::lowestPosition):
768 (khtml::RenderBlock::rightmostPosition):
769 (khtml::RenderBlock::leftmostPosition):
770 (khtml::RenderBlock::nodeAtPoint):
771 * khtml/rendering/render_block.h:
772 * khtml/rendering/render_box.h:
773 (khtml::RenderBox::borderBox):
774 (khtml::RenderBox::borderTopExtra):
775 (khtml::RenderBox::borderBottomExtra):
776 * khtml/rendering/render_layer.cpp:
777 (RenderLayer::paintScrollbars):
778 (mustExamineRenderer):
779 (RenderLayer::intersectsDamageRect):
780 (RenderLayer::containsPoint):
781 * khtml/rendering/render_line.cpp:
782 (khtml::InlineFlowBox::placeBoxesHorizontally):
783 (khtml::InlineFlowBox::verticallyAlignBoxes):
784 * khtml/rendering/render_line.h:
785 (khtml::InlineBox::leftOverflow):
786 (khtml::InlineBox::rightOverflow):
787 (khtml::InlineFlowBox::setVerticalOverflowPositions):
788 (khtml::RootInlineBox::RootInlineBox):
789 (khtml::RootInlineBox::leftOverflow):
790 (khtml::RootInlineBox::rightOverflow):
791 (khtml::RootInlineBox::setVerticalOverflowPositions):
792 (khtml::RootInlineBox::setHorizontalOverflowPositions):
793 * khtml/rendering/render_object.h:
794 (khtml::RenderObject::borderBox):
795 (khtml::RenderObject::overflowLeft):
796 (khtml::RenderObject::overflowTop):
797 (khtml::RenderObject::overflowRect):
798 (khtml::RenderObject::floatRect):
799 * khtml/rendering/render_table.cpp:
800 (RenderTable::layout):
801 (RenderTable::paint):
802 (RenderTable::paintBoxDecorations):
803 (RenderTable::calcMinMaxWidth):
804 * khtml/rendering/render_table.h:
805 (khtml::RenderTableCell::borderTopExtra):
806 (khtml::RenderTableCell::borderBottomExtra):
811 2004-12-06 Maciej Stachowiak <mjs@apple.com>
815 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
817 I changed all unprotected places that can navigate a different
818 window or frame from script to check for a javascript: URL, and if
819 found, to check for safety using cross-site-script rules.
821 I considered a few other possible exploits and made no change:
823 - document.location is already protected because the document
824 object itself is protected
826 - frame.src, frame.location, iframe.src and targetted links are
827 all safe because setting the URL of a frame to a javascript: URL
828 executes the script in the context of the parent
830 * khtml/ecma/kjs_window.cpp:
831 (WindowFunc::tryCall):
833 (LocationFunc::tryCall):
835 2004-12-06 Ken Kocienda <kocienda@apple.com>
841 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
843 * khtml/editing/htmlediting.cpp:
844 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
845 check for one of the special cases being checked for in this function. The specific case
846 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
847 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
848 case where a selection ended in a <br> after a block and would not delete any part of the
849 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
852 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
853 new use of the function exposed this bug:
855 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
857 * khtml/xml/dom_position.cpp:
858 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
859 not have this fatal flaw. It is a much better design as well.
861 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
862 have what I consider to be a better result. Going with it.
864 2004-12-06 Chris Blumenberg <cblu@apple.com>
866 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
871 (-[DOMElement _font]): new SPI for AppKit
874 2004-12-06 Darin Adler <darin@apple.com>
878 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
880 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
881 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
883 2004-12-06 John Sullivan <sullivan@apple.com>
885 Darin found what appears to be the real leak that we were falsely blaming
886 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
889 * khtml/css/cssparser.cpp:
890 (CSSParser::parseValue):
891 call clearProperties() instead of just setting numParsedProperties to 0
892 (CSSParser::parseDeclaration):
894 (CSSParser::createStyleDeclaration):
897 2004-12-06 Ken Kocienda <kocienda@apple.com>
903 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
904 * layout-tests/editing/inserting/insert-div-001.html: Added.
905 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
906 * layout-tests/editing/inserting/insert-div-002.html: Added.
907 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
908 * layout-tests/editing/inserting/insert-div-003.html: Added.
909 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
910 * layout-tests/editing/inserting/insert-div-004.html: Added.
911 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
912 * layout-tests/editing/inserting/insert-div-005.html: Added.
913 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
914 * layout-tests/editing/inserting/insert-div-006.html: Added.
915 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
916 * layout-tests/editing/inserting/insert-div-007.html: Added.
917 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
918 * layout-tests/editing/inserting/insert-div-008.html: Added.
919 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
920 * layout-tests/editing/inserting/insert-div-009.html: Added.
922 2004-12-06 Ken Kocienda <kocienda@apple.com>
928 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
930 * khtml/editing/htmlediting.cpp:
931 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
932 being added to this function. This ensures that the added block has a height.
933 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
935 2004-12-06 Ken Kocienda <kocienda@apple.com>
939 * khtml/dom/dom_string.cpp:
940 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
941 * khtml/dom/dom_string.h: Ditto.
942 * khtml/editing/htmlediting.cpp:
943 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
944 RebalanceWhitespaceCommand instance.
945 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
946 (khtml::InsertLineBreakCommand::doApply): Ditto.
947 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
948 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
949 (khtml::InsertTextCommand::input): Ditto.
950 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
951 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
952 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
953 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
954 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
955 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
956 * khtml/editing/htmlediting.h: Ditto.
957 (khtml::RebalanceWhitespaceCommand::): Ditto.
959 2004-12-05 Darin Adler <darin@apple.com>
961 - fixed small problem in my check-in from yesterday
964 (positionForEvent): Get location from event without raising exception if it's the wrong type.
965 (clickCountForEvent): Same, for clickCount.
966 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
967 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
968 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
970 2004-12-04 Darin Adler <darin@apple.com>
974 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
976 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
977 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
978 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
980 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
982 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
983 * khtml/rendering/render_form.cpp:
984 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
985 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
986 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
988 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
989 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
990 Added a fixState helper method so the constructors can save code.
992 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
993 and added a third constructor that uses the "current event" from AppKit (used above).
994 (QMouseEvent::fixState): Compute state and click count based on event type.
996 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
998 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
999 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
1000 underlying cause in CSS.
1002 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
1004 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
1005 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
1007 2004-12-03 Chris Blumenberg <cblu@apple.com>
1010 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
1011 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
1012 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
1013 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
1015 Reviewed by darin, rjw, kocienda.
1017 * khtml/misc/loader.cpp:
1018 (CachedObject::~CachedObject):
1019 (CachedCSSStyleSheet::checkNotify):
1020 (Loader::servePendingRequests):
1021 (Loader::slotFinished):
1022 (Loader::slotReceivedResponse):
1023 (Cache::requestImage):
1024 (Cache::requestScript):
1025 * khtml/misc/loader.h:
1026 (khtml::CachedObject::CachedObject):
1027 (khtml::CachedObject::response):
1028 (khtml::CachedObject::allData):
1029 * kwq/KWQKJobClasses.h:
1030 * kwq/KWQKJobClasses.mm:
1031 (KIO::TransferJobPrivate::TransferJobPrivate):
1032 (KIO::TransferJobPrivate::~TransferJobPrivate):
1033 (KIO::TransferJob::TransferJob):
1034 (KIO::TransferJob::assembleResponseHeaders):
1035 (KIO::TransferJob::retrieveCharset):
1036 (KIO::TransferJob::emitResult):
1037 (KIO::TransferJob::emitReceivedResponse):
1040 (KWQHeaderStringFromDictionary):
1041 (KWQCheckCacheObjectStatus):
1042 (KWQIsResponseURLEqualToURL):
1044 (KWQResponseMIMEType):
1045 (KWQCacheObjectExpiresTime):
1046 (khtml::CachedObject::setResponse):
1047 (khtml::CachedObject::setAllData):
1051 * kwq/KWQResourceLoader.mm:
1052 (-[KWQResourceLoader finishJobAndHandle:]):
1053 (-[KWQResourceLoader cancel]):
1054 (-[KWQResourceLoader reportError]):
1055 (-[KWQResourceLoader finishWithData:]):
1063 * kwq/WebCoreBridge.h:
1064 * kwq/WebCoreResourceLoader.h:
1066 2004-12-04 Darin Adler <darin@apple.com>
1070 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
1072 * khtml/rendering/render_form.cpp:
1073 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
1074 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
1075 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
1076 (RenderSlider::slotSliderValueChanged): Ditto.
1078 2004-12-03 John Sullivan <sullivan@apple.com>
1082 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
1083 khtml::BackgroundLayer::cullEmptyLayers
1085 * khtml/rendering/render_style.cpp:
1086 (BackgroundLayer::cullEmptyLayers):
1087 added missing nil check
1091 2004-12-03 Ken Kocienda <kocienda@apple.com>
1095 Roll out some recent changes by Chris that caused a performance regression.
1096 Fix is in hand, but it is a little risky this close to a submission. So,
1097 we have decided to roll back the change with the regression and roll in
1098 the new code after we submit.
1100 * khtml/css/cssproperties.c:
1103 * khtml/css/cssvalues.c:
1106 * khtml/misc/htmlattrs.c:
1109 * khtml/misc/htmltags.c:
1112 * khtml/misc/loader.cpp:
1113 (CachedObject::~CachedObject):
1114 (CachedObject::setResponse):
1115 (CachedCSSStyleSheet::checkNotify):
1116 (Loader::servePendingRequests):
1117 (Loader::slotFinished):
1118 (Loader::slotReceivedResponse):
1119 (Cache::requestImage):
1120 (Cache::requestScript):
1121 * khtml/misc/loader.h:
1122 (khtml::CachedObject::CachedObject):
1123 (khtml::CachedObject::response):
1124 * kwq/KWQKJobClasses.h:
1125 * kwq/KWQKJobClasses.mm:
1126 (KIO::TransferJobPrivate::TransferJobPrivate):
1127 (KIO::TransferJobPrivate::~TransferJobPrivate):
1128 (KIO::TransferJob::TransferJob):
1129 (KIO::TransferJob::assembleResponseHeaders):
1130 (KIO::TransferJob::retrieveCharset):
1131 (KIO::TransferJob::emitResult):
1132 (KIO::TransferJob::emitReceivedResponse):
1135 (KWQHeaderStringFromDictionary):
1136 (KWQCheckCacheObjectStatus):
1137 (KWQRetainResponse):
1138 (KWQReleaseResponse):
1139 (KWQIsResponseURLEqualToURL):
1141 (KWQResponseMIMEType):
1142 (KWQResponseTextEncodingName):
1143 (KWQResponseHeaderString):
1144 (KWQCacheObjectExpiresTime):
1145 (KWQLoader::KWQLoader):
1149 * kwq/KWQResourceLoader.mm:
1150 (-[KWQResourceLoader finishJobAndHandle]):
1151 (-[KWQResourceLoader cancel]):
1152 (-[KWQResourceLoader reportError]):
1153 (-[KWQResourceLoader finish]):
1161 * kwq/WebCoreBridge.h:
1162 * kwq/WebCoreResourceLoader.h:
1164 2004-12-03 John Sullivan <sullivan@apple.com>
1168 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
1170 * kwq/KWQKHTMLPart.mm:
1171 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
1172 when checking whether we moved the focus to another view, make sure we didn't "move" it to
1173 our documentView, because that's no move at all.
1175 2004-12-03 Darin Adler <darin@apple.com>
1179 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
1181 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
1182 Added missing initialization for base class and node pointer.
1184 - fixed a few places that could leave dangling node pointers
1186 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
1187 Clear out the node pointer when the node is destroyed.
1188 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
1190 2004-12-03 Chris Blumenberg <cblu@apple.com>
1192 Fix for performance regression. My original patch added a signal for passing the data of a resource to its WebCore cache object. This patch passes the data with the preexisting "finished" symbol so we make less calls.
1193 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
1197 * khtml/misc/loader.cpp:
1198 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
1199 (Loader::slotFinished): take data param
1200 * khtml/misc/loader.h:
1201 * kwq/KWQKJobClasses.h:
1202 * kwq/KWQKJobClasses.mm:
1203 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
1204 (KIO::TransferJob::emitResult): take data param and pass it
1205 * kwq/KWQResourceLoader.mm:
1206 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
1207 (-[KWQResourceLoader cancel]): pass nil for data
1208 (-[KWQResourceLoader reportError]): ditto
1209 (-[KWQResourceLoader finishWithData:]): pass data
1211 (KWQSlot::KWQSlot): pass data param to slotFinished
1212 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
1214 2004-12-03 Ken Kocienda <kocienda@apple.com>
1218 Did some clean up in the Position class as a result of trying to write some new layout
1219 tests and discovering a bug along the way.
1221 I removed these three functions from the Position class:
1223 1. bool isFirstRenderedPositionOnLine() const;
1224 2. bool isLastRenderedPositionOnLine() const;
1225 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
1226 4. bool inFirstEditableInRootEditableElement() const;
1228 The first two have replacements in the VisiblePosition class, and some code has been
1229 moved to use these new variants. The third function was a helper used only by these
1230 first two function, and can be removed as well. The fourth function was not used by anyone.
1232 * khtml/editing/htmlediting.cpp:
1233 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
1234 * khtml/editing/visible_position.cpp:
1235 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
1236 Incorrect results were being returned when asking about positions at the starts of blocks.
1237 * khtml/xml/dom_position.cpp:
1238 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
1239 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
1240 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
1241 * khtml/xml/dom_position.h: Update header for deletions.
1243 2004-12-03 Ken Kocienda <kocienda@apple.com>
1247 Terminology change in execCommand command identifiers. Specifically, the name of
1248 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
1249 terminology used by AppKit. It is also more accurate, since the insertion of a
1250 "br" element is what the command does. The inspiration for this change is so the
1251 -insertNewline AppKit method can be mapped to insert a new "div" element in
1252 a document and avoid ambiguity with what the javascript editing command does.
1254 * khtml/editing/jsediting.cpp
1255 * layout-tests/editing/deleting/delete-tab-004.html
1256 * layout-tests/editing/editing.js
1257 * layout-tests/editing/inserting/insert-3654864-fix.html
1258 * layout-tests/editing/inserting/insert-3659587-fix.html
1259 * layout-tests/editing/inserting/insert-3775316-fix.html
1260 * layout-tests/editing/inserting/insert-3800346-fix.html
1261 * layout-tests/editing/inserting/insert-br-001.html
1262 * layout-tests/editing/inserting/insert-br-002.html
1263 * layout-tests/editing/inserting/insert-br-003.html
1264 * layout-tests/editing/inserting/insert-br-004.html
1265 * layout-tests/editing/inserting/insert-br-005.html
1266 * layout-tests/editing/inserting/insert-br-006.html
1267 * layout-tests/editing/inserting/insert-br-007.html
1268 * layout-tests/editing/inserting/insert-br-008.html
1269 * layout-tests/editing/inserting/insert-tab-004.html
1270 * layout-tests/editing/inserting/insert-text-with-newlines.html
1271 * layout-tests/editing/pasteboard/paste-text-010.html
1273 2004-12-02 Ken Kocienda <kocienda@apple.com>
1279 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
1281 * khtml/editing/htmlediting.cpp:
1282 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
1283 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
1284 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
1285 in a block and the document is in quirks mode, add an additional br to make the one in the
1286 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
1287 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
1288 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
1290 2004-12-02 Richard Williamson <rjw@apple.com>
1292 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
1294 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
1295 the b/f cache won't incorrectly trash the previous state when restoring.
1299 * kwq/WebCoreBridge.h:
1300 * kwq/WebCoreBridge.mm:
1301 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
1302 (-[WebCoreBridge canCachePage]):
1303 (-[WebCoreBridge clear]):
1305 2004-12-02 Ken Kocienda <kocienda@apple.com>
1311 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
1313 * khtml/xml/dom2_rangeimpl.cpp:
1314 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
1315 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
1316 of this bug where there is content after the body tag). Did a little code clean up as well.
1317 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
1319 2004-12-02 Ken Kocienda <kocienda@apple.com>
1325 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
1327 * khtml/khtml_part.cpp:
1328 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
1329 to figure out which end of the selection to extend.
1331 2004-12-02 David Harrison <harrison@apple.com>
1333 Reviewed by Ken Kocienda.
1335 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
1336 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
1338 * khtml/editing/visible_text.cpp:
1339 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1340 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
1341 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
1342 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
1343 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
1344 Distinguish BR from whitespace.
1345 * khtml/editing/visible_text.h:
1346 Distinguish BR from whitespace.
1347 * khtml/editing/visible_units.cpp:
1348 (khtml::previousWordBoundary):
1349 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.
1351 2004-12-02 Ken Kocienda <kocienda@apple.com>
1357 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
1359 * khtml/xml/dom_position.cpp:
1360 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
1361 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
1362 exception trying to use a Position returned from this function to set the boundary point of a Range (which
1363 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
1364 contract to return a range-compliant position, hence the need for this fix.
1366 2004-12-01 Ken Kocienda <kocienda@apple.com>
1372 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
1373 regard to other editing commands. The class had a name change ages ago, and it was never
1375 * khtml/editing/htmlediting.h: Ditto.
1377 2004-12-01 Ken Kocienda <kocienda@apple.com>
1381 Some improvements for paste, including some new code to annotate
1382 whitespace when writing to the pasteboard to ensure that the meaning
1383 of the markup on the pasteboard is unambiguous.
1385 There is also new code for reading this annotated markup from the pasteboard,
1386 removing the nodes that were added only to prevent ambiguity.
1388 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
1389 The header should have been added earlier, but I did not do so.
1390 * khtml/editing/html_interchange.cpp: Added.
1391 (convertHTMLTextToInterchangeFormat):
1392 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
1393 * khtml/editing/htmlediting.cpp:
1394 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
1395 Also fixed a bug in the code that counts blocks in a fragment.
1396 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
1397 (khtml::ReplacementFragment::insertNodeBefore): New helper.
1398 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
1399 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
1400 * khtml/editing/htmlediting.h: Add some new declarations.
1401 * khtml/xml/dom2_rangeimpl.cpp:
1402 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
1403 * khtml/xml/dom_nodeimpl.cpp:
1404 (NodeImpl::stringValueForRange): New helper.
1405 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
1406 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
1407 should be added. Called by the paste code.
1408 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
1410 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
1411 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
1412 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
1414 2004-11-30 Chris Blumenberg <cblu@apple.com>
1416 * ChangeLog: removed conflict marker
1418 2004-11-30 Chris Blumenberg <cblu@apple.com>
1421 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
1422 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
1426 * khtml/misc/loader.cpp:
1427 (CachedObject::~CachedObject): release m_allData
1428 (CachedObject::setAllData): new
1429 (Loader::servePendingRequests): connect slotAllData
1430 (Loader::slotAllData): new
1431 (Cache::requestImage): tweak
1432 * khtml/misc/loader.h:
1433 (khtml::CachedObject::CachedObject): set allData to 0
1434 (khtml::CachedObject::allData): new
1435 * kwq/KWQKJobClasses.h:
1436 * kwq/KWQKJobClasses.mm:
1437 (KIO::TransferJob::TransferJob): set m_allData
1438 (KIO::TransferJob::emitAllData): new
1440 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
1441 * kwq/KWQResourceLoader.mm:
1442 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
1444 (KWQSlot::KWQSlot): support for slotAllData
1446 * kwq/WebCoreBridge.h:
1447 * kwq/WebCoreResourceLoader.h:
1449 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1453 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1457 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
1459 * khtml/khtml_part.cpp:
1460 (KHTMLPart::begin): call setParsing on document here after opening
1461 - from now on we'll only set parsing to true for a document open
1462 caused by page loading, not a programmatic one.
1463 * khtml/xml/dom_docimpl.cpp:
1464 (DocumentImpl::open): don't setParsing to true here any more.
1466 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1470 - fix recent regression from collection perf fixes.
1472 * khtml/html/html_miscimpl.cpp:
1473 (HTMLFormCollectionImpl::updateNameCache): Look up the name
1474 attribute in the name cache, not the id cache (d'oh!)
1476 2004-11-30 Darin Adler <darin@apple.com>
1480 - rolled in a KDE fix for a problem that may underlie a number of crashes
1482 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
1483 the KDE guys to fix a subtle problem. Code said "n = n =".
1485 - rolled in a KDE fix for a containingBlock crash
1487 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
1488 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
1491 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
1494 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
1495 (-[KWQButton detachQButton]): Added.
1496 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
1497 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
1498 (-[KWQButton widget]): Added.
1499 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
1500 (-[KWQButton resignFirstResponder]): Ditto.
1501 (-[KWQButton canBecomeKeyView]): Ditto.
1502 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
1503 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
1505 * kwq/KWQComboBox.mm:
1506 (QComboBox::~QComboBox): Call detachQComboBox.
1507 (-[KWQPopUpButtonCell detachQComboBox]): Added.
1508 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
1509 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
1510 (-[KWQPopUpButton action:]): Ditto.
1511 (-[KWQPopUpButton widget]): Tweaked.
1512 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
1513 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
1514 (-[KWQPopUpButton resignFirstResponder]): Ditto.
1515 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
1517 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
1519 * kwq/KWQListBox.mm:
1520 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
1522 * kwq/KWQScrollBar.h: Removed m_scroller field.
1523 * kwq/KWQScrollBar.mm:
1524 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
1525 (-[KWQScrollBar detachQScrollBar]): Added.
1526 (-[KWQScrollBar widget]): Added.
1527 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
1528 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
1529 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
1530 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
1531 (QScrollBar::setKnobProportion): Ditto.
1532 (QScrollBar::scrollbarHit): Ditto.
1534 * kwq/KWQScrollView.mm:
1535 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
1536 hack where we don't remove right away when doing mouse tracking.
1537 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
1538 the hack where we don't add right away when doing mouse tracking.
1540 * kwq/KWQSlider.h: Added destructor.
1542 (-[KWQSlider initWithQSlider:]): Tweaked a little.
1543 (-[KWQSlider detachQSlider]): Added.
1544 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
1545 (-[KWQSlider widget]): Added.
1546 (QSlider::~QSlider): Added. Calls detachQSlider.
1548 * kwq/KWQTextArea.h: Added detachQTextEdit method.
1549 * kwq/KWQTextArea.mm:
1550 (-[KWQTextArea detachQTextEdit]): Added.
1551 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
1552 (-[KWQTextArea becomeFirstResponder]): Ditto.
1553 (-[KWQTextArea nextKeyView]): Ditto.
1554 (-[KWQTextArea previousKeyView]): Ditto.
1555 (-[KWQTextArea drawRect:]): Ditto.
1556 (-[KWQTextAreaTextView insertTab:]): Ditto.
1557 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
1558 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
1559 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
1560 (-[KWQTextAreaTextView mouseDown:]): Ditto.
1561 (-[KWQTextAreaTextView keyDown:]): Ditto.
1562 (-[KWQTextAreaTextView keyUp:]): Ditto.
1564 * kwq/KWQTextEdit.h: Added ~QTextEdit.
1565 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
1567 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
1568 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
1570 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
1571 Added beforeMouseDown and afterMouseDown for use in widget implementations.
1572 Removed unused hasMouseTracking function.
1574 (QWidget::QWidget): Initialize two new fields.
1575 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
1576 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
1577 (QWidget::addToSuperview): Added.
1578 (QWidget::removeFromSuperview): Added.
1579 (QWidget::beforeMouseDown): Added.
1580 (QWidget::afterMouseDown): Added.
1582 * khtml/rendering/render_layer.cpp:
1583 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
1584 (RenderLayer::setHasVerticalScrollbar): Ditto.
1586 2004-11-30 Ken Kocienda <kocienda@apple.com>
1592 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
1594 * khtml/khtml_part.cpp:
1595 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
1596 with no blink if it is.
1598 2004-11-30 Ken Kocienda <kocienda@apple.com>
1604 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
1606 * khtml/khtml_part.cpp:
1607 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
1608 or <input type=image> was checked for focus since these elements are keyboard-focusable,
1609 but not mouse focusable. Also, this function did not work hard enough to set the focused
1610 node, and was content to clear it if the first element checked failed the test, rather
1611 than looking more at parents. This would have the effect of clearing, then resetting the
1612 focus on a DIV containing a button or image with content on either side of it in the
1613 process of arrowing over such content.
1615 2004-11-30 Ken Kocienda <kocienda@apple.com>
1619 * khtml/editing/htmlediting.cpp:
1620 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
1621 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
1622 * khtml/khtml_part.cpp:
1623 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
1624 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
1625 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
1626 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
1627 isCharacterSmartReplaceExempt virtual.
1629 2004-11-30 Ken Kocienda <kocienda@apple.com>
1633 * khtml/editing/htmlediting.cpp:
1634 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
1635 Seemed simple enough to land without review.
1637 2004-11-29 Ken Kocienda <kocienda@apple.com>
1641 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
1642 are handled correctly now, including selections that span multiple blocks, and cases
1643 where content on the pasteboard ends in newlines (or what appear to be newlines to a
1644 user, really block ends or BRs). I also made one small, but important change in the
1645 copy code to annotate the markup written to the pasteboard to support these selections
1648 New header that defines a couple of constants used in copying and pasting.
1650 * ForwardingHeaders/editing/html_interchange.h: Added.
1651 * khtml/editing/html_interchange.h: Added.
1653 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
1654 as a new helper class, ReplacementFragment, which encapsulates information and functions
1655 pertaining to a document fragment that is being inserted into a document.
1657 * khtml/editing/htmlediting.cpp:
1658 (khtml::ReplacementFragment::ReplacementFragment):
1659 (khtml::ReplacementFragment::~ReplacementFragment):
1660 (khtml::ReplacementFragment::firstChild): Simple accessor.
1661 (khtml::ReplacementFragment::lastChild): Ditto.
1662 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
1663 the starting node to use for merging into the block containing the start of the selection.
1664 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
1665 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
1666 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
1667 special annotation comment added in by the copy code.
1668 (khtml::ReplacementFragment::removeNode): Simple helper.
1669 (khtml::isComment): Simple helper.
1670 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
1671 I would like to do better than this some day, but this check will hold us until I can do better.
1672 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
1673 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
1674 (khtml::ReplaceSelectionCommand::doApply):
1675 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
1676 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
1677 (khtml::ReplacementFragment::root):
1678 (khtml::ReplacementFragment::type):
1679 (khtml::ReplacementFragment::isEmpty):
1680 (khtml::ReplacementFragment::isSingleTextNode):
1681 (khtml::ReplacementFragment::isTreeFragment):
1682 (khtml::ReplacementFragment::hasMoreThanOneBlock):
1683 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
1685 This smaller set of changes markup generation to add the newline annotation described in the
1686 comment at the start of this entry.
1688 * khtml/xml/dom2_rangeimpl.cpp:
1689 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
1690 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
1691 comment annotations are added to the markup generated.
1692 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
1693 * kwq/WebCoreBridge.mm:
1694 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
1695 DOM::RangeImpl::toHTML uses annotations when generating.
1699 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
1700 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
1701 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
1702 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
1703 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
1704 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
1705 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
1706 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
1707 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
1708 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
1709 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
1710 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
1711 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
1712 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
1713 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
1714 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
1715 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
1716 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
1718 2004-11-29 Ken Kocienda <kocienda@apple.com>
1720 Reviewed by Harrison
1722 Made two small changes that make it possible for comments to have DOM nodes made for them
1723 when pasting. This relies on some earlier work I did some days ago.
1725 * khtml/xml/dom_nodeimpl.cpp:
1726 (NodeImpl::startMarkup): Get the string from the comment.
1727 * kwq/WebCoreBridge.mm:
1728 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
1729 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
1730 be included in the DOM.
1732 2004-11-29 Ken Kocienda <kocienda@apple.com>
1734 Reviewed by Harrison
1736 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
1737 my improved paste code.
1739 * khtml/editing/visible_position.cpp:
1740 (khtml::blockRelationship)
1741 (khtml::visiblePositionsInDifferentBlocks)
1742 (khtml::isFirstVisiblePositionInBlock)
1743 (khtml::isFirstVisiblePositionInNode)
1744 (khtml::isLastVisiblePositionInBlock)
1745 * khtml/editing/visible_position.h
1747 2004-11-29 Ken Kocienda <kocienda@apple.com>
1749 Reviewed by Harrison
1751 * khtml/xml/dom_position.cpp:
1752 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
1753 specified from obeying that directive. The old code would stop at an outer block boundary in
1754 the case where that block had a block as its first child. The correct behavior is to drill into
1755 that inner block (and continue on drilling down, if possible), to find the correct position.
1757 2004-11-29 Ken Kocienda <kocienda@apple.com>
1759 Reviewed by Harrison
1761 Small improvements to the node-display debugging helpers.
1763 * khtml/xml/dom_nodeimpl.cpp:
1764 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
1765 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
1767 2004-11-29 Ken Kocienda <kocienda@apple.com>
1769 Reviewed by Harrison
1771 * khtml/editing/htmlediting.cpp:
1772 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
1773 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
1774 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
1775 place after the delete.
1777 2004-11-29 Ken Kocienda <kocienda@apple.com>
1779 Reviewed by Harrison
1781 Add a new helper function to insert a paragraph separator. Will be used in my
1782 upcoming paste improvments.
1784 * khtml/editing/htmlediting.cpp: Added function
1785 (khtml::CompositeEditCommand::insertParagraphSeparator)
1786 * khtml/editing/htmlediting.h: Ditto.
1788 2004-11-23 David Harrison <harrison@apple.com>
1790 Added various comments.
1792 * khtml/editing/htmlediting.cpp:
1793 (khtml::StyleChange::init):
1794 (khtml::ApplyStyleCommand::doApply):
1795 (khtml::ApplyStyleCommand::applyBlockStyle):
1796 (khtml::ApplyStyleCommand::applyInlineStyle):
1798 2004-11-23 David Hyatt <hyatt@apple.com>
1800 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
1801 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
1803 * khtml/rendering/render_block.cpp:
1804 (khtml::RenderBlock::nodeAtPoint):
1806 2004-11-22 David Hyatt <hyatt@apple.com>
1808 Make sure you can use document.createElement to make a <canvas> element.
1810 * khtml/xml/dom_docimpl.cpp:
1811 (DocumentImpl::createHTMLElement):
1813 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1817 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
1818 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
1819 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
1820 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
1822 * khtml/ecma/kjs_html.cpp:
1823 (KJS::HTMLDocument::tryGet):
1824 * khtml/html/html_formimpl.cpp:
1825 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
1826 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1827 * khtml/html/html_formimpl.h:
1828 * khtml/html/html_miscimpl.cpp:
1829 (HTMLCollectionImpl::HTMLCollectionImpl):
1830 (HTMLCollectionImpl::~HTMLCollectionImpl):
1831 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
1832 (HTMLCollectionImpl::CollectionInfo::reset):
1833 (HTMLCollectionImpl::resetCollectionInfo):
1834 (HTMLCollectionImpl::checkForNameMatch):
1836 (HTMLCollectionImpl::updateNameCache):
1837 (HTMLCollectionImpl::namedItems):
1838 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
1839 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1840 (HTMLFormCollectionImpl::item):
1841 (HTMLFormCollectionImpl::updateNameCache):
1842 * khtml/html/html_miscimpl.h:
1844 2004-11-22 David Hyatt <hyatt@apple.com>
1846 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
1851 * khtml/misc/loader.cpp:
1852 (CachedObject::finish):
1855 * khtml/misc/loader.h:
1856 (khtml::Cache::maxCacheableObjectSize):
1858 2004-11-22 David Hyatt <hyatt@apple.com>
1860 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
1861 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
1862 that lets us short circuit earlier when painting and hit testing.
1866 * khtml/khtml_part.cpp:
1867 (KHTMLPart::isPointInsideSelection):
1868 * khtml/rendering/render_block.cpp:
1869 (khtml::RenderBlock::paint):
1870 (khtml::RenderBlock::paintChildren):
1871 (khtml::RenderBlock::paintObject):
1872 (khtml::RenderBlock::paintFloats):
1873 (khtml::RenderBlock::nodeAtPoint):
1874 * khtml/rendering/render_block.h:
1875 * khtml/rendering/render_box.cpp:
1876 (RenderBox::nodeAtPoint):
1877 * khtml/rendering/render_box.h:
1878 * khtml/rendering/render_br.h:
1879 * khtml/rendering/render_canvas.cpp:
1880 (RenderCanvas::paint):
1881 * khtml/rendering/render_flow.cpp:
1882 (RenderFlow::paintLines):
1883 (RenderFlow::hitTestLines):
1884 (RenderFlow::caretRect):
1885 (RenderFlow::addFocusRingRects):
1886 (RenderFlow::paintFocusRing):
1887 (RenderFlow::paintOutlines):
1888 (RenderFlow::paintOutlineForLine):
1889 * khtml/rendering/render_flow.h:
1890 * khtml/rendering/render_frames.cpp:
1891 (RenderFrameSet::nodeAtPoint):
1892 * khtml/rendering/render_frames.h:
1893 * khtml/rendering/render_image.cpp:
1894 (RenderImage::nodeAtPoint):
1895 * khtml/rendering/render_image.h:
1896 * khtml/rendering/render_inline.cpp:
1897 (RenderInline::paint):
1898 (RenderInline::nodeAtPoint):
1899 * khtml/rendering/render_inline.h:
1900 * khtml/rendering/render_layer.cpp:
1901 (RenderLayer::paintLayer):
1902 (RenderLayer::hitTest):
1903 (RenderLayer::hitTestLayer):
1904 * khtml/rendering/render_layer.h:
1905 * khtml/rendering/render_line.cpp:
1906 (khtml::InlineBox::paint):
1907 (khtml::InlineBox::nodeAtPoint):
1908 (khtml::InlineFlowBox::flowObject):
1909 (khtml::InlineFlowBox::nodeAtPoint):
1910 (khtml::InlineFlowBox::paint):
1911 (khtml::InlineFlowBox::paintBackgrounds):
1912 (khtml::InlineFlowBox::paintBackground):
1913 (khtml::InlineFlowBox::paintBackgroundAndBorder):
1914 (khtml::InlineFlowBox::paintDecorations):
1915 (khtml::EllipsisBox::paint):
1916 (khtml::EllipsisBox::nodeAtPoint):
1917 (khtml::RootInlineBox::paintEllipsisBox):
1918 (khtml::RootInlineBox::paint):
1919 (khtml::RootInlineBox::nodeAtPoint):
1920 * khtml/rendering/render_line.h:
1921 (khtml::InlineRunBox::paintBackgroundAndBorder):
1922 * khtml/rendering/render_object.cpp:
1923 (RenderObject::hitTest):
1924 (RenderObject::setInnerNode):
1925 (RenderObject::nodeAtPoint):
1926 * khtml/rendering/render_object.h:
1927 (khtml::RenderObject::PaintInfo::PaintInfo):
1928 (khtml::RenderObject::PaintInfo::~PaintInfo):
1929 (khtml::RenderObject::paintingRootForChildren):
1930 (khtml::RenderObject::shouldPaintWithinRoot):
1931 * khtml/rendering/render_table.cpp:
1932 (RenderTable::layout):
1933 (RenderTable::paint):
1934 * khtml/rendering/render_text.cpp:
1935 (simpleDifferenceBetweenColors):
1936 (correctedTextColor):
1937 (InlineTextBox::nodeAtPoint):
1938 (InlineTextBox::paint):
1939 (InlineTextBox::selectionStartEnd):
1940 (InlineTextBox::paintSelection):
1941 (InlineTextBox::paintMarkedTextBackground):
1942 (InlineTextBox::paintDecoration):
1943 (RenderText::posOfChar):
1944 * khtml/rendering/render_text.h:
1945 (khtml::RenderText::paint):
1946 (khtml::RenderText::layout):
1947 (khtml::RenderText::nodeAtPoint):
1948 * khtml/xml/dom2_eventsimpl.cpp:
1949 (MouseEventImpl::computeLayerPos):
1950 * khtml/xml/dom_docimpl.cpp:
1951 (DocumentImpl::prepareMouseEvent):
1952 * kwq/KWQAccObject.mm:
1953 (-[KWQAccObject accessibilityHitTest:]):
1954 * kwq/KWQKHTMLPart.mm:
1955 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
1956 (KWQKHTMLPart::eventMayStartDrag):
1957 (KWQKHTMLPart::khtmlMouseMoveEvent):
1958 * kwq/WebCoreBridge.mm:
1959 (-[WebCoreBridge elementAtPoint:]):
1960 (-[WebCoreBridge _positionForPoint:]):
1962 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1966 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
1967 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
1969 This avoids the O(N^2) penalty for named item traversal for form collections.
1971 It also combines the item traversal logic for all non-form
1972 collection operations into a single traverseNextItem
1973 function. This avoids having 5 copies of the big switch statement
1976 Also fixed a bug that prevented the last form element from being removed properly.
1978 * khtml/html/html_formimpl.cpp:
1979 (DOM::removeFromVector):
1980 * khtml/dom/html_misc.cpp:
1981 (HTMLCollection::namedItems):
1982 * khtml/dom/html_misc.h:
1983 * khtml/ecma/kjs_html.cpp:
1984 (KJS::HTMLCollection::getNamedItems):
1985 * khtml/html/html_miscimpl.cpp:
1986 (HTMLCollectionImpl::traverseNextItem):
1987 (HTMLCollectionImpl::calcLength):
1988 (HTMLCollectionImpl::length):
1989 (HTMLCollectionImpl::item):
1990 (HTMLCollectionImpl::nextItem):
1991 (HTMLCollectionImpl::checkForNameMatch):
1992 (HTMLCollectionImpl::namedItem):
1993 (HTMLCollectionImpl::namedItems):
1994 (HTMLCollectionImpl::nextNamedItem):
1995 (HTMLFormCollectionImpl::calcLength):
1996 (HTMLFormCollectionImpl::namedItem):
1997 (HTMLFormCollectionImpl::nextNamedItem):
1998 (HTMLFormCollectionImpl::namedItems):
1999 * khtml/html/html_miscimpl.h:
2001 2004-11-22 Ken Kocienda <kocienda@apple.com>
2003 Reviewed by Harrison
2005 Change around the way we block the Javascript "Paste" command identifier from
2006 being available. Formerly, this was done with an ifdef we never compiled in.
2007 Now, this is done with a couple of cheap runtime checks. The advantage is that
2008 we can now compile this command into development builds, and still yet switch
2009 on the command in deployment builds through the use of WebCore SPI so we can
2010 write and run layout tests with all of our builds.
2012 * khtml/editing/jsediting.cpp:
2013 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
2014 command being queried is the paste command.
2015 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
2016 * khtml/editing/jsediting.h: Ditto.
2017 * khtml/khtml_part.cpp:
2018 (KHTMLPart::pasteFromPasteboard): Added.
2019 (KHTMLPart::canPaste): Added.
2020 * kwq/KWQKHTMLPart.mm:
2021 (KHTMLPart::canPaste): Added.
2022 * kwq/KWQRenderTreeDebug.cpp:
2023 (externalRepresentation): Turn on paste command.
2024 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
2026 2004-11-21 Maciej Stachowiak <mjs@apple.com>
2028 Reviewed by Richard.
2030 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
2032 * khtml/html/html_miscimpl.cpp:
2033 (HTMLCollectionImpl::calcLength):
2034 (HTMLCollectionImpl::getItem):
2035 (HTMLCollectionImpl::item):
2036 (HTMLCollectionImpl::nextItem):
2037 (HTMLCollectionImpl::getNamedItem):
2038 (HTMLCollectionImpl::namedItem):
2039 (HTMLCollectionImpl::nextNamedItemInternal):
2040 (HTMLFormCollectionImpl::nextNamedItemInternal):
2042 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2046 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
2047 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
2048 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
2050 Many optimizations to HTMLFormCollection. Iterating it should not
2051 be N^2 any more, though finding items by name could still be.
2053 * khtml/html/html_formimpl.cpp:
2054 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2055 (DOM::HTMLFormElementImpl::length):
2056 (DOM::HTMLFormElementImpl::submitClick):
2057 (DOM::HTMLFormElementImpl::formData):
2058 (DOM::HTMLFormElementImpl::submit):
2059 (DOM::HTMLFormElementImpl::reset):
2060 (DOM::HTMLFormElementImpl::radioClicked):
2061 (DOM::appendToVector):
2062 (DOM::removeFromVector):
2063 (DOM::HTMLFormElementImpl::registerFormElement):
2064 (DOM::HTMLFormElementImpl::removeFormElement):
2065 (DOM::HTMLFormElementImpl::makeFormElementDormant):
2066 (DOM::HTMLFormElementImpl::registerImgElement):
2067 (DOM::HTMLFormElementImpl::removeImgElement):
2068 * khtml/html/html_formimpl.h:
2069 * khtml/html/html_miscimpl.cpp:
2070 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
2071 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
2072 (HTMLFormCollectionImpl::resetCollectionInfo):
2073 (HTMLFormCollectionImpl::calcLength):
2074 (HTMLFormCollectionImpl::item):
2075 (HTMLFormCollectionImpl::getNamedItem):
2076 (HTMLFormCollectionImpl::getNamedFormItem):
2077 (HTMLFormCollectionImpl::firstItem):
2078 (HTMLFormCollectionImpl::nextItem):
2079 * khtml/html/html_miscimpl.h:
2080 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
2081 * khtml/xml/dom_elementimpl.cpp:
2082 (ElementImpl::setAttribute):
2083 (ElementImpl::setAttributeMap):
2084 * kwq/KWQPtrVector.h:
2085 (QPtrVector::findRef):
2086 * kwq/KWQVectorImpl.h:
2087 * kwq/KWQVectorImpl.mm:
2088 (KWQVectorImpl::findRef):
2089 * kwq/WebCoreBridge.mm:
2090 (-[WebCoreBridge elementWithName:inForm:]):
2091 (-[WebCoreBridge controlsInForm:]):
2093 2004-11-19 David Harrison <harrison@apple.com>
2095 Reviewed by Ken and Darin.
2097 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
2099 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
2100 for the existing style, but in this case (hitting cmd-B with caret at top of
2101 file) there is nothing upstream. Changed this to use the VisiblePosition
2102 deepEquivalent instead.
2104 * khtml/khtml_part.cpp:
2105 (KHTMLPart::computeAndSetTypingStyle):
2109 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2113 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
2115 * khtml/xml/dom_docimpl.cpp:
2116 (DocumentImpl::close): Don't fire the onload handler if there is a
2117 redirect pending. This is a very long-standing bug that was masked
2118 by our previously incorrect redirect logic. It used to be that an
2119 older redirect would always win. Recently we changed things so
2120 that a newer redirect would win, but a script that causes a
2121 redirect would stop parsing once complete (so if there are two
2122 redirects in the same script, the latter wins). However, we should
2123 have also prevented onload in this case. Testing with other
2124 browsers shows that onload handlers do not run at all when there
2125 is a pending redirect.
2127 2004-11-19 Ken Kocienda <kocienda@apple.com>
2129 Reviewed by Harrison
2131 Fix some object lifetime issues in these two commands. This fixes some crashes
2132 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
2134 * khtml/editing/htmlediting.cpp:
2135 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
2136 in the ancestor list. They are not ref'ed when put on list. D'uh.
2137 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
2138 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
2139 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
2141 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
2143 2004-11-19 Ken Kocienda <kocienda@apple.com>
2145 Reviewed by Harrison
2149 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
2151 * khtml/khtml_part.cpp:
2152 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
2153 declaration given the current selection, and then sets the minimum necessary style as the typing
2155 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
2156 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
2158 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
2159 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
2160 * kwq/WebCoreBridge.mm:
2161 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
2162 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
2164 2004-11-18 David Harrison <harrison@apple.com>
2168 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
2169 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
2172 (-[DOMCSSStyleDeclaration setProperty:::]):
2174 2004-11-18 Chris Blumenberg <cblu@apple.com>
2176 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
2180 * kwq/KWQKHTMLPart.mm:
2181 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
2183 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2187 - fix recursive item traversal, use traverseNextNode() instead of
2188 the buggy hand-rolled traversal.
2190 * khtml/xml/dom_nodeimpl.cpp:
2191 (NodeListImpl::recursiveItem):
2193 2004-11-17 Darin Adler <darin@apple.com>
2197 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
2199 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
2200 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
2202 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
2203 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
2204 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
2205 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
2206 an entire category of leaks we have been fixing one by one recently
2207 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
2208 stale RenderObject pointer, although I never saw it do that in practice
2209 - implemented the length and item methods for computed styles
2210 - implemented querying additional properties in computed styles (29 more)
2212 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
2213 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
2214 take a mutable style.
2215 * khtml/khtml_part.cpp:
2216 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
2217 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
2218 a computed style; also change some types to mutable style.
2219 (updateState): Update iteration of CSSProperty objects in a style declaration to use
2220 the new valuesIterator interface.
2221 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
2222 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
2223 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
2224 including accomodating the exception code that setCssText has now.
2225 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
2226 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
2227 the style attributes really was a change, although it's not an important optimization it's
2228 good to do it right.
2230 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
2231 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
2232 calling it were already removing the old property explicitly, so the code in here to remove
2233 the property again was redundant.
2235 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
2236 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
2237 * khtml/css/css_computedstyle.cpp:
2238 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
2239 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
2240 Before we had no guarantee the object would outlast us.
2241 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
2242 exception to NO_MODIFICATION_ALLOWED_ERR.
2243 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
2244 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
2245 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
2246 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
2247 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
2248 page-break-inside, position, unicode-bidi, widows, z-index.
2249 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
2250 exception to NO_MODIFICATION_ALLOWED_ERR.
2251 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
2252 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
2253 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
2254 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
2255 CSSMutableStyleDeclarationImpl.
2256 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
2257 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
2259 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
2260 now a separate class rather than a typedef.
2261 * khtml/css/cssparser.h: Ditto.
2263 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
2264 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
2265 Removed a bunch of redundant stuff from other classes in this file too.
2266 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
2267 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
2268 (DOM::CSSProperty::operator=): Added.
2269 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
2271 * khtml/css/css_valueimpl.cpp:
2272 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
2273 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
2274 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
2275 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
2276 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
2277 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
2278 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
2279 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
2280 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
2281 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
2282 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
2283 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
2284 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
2285 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
2286 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
2287 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
2288 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
2289 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
2290 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
2291 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
2292 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
2293 no styles in the list. Update to use QValueList.
2294 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
2295 parameter and set it.
2296 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
2297 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
2298 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
2299 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
2300 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
2301 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
2303 * khtml/css/cssparser.cpp:
2304 (CSSParser::parseValue): Changed to use addParsedProperties.
2305 (CSSParser::parseDeclaration): Ditto.
2306 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
2308 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
2309 * khtml/css/cssproperties.c: Regenerated.
2310 * khtml/css/cssproperties.h: Regenerated.
2312 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
2313 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
2315 * khtml/dom/css_value.cpp:
2316 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
2317 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
2318 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
2319 first doing getPropertyCSSValue and then doing cssText.
2320 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
2321 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
2322 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
2323 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
2324 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
2325 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
2326 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
2328 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
2329 * khtml/dom/dom_node.cpp: Ditto.
2331 * khtml/editing/htmlediting.h: Change some types to mutable style.
2332 * khtml/editing/htmlediting.cpp:
2333 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
2334 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
2335 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
2336 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
2337 (khtml::EditCommand::setTypingStyle): Ditto.
2338 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
2339 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
2340 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
2341 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
2342 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
2343 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
2344 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
2345 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2346 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
2347 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
2348 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
2349 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
2350 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
2352 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
2353 * khtml/html/html_baseimpl.h: Change type to mutable style.
2354 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
2356 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
2357 class as a base class, and change types to mutable style as needed.
2358 * khtml/html/html_elementimpl.cpp:
2359 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
2360 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
2361 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
2362 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
2363 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
2364 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
2366 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
2369 * khtml/html/html_tableimpl.h: Change types to mutable style.
2370 * khtml/html/html_tableimpl.cpp:
2371 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2372 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
2373 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2375 * khtml/html/htmlparser.cpp:
2376 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
2377 than using an explicit delete to make the node go away, and is required for compatibility with the
2378 changes to the NodeImpl functions.
2379 (KHTMLParser::insertNode): Ditto.
2380 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
2381 the NodeImpl functions.
2383 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
2384 now that there's no need to make the property list explictly.
2387 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
2388 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
2389 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
2391 * khtml/xml/dom_nodeimpl.cpp:
2392 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
2393 function succeeded or not for ownership purposes.
2394 (NodeImpl::replaceChild): Ditto.
2395 (NodeImpl::appendChild): Ditto.
2396 (NodeBaseImpl::insertBefore): Ditto.
2397 (NodeBaseImpl::replaceChild): Ditto.
2398 (NodeBaseImpl::appendChild): Ditto.
2399 (NodeBaseImpl::addChild): Ditto.
2401 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
2402 * WebCore-combined.exp: Regenerated.
2404 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2406 still even more build fixing
2408 * khtml/html/html_miscimpl.cpp:
2409 (HTMLCollectionImpl::resetCollectionInfo):
2411 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2415 * khtml/html/html_miscimpl.cpp:
2416 (HTMLCollectionImpl::resetCollectionInfo):
2418 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2420 Fixed build problem.
2422 * khtml/html/html_miscimpl.h:
2423 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
2425 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2429 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
2431 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
2432 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
2434 This is also a start on fixing 5 other bugs, but those need additional work to make
2435 HTMLFormCollection fast.
2437 * khtml/html/html_documentimpl.h:
2438 (DOM::HTMLDocumentImpl::collectionInfo):
2439 * khtml/html/html_formimpl.cpp:
2440 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2441 (DOM::HTMLFormElementImpl::isURLAttribute):
2442 (DOM::HTMLFormElementImpl::registerImgElement):
2443 (DOM::HTMLFormElementImpl::removeImgElement):
2444 * khtml/html/html_formimpl.h:
2445 * khtml/html/html_imageimpl.cpp:
2446 (HTMLImageElementImpl::HTMLImageElementImpl):
2447 (HTMLImageElementImpl::~HTMLImageElementImpl):
2448 * khtml/html/html_imageimpl.h:
2449 * khtml/html/html_miscimpl.cpp:
2450 (HTMLCollectionImpl::HTMLCollectionImpl):
2451 (HTMLCollectionImpl::~HTMLCollectionImpl):
2452 (HTMLCollectionImpl::updateCollectionInfo):
2453 (HTMLCollectionImpl::length):
2454 (HTMLCollectionImpl::item):
2455 (HTMLCollectionImpl::firstItem):
2456 (HTMLCollectionImpl::nextItem):
2457 (HTMLCollectionImpl::namedItem):
2458 (HTMLCollectionImpl::nextNamedItemInternal):
2459 (HTMLFormCollectionImpl::getNamedFormItem):
2460 * khtml/html/html_miscimpl.h:
2461 (DOM::HTMLCollectionImpl::):
2462 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
2463 * khtml/html/htmlparser.cpp:
2464 (KHTMLParser::getElement):
2465 * khtml/xml/dom_docimpl.cpp:
2466 (DocumentImpl::DocumentImpl):
2467 * khtml/xml/dom_docimpl.h:
2468 (DOM::DocumentImpl::incDOMTreeVersion):
2469 (DOM::DocumentImpl::domTreeVersion):
2470 * khtml/xml/dom_nodeimpl.cpp:
2474 2004-11-18 Kevin Decker <kdecker@apple.com>
2478 fixed: <rdar://problem/3841842> getPropertyID expensive
2481 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
2483 2004-11-17 David Hyatt <hyatt@apple.com>
2485 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
2486 and subsequently backed out).
2488 Reviewed by kocienda
2490 * khtml/html/html_baseimpl.cpp:
2491 (HTMLBodyElementImpl::insertedIntoDocument):
2492 * khtml/html/htmltokenizer.cpp:
2493 (khtml::HTMLTokenizer::reset):
2494 (khtml::HTMLTokenizer::scriptHandler):
2495 (khtml::HTMLTokenizer::scriptExecution):
2496 (khtml::HTMLTokenizer::write):
2497 (khtml::HTMLTokenizer::continueProcessing):
2498 (khtml::HTMLTokenizer::timerEvent):
2499 (khtml::HTMLTokenizer::notifyFinished):
2500 * khtml/html/htmltokenizer.h:
2501 * khtml/khtmlview.cpp:
2502 (KHTMLViewPrivate::KHTMLViewPrivate):
2503 (KHTMLViewPrivate::reset):
2505 (KHTMLView::layout):
2506 (KHTMLView::timerEvent):
2507 (KHTMLView::scheduleRelayout):
2508 (KHTMLView::layoutPending):
2509 (KHTMLView::haveDelayedLayoutScheduled):
2510 (KHTMLView::unscheduleRelayout):
2511 * khtml/khtmlview.h:
2512 * khtml/xml/dom_docimpl.cpp:
2513 (DocumentImpl::DocumentImpl):
2514 (DocumentImpl::close):
2515 (DocumentImpl::setParsing):
2516 (DocumentImpl::shouldScheduleLayout):
2517 (DocumentImpl::minimumLayoutDelay):
2518 (DocumentImpl::write):
2519 (DocumentImpl::finishParsing):
2520 (DocumentImpl::stylesheetLoaded):
2521 (DocumentImpl::updateStyleSelector):
2522 * khtml/xml/dom_docimpl.h:
2523 (DOM::DocumentImpl::parsing):
2524 * kwq/KWQDateTime.mm:
2525 (KWQUIEventTime::uiEventPending):
2527 2004-11-17 David Harrison <harrison@apple.com>
2529 Reviewed by Ken Kocienda.
2531 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
2532 Treat null case as meaning no post-move merge is needed.
2534 * khtml/editing/htmlediting.cpp:
2535 (khtml::DeleteSelectionCommand::initializePositionData):
2537 2004-11-17 David Harrison <harrison@apple.com>
2539 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
2540 * khtml/xml/dom_nodeimpl.cpp:
2541 (NodeImpl::displayNode):
2542 (NodeImpl::displayTree):
2543 (NodeBaseImpl::dispatchChildRemovalEvents):
2544 * khtml/xml/dom_nodeimpl.h:
2546 2004-11-16 John Sullivan <sullivan@apple.com>
2548 Reviewed by Richard.
2550 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
2552 * khtml/khtml_part.cpp:
2554 delete the list we created when we're done with it
2556 2004-11-16 Ken Kocienda <kocienda@apple.com>
2560 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
2561 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
2562 QPtrList when the list goes out of scope.
2564 * khtml/editing/htmlediting.cpp:
2565 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
2566 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
2567 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
2568 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
2569 No longer set lists to autodelete.
2570 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
2571 Call new derefNodesInList helper.
2572 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
2573 of one before, but now it does.
2575 2004-11-15 David Harrison <harrison@apple.com>
2577 Reviewed by Chris and Darin.
2579 <rdar://problem/3880304> Non-linear performance hit for style changes
2581 * khtml/xml/dom_nodeimpl.cpp:
2582 (NodeImpl::traverseNextNode):
2583 (NodeImpl::traverseNextSibling):
2584 (NodeImpl::traversePreviousNodePostOrder):
2585 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
2586 Add asserts that stayWithin is an ancestor of the returned node.
2588 2004-11-15 Darin Adler <darin@apple.com>
2592 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
2594 * khtml/css/css_computedstyle.cpp:
2595 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
2596 since there's no guarantee it's already ref'd.
2597 * khtml/css/css_valueimpl.cpp:
2598 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
2599 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
2600 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
2601 (CSSStyleDeclarationImpl::merge): Ditto.
2602 (CSSStyleDeclarationImpl::diff): Ditto.
2603 * khtml/editing/htmlediting.cpp:
2604 (khtml::StyleChange::currentlyHasStyle): Ditto.
2605 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
2606 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
2607 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
2609 2004-11-15 Darin Adler <darin@apple.com>
2613 Use separate mutable style and computed style types as appropriate.
2614 For now this should have no effect, but it prepares us for refactoring later.
2615 Also remove some unnecessary "DOM::" prefixes and in one case factor out
2618 * khtml/khtml_part.cpp:
2619 (KHTMLPart::typingStyle):
2620 (KHTMLPart::setTypingStyle):
2622 (KHTMLPart::selectionHasStyle):
2623 (KHTMLPart::selectionStartHasStyle):
2624 (KHTMLPart::selectionComputedStyle):
2625 * khtml/khtml_part.h:
2626 * khtml/khtmlpart_p.h:
2628 * khtml/css/css_base.h:
2629 * khtml/css/css_ruleimpl.cpp:
2630 (CSSStyleRuleImpl::setDeclaration):
2631 * khtml/css/css_ruleimpl.h:
2632 (DOM::CSSFontFaceRuleImpl::style):
2633 (DOM::CSSPageRuleImpl::style):
2634 (DOM::CSSStyleRuleImpl::style):
2635 (DOM::CSSStyleRuleImpl::declaration):
2636 * khtml/css/css_valueimpl.h:
2637 (DOM::CSSPrimitiveValueImpl::):
2638 * khtml/css/cssparser.cpp:
2639 (CSSParser::parseValue):
2640 (CSSParser::parseColor):
2641 (CSSParser::parseDeclaration):
2642 (CSSParser::createStyleDeclaration):
2643 * khtml/css/cssparser.h:
2644 * khtml/css/cssstyleselector.cpp:
2645 (khtml::CSSStyleSelector::addMatchedDeclaration):
2646 (khtml::CSSStyleSelector::matchRulesForList):
2647 (khtml::CSSStyleSelector::styleForElement):
2648 (khtml::CSSStyleSelector::applyDeclarations):
2649 * khtml/css/cssstyleselector.h:
2650 * khtml/css/parser.cpp:
2651 * khtml/css/parser.y:
2652 * khtml/dom/css_rule.h:
2653 * khtml/dom/css_stylesheet.h:
2654 * khtml/dom/css_value.h:
2655 * khtml/dom/dom2_views.cpp:
2656 * khtml/xml/dom2_viewsimpl.cpp:
2657 (DOM::AbstractViewImpl::getComputedStyle):
2658 * khtml/xml/dom_docimpl.cpp:
2659 (DocumentImpl::importNode):
2660 (DocumentImpl::setStyleSheet):
2661 * khtml/xml/dom_docimpl.h:
2662 * khtml/xml/dom_xmlimpl.cpp:
2663 (DOM::ProcessingInstructionImpl::setStyleSheet):
2664 * khtml/xml/dom_xmlimpl.h:
2666 * khtml/dom/css_value.cpp:
2667 (DOM::throwException): Added.
2668 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
2669 The real thing is coming with the next change to refactor.
2670 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
2671 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
2673 2004-11-15 Darin Adler <darin@apple.com>
2677 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
2679 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
2680 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
2681 node's attributes changed without sending a misleading childrenChanged call,
2682 but the childrenChanged call can happen at the exact right moment.
2683 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
2684 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
2685 the boolean true is passed in.
2687 * khtml/xml/dom_elementimpl.cpp:
2688 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
2689 (NamedAttrMapImpl::removeAttribute): Ditto.
2691 2004-11-15 John Sullivan <sullivan@apple.com>
2695 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
2696 seen often in Mail and Blot
2698 * khtml/css/css_valueimpl.cpp:
2699 (CSSStyleDeclarationImpl::copyPropertiesInSet):
2700 delete temporary list after we're done using it
2702 2004-11-15 Richard Williamson <rjw@apple.com>
2704 Fixed leak (3879883) that John found. Early return leaked
2709 * khtml/css/css_computedstyle.cpp:
2710 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2712 2004-11-15 Ken Kocienda <kocienda@apple.com>
2718 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
2720 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
2721 EditCommandPtr to its parent, but this caused a a reference cycle in composite
2722 commands as the children held a ref to their parent. Now, the parent variable
2723 is a non-retained reference to an EditCommand *. It would be nice to have a
2724 weak reference to the parent or even override deref in composite commands (but I
2725 can't since deref() is not virtual). However, this should be OK since any
2726 dangling parent pointer is a sign of a bigger object lifetime problem that
2727 would need to be addressed anyway.
2729 * khtml/css/css_valueimpl.cpp:
2730 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
2731 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
2732 just assigning the list variable passed in to the local list variable, or the list will be
2734 * khtml/editing/htmlediting.cpp:
2735 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
2736 (khtml::EditCommand::setEndingSelection): Ditto.
2737 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
2738 Unrelated to the change, but saves some ref's and deref's.
2739 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
2740 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
2741 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
2742 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
2744 2004-11-15 Maciej Stachowiak <mjs@apple.com>
2748 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
2750 * khtml/xml/dom_nodeimpl.cpp:
2751 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
2753 (NodeListImpl::recursiveLength): Adjusted for rename.
2754 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
2755 If the same offset is looked up again, just return it, otherwise, if looking up
2756 a later offset, start at the last item and proceed from there.
2757 (NodeListImpl::itemById): Apply the special document optimization to all
2758 nodes that are either a document or in a document - just walk up to make
2759 sure the node found by ID has the root node as an ancestor.
2760 (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
2761 * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
2763 2004-11-15 John Sullivan <sullivan@apple.com>
2767 - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
2769 * kwq/KWQKHTMLPart.mm:
2770 (KWQKHTMLPart::documentFragmentWithText):
2771 release mutable copy of string after we're done using it
2773 2004-11-14 Kevin Decker <kdecker@apple.com>
2777 fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
2779 * khtml/html/html_elementimpl.cpp:
2780 (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
2781 (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
2783 2004-11-13 Maciej Stachowiak <mjs@apple.com>
2787 <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
2789 * khtml/dom/dom_node.cpp:
2790 (NodeList::itemById): New method, just forward to impl.
2791 * khtml/dom/dom_node.h: Prototype it.
2792 * khtml/ecma/kjs_dom.cpp:
2793 (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
2794 let the NodeList do it. The NodeList might be able to do it more efficiently.
2795 * khtml/xml/dom_nodeimpl.cpp:
2796 (NodeListImpl::itemById): Optimize for the case where the NodeList
2797 covers the whole document. In this case, just use getElementById,
2798 then check that the element satisfies the list criteria.
2799 (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
2800 (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
2801 * khtml/xml/dom_nodeimpl.h:
2803 2004-11-12 Maciej Stachowiak <mjs@apple.com>
2807 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
2808 sometimes using a huge bogus length value.
2810 * khtml/xml/dom_nodeimpl.cpp:
2811 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
2813 2004-11-12 Darin Adler <darin@apple.com>
2817 - fixed an infinite loop in that last check-in
2819 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
2820 Added a ++i to the loop so it won't get stuck on the first element in the list.
2822 2004-11-12 Maciej Stachowiak <mjs@apple.com>
2826 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
2828 I fixed this by changing NodeLists to cache their length, but
2829 invalidate it whenever there is a change in the DOM subtree at
2830 which they are rooted. This makes NodeListImpl::recursiveLength()
2831 drop completely off the profile, since we were repeatedly getting
2832 a length for the same NodeList over and over.
2834 * khtml/xml/dom_nodeimpl.cpp:
2835 (NodeImpl::NodeImpl):
2836 (NodeImpl::~NodeImpl):
2837 (NodeImpl::registerNodeList):
2838 (NodeImpl::unregisterNodeList):
2839 (NodeImpl::notifyLocalNodeListsSubtreeModified):
2840 (NodeImpl::notifyNodeListsSubtreeModified):
2841 (NodeImpl::dispatchSubtreeModifiedEvent):
2842 (NodeListImpl::NodeListImpl):
2843 (NodeListImpl::~NodeListImpl):
2844 (NodeListImpl::recursiveLength):
2845 (NodeListImpl::recursiveItem):
2846 (NodeListImpl::rootNodeSubtreeModified):
2847 (ChildNodeListImpl::ChildNodeListImpl):
2848 (ChildNodeListImpl::length):
2849 (ChildNodeListImpl::item):
2850 (TagNodeListImpl::TagNodeListImpl):
2851 (TagNodeListImpl::length):
2852 (TagNodeListImpl::item):
2853 (NameNodeListImpl::NameNodeListImpl):
2854 (NameNodeListImpl::length):
2855 (NameNodeListImpl::item):
2856 * khtml/xml/dom_nodeimpl.h:
2858 2004-11-12 Darin Adler <darin@apple.com>
2862 - various small cleanups
2864 * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
2865 * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
2867 * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
2868 * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
2869 * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
2870 * khtml/html/htmltokenizer.cpp:
2871 (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
2872 (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
2874 * khtml/khtml_part.h: Removed docImpl function.
2875 * khtml/khtml_part.cpp: Ditto.
2877 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
2878 the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
2880 * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
2881 * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
2882 part of the change last time, which is why the build broke).
2883 (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
2884 (KWQKHTMLPart::setPolicyBaseURL): Ditto.
2885 (KWQKHTMLPart::keyEvent): Ditto.
2886 (KWQKHTMLPart::dispatchCPPEvent): Ditto.
2887 (KWQKHTMLPart::bodyBackgroundColor): Ditto.
2889 2004-11-12 Chris Blumenberg <cblu@apple.com>
2891 <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
2895 * kwq/KWQKHTMLPart.mm:
2896 (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
2900 2004-11-12 Darin Adler <darin@apple.com>
2904 - fixed a couple places that would not work for XML documents
2906 * khtml/ecma/kjs_window.cpp:
2907 (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
2908 is present on the base class.
2909 (WindowFunc::tryCall): More of the same.
2911 2004-11-12 Darin Adler <darin@apple.com>
2913 - land versions of these files generated by the newer gperf
2915 People building on Panther will continue to see these files modified.
2916 A workaround would be to install the newer gperf on our Tiger build machines.
2918 * khtml/css/cssproperties.c: Regenerated.
2919 * khtml/css/cssvalues.c: Regenerated.
2920 * khtml/html/doctypes.cpp: Regenerated.
2921 * khtml/html/kentities.c: Regenerated.
2922 * khtml/misc/htmlattrs.c: Regenerated.
2923 * khtml/misc/htmltags.c: Regenerated.
2924 * kwq/KWQColorData.c: Regenerated.
2926 2004-11-11 Richard Williamson <rjw@apple.com>
2928 Fix build horkage from previous checkin.
2930 * kwq/KWQKHTMLPart.h:
2932 2004-11-11 Darin Adler <darin@apple.com>
2936 - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
2938 * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
2940 * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
2941 * kwq/KWQKHTMLPart.mm:
2942 (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
2943 method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
2944 we started with the NSTextField as first responder, and then took focus away and gave it back, which
2945 makes dragging text work again.
2946 (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
2948 2004-11-11 David Hyatt <hyatt@apple.com>
2950 Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
2954 * khtml/html/htmltokenizer.cpp:
2955 (khtml::HTMLTokenizer::continueProcessing):
2957 2004-11-11 Ken Kocienda <kocienda@apple.com>
2961 * khtml/editing/htmlediting.cpp:
2962 (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
2963 of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
2964 with the prevailing style for the VisiblePosition class.
2965 * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files.
2966 * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
2967 (khtml::visiblePositionsInDifferentBlocks): New helper method.
2968 (khtml::isLastVisiblePositionInBlock): Ditto.
2969 (khtml::isLastVisiblePositionInNode): Ditto.
2970 * khtml/editing/visible_position.h: Add declarations for new functions.
2972 2004-11-11 Ken Kocienda <kocienda@apple.com>
2976 * khtml/editing/htmlediting.cpp:
2977 (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
2978 (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
2979 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2980 (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
2981 (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
2982 * khtml/xml/dom2_rangeimpl.cpp:
2983 (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
2984 * khtml/xml/dom2_rangeimpl.h: Ditto.
2986 2004-11-11 Ken Kocienda <kocienda@apple.com>
2988 Reviewed by Harrison
2990 Some improvements to deleting when complete lines are selected.
2992 * khtml/editing/htmlediting.cpp:
2993 (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
2994 the end of a selection is fully selected. Turn off block merging in this case.
2995 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
2996 whether a BR immediately followed a block. The old code could erroneously skip nodes.
2997 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
2998 start block is selected. This new code will now delete this block in one call, rather
2999 than iterating over each child.
3000 * khtml/editing/visible_position.cpp:
3001 (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
3002 to do the work mentioned above in the comment for that function.
3003 (khtml::isFirstVisiblePositionOnLine): Ditto.
3004 (khtml::isLastVisiblePositionOnLine): Ditto.
3005 * khtml/editing/visible_position.h: Add new functions.
3006 * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
3007 * layout-tests/editing/deleting/delete-line-001.html: Added.
3008 * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
3009 * layout-tests/editing/deleting/delete-line-002.html: Added.
3010 * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
3011 * layout-tests/editing/deleting/delete-line-003.html: Added.
3012 * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
3013 * layout-tests/editing/deleting/delete-line-004.html: Added.
3014 * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
3015 * layout-tests/editing/deleting/delete-line-005.html: Added.
3016 * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
3017 * layout-tests/editing/deleting/delete-line-006.html: Added.
3018 * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
3019 * layout-tests/editing/deleting/delete-line-007.html: Added.
3020 * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
3021 * layout-tests/editing/deleting/delete-line-008.html: Added.
3022 * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
3023 * layout-tests/editing/deleting/delete-line-009.html: Added.
3024 * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
3025 * layout-tests/editing/deleting/delete-line-010.html: Added.
3026 * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
3027 * layout-tests/editing/deleting/delete-line-011.html: Added.
3028 * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
3029 * layout-tests/editing/deleting/delete-line-012.html: Added.
3031 2004-11-11 Ken Kocienda <kocienda@apple.com>
3035 * khtml/editing/htmlediting.cpp:
3036 (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
3038 2004-11-11 Ken Kocienda <kocienda@apple.com>
3044 <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
3045 <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
3047 * khtml/editing/selection.cpp:
3048 (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
3049 the next line position when necessary.
3050 * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
3051 * layout-tests/editing/selection/move-3875618-fix.html: Added.
3052 * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
3053 * layout-tests/editing/selection/move-3875641-fix.html: Added.
3055 2004-11-11 Ken Kocienda <kocienda@apple.com>
3059 Improved some function names, at John's urging. No changes to the
3060 functions themselves.
3062 canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
3063 canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
3064 performGeneralDelete() --> handleGeneralDelete()
3066 * khtml/editing/htmlediting.cpp:
3067 (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
3068 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
3069 (khtml::DeleteSelectionCommand::handleGeneralDelete)
3070 (khtml::DeleteSelectionCommand::doApply)
3071 * khtml/editing/htmlediting.h
3073 2004-11-11 Ken Kocienda <kocienda@apple.com>
3077 Updated some layout test results that changed as a result of my last checking.
3078 Added a new test that has been in my tree for a few days.
3080 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
3081 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
3082 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
3083 * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
3085 2004-11-11 Ken Kocienda <kocienda@apple.com>
3089 * khtml/editing/htmlediting.cpp:
3090 (khtml::debugNode): New debugging helper.
3091 (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
3092 startPositionForDelete() and endPositionForDelete() functions. Just use the
3093 m_selectionToDelete object to determine start and end positions for the delete.
3094 (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
3095 function that creates a special case for deleting all the content in a root
3097 (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
3098 function before BR special case and the general case delete functions.
3099 * khtml/editing/htmlediting.h: Updated for changed functions.
3101 2004-11-10 Kevin Decker <kdecker@apple.com>
3105 Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.
3107 * khtml/ecma/kjs_dom.cpp:
3108 (DOMNodeList::tryGet): Got rid of an unnecessary node traversal.
3110 2004-11-10 Ken Kocienda <kocienda@apple.com>
3114 * khtml/editing/htmlediting.cpp:
3115 (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
3116 smart delete from the two functions below to here. There was an unnecessary double
3117 calculation of the leading and trailing whitespace positions. Also refined the trailing
3118 case so it only acts when the leading position is null (which seems to match TextEdit in
3119 my tests). Also removed some unnecessary copying of Position objects.
3120 (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
3122 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
3124 2004-11-10 Ken Kocienda <kocienda@apple.com>
3126 Reviewed by Harrison
3128 (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
3129 make things more clear.
3130 * khtml/editing/selection.cpp:
3131 (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the
3132 resulting positions do not cross block boundaries. This was a bug and caused some
3133 delete problems when whole blocks were selected. I will be addressing that issue
3134 more fully in upcoming changes.
3136 2004-11-10 Ken Kocienda <kocienda@apple.com>
3138 Reviewed by Harrison
3140 Some cleanups and fixes in upstream and downstream functions.
3142 Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement().
3143 Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the
3144 block's enclosing block will be returned.
3146 Remove code from upstream that confined the serach to block boundaries outside of
3147 the code which runs in the StayInBlock case. This code was redundant, and caused
3148 incorrect results to be returned in the DoNotStayInBlock case.
3150 In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
3151 node, not the the this pointer's node.
3153 * khtml/xml/dom_position.cpp:
3154 (DOM::Position::upstream)
3155 (DOM::Position::downstream)
3157 2004-11-09 David Hyatt <hyatt@apple.com>
3159 Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
3160 loading large local files.
3164 * khtml/html/htmltokenizer.cpp:
3165 (khtml::HTMLTokenizer::HTMLTokenizer):
3166 (khtml::HTMLTokenizer::reset):
3167 (khtml::HTMLTokenizer::write):
3168 (khtml::HTMLTokenizer::stopped):
3169 (khtml::HTMLTokenizer::processingData):
3170 (khtml::HTMLTokenizer::continueProcessing):
3171 (khtml::HTMLTokenizer::timerEvent):
3172 (khtml::HTMLTokenizer::allDataProcessed):
3173 (khtml::HTMLTokenizer::end):
3174 (khtml::HTMLTokenizer::finish):
3175 (khtml::HTMLTokenizer::notifyFinished):
3176 * khtml/html/htmltokenizer.h:
3177 * khtml/khtml_part.cpp:
3178 (KHTMLPart::slotFinished):
3181 * khtml/khtml_part.h:
3182 (KHTMLPart::tokenizerProcessedData):
3183 * khtml/khtmlview.cpp:
3184 * khtml/xml/dom_docimpl.cpp:
3185 * khtml/xml/xml_tokenizer.h:
3186 (khtml::Tokenizer::stopped):
3187 (khtml::Tokenizer::processingData):
3188 * kwq/KWQDateTime.h:
3189 * kwq/KWQDateTime.mm:
3190 (QDateTime::secsTo):
3191 (KWQUIEventTime::uiEventPending):
3192 * kwq/KWQKHTMLPart.h:
3193 * kwq/KWQKHTMLPart.mm:
3194 (KWQKHTMLPart::tokenizerProcessedData):
3195 * kwq/WebCoreBridge.h:
3196 * kwq/WebCoreBridge.mm:
3197 (-[WebCoreBridge stop]):
3198 (-[WebCoreBridge numPendingOrLoadingRequests]):
3199 (-[WebCoreBridge doneProcessingData]):
3201 2004-11-09 David Harrison <harrison@apple.com>
3203 Reviewed by Ken Kocienda.
3205 <rdar://problem/3865837> Wrong text style after delete to start of document
3207 * khtml/editing/htmlediting.cpp:
3208 (khtml::DeleteSelectionCommand::saveTypingStyleState):
3209 Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
3211 2004-11-09 Richard Williamson <rjw@apple.com>
3213 Fixed <rdar://problem/3872440> NSTimer prematurely released.
3222 2004-11-09 Chris Blumenberg <cblu@apple.com>
3226 * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
3228 2004-11-08 David Harrison <harrison@apple.com>
3230 Reviewed by Ken Kocienda.
3232 <rdar://problem/3865854> Deleting first line deletes all lines
3234 * khtml/editing/htmlediting.cpp:
3235 (khtml::DeleteSelectionCommand::performGeneralDelete):
3236 Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
3237 of its ancestors, failed to end the loop that deletes all fully selected nodes. Also,
3238 fixed this code to clear m_trailingWhitespaceValid. Also removed dead m_endingPosition
3239 update because it is handled in calculateEndingPosition now.
3240 * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
3241 * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
3243 2004-11-08 Ken Kocienda <kocienda@apple.com>
3247 * khtml/html/html_elementimpl.cpp:
3248 (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
3249 are added to the DOM.
3250 * khtml/html/html_elementimpl.h: Ditto.
3251 * khtml/html/htmlparser.cpp:
3252 (KHTMLParser::KHTMLParser): Ditto.
3253 (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
3254 * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
3255 * khtml/html/htmltokenizer.cpp:
3256 (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
3257 (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
3258 There were a couple of indexing errors that resulted in the comment text containing part of the
3260 (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
3261 * khtml/html/htmltokenizer.h: Add flag to constructor so callers can request comment nodes.
3263 2004-11-08 Chris Blumenberg <cblu@apple.com>
3265 Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
3269 * WebCore.pbproj/project.pbxproj: stop unnecessary linking
3270 * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
3271 * kwq/KWQKHTMLPart.h: ditto
3273 2004-11-08 Darin Adler <darin@apple.com>
3277 - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
3279 * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
3280 that possibly deletes the QTimer.
3282 2004-11-08 Chris Blumenberg <cblu@apple.com>
3284 Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
3288 * kwq/KWQTextField.mm:
3289 (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
3290 * kwq/WebCoreBridge.h:
3292 2004-11-08 David Harrison <harrison@apple.com>
3296 Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
3298 * khtml/editing/htmlediting.cpp:
3299 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
3300 * khtml/xml/dom_nodeimpl.cpp:
3301 (NodeImpl::enclosingInlineElement):
3302 * khtml/xml/dom_nodeimpl.h:
3304 2004-11-05 Chris Blumenberg <cblu@apple.com>
3306 Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
3310 * khtml/editing/htmlediting.cpp:
3311 (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
3312 * khtml/editing/visible_position.cpp:
3313 (khtml::VisiblePosition::character): new, returns the character for the position
3314 * khtml/editing/visible_position.h:
3315 * kwq/KWQKHTMLPart.h:
3316 * kwq/KWQKHTMLPart.mm:
3317 (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
3318 * kwq/WebCoreBridge.h:
3322 2004-11-05 Adele Amchan <adele@apple.com>
3326 Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
3327 and a workaround for displaying transparent backgrounds for textareas.
3329 * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
3330 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
3331 * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class,
3332 on the contentView, and on the textView.
3334 2004-11-04 David Hyatt <hyatt@apple.com>
3336 Fix for relpositioned inlines. This was reviewed a long time ago, but I can't recall who reviewed it (either
3339 Reviewed by darin or ken
3341 * khtml/rendering/bidi.cpp:
3342 (khtml::appendRunsForObject):
3343 (khtml::RenderBlock::skipWhitespace):
3344 (khtml::RenderBlock::findNextLineBreak):
3345 * khtml/rendering/render_block.cpp:
3346 (khtml::RenderBlock::lowestPosition):
3347 (khtml::RenderBlock::rightmostPosition):
3348 (khtml::RenderBlock::leftmostPosition):
3349 * khtml/rendering/render_box.cpp:
3350 (RenderBox::position):
3351 * khtml/rendering/render_box.h:
3352 (khtml::RenderBox::staticX):
3353 (khtml::RenderBox::staticY):
3354 * khtml/rendering/render_layer.cpp:
3355 (RenderLayer::updateLayerPosition):
3356 (RenderLayer::convertToLayerCoords):
3357 * khtml/rendering/render_line.cpp:
3358 (khtml::InlineFlowBox::placeBoxesHorizontally):
3359 * khtml/rendering/render_object.h:
3360 (khtml::RenderObject::staticX):
3361 (khtml::RenderObject::staticY):
3363 Finish turning on XSLT. Make sure child stylesheets can load.
3365 * khtml/xsl/xslt_processorimpl.cpp:
3366 (DOM::stylesheetLoadFunc):
3367 (DOM::XSLTProcessorImpl::transformDocument):
3369 2004-11-04 David Hyatt <hyatt@apple.com>
3371 Implement CSS3 support for multiple backgrounds. Also fix a bug with background propagation so that it only
3372 happens (from the <body> to the root) for HTML documents. Fixed background-position to handle a mixture of
3373 keyword and length values.
3377 * khtml/css/cssparser.cpp:
3378 (CSSParser::parseValue):
3379 (CSSParser::addBackgroundValue):
3380 (CSSParser::parseBackgroundShorthand):
3381 (CSSParser::parseBackgroundColor):
3382 (CSSParser::parseBackgroundImage):
3383 (CSSParser::parseBackgroundPositionXY):
3384 (CSSParser::parseBackgroundPosition):
3385 (CSSParser::parseBackgroundProperty):
3386 (CSSParser::parseColorFromValue):
3387 * khtml/css/cssparser.h:
3388 * khtml/css/cssstyleselector.cpp:
3389 (khtml::CSSStyleSelector::adjustRenderStyle):
3390 (khtml::CSSStyleSelector::applyProperty):
3391 (khtml::CSSStyleSelector::mapBackgroundAttachment):
3392 (khtml::CSSStyleSelector::mapBackgroundImage):
3393 (khtml::CSSStyleSelector::mapBackgroundRepeat):
3394 (khtml::CSSStyleSelector::mapBackgroundXPosition):
3395 (khtml::CSSStyleSelector::mapBackgroundYPosition):
3396 * khtml/css/cssstyleselector.h:
3397 * khtml/rendering/render_box.cpp:
3398 (RenderBox::paintRootBoxDecorations):
3399 (RenderBox::paintBoxDecorations):
3400 (RenderBox::paintBackgrounds):
3401 (RenderBox::paintBackground):
3402 (RenderBox::paintBackgroundExtended):
3403 * khtml/rendering/render_box.h:
3404 * khtml/rendering/render_form.cpp:
3405 (RenderFieldset::paintBoxDecorations):
3406 * khtml/rendering/render_line.cpp:
3407 (khtml::InlineFlowBox::paintBackgrounds):
3408 (khtml::InlineFlowBox::paintBackground):
3409 (khtml::InlineFlowBox::paintBackgroundAndBorder):
3410 * khtml/rendering/render_line.h:
3411 * khtml/rendering/render_object.cpp:
3412 (RenderObject::setStyle):
3413 (RenderObject::updateBackgroundImages):
3414 (RenderObject::getVerticalPosition):
3415 * khtml/rendering/render_object.h:
3416 (khtml::RenderObject::paintBackgroundExtended):
3417 * khtml/rendering/render_style.cpp:
3419 (BackgroundLayer::BackgroundLayer):
3420 (BackgroundLayer::~BackgroundLayer):
3421 (BackgroundLayer::operator=):
3422 (BackgroundLayer::operator==):
3423 (BackgroundLayer::fillUnsetProperties):
3424 (BackgroundLayer::cullEmptyLayers):
3425 (StyleBackgroundData::StyleBackgroundData):
3426 (StyleBackgroundData::operator==):
3427 (RenderStyle::diff):
3428 (RenderStyle::adjustBackgroundLayers):
3429 * khtml/rendering/render_style.h:
3430 (khtml::OutlineValue::operator==):
3431 (khtml::OutlineValue::operator!=):
3432 (khtml::BackgroundLayer::backgroundImage):
3433 (khtml::BackgroundLayer::backgroundXPosition):
3434 (khtml::BackgroundLayer::backgroundYPosition):
3435 (khtml::BackgroundLayer::backgroundAttachment):
3436 (khtml::BackgroundLayer::backgroundRepeat):
3437 (khtml::BackgroundLayer::next):
3438 (khtml::BackgroundLayer::isBackgroundImageSet):
3439 (khtml::BackgroundLayer::isBackgroundXPositionSet):
3440 (khtml::BackgroundLayer::isBackgroundYPositionSet):
3441 (khtml::BackgroundLayer::isBackgroundAttachmentSet):
3442 (khtml::BackgroundLayer::isBackgroundRepeatSet):
3443 (khtml::BackgroundLayer::setBackgroundImage):
3444 (khtml::BackgroundLayer::setBackgroundXPosition):
3445 (khtml::BackgroundLayer::setBackgroundYPosition):
3446 (khtml::BackgroundLayer::setBackgroundAttachment):
3447 (khtml::BackgroundLayer::setBackgroundRepeat):
3448 (khtml::BackgroundLayer::clearBackgroundImage):
3449 (khtml::BackgroundLayer::clearBackgroundXPosition):
3450 (khtml::BackgroundLayer::clearBackgroundYPosition):
3451 (khtml::BackgroundLayer::clearBackgroundAttachment):
3452 (khtml::BackgroundLayer::clearBackgroundRepeat):
3453 (khtml::BackgroundLayer::setNext):
3454 (khtml::BackgroundLayer::operator!=):
3455 (khtml::BackgroundLayer::containsImage):
3456 (khtml::BackgroundLayer::hasImage):
3457 (khtml::BackgroundLayer::hasFixedImage):
3458 (khtml::RenderStyle::setBitDefaults):
3459 (khtml::RenderStyle::hasBackground):
3460 (khtml::RenderStyle::hasFixedBackgroundImage):
3461 (khtml::RenderStyle::outlineWidth):
3462 (khtml::RenderStyle::outlineStyle):
3463 (khtml::RenderStyle::outlineStyleIsAuto):
3464 (khtml::RenderStyle::outlineColor):
3465 (khtml::RenderStyle::backgroundColor):
3466 (khtml::RenderStyle::backgroundImage):
3467 (khtml::RenderStyle::backgroundRepeat):
3468 (khtml::RenderStyle::backgroundAttachment):
3469 (khtml::RenderStyle::backgroundXPosition):
3470 (khtml::RenderStyle::backgroundYPosition):
3471 (khtml::RenderStyle::accessBackgroundLayers):
3472 (khtml::RenderStyle::backgroundLayers):
3473 (khtml::RenderStyle::outlineOffset):
3474 (khtml::RenderStyle::resetOutline):
3475 (khtml::RenderStyle::setBackgroundColor):
3476 (khtml::RenderStyle::setOutlineWidth):
3477 (khtml::RenderStyle::setOutlineStyle):
3478 (khtml::RenderStyle::setOutlineColor):
3479 (khtml::RenderStyle::clearBackgroundLayers):
3480 (khtml::RenderStyle::inheritBackgroundLayers):
3481 (khtml::RenderStyle::setOutlineOffset):
3482 * khtml/rendering/render_table.cpp:
3483 (RenderTable::paintBoxDecorations):
3484 (RenderTableCell::paintBoxDecorations):
3486 2004-11-04 David Hyatt <hyatt@apple.com>
3488 Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
3489 Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
3493 * kwq/KWQTextCodec.mm:
3494 (KWQTextDecoder::convertLatin1):
3495 (KWQTextDecoder::convertUTF16):
3496 (KWQTextDecoder::convertUsingTEC):
3497 (KWQTextDecoder::toUnicode):
3499 2004-11-04 David Hyatt <hyatt@apple.com>
3501 Make sure line-height returns the correct value for normal.
3505 * khtml/css/css_computedstyle.cpp:
3506 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3508 2004-11-04 David Harrison <harrison@apple.com>
3510 Reviewed by Ken Kocienda.
3512 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
3514 * khtml/editing/htmlediting.cpp:
3515 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
3516 to, but not including, the enclosingBlockFlowElement) rather than just the source element.
3517 Fixed to insert after the destination subtree, rather than the destination element. Handles
3518 edge case of deleting back to the top of the tree, where there is nothing left to insert after.
3519 * khtml/xml/dom_nodeimpl.cpp:
3520 (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
3521 * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
3522 * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
3523 * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
3525 2004-11-03 Ken Kocienda <kocienda@apple.com>
3531 * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
3532 * layout-tests/editing/deleting/delete-br-008.html: Added.
3533 * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
3534 * layout-tests/editing/deleting/delete-br-009.html: Added.
3535 * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
3536 * layout-tests/editing/deleting/delete-br-010.html: Added.
3538 2004-11-03 Maciej Stachowiak <mjs@apple.com>
3540 Fix by Yasuo Kida, reviewed by me.
3542 <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
3544 * kwq/KWQKHTMLPart.mm:
3545 (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
3546 same as a nil range - setting an empty marked range should clear
3547 the marked range entirely.
3549 2004-11-02 Maciej Stachowiak <mjs@apple.com>
3551 Reviewed by Dave Hyatt (when I originally coded it).
3553 WebCore part of fix for:
3555 <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
3557 * kwq/WebCoreBridge.h:
3558 * kwq/WebCoreBridge.mm:
3559 (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
3560 DOMRange, or if the range is split into multiple lines, the rect for the part on
3561 the first line only.
3563 * khtml/rendering/render_object.cpp:
3564 (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
3565 for the overrides below.
3566 * khtml/rendering/render_object.h:
3567 * khtml/rendering/render_box.cpp:
3568 (RenderBox::caretRect):
3569 * khtml/rendering/render_box.h:
3570 * khtml/rendering/render_br.cpp:
3571 (RenderBR::caretRect):
3572 * khtml/rendering/render_br.h:
3573 * khtml/rendering/render_flow.cpp:
3574 (RenderFlow::caretRect):
3575 * khtml/rendering/render_flow.h:
3576 * khtml/rendering/render_text.cpp:
3577 (RenderText::caretRect):
3579 2004-11-02 Ken Kocienda <kocienda@apple.com>
3583 Implemented command to insert a block in response to typing a return key (even though
3584 I am not turning that on by default with this patch....that will come later).
3586 This new command is called InsertParagraphSeparatorCommand.
3588 Reworked the command and function names associated with inserting content into a
3589 document. Before this patch, there were inputXXX and insertXXX variants, with the
3590 former used for more high-level actions and the latter used for lower-level stuff.
3591 However, this was confusing as the AppKit uses insertXXX for everything. This resulted
3592 in an insertXXX command going through an inputXXX WebCore step and then finally to an
3593 insertXXX WebCore step. To make this less confusing, I have changes all the names to
3594 be insertXXX, and modified the lower-level operations so that it is clear what they do.
3596 * khtml/editing/htmlediting.cpp:
3597 (khtml::EditCommandPtr::isInsertTextCommand): Name change.
3598 (khtml::EditCommand::isInsertTextCommand): Ditto.
3599 (khtml::CompositeEditCommand::inputText): Ditto.
3600 (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
3601 (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
3602 (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
3603 (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
3604 (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
3605 (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
3606 (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
3607 (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
3608 (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
3609 (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
3610 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
3611 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
3612 (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
3613 (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
3614 (khtml::InsertIntoTextNode::doApply): Ditto.
3615 (khtml::InsertIntoTextNode::doUnapply): Ditto.
3616 (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
3617 (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
3618 (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
3619 (khtml::InsertLineBreakCommand::doApply):
3620 (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
3621 (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
3622 (khtml::InsertNodeBeforeCommand::doApply): Ditto.
3623 (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
3624 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
3625 (khtml::InsertParagraphSeparatorCommand::doApply):
3626 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
3627 Class name change, was InsertNewlineCommandInQuotedContentCommand.
3628 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
3629 (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
3630 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
3631 (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
3632 (khtml::InsertTextCommand::doApply): Ditto.
3633 (khtml::InsertTextCommand::deleteCharacter): Ditto.
3634 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
3635 (khtml::InsertTextCommand::input): Ditto.
3636 (khtml::InsertTextCommand::insertSpace): Ditto.
3637 (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
3638 (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
3639 (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
3640 (khtml::TypingCommand::insertParagraphSeparator): New function.
3641 (khtml::TypingCommand::doApply): Name changes, as above.
3642 (khtml::TypingCommand::insertText): Ditto.
3643 (khtml::TypingCommand::deleteKeyPressed): Ditto.
3644 (khtml::TypingCommand::preservesTypingStyle): Ditto.
3645 * khtml/editing/htmlediting.h:
3646 (khtml::DeleteFromTextNodeCommand::node): Name change.
3647 (khtml::DeleteFromTextNodeCommand::offset): Ditto.
3648 (khtml::DeleteFromTextNodeCommand::count): Ditto.
3649 (khtml::InsertIntoTextNode::text): Ditto.
3650 (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
3651 (khtml::InsertNodeBeforeCommand::refChild): Ditto.
3652 (khtml::TypingCommand::): Ditto.
3653 * khtml/editing/jsediting.cpp: Name changes, as above.
3654 * kwq/WebCoreBridge.h:
3655 * kwq/WebCoreBridge.mm:
3656 (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
3657 (-[WebCoreBridge insertParagraphSeparator]): New function.
3658 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
3660 2004-11-01 Kevin Decker <kdecker@apple.com>
3664 fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
3667 * khtml/ecma/kjs_window.cpp:
3668 (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
3670 2004-11-01 Darin Adler <darin@apple.com>
3674 - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
3676 * khtml/css/html4.css: Use color: initial for textarea and related ones.
3678 2004-11-01 Ken Kocienda <kocienda@apple.com>
3684 <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
3686 * khtml/css/css_computedstyle.cpp:
3687 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the
3688 implementation here into new copyPropertiesInSet helper. This now calls the
3689 generalized copyPropertiesInSet function with the arguments needed to make copying
3691 * khtml/css/css_computedstyle.h:
3692 * khtml/css/css_valueimpl.cpp:
3693 (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
3694 In order to do apply block properties, "regular" style declarations need to do style
3696 (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
3697 except that it uses a different set of properties that apply only to blocks.
3698 (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
3699 and copies out those properties listed in a pre-defined set.
3700 * khtml/css/css_valueimpl.h:
3701 * khtml/editing/htmlediting.cpp:
3702 (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
3703 block, factoring out some of the special case code that should now only run in the inline case.
3704 (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
3705 (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
3706 special handling for "legacy" HTML styles like <B> and <I>.
3707 (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
3708 style changes into different kinds. CSS specifies certain properties only apply to certain
3709 element types. This set of changes now recognizes two such separate cases: styles that apply
3710 to blocks, and styles that apply to inlines.
3711 (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
3712 (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
3713 (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
3714 with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
3715 done so that the function can be passed a portion of the styles being applied so that block styles
3716 and inline styles can be handled separately.
3717 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
3718 (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
3719 (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
3720 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
3721 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
3722 * khtml/editing/htmlediting.h:
3723 (khtml::StyleChange::): Changed as described above.
3724 (khtml::StyleChange::usesLegacyStyles):
3725 (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
3726 it needs to layout, even though it has not changed position in the DOM. For instance, this is needed
3727 when text align changes.
3728 * khtml/khtml_part.cpp:
3729 (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
3730 the passed-in argument.
3731 (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
3732 is a caret. Formerly, this just set typing style and made no visible changes to the document.
3736 * layout-tests/editing/editing.js: Added some glue to change text align.
3737 * layout-tests/editing/style/block-style-001-expected.txt: Added.
3738 * layout-tests/editing/style/block-style-001.html: Added.
3739 * layout-tests/editing/style/block-style-002-expected.txt: Added.
3740 * layout-tests/editing/style/block-style-002.html: Added.
3741 * layout-tests/editing/style/block-style-003-expected.txt: Added.
3742 * layout-tests/editing/style/block-style-003.html: Added.
3746 2004-10-29 Darin Adler <darin@apple.com>
3750 - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
3752 * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
3753 before advancing one character; before it did it backwards.
3755 2004-10-29 Chris Blumenberg <cblu@apple.com>
3757 Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
3759 Reviewed by kocienda, adele.
3761 * khtml/rendering/render_frames.cpp:
3762 (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
3764 2004-10-29 Darin Adler <darin@apple.com>
3768 - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
3770 * khtml/khtmlview.cpp:
3771 (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
3772 deleted before this function finishes running.
3773 (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
3774 (KHTMLView::viewportMouseReleaseEvent): Ditto.
3775 (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
3776 is guaranteed to do ref/deref as needed.
3778 * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
3780 2004-10-28 Chris Blumenberg <cblu@apple.com>
3782 Enabled XSLT on Panther. See intrigue mail for compiling instructions.
3786 * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
3787 * WebCorePrefix.h: always use XSLT
3789 2004-10-28 Ken Kocienda <kocienda@apple.com>
3795 <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
3796 <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
3798 * khtml/editing/htmlediting.cpp:
3799 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members
3800 to initialization list, zeroing them out.
3801 (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
3802 handle a delete of content in special cases where the only thing selected is a BR. This
3803 code path is much simpler than the newly-named performGeneralDelete, and detects when no
3804 content merging should be done between blocks. This aspect of the change fixes 3854848.
3805 One of the special cases added fixes 3803832.
3806 (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
3807 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
3808 like the other helpers in this class.
3809 (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
3810 (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
3811 * khtml/editing/htmlediting.h: Added new helper and changed an old one.
3813 2004-10-28 Chris Blumenberg <cblu@apple.com>
3815 Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
3819 * kwq/KWQKHTMLPart.mm:
3820 (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
3822 2004-10-28 Ken Kocienda <kocienda@apple.com>
3824 Reviewed by Harrison
3826 Reorganization of delete command functionality so that doApply is not
3827 several hundred lines long. This is not a squeaky-clean cleanup, but
3828 it is a step in the right direction. No functionality changes.
3830 * khtml/editing/htmlediting.cpp:
3831 (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
3832 (khtml::DeleteSelectionCommand::initializePositionData): New helper.
3833 (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
3834 (khtml::DeleteSelectionCommand::performDelete): Ditto.
3835 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
3836 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
3837 (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
3838 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
3839 (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
3840 (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
3841 * khtml/editing/htmlediting.h:
3843 2004-10-28 Ken Kocienda <kocienda@apple.com>
3847 * khtml/editing/htmlediting.cpp:
3848 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
3849 new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
3851 2004-10-27 Ken Kocienda <kocienda@apple.com>
3855 * khtml/editing/htmlediting.cpp:
3856 (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
3857 whether content not in the block containing the&n