1 2004-12-14 David Hyatt <hyatt@apple.com>
3 Fix for 3833123, setting a cell's colspan does not update rendering like it should.
7 * khtml/html/html_tableimpl.cpp:
8 (HTMLTableCellElementImpl::parseHTMLAttribute):
9 * khtml/rendering/render_table.cpp:
10 (RenderTableCell::RenderTableCell):
11 (RenderTableCell::updateFromElement):
13 2004-12-14 Chris Blumenberg <cblu@apple.com>
15 Fixed: <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
19 * khtml/editing/markup.cpp:
20 (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it
22 2004-12-14 David Hyatt <hyatt@apple.com>
24 Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position.
25 This is actually a regression from my positioned object DHTML optimization.
29 * khtml/rendering/render_object.cpp:
30 (RenderObject::setStyle):
32 2004-12-14 David Hyatt <hyatt@apple.com>
34 Make sure the class attribute works when newlines are present in the attribute.
38 * khtml/html/html_elementimpl.cpp:
39 (HTMLNamedAttrMapImpl::parseClassAttribute):
41 2004-12-14 David Hyatt <hyatt@apple.com>
43 Fix for 3724938, float element is duplicated and paints twice. The logic for when to paint floats was
44 actually fairly screwed up. This patch simplifies the logic and makes addOverhangingFloats easier to
45 read by splitting it into two separate functions.
49 * khtml/rendering/render_block.cpp:
50 (khtml::RenderBlock::layoutBlockChildren):
51 (khtml::RenderBlock::clearFloats):
52 (khtml::RenderBlock::addOverhangingFloats):
53 (khtml::RenderBlock::addIntrudingFloats):
54 * khtml/rendering/render_block.h:
56 2004-12-14 John Sullivan <sullivan@apple.com>
60 - added Undo action names for Cut, Paste, and Drag
62 * khtml/editing/htmlediting.h:
63 * khtml/editing/htmlediting.cpp:
64 (khtml::DeleteSelectionCommand::editingAction):
65 overridden to return HTMLEditActionCut
66 (khtml::MoveSelectionCommand::editingAction):
67 overridden to return HTMLEditActionDrag
68 (khtml::ReplaceSelectionCommand::editingAction):
69 overridden to return HTMLEditActionPaste
71 2004-12-14 John Sullivan <sullivan@apple.com>
75 - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu,
76 no specific action names
78 The remaining step is to make each EditCommand subclass override editingAction() to return an
79 appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
80 is not completely straightforward, so this next step isn't trivial.)
82 * khtml/editing/htmlediting.h:
83 new enum for HTMLEditAction
85 * khtml/editing/htmlediting.cpp:
86 (khtml::EditCommandPtr::editingAction):
87 new method, calls through to EditCommand
88 (khtml::EditCommand::editingAction):
89 new method for subclasses to override, returns HTMLEditActionUnspecified at this level
90 (khtml::TypingCommand::editingAction):
91 proof of concept override, returns HTMLEditActionTyping
94 declare new private bottleneck method registerCommandForUndoOrRedo
95 * kwq/KWQKHTMLPart.mm:
96 (KWQKHTMLPart::registerCommandForUndoOrRedo):
97 new bottleneck method to reduce code duplication; now calls over the bridge
98 to get the localized string to use for the Undo action name
99 (KWQKHTMLPart::registerCommandForUndo):
100 now calls new bottleneck method
101 (KWQKHTMLPart::registerCommandForRedo):
102 now calls new bottleneck method
104 * kwq/WebCoreBridge.h:
105 new enum for WebUndoAction, maps directly to HTMLEditAction.
106 Declaration of nameForUndoAction:
108 2004-12-14 Darin Adler <darin@apple.com>
112 - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)
114 * khtml/rendering/render_frames.cpp:
115 (RenderPart::~RenderPart): Check widget for nil.
116 (RenderPart::setWidget): Ditto.
117 (RenderFrame::slotViewCleared): Ditto.
118 (RenderPartObject::slotViewCleared): Ditto.
120 2004-12-13 Darin Adler <darin@apple.com>
124 - moved markup-related functions into new sources files in the editing directory
125 - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster
127 * ForwardingHeaders/editing/markup.h: Added.
128 * khtml/editing/markup.h: Added.
129 * khtml/editing/markup.cpp: Added.
131 * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.
133 * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
134 * khtml/html/html_elementimpl.cpp:
135 (HTMLElementImpl::innerHTML): Changed to call createMarkup.
136 (HTMLElementImpl::outerHTML): Ditto.
138 * khtml/ecma/kjs_window.cpp:
139 (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
140 (Window::retrieveActive): Ditto.
142 * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
143 * khtml/xml/dom_docimpl.h: Ditto.
145 * khtml/khtml_part.cpp:
146 (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
147 (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.
149 * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
150 still works even with the additional replace overloads added to QString.
151 * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.
153 * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
154 base pointer, because it used dynamic_cast in its implementation. Made the other version public.
155 * khtml/rendering/render_object.cpp: Ditto.
156 * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.
158 * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
159 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
160 the support code into markup.cpp.
162 * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
163 * khtml/xml/dom_nodeimpl.cpp: Ditto.
165 * khtml/xml/dom_position.cpp:
166 (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
167 so these return null positions rather than raising exceptions.
168 (DOM::endPosition): Ditto.
170 * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
171 * kwq/KWQFrame.h: Ditto.
172 * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
173 * kwq/KWQKPartsPart.h: Ditto.
174 * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
175 * kwq/KWQScrollView.h: Ditto.
176 * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
177 * kwq/KWQKHTMLPart.h: Ditto.
178 * kwq/KWQKHTMLPart.mm:
179 (KHTMLView::isKHTMLView): Ditto.
180 (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
181 replace overloads added to QString.
182 (KWQKHTMLPart::setStatusBarText): Ditto.
183 (KWQKHTMLPart::runJavaScriptAlert): Ditto.
184 (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
185 (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
186 (KWQKHTMLPart::attributedString): Ditto.
187 (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
188 (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).
190 * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
192 (QObject::inherits): Changed to not use dynamic cast.
193 (QObject::isKHTMLPart): Added. Returns false.
194 (QObject::isKHTMLView): Ditto.
195 (QObject::isKPartsReadOnlyPart): Ditto.
196 (QObject::isQFrame): Ditto.
197 (QObject::isQScrollView): Ditto.
199 * kwq/KWQRenderTreeDebug.cpp:
200 (write): Changed to use inherits rather than dynamic_cast.
201 (writeSelection): Ditto.
203 * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
204 than going straight on to the "no parameters at all" version.
207 * kwq/KWQString.mm: (QString::replace): Added overloads.
208 * kwq/WebCoreBridge.mm:
209 (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
210 (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
211 (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
212 the additional replace overloads added to QString.
213 (-[WebCoreBridge stringForRange:]): Ditto.
214 (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
215 (-[WebCoreBridge elementAtPoint:]): QChar conversion.
216 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
217 (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.
219 2004-12-13 Ken Kocienda <kocienda@apple.com>
225 <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
227 * khtml/editing/htmlediting.cpp:
228 (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
229 leading and trailing whitespace positions was reversed! I must have introduced this error recently
230 when changing around this code.
232 2004-12-13 David Hyatt <hyatt@apple.com>
234 Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing
235 and painting was using the wrong rect when setting up the x/y of the rect.
239 * khtml/rendering/render_block.cpp:
240 (khtml::RenderBlock::paint):
241 (khtml::RenderBlock::nodeAtPoint):
242 * khtml/rendering/render_object.h:
243 (khtml::RenderObject::floatRect):
245 2004-12-13 Ken Kocienda <kocienda@apple.com>
251 <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles
253 Code to figuire out the end node to merge was missing the font tag in the second paragraph
254 written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.
256 * khtml/editing/htmlediting.cpp:
257 (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
258 looking for the node that is the last inline in the last block of the fragment. The old algorithm was
259 insufficiently powerful.
260 (khtml::ReplacementFragment::enclosingBlock): New helper function.
261 * khtml/editing/htmlediting.h: Add declaration for new helper function.
262 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
263 * layout-tests/editing/pasteboard/paste-text-011.html: Added.
265 2004-12-13 Ken Kocienda <kocienda@apple.com>
269 WebCore side of fix for this bug:
271 <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace
273 Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
274 bug. This change involves our half of the needed changes.
276 Note that a lot of this change has to do with changing code to use a <br> element instead of
277 a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
278 other places, code to handle comments in markup can be removed since we do not use comments for
279 such annotations after this change.
281 * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
282 (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
283 (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
284 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
285 convertedSpaceSpanClassString to match other uses of the idiom used here.
286 (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
287 * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
288 (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
289 * khtml/html/html_elementimpl.cpp:
290 (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
291 annotate fragments with comments any longer.
292 * khtml/html/html_elementimpl.h: Ditto.
293 * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
294 (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
295 (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
297 * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
298 * kwq/WebCoreBridge.mm:
299 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
300 in DOM when calling createContextualFragment().
302 2004-12-10 John Sullivan <sullivan@apple.com>
304 fixed deployment build bustage that John Louch ran into
306 * kwq/KWQTextEdit.mm:
307 (QTextEdit::setScrollBarModes):
308 move bool declaration inside exception-handling block to avoid obscure
311 2004-12-10 Maciej Stachowiak <mjs@apple.com>
315 <rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
318 (QWidget::setFocus): Handle the case where setting focus removed
319 us from the superview - this can happen due to style changes on
322 2004-12-10 Ken Kocienda <kocienda@apple.com>
328 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
330 There are a number of interesting things we could do to fix this bug, including SPI and involving
331 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
332 will fix the bug in the general case until such time as we can come up with more specific
335 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
338 * khtml/editing/htmlediting.cpp:
339 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
340 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
341 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
342 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
344 2004-12-10 Darin Adler <darin@apple.com>
348 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
350 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
351 * khtml/rendering/render_form.cpp:
352 (RenderSubmitButton::rawText): Convert to QChar explicitly.
353 (RenderLineEdit::updateFromElement): Ditto.
354 (RenderLineEdit::slotTextChanged): Ditto.
355 (RenderSelect::updateFromElement): Ditto.
356 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
357 that requires a derived class. Now we don't use this class at all for WebCore, but they still
359 (TextAreaWidget::event): Moved out the ifdefs.
360 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
361 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
362 now done in setStyle.
363 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
364 that's needed and WebCore no longer has TextAreaWidget.
365 (RenderTextArea::calcMinMaxWidth): Ditto.
366 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
368 (RenderTextArea::updateFromElement): Use type QTextEdit.
369 (RenderTextArea::text): Ditto.
370 (RenderTextArea::select): Ditto.
372 * kwq/KWQTextArea.mm:
373 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
374 since it's now handled by QTextEdit.
375 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
377 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
378 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
379 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
381 2004-12-10 Ken Kocienda <kocienda@apple.com>
387 <rdar://problem/3915047> HItting return in empty document inserts <p> but
388 insertion point does not move
390 * khtml/editing/htmlediting.cpp:
391 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
392 code to insert the <p> element for the return is not detecting the fact
393 that the document is empty. Inserting a <p> into an empty body will not
394 "add a new line" as the user expects. With this change, we'll add a second
395 <p> when the root editable element has no rendered kids.
397 2004-12-10 Maciej Stachowiak <mjs@apple.com>
401 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
403 * khtml/html/html_miscimpl.cpp:
404 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
405 the initial one step, otherwise we might inadvertantly step
406 outside the collection base, thereby causing assertion failures or
409 2004-12-10 Ken Kocienda <kocienda@apple.com>
413 * khtml/editing/htmlediting.cpp:
414 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
415 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
416 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
417 should do nothing if the starting point for the selection is itself the starting block.
418 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
419 function, though the names and concepts are slightly different.
421 2004-12-10 Maciej Stachowiak <mjs@apple.com>
425 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
427 * khtml/dom/html_document.cpp:
428 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
429 * khtml/dom/html_document.h:
430 * khtml/ecma/kjs_html.cpp:
431 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
432 * khtml/html/html_miscimpl.cpp:
433 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
434 the items that can be accessed directly as a document propery, in particular forms, images,
435 objects, applets and embeds.
436 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
437 (HTMLFormCollectionImpl::updateNameCache): Ditto.
438 * khtml/html/html_miscimpl.h:
439 (DOM::HTMLCollectionImpl::): Added new type.
441 2004-12-10 Ken Kocienda <kocienda@apple.com>
447 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
449 * khtml/rendering/render_text.cpp:
450 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
452 2004-12-10 Ken Kocienda <kocienda@apple.com>
458 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
460 * khtml/editing/htmlediting.cpp:
461 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
462 that was removed from the document when pasting. This caused the disappearance. Now this
463 is detected, and the selection is shifted to a node that is in the document.
465 2004-12-09 Richard Williamson <rjw@apple.com>
467 Check to disable threaded decoding during
468 layout tests wasn't invoking function, just checking address of
469 function, which would always return true.
471 * kwq/WebCoreImageRendererFactory.m:
472 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
474 2004-12-09 David Hyatt <hyatt@apple.com>
476 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
479 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
480 all inlines when repainting.
484 * khtml/rendering/render_block.cpp:
485 (khtml::RenderBlock::layoutBlockChildren):
486 * khtml/rendering/render_flow.cpp:
487 (RenderFlow::getAbsoluteRepaintRect):
489 2004-12-09 David Hyatt <hyatt@apple.com>
491 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
492 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
493 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
494 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
498 * khtml/rendering/render_block.cpp:
499 (khtml::RenderBlock::getClearDelta):
500 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
501 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
502 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
503 * layout-tests/fast/block/margin-collapse/102-expected.txt:
504 * layout-tests/fast/block/margin-collapse/102.html:
506 2004-12-09 Richard Williamson <rjw@apple.com>
508 Fixed <rdar://problem/3914078> worldclock crashing gc related
510 Use ProtectedValue for Context2D instance members.
514 * khtml/ecma/kjs_html.h:
516 2004-12-09 John Sullivan <sullivan@apple.com>
520 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
522 * kwq/KWQAccObject.mm:
523 (-[KWQAccObject title]): moved image alt tag code out of here
524 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
525 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
526 that ordinary elements return; this means that ordinary elements that aren't images will return
527 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
529 (-[KWQAccObject accessibilityAttributeValue:]):
530 call accessibilityDescription when asked for AXDescription
532 2004-12-09 Ken Kocienda <kocienda@apple.com>
538 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
540 * khtml/editing/htmlediting.cpp:
541 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
542 been deleted. If this is the case, set the destination to the node the delete command provides in
543 its ending selection.
547 2004-12-09 Ken Kocienda <kocienda@apple.com>
553 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
555 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
556 callback may not be delivered before the program asks for the dimensions of an image in order to
557 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
558 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
560 * kwq/KWQRenderTreeDebug.cpp:
561 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
562 (externalRepresentation): Sets debuggingRenderTree flag to true;
563 * kwq/KWQRenderTreeDebug.h:
564 * kwq/WebCoreImageRendererFactory.m:
565 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
566 do threaded decoding in any case if the flag is set.
568 2004-12-09 Chris Blumenberg <cblu@apple.com>
570 Fix for busting XMLHTTPRequest.
572 Reviewed by kocienda.
574 * khtml/misc/loader.cpp:
575 (Loader::servePendingRequests): pass true for deliverAllData
577 (KIO::get): take deliverAllData param
578 (KIO::http_post): ditto
579 * kwq/KWQKJobClasses.h:
580 * kwq/KWQKJobClasses.mm:
581 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
582 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
584 2004-12-09 Ken Kocienda <kocienda@apple.com>
588 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
590 * khtml/xml/dom_nodeimpl.cpp:
591 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
593 2004-12-07 Richard Williamson <rjw@apple.com>
595 Support threaded image decoding on machines w/ > 2 CPUs.
597 Reviewed by Maciej and Chris.
599 * khtml/misc/loader.cpp:
600 (CachedImageCallback::notifyUpdate):
601 (CachedImageCallback::notifyFinished):
602 (CachedImageCallback::notifyDecodingError):
603 (CachedImageCallback::handleError):
604 (CachedImageCallback::clear):
605 (CachedImage::CachedImage):
606 (CachedImage::clear):
608 (CachedImage::checkNotify):
609 (Loader::servePendingRequests):
610 (Loader::slotFinished):
611 (Loader::numRequests):
612 (Loader::cancelRequests):
613 (Loader::removeBackgroundDecodingRequest):
614 * khtml/misc/loader.h:
615 (khtml::CachedImageCallback::CachedImageCallback):
616 (khtml::CachedImageCallback::ref):
617 (khtml::CachedImageCallback::deref):
618 (khtml::CachedImage::decoderCallback):
619 * khtml/rendering/render_object.cpp:
620 (RenderObject::setPixmap):
623 (-[WebImageCallback initWithCallback:khtml::]):
624 (-[WebImageCallback _commonTermination]):
625 (-[WebImageCallback dealloc]):
626 (-[WebImageCallback finalize]):
627 (-[WebImageCallback notify]):
628 (-[WebImageCallback setImageSourceStatus:]):
629 (-[WebImageCallback status]):
630 (QPixmap::shouldUseThreadedDecoding):
631 (QPixmap::receivedData):
632 * kwq/WebCoreImageRenderer.h:
633 * kwq/WebCoreImageRendererFactory.h:
634 * kwq/WebCoreImageRendererFactory.m:
635 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
636 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
638 2004-12-07 Ken Kocienda <kocienda@apple.com>
642 * khtml/editing/htmlediting.cpp:
643 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
644 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
645 after new block has been inserted, otherwise a crash can result. Shuffle down call
646 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
649 2004-12-07 Ken Kocienda <kocienda@apple.com>
655 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
657 * khtml/editing/htmlediting.cpp:
658 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
659 for determining the location for inserting content. Do not allow an insert before or after if the
660 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
661 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
662 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
664 2004-12-07 Darin Adler <darin@apple.com>
668 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
670 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
672 2004-12-07 Ken Kocienda <kocienda@apple.com>
676 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
677 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
679 * khtml/editing/html_interchange.h: Name change, as described above.
680 * khtml/editing/htmlediting.cpp:
681 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
682 * khtml/xml/dom2_rangeimpl.cpp:
683 (DOM::RangeImpl::toHTML): Ditto.
685 2004-12-07 Ken Kocienda <kocienda@apple.com>
689 Added a couple more layout tests.
691 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
692 * layout-tests/editing/deleting/delete-line-013.html: Added.
693 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
694 * layout-tests/editing/deleting/delete-line-014.html: Added.
696 2004-12-06 Maciej Stachowiak <mjs@apple.com>
700 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
703 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
704 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
705 (-[KWQListBoxScrollView widget]): See above.
706 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
707 afterMouseDown, to avoid triggering an assertion failure.
709 2004-12-06 David Hyatt <hyatt@apple.com>
711 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
712 made by me, kocienda and harrison to just remove it.
716 * khtml/rendering/bidi.cpp:
717 (khtml::RenderBlock::layoutInlineChildren):
718 * khtml/rendering/render_block.cpp:
719 (khtml:::RenderFlow):
720 * khtml/rendering/render_block.h:
721 * khtml/rendering/render_flow.cpp:
722 (RenderFlow::dirtyLinesFromChangedChild):
724 2004-12-06 David Hyatt <hyatt@apple.com>
726 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
727 not a damage rect that can be changed when intersected with the clip regions of the web page.
731 * khtml/rendering/render_canvas.h:
732 (khtml::RenderCanvas::printRect):
733 (khtml::RenderCanvas::setPrintRect):
734 * khtml/rendering/render_flow.cpp:
735 (RenderFlow::paintLines):
736 * khtml/rendering/render_list.cpp:
737 (RenderListMarker::paint):
738 * kwq/KWQKHTMLPart.mm:
739 (KWQKHTMLPart::adjustPageHeight):
741 2004-12-06 David Harrison <harrison@apple.com>
743 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
745 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
748 * khtml/rendering/render_flow.cpp:
749 (RenderFlow::dirtyLinesFromChangedChild):
750 Dirty the line above because new child can inval the cached line break position of previous line.
752 2004-12-06 David Hyatt <hyatt@apple.com>
754 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
755 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
756 3126929, handle top/left overflow.
758 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
760 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
761 regions and web pages) has been fixed.
765 * khtml/rendering/bidi.cpp:
766 (khtml::RenderBlock::computeHorizontalPositionsForLine):
767 (khtml::RenderBlock::checkLinesForOverflow):
768 * khtml/rendering/render_block.cpp:
769 (khtml:::RenderFlow):
770 (khtml::RenderBlock::overflowHeight):
771 (khtml::RenderBlock::overflowWidth):
772 (khtml::RenderBlock::overflowLeft):
773 (khtml::RenderBlock::overflowTop):
774 (khtml::RenderBlock::overflowRect):
775 (khtml::RenderBlock::layoutBlock):
776 (khtml::RenderBlock::layoutBlockChildren):
777 (khtml::RenderBlock::paint):
778 (khtml::RenderBlock::floatRect):
779 (khtml::RenderBlock::lowestPosition):
780 (khtml::RenderBlock::rightmostPosition):
781 (khtml::RenderBlock::leftmostPosition):
782 (khtml::RenderBlock::nodeAtPoint):
783 * khtml/rendering/render_block.h:
784 * khtml/rendering/render_box.h:
785 (khtml::RenderBox::borderBox):
786 (khtml::RenderBox::borderTopExtra):
787 (khtml::RenderBox::borderBottomExtra):
788 * khtml/rendering/render_layer.cpp:
789 (RenderLayer::paintScrollbars):
790 (mustExamineRenderer):
791 (RenderLayer::intersectsDamageRect):
792 (RenderLayer::containsPoint):
793 * khtml/rendering/render_line.cpp:
794 (khtml::InlineFlowBox::placeBoxesHorizontally):
795 (khtml::InlineFlowBox::verticallyAlignBoxes):
796 * khtml/rendering/render_line.h:
797 (khtml::InlineBox::leftOverflow):
798 (khtml::InlineBox::rightOverflow):
799 (khtml::InlineFlowBox::setVerticalOverflowPositions):
800 (khtml::RootInlineBox::RootInlineBox):
801 (khtml::RootInlineBox::leftOverflow):
802 (khtml::RootInlineBox::rightOverflow):
803 (khtml::RootInlineBox::setVerticalOverflowPositions):
804 (khtml::RootInlineBox::setHorizontalOverflowPositions):
805 * khtml/rendering/render_object.h:
806 (khtml::RenderObject::borderBox):
807 (khtml::RenderObject::overflowLeft):
808 (khtml::RenderObject::overflowTop):
809 (khtml::RenderObject::overflowRect):
810 (khtml::RenderObject::floatRect):
811 * khtml/rendering/render_table.cpp:
812 (RenderTable::layout):
813 (RenderTable::paint):
814 (RenderTable::paintBoxDecorations):
815 (RenderTable::calcMinMaxWidth):
816 * khtml/rendering/render_table.h:
817 (khtml::RenderTableCell::borderTopExtra):
818 (khtml::RenderTableCell::borderBottomExtra):
823 2004-12-06 Maciej Stachowiak <mjs@apple.com>
827 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
829 I changed all unprotected places that can navigate a different
830 window or frame from script to check for a javascript: URL, and if
831 found, to check for safety using cross-site-script rules.
833 I considered a few other possible exploits and made no change:
835 - document.location is already protected because the document
836 object itself is protected
838 - frame.src, frame.location, iframe.src and targetted links are
839 all safe because setting the URL of a frame to a javascript: URL
840 executes the script in the context of the parent
842 * khtml/ecma/kjs_window.cpp:
843 (WindowFunc::tryCall):
845 (LocationFunc::tryCall):
847 2004-12-06 Ken Kocienda <kocienda@apple.com>
853 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
855 * khtml/editing/htmlediting.cpp:
856 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
857 check for one of the special cases being checked for in this function. The specific case
858 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
859 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
860 case where a selection ended in a <br> after a block and would not delete any part of the
861 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
864 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
865 new use of the function exposed this bug:
867 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
869 * khtml/xml/dom_position.cpp:
870 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
871 not have this fatal flaw. It is a much better design as well.
873 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
874 have what I consider to be a better result. Going with it.
876 2004-12-06 Chris Blumenberg <cblu@apple.com>
878 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
883 (-[DOMElement _font]): new SPI for AppKit
886 2004-12-06 Darin Adler <darin@apple.com>
890 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
892 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
893 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
895 2004-12-06 John Sullivan <sullivan@apple.com>
897 Darin found what appears to be the real leak that we were falsely blaming
898 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
901 * khtml/css/cssparser.cpp:
902 (CSSParser::parseValue):
903 call clearProperties() instead of just setting numParsedProperties to 0
904 (CSSParser::parseDeclaration):
906 (CSSParser::createStyleDeclaration):
909 2004-12-06 Ken Kocienda <kocienda@apple.com>
915 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
916 * layout-tests/editing/inserting/insert-div-001.html: Added.
917 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
918 * layout-tests/editing/inserting/insert-div-002.html: Added.
919 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
920 * layout-tests/editing/inserting/insert-div-003.html: Added.
921 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
922 * layout-tests/editing/inserting/insert-div-004.html: Added.
923 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
924 * layout-tests/editing/inserting/insert-div-005.html: Added.
925 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
926 * layout-tests/editing/inserting/insert-div-006.html: Added.
927 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
928 * layout-tests/editing/inserting/insert-div-007.html: Added.
929 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
930 * layout-tests/editing/inserting/insert-div-008.html: Added.
931 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
932 * layout-tests/editing/inserting/insert-div-009.html: Added.
934 2004-12-06 Ken Kocienda <kocienda@apple.com>
940 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
942 * khtml/editing/htmlediting.cpp:
943 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
944 being added to this function. This ensures that the added block has a height.
945 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
947 2004-12-06 Ken Kocienda <kocienda@apple.com>
951 * khtml/dom/dom_string.cpp:
952 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
953 * khtml/dom/dom_string.h: Ditto.
954 * khtml/editing/htmlediting.cpp:
955 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
956 RebalanceWhitespaceCommand instance.
957 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
958 (khtml::InsertLineBreakCommand::doApply): Ditto.
959 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
960 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
961 (khtml::InsertTextCommand::input): Ditto.
962 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
963 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
964 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
965 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
966 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
967 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
968 * khtml/editing/htmlediting.h: Ditto.
969 (khtml::RebalanceWhitespaceCommand::): Ditto.
971 2004-12-05 Darin Adler <darin@apple.com>
973 - fixed small problem in my check-in from yesterday
976 (positionForEvent): Get location from event without raising exception if it's the wrong type.
977 (clickCountForEvent): Same, for clickCount.
978 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
979 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
980 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
982 2004-12-04 Darin Adler <darin@apple.com>
986 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
988 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
989 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
990 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
992 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
994 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
995 * khtml/rendering/render_form.cpp:
996 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
997 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
998 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
1000 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
1001 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
1002 Added a fixState helper method so the constructors can save code.
1004 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
1005 and added a third constructor that uses the "current event" from AppKit (used above).
1006 (QMouseEvent::fixState): Compute state and click count based on event type.
1008 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
1010 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
1011 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
1012 underlying cause in CSS.
1014 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
1016 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
1017 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
1019 2004-12-03 Chris Blumenberg <cblu@apple.com>
1022 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
1023 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
1024 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
1025 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
1027 Reviewed by darin, rjw, kocienda.
1029 * khtml/misc/loader.cpp:
1030 (CachedObject::~CachedObject):
1031 (CachedCSSStyleSheet::checkNotify):
1032 (Loader::servePendingRequests):
1033 (Loader::slotFinished):
1034 (Loader::slotReceivedResponse):
1035 (Cache::requestImage):
1036 (Cache::requestScript):
1037 * khtml/misc/loader.h:
1038 (khtml::CachedObject::CachedObject):
1039 (khtml::CachedObject::response):
1040 (khtml::CachedObject::allData):
1041 * kwq/KWQKJobClasses.h:
1042 * kwq/KWQKJobClasses.mm:
1043 (KIO::TransferJobPrivate::TransferJobPrivate):
1044 (KIO::TransferJobPrivate::~TransferJobPrivate):
1045 (KIO::TransferJob::TransferJob):
1046 (KIO::TransferJob::assembleResponseHeaders):
1047 (KIO::TransferJob::retrieveCharset):
1048 (KIO::TransferJob::emitResult):
1049 (KIO::TransferJob::emitReceivedResponse):
1052 (KWQHeaderStringFromDictionary):
1053 (KWQCheckCacheObjectStatus):
1054 (KWQIsResponseURLEqualToURL):
1056 (KWQResponseMIMEType):
1057 (KWQCacheObjectExpiresTime):
1058 (khtml::CachedObject::setResponse):
1059 (khtml::CachedObject::setAllData):
1063 * kwq/KWQResourceLoader.mm:
1064 (-[KWQResourceLoader finishJobAndHandle:]):
1065 (-[KWQResourceLoader cancel]):
1066 (-[KWQResourceLoader reportError]):
1067 (-[KWQResourceLoader finishWithData:]):
1075 * kwq/WebCoreBridge.h:
1076 * kwq/WebCoreResourceLoader.h:
1078 2004-12-04 Darin Adler <darin@apple.com>
1082 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
1084 * khtml/rendering/render_form.cpp:
1085 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
1086 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
1087 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
1088 (RenderSlider::slotSliderValueChanged): Ditto.
1090 2004-12-03 John Sullivan <sullivan@apple.com>
1094 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
1095 khtml::BackgroundLayer::cullEmptyLayers
1097 * khtml/rendering/render_style.cpp:
1098 (BackgroundLayer::cullEmptyLayers):
1099 added missing nil check
1103 2004-12-03 Ken Kocienda <kocienda@apple.com>
1107 Roll out some recent changes by Chris that caused a performance regression.
1108 Fix is in hand, but it is a little risky this close to a submission. So,
1109 we have decided to roll back the change with the regression and roll in
1110 the new code after we submit.
1112 * khtml/css/cssproperties.c:
1115 * khtml/css/cssvalues.c:
1118 * khtml/misc/htmlattrs.c:
1121 * khtml/misc/htmltags.c:
1124 * khtml/misc/loader.cpp:
1125 (CachedObject::~CachedObject):
1126 (CachedObject::setResponse):
1127 (CachedCSSStyleSheet::checkNotify):
1128 (Loader::servePendingRequests):
1129 (Loader::slotFinished):
1130 (Loader::slotReceivedResponse):
1131 (Cache::requestImage):
1132 (Cache::requestScript):
1133 * khtml/misc/loader.h:
1134 (khtml::CachedObject::CachedObject):
1135 (khtml::CachedObject::response):
1136 * kwq/KWQKJobClasses.h:
1137 * kwq/KWQKJobClasses.mm:
1138 (KIO::TransferJobPrivate::TransferJobPrivate):
1139 (KIO::TransferJobPrivate::~TransferJobPrivate):
1140 (KIO::TransferJob::TransferJob):
1141 (KIO::TransferJob::assembleResponseHeaders):
1142 (KIO::TransferJob::retrieveCharset):
1143 (KIO::TransferJob::emitResult):
1144 (KIO::TransferJob::emitReceivedResponse):
1147 (KWQHeaderStringFromDictionary):
1148 (KWQCheckCacheObjectStatus):
1149 (KWQRetainResponse):
1150 (KWQReleaseResponse):
1151 (KWQIsResponseURLEqualToURL):
1153 (KWQResponseMIMEType):
1154 (KWQResponseTextEncodingName):
1155 (KWQResponseHeaderString):
1156 (KWQCacheObjectExpiresTime):
1157 (KWQLoader::KWQLoader):
1161 * kwq/KWQResourceLoader.mm:
1162 (-[KWQResourceLoader finishJobAndHandle]):
1163 (-[KWQResourceLoader cancel]):
1164 (-[KWQResourceLoader reportError]):
1165 (-[KWQResourceLoader finish]):
1173 * kwq/WebCoreBridge.h:
1174 * kwq/WebCoreResourceLoader.h:
1176 2004-12-03 John Sullivan <sullivan@apple.com>
1180 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
1182 * kwq/KWQKHTMLPart.mm:
1183 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
1184 when checking whether we moved the focus to another view, make sure we didn't "move" it to
1185 our documentView, because that's no move at all.
1187 2004-12-03 Darin Adler <darin@apple.com>
1191 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
1193 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
1194 Added missing initialization for base class and node pointer.
1196 - fixed a few places that could leave dangling node pointers
1198 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
1199 Clear out the node pointer when the node is destroyed.
1200 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
1202 2004-12-03 Chris Blumenberg <cblu@apple.com>
1204 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.
1205 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
1209 * khtml/misc/loader.cpp:
1210 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
1211 (Loader::slotFinished): take data param
1212 * khtml/misc/loader.h:
1213 * kwq/KWQKJobClasses.h:
1214 * kwq/KWQKJobClasses.mm:
1215 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
1216 (KIO::TransferJob::emitResult): take data param and pass it
1217 * kwq/KWQResourceLoader.mm:
1218 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
1219 (-[KWQResourceLoader cancel]): pass nil for data
1220 (-[KWQResourceLoader reportError]): ditto
1221 (-[KWQResourceLoader finishWithData:]): pass data
1223 (KWQSlot::KWQSlot): pass data param to slotFinished
1224 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
1226 2004-12-03 Ken Kocienda <kocienda@apple.com>
1230 Did some clean up in the Position class as a result of trying to write some new layout
1231 tests and discovering a bug along the way.
1233 I removed these three functions from the Position class:
1235 1. bool isFirstRenderedPositionOnLine() const;
1236 2. bool isLastRenderedPositionOnLine() const;
1237 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
1238 4. bool inFirstEditableInRootEditableElement() const;
1240 The first two have replacements in the VisiblePosition class, and some code has been
1241 moved to use these new variants. The third function was a helper used only by these
1242 first two function, and can be removed as well. The fourth function was not used by anyone.
1244 * khtml/editing/htmlediting.cpp:
1245 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
1246 * khtml/editing/visible_position.cpp:
1247 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
1248 Incorrect results were being returned when asking about positions at the starts of blocks.
1249 * khtml/xml/dom_position.cpp:
1250 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
1251 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
1252 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
1253 * khtml/xml/dom_position.h: Update header for deletions.
1255 2004-12-03 Ken Kocienda <kocienda@apple.com>
1259 Terminology change in execCommand command identifiers. Specifically, the name of
1260 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
1261 terminology used by AppKit. It is also more accurate, since the insertion of a
1262 "br" element is what the command does. The inspiration for this change is so the
1263 -insertNewline AppKit method can be mapped to insert a new "div" element in
1264 a document and avoid ambiguity with what the javascript editing command does.
1266 * khtml/editing/jsediting.cpp
1267 * layout-tests/editing/deleting/delete-tab-004.html
1268 * layout-tests/editing/editing.js
1269 * layout-tests/editing/inserting/insert-3654864-fix.html
1270 * layout-tests/editing/inserting/insert-3659587-fix.html
1271 * layout-tests/editing/inserting/insert-3775316-fix.html
1272 * layout-tests/editing/inserting/insert-3800346-fix.html
1273 * layout-tests/editing/inserting/insert-br-001.html
1274 * layout-tests/editing/inserting/insert-br-002.html
1275 * layout-tests/editing/inserting/insert-br-003.html
1276 * layout-tests/editing/inserting/insert-br-004.html
1277 * layout-tests/editing/inserting/insert-br-005.html
1278 * layout-tests/editing/inserting/insert-br-006.html
1279 * layout-tests/editing/inserting/insert-br-007.html
1280 * layout-tests/editing/inserting/insert-br-008.html
1281 * layout-tests/editing/inserting/insert-tab-004.html
1282 * layout-tests/editing/inserting/insert-text-with-newlines.html
1283 * layout-tests/editing/pasteboard/paste-text-010.html
1285 2004-12-02 Ken Kocienda <kocienda@apple.com>
1291 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
1293 * khtml/editing/htmlediting.cpp:
1294 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
1295 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
1296 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
1297 in a block and the document is in quirks mode, add an additional br to make the one in the
1298 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
1299 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
1300 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
1302 2004-12-02 Richard Williamson <rjw@apple.com>
1304 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
1306 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
1307 the b/f cache won't incorrectly trash the previous state when restoring.
1311 * kwq/WebCoreBridge.h:
1312 * kwq/WebCoreBridge.mm:
1313 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
1314 (-[WebCoreBridge canCachePage]):
1315 (-[WebCoreBridge clear]):
1317 2004-12-02 Ken Kocienda <kocienda@apple.com>
1323 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
1325 * khtml/xml/dom2_rangeimpl.cpp:
1326 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
1327 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
1328 of this bug where there is content after the body tag). Did a little code clean up as well.
1329 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
1331 2004-12-02 Ken Kocienda <kocienda@apple.com>
1337 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
1339 * khtml/khtml_part.cpp:
1340 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
1341 to figure out which end of the selection to extend.
1343 2004-12-02 David Harrison <harrison@apple.com>
1345 Reviewed by Ken Kocienda.
1347 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
1348 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
1350 * khtml/editing/visible_text.cpp:
1351 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1352 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
1353 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
1354 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
1355 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
1356 Distinguish BR from whitespace.
1357 * khtml/editing/visible_text.h:
1358 Distinguish BR from whitespace.
1359 * khtml/editing/visible_units.cpp:
1360 (khtml::previousWordBoundary):
1361 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.
1363 2004-12-02 Ken Kocienda <kocienda@apple.com>
1369 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
1371 * khtml/xml/dom_position.cpp:
1372 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
1373 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
1374 exception trying to use a Position returned from this function to set the boundary point of a Range (which
1375 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
1376 contract to return a range-compliant position, hence the need for this fix.
1378 2004-12-01 Ken Kocienda <kocienda@apple.com>
1384 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
1385 regard to other editing commands. The class had a name change ages ago, and it was never
1387 * khtml/editing/htmlediting.h: Ditto.
1389 2004-12-01 Ken Kocienda <kocienda@apple.com>
1393 Some improvements for paste, including some new code to annotate
1394 whitespace when writing to the pasteboard to ensure that the meaning
1395 of the markup on the pasteboard is unambiguous.
1397 There is also new code for reading this annotated markup from the pasteboard,
1398 removing the nodes that were added only to prevent ambiguity.
1400 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
1401 The header should have been added earlier, but I did not do so.
1402 * khtml/editing/html_interchange.cpp: Added.
1403 (convertHTMLTextToInterchangeFormat):
1404 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
1405 * khtml/editing/htmlediting.cpp:
1406 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
1407 Also fixed a bug in the code that counts blocks in a fragment.
1408 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
1409 (khtml::ReplacementFragment::insertNodeBefore): New helper.
1410 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
1411 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
1412 * khtml/editing/htmlediting.h: Add some new declarations.
1413 * khtml/xml/dom2_rangeimpl.cpp:
1414 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
1415 * khtml/xml/dom_nodeimpl.cpp:
1416 (NodeImpl::stringValueForRange): New helper.
1417 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
1418 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
1419 should be added. Called by the paste code.
1420 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
1422 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
1423 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
1424 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
1426 2004-11-30 Chris Blumenberg <cblu@apple.com>
1428 * ChangeLog: removed conflict marker
1430 2004-11-30 Chris Blumenberg <cblu@apple.com>
1433 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
1434 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
1438 * khtml/misc/loader.cpp:
1439 (CachedObject::~CachedObject): release m_allData
1440 (CachedObject::setAllData): new
1441 (Loader::servePendingRequests): connect slotAllData
1442 (Loader::slotAllData): new
1443 (Cache::requestImage): tweak
1444 * khtml/misc/loader.h:
1445 (khtml::CachedObject::CachedObject): set allData to 0
1446 (khtml::CachedObject::allData): new
1447 * kwq/KWQKJobClasses.h:
1448 * kwq/KWQKJobClasses.mm:
1449 (KIO::TransferJob::TransferJob): set m_allData
1450 (KIO::TransferJob::emitAllData): new
1452 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
1453 * kwq/KWQResourceLoader.mm:
1454 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
1456 (KWQSlot::KWQSlot): support for slotAllData
1458 * kwq/WebCoreBridge.h:
1459 * kwq/WebCoreResourceLoader.h:
1461 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1465 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1469 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
1471 * khtml/khtml_part.cpp:
1472 (KHTMLPart::begin): call setParsing on document here after opening
1473 - from now on we'll only set parsing to true for a document open
1474 caused by page loading, not a programmatic one.
1475 * khtml/xml/dom_docimpl.cpp:
1476 (DocumentImpl::open): don't setParsing to true here any more.
1478 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1482 - fix recent regression from collection perf fixes.
1484 * khtml/html/html_miscimpl.cpp:
1485 (HTMLFormCollectionImpl::updateNameCache): Look up the name
1486 attribute in the name cache, not the id cache (d'oh!)
1488 2004-11-30 Darin Adler <darin@apple.com>
1492 - rolled in a KDE fix for a problem that may underlie a number of crashes
1494 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
1495 the KDE guys to fix a subtle problem. Code said "n = n =".
1497 - rolled in a KDE fix for a containingBlock crash
1499 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
1500 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
1503 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
1506 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
1507 (-[KWQButton detachQButton]): Added.
1508 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
1509 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
1510 (-[KWQButton widget]): Added.
1511 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
1512 (-[KWQButton resignFirstResponder]): Ditto.
1513 (-[KWQButton canBecomeKeyView]): Ditto.
1514 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
1515 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
1517 * kwq/KWQComboBox.mm:
1518 (QComboBox::~QComboBox): Call detachQComboBox.
1519 (-[KWQPopUpButtonCell detachQComboBox]): Added.
1520 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
1521 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
1522 (-[KWQPopUpButton action:]): Ditto.
1523 (-[KWQPopUpButton widget]): Tweaked.
1524 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
1525 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
1526 (-[KWQPopUpButton resignFirstResponder]): Ditto.
1527 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
1529 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
1531 * kwq/KWQListBox.mm:
1532 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
1534 * kwq/KWQScrollBar.h: Removed m_scroller field.
1535 * kwq/KWQScrollBar.mm:
1536 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
1537 (-[KWQScrollBar detachQScrollBar]): Added.
1538 (-[KWQScrollBar widget]): Added.
1539 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
1540 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
1541 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
1542 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
1543 (QScrollBar::setKnobProportion): Ditto.
1544 (QScrollBar::scrollbarHit): Ditto.
1546 * kwq/KWQScrollView.mm:
1547 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
1548 hack where we don't remove right away when doing mouse tracking.
1549 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
1550 the hack where we don't add right away when doing mouse tracking.
1552 * kwq/KWQSlider.h: Added destructor.
1554 (-[KWQSlider initWithQSlider:]): Tweaked a little.
1555 (-[KWQSlider detachQSlider]): Added.
1556 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
1557 (-[KWQSlider widget]): Added.
1558 (QSlider::~QSlider): Added. Calls detachQSlider.
1560 * kwq/KWQTextArea.h: Added detachQTextEdit method.
1561 * kwq/KWQTextArea.mm:
1562 (-[KWQTextArea detachQTextEdit]): Added.
1563 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
1564 (-[KWQTextArea becomeFirstResponder]): Ditto.
1565 (-[KWQTextArea nextKeyView]): Ditto.
1566 (-[KWQTextArea previousKeyView]): Ditto.
1567 (-[KWQTextArea drawRect:]): Ditto.
1568 (-[KWQTextAreaTextView insertTab:]): Ditto.
1569 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
1570 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
1571 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
1572 (-[KWQTextAreaTextView mouseDown:]): Ditto.
1573 (-[KWQTextAreaTextView keyDown:]): Ditto.
1574 (-[KWQTextAreaTextView keyUp:]): Ditto.
1576 * kwq/KWQTextEdit.h: Added ~QTextEdit.
1577 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
1579 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
1580 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
1582 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
1583 Added beforeMouseDown and afterMouseDown for use in widget implementations.
1584 Removed unused hasMouseTracking function.
1586 (QWidget::QWidget): Initialize two new fields.
1587 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
1588 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
1589 (QWidget::addToSuperview): Added.
1590 (QWidget::removeFromSuperview): Added.
1591 (QWidget::beforeMouseDown): Added.
1592 (QWidget::afterMouseDown): Added.
1594 * khtml/rendering/render_layer.cpp:
1595 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
1596 (RenderLayer::setHasVerticalScrollbar): Ditto.
1598 2004-11-30 Ken Kocienda <kocienda@apple.com>
1604 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
1606 * khtml/khtml_part.cpp:
1607 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
1608 with no blink if it is.
1610 2004-11-30 Ken Kocienda <kocienda@apple.com>
1616 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
1618 * khtml/khtml_part.cpp:
1619 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
1620 or <input type=image> was checked for focus since these elements are keyboard-focusable,
1621 but not mouse focusable. Also, this function did not work hard enough to set the focused
1622 node, and was content to clear it if the first element checked failed the test, rather
1623 than looking more at parents. This would have the effect of clearing, then resetting the
1624 focus on a DIV containing a button or image with content on either side of it in the
1625 process of arrowing over such content.
1627 2004-11-30 Ken Kocienda <kocienda@apple.com>
1631 * khtml/editing/htmlediting.cpp:
1632 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
1633 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
1634 * khtml/khtml_part.cpp:
1635 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
1636 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
1637 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
1638 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
1639 isCharacterSmartReplaceExempt virtual.
1641 2004-11-30 Ken Kocienda <kocienda@apple.com>
1645 * khtml/editing/htmlediting.cpp:
1646 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
1647 Seemed simple enough to land without review.
1649 2004-11-29 Ken Kocienda <kocienda@apple.com>
1653 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
1654 are handled correctly now, including selections that span multiple blocks, and cases
1655 where content on the pasteboard ends in newlines (or what appear to be newlines to a
1656 user, really block ends or BRs). I also made one small, but important change in the
1657 copy code to annotate the markup written to the pasteboard to support these selections
1660 New header that defines a couple of constants used in copying and pasting.
1662 * ForwardingHeaders/editing/html_interchange.h: Added.
1663 * khtml/editing/html_interchange.h: Added.
1665 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
1666 as a new helper class, ReplacementFragment, which encapsulates information and functions
1667 pertaining to a document fragment that is being inserted into a document.
1669 * khtml/editing/htmlediting.cpp:
1670 (khtml::ReplacementFragment::ReplacementFragment):
1671 (khtml::ReplacementFragment::~ReplacementFragment):
1672 (khtml::ReplacementFragment::firstChild): Simple accessor.
1673 (khtml::ReplacementFragment::lastChild): Ditto.
1674 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
1675 the starting node to use for merging into the block containing the start of the selection.
1676 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
1677 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
1678 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
1679 special annotation comment added in by the copy code.
1680 (khtml::ReplacementFragment::removeNode): Simple helper.
1681 (khtml::isComment): Simple helper.
1682 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
1683 I would like to do better than this some day, but this check will hold us until I can do better.
1684 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
1685 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
1686 (khtml::ReplaceSelectionCommand::doApply):
1687 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
1688 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
1689 (khtml::ReplacementFragment::root):
1690 (khtml::ReplacementFragment::type):
1691 (khtml::ReplacementFragment::isEmpty):
1692 (khtml::ReplacementFragment::isSingleTextNode):
1693 (khtml::ReplacementFragment::isTreeFragment):
1694 (khtml::ReplacementFragment::hasMoreThanOneBlock):
1695 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
1697 This smaller set of changes markup generation to add the newline annotation described in the
1698 comment at the start of this entry.
1700 * khtml/xml/dom2_rangeimpl.cpp:
1701 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
1702 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
1703 comment annotations are added to the markup generated.
1704 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
1705 * kwq/WebCoreBridge.mm:
1706 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
1707 DOM::RangeImpl::toHTML uses annotations when generating.
1711 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
1712 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
1713 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
1714 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
1715 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
1716 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
1717 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
1718 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
1719 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
1720 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
1721 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
1722 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
1723 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
1724 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
1725 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
1726 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
1727 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
1728 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
1730 2004-11-29 Ken Kocienda <kocienda@apple.com>
1732 Reviewed by Harrison
1734 Made two small changes that make it possible for comments to have DOM nodes made for them
1735 when pasting. This relies on some earlier work I did some days ago.
1737 * khtml/xml/dom_nodeimpl.cpp:
1738 (NodeImpl::startMarkup): Get the string from the comment.
1739 * kwq/WebCoreBridge.mm:
1740 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
1741 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
1742 be included in the DOM.
1744 2004-11-29 Ken Kocienda <kocienda@apple.com>
1746 Reviewed by Harrison
1748 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
1749 my improved paste code.
1751 * khtml/editing/visible_position.cpp:
1752 (khtml::blockRelationship)
1753 (khtml::visiblePositionsInDifferentBlocks)
1754 (khtml::isFirstVisiblePositionInBlock)
1755 (khtml::isFirstVisiblePositionInNode)
1756 (khtml::isLastVisiblePositionInBlock)
1757 * khtml/editing/visible_position.h
1759 2004-11-29 Ken Kocienda <kocienda@apple.com>
1761 Reviewed by Harrison
1763 * khtml/xml/dom_position.cpp:
1764 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
1765 specified from obeying that directive. The old code would stop at an outer block boundary in
1766 the case where that block had a block as its first child. The correct behavior is to drill into
1767 that inner block (and continue on drilling down, if possible), to find the correct position.
1769 2004-11-29 Ken Kocienda <kocienda@apple.com>
1771 Reviewed by Harrison
1773 Small improvements to the node-display debugging helpers.
1775 * khtml/xml/dom_nodeimpl.cpp:
1776 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
1777 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
1779 2004-11-29 Ken Kocienda <kocienda@apple.com>
1781 Reviewed by Harrison
1783 * khtml/editing/htmlediting.cpp:
1784 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
1785 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
1786 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
1787 place after the delete.
1789 2004-11-29 Ken Kocienda <kocienda@apple.com>
1791 Reviewed by Harrison
1793 Add a new helper function to insert a paragraph separator. Will be used in my
1794 upcoming paste improvments.
1796 * khtml/editing/htmlediting.cpp: Added function
1797 (khtml::CompositeEditCommand::insertParagraphSeparator)
1798 * khtml/editing/htmlediting.h: Ditto.
1800 2004-11-23 David Harrison <harrison@apple.com>
1802 Added various comments.
1804 * khtml/editing/htmlediting.cpp:
1805 (khtml::StyleChange::init):
1806 (khtml::ApplyStyleCommand::doApply):
1807 (khtml::ApplyStyleCommand::applyBlockStyle):
1808 (khtml::ApplyStyleCommand::applyInlineStyle):
1810 2004-11-23 David Hyatt <hyatt@apple.com>
1812 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
1813 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
1815 * khtml/rendering/render_block.cpp:
1816 (khtml::RenderBlock::nodeAtPoint):
1818 2004-11-22 David Hyatt <hyatt@apple.com>
1820 Make sure you can use document.createElement to make a <canvas> element.
1822 * khtml/xml/dom_docimpl.cpp:
1823 (DocumentImpl::createHTMLElement):
1825 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1829 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
1830 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
1831 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
1832 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
1834 * khtml/ecma/kjs_html.cpp:
1835 (KJS::HTMLDocument::tryGet):
1836 * khtml/html/html_formimpl.cpp:
1837 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
1838 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1839 * khtml/html/html_formimpl.h:
1840 * khtml/html/html_miscimpl.cpp:
1841 (HTMLCollectionImpl::HTMLCollectionImpl):
1842 (HTMLCollectionImpl::~HTMLCollectionImpl):
1843 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
1844 (HTMLCollectionImpl::CollectionInfo::reset):
1845 (HTMLCollectionImpl::resetCollectionInfo):
1846 (HTMLCollectionImpl::checkForNameMatch):
1848 (HTMLCollectionImpl::updateNameCache):
1849 (HTMLCollectionImpl::namedItems):
1850 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
1851 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1852 (HTMLFormCollectionImpl::item):
1853 (HTMLFormCollectionImpl::updateNameCache):
1854 * khtml/html/html_miscimpl.h:
1856 2004-11-22 David Hyatt <hyatt@apple.com>
1858 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
1863 * khtml/misc/loader.cpp:
1864 (CachedObject::finish):
1867 * khtml/misc/loader.h:
1868 (khtml::Cache::maxCacheableObjectSize):
1870 2004-11-22 David Hyatt <hyatt@apple.com>
1872 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
1873 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
1874 that lets us short circuit earlier when painting and hit testing.
1878 * khtml/khtml_part.cpp:
1879 (KHTMLPart::isPointInsideSelection):
1880 * khtml/rendering/render_block.cpp:
1881 (khtml::RenderBlock::paint):
1882 (khtml::RenderBlock::paintChildren):
1883 (khtml::RenderBlock::paintObject):
1884 (khtml::RenderBlock::paintFloats):
1885 (khtml::RenderBlock::nodeAtPoint):
1886 * khtml/rendering/render_block.h:
1887 * khtml/rendering/render_box.cpp:
1888 (RenderBox::nodeAtPoint):
1889 * khtml/rendering/render_box.h:
1890 * khtml/rendering/render_br.h:
1891 * khtml/rendering/render_canvas.cpp:
1892 (RenderCanvas::paint):
1893 * khtml/rendering/render_flow.cpp:
1894 (RenderFlow::paintLines):
1895 (RenderFlow::hitTestLines):
1896 (RenderFlow::caretRect):
1897 (RenderFlow::addFocusRingRects):
1898 (RenderFlow::paintFocusRing):
1899 (RenderFlow::paintOutlines):
1900 (RenderFlow::paintOutlineForLine):
1901 * khtml/rendering/render_flow.h:
1902 * khtml/rendering/render_frames.cpp:
1903 (RenderFrameSet::nodeAtPoint):
1904 * khtml/rendering/render_frames.h:
1905 * khtml/rendering/render_image.cpp:
1906 (RenderImage::nodeAtPoint):
1907 * khtml/rendering/render_image.h:
1908 * khtml/rendering/render_inline.cpp:
1909 (RenderInline::paint):
1910 (RenderInline::nodeAtPoint):
1911 * khtml/rendering/render_inline.h:
1912 * khtml/rendering/render_layer.cpp:
1913 (RenderLayer::paintLayer):
1914 (RenderLayer::hitTest):
1915 (RenderLayer::hitTestLayer):
1916 * khtml/rendering/render_layer.h:
1917 * khtml/rendering/render_line.cpp:
1918 (khtml::InlineBox::paint):
1919 (khtml::InlineBox::nodeAtPoint):
1920 (khtml::InlineFlowBox::flowObject):
1921 (khtml::InlineFlowBox::nodeAtPoint):
1922 (khtml::InlineFlowBox::paint):
1923 (khtml::InlineFlowBox::paintBackgrounds):
1924 (khtml::InlineFlowBox::paintBackground):
1925 (khtml::InlineFlowBox::paintBackgroundAndBorder):
1926 (khtml::InlineFlowBox::paintDecorations):
1927 (khtml::EllipsisBox::paint):
1928 (khtml::EllipsisBox::nodeAtPoint):
1929 (khtml::RootInlineBox::paintEllipsisBox):
1930 (khtml::RootInlineBox::paint):
1931 (khtml::RootInlineBox::nodeAtPoint):
1932 * khtml/rendering/render_line.h:
1933 (khtml::InlineRunBox::paintBackgroundAndBorder):
1934 * khtml/rendering/render_object.cpp:
1935 (RenderObject::hitTest):
1936 (RenderObject::setInnerNode):
1937 (RenderObject::nodeAtPoint):
1938 * khtml/rendering/render_object.h:
1939 (khtml::RenderObject::PaintInfo::PaintInfo):
1940 (khtml::RenderObject::PaintInfo::~PaintInfo):
1941 (khtml::RenderObject::paintingRootForChildren):
1942 (khtml::RenderObject::shouldPaintWithinRoot):
1943 * khtml/rendering/render_table.cpp:
1944 (RenderTable::layout):
1945 (RenderTable::paint):
1946 * khtml/rendering/render_text.cpp:
1947 (simpleDifferenceBetweenColors):
1948 (correctedTextColor):
1949 (InlineTextBox::nodeAtPoint):
1950 (InlineTextBox::paint):
1951 (InlineTextBox::selectionStartEnd):
1952 (InlineTextBox::paintSelection):
1953 (InlineTextBox::paintMarkedTextBackground):
1954 (InlineTextBox::paintDecoration):
1955 (RenderText::posOfChar):
1956 * khtml/rendering/render_text.h:
1957 (khtml::RenderText::paint):
1958 (khtml::RenderText::layout):
1959 (khtml::RenderText::nodeAtPoint):
1960 * khtml/xml/dom2_eventsimpl.cpp:
1961 (MouseEventImpl::computeLayerPos):
1962 * khtml/xml/dom_docimpl.cpp:
1963 (DocumentImpl::prepareMouseEvent):
1964 * kwq/KWQAccObject.mm:
1965 (-[KWQAccObject accessibilityHitTest:]):
1966 * kwq/KWQKHTMLPart.mm:
1967 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
1968 (KWQKHTMLPart::eventMayStartDrag):
1969 (KWQKHTMLPart::khtmlMouseMoveEvent):
1970 * kwq/WebCoreBridge.mm:
1971 (-[WebCoreBridge elementAtPoint:]):
1972 (-[WebCoreBridge _positionForPoint:]):
1974 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1978 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
1979 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
1981 This avoids the O(N^2) penalty for named item traversal for form collections.
1983 It also combines the item traversal logic for all non-form
1984 collection operations into a single traverseNextItem
1985 function. This avoids having 5 copies of the big switch statement
1988 Also fixed a bug that prevented the last form element from being removed properly.
1990 * khtml/html/html_formimpl.cpp:
1991 (DOM::removeFromVector):
1992 * khtml/dom/html_misc.cpp:
1993 (HTMLCollection::namedItems):
1994 * khtml/dom/html_misc.h:
1995 * khtml/ecma/kjs_html.cpp:
1996 (KJS::HTMLCollection::getNamedItems):
1997 * khtml/html/html_miscimpl.cpp:
1998 (HTMLCollectionImpl::traverseNextItem):
1999 (HTMLCollectionImpl::calcLength):
2000 (HTMLCollectionImpl::length):
2001 (HTMLCollectionImpl::item):
2002 (HTMLCollectionImpl::nextItem):
2003 (HTMLCollectionImpl::checkForNameMatch):
2004 (HTMLCollectionImpl::namedItem):
2005 (HTMLCollectionImpl::namedItems):
2006 (HTMLCollectionImpl::nextNamedItem):
2007 (HTMLFormCollectionImpl::calcLength):
2008 (HTMLFormCollectionImpl::namedItem):
2009 (HTMLFormCollectionImpl::nextNamedItem):
2010 (HTMLFormCollectionImpl::namedItems):
2011 * khtml/html/html_miscimpl.h:
2013 2004-11-22 Ken Kocienda <kocienda@apple.com>
2015 Reviewed by Harrison
2017 Change around the way we block the Javascript "Paste" command identifier from
2018 being available. Formerly, this was done with an ifdef we never compiled in.
2019 Now, this is done with a couple of cheap runtime checks. The advantage is that
2020 we can now compile this command into development builds, and still yet switch
2021 on the command in deployment builds through the use of WebCore SPI so we can
2022 write and run layout tests with all of our builds.
2024 * khtml/editing/jsediting.cpp:
2025 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
2026 command being queried is the paste command.
2027 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
2028 * khtml/editing/jsediting.h: Ditto.
2029 * khtml/khtml_part.cpp:
2030 (KHTMLPart::pasteFromPasteboard): Added.
2031 (KHTMLPart::canPaste): Added.
2032 * kwq/KWQKHTMLPart.mm:
2033 (KHTMLPart::canPaste): Added.
2034 * kwq/KWQRenderTreeDebug.cpp:
2035 (externalRepresentation): Turn on paste command.
2036 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
2038 2004-11-21 Maciej Stachowiak <mjs@apple.com>
2040 Reviewed by Richard.
2042 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
2044 * khtml/html/html_miscimpl.cpp:
2045 (HTMLCollectionImpl::calcLength):
2046 (HTMLCollectionImpl::getItem):
2047 (HTMLCollectionImpl::item):
2048 (HTMLCollectionImpl::nextItem):
2049 (HTMLCollectionImpl::getNamedItem):
2050 (HTMLCollectionImpl::namedItem):
2051 (HTMLCollectionImpl::nextNamedItemInternal):
2052 (HTMLFormCollectionImpl::nextNamedItemInternal):
2054 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2058 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
2059 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
2060 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
2062 Many optimizations to HTMLFormCollection. Iterating it should not
2063 be N^2 any more, though finding items by name could still be.
2065 * khtml/html/html_formimpl.cpp:
2066 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2067 (DOM::HTMLFormElementImpl::length):
2068 (DOM::HTMLFormElementImpl::submitClick):
2069 (DOM::HTMLFormElementImpl::formData):
2070 (DOM::HTMLFormElementImpl::submit):
2071 (DOM::HTMLFormElementImpl::reset):
2072 (DOM::HTMLFormElementImpl::radioClicked):
2073 (DOM::appendToVector):
2074 (DOM::removeFromVector):
2075 (DOM::HTMLFormElementImpl::registerFormElement):
2076 (DOM::HTMLFormElementImpl::removeFormElement):
2077 (DOM::HTMLFormElementImpl::makeFormElementDormant):
2078 (DOM::HTMLFormElementImpl::registerImgElement):
2079 (DOM::HTMLFormElementImpl::removeImgElement):
2080 * khtml/html/html_formimpl.h:
2081 * khtml/html/html_miscimpl.cpp:
2082 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
2083 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
2084 (HTMLFormCollectionImpl::resetCollectionInfo):
2085 (HTMLFormCollectionImpl::calcLength):
2086 (HTMLFormCollectionImpl::item):
2087 (HTMLFormCollectionImpl::getNamedItem):
2088 (HTMLFormCollectionImpl::getNamedFormItem):
2089 (HTMLFormCollectionImpl::firstItem):
2090 (HTMLFormCollectionImpl::nextItem):
2091 * khtml/html/html_miscimpl.h:
2092 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
2093 * khtml/xml/dom_elementimpl.cpp:
2094 (ElementImpl::setAttribute):
2095 (ElementImpl::setAttributeMap):
2096 * kwq/KWQPtrVector.h:
2097 (QPtrVector::findRef):
2098 * kwq/KWQVectorImpl.h:
2099 * kwq/KWQVectorImpl.mm:
2100 (KWQVectorImpl::findRef):
2101 * kwq/WebCoreBridge.mm:
2102 (-[WebCoreBridge elementWithName:inForm:]):
2103 (-[WebCoreBridge controlsInForm:]):
2105 2004-11-19 David Harrison <harrison@apple.com>
2107 Reviewed by Ken and Darin.
2109 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
2111 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
2112 for the existing style, but in this case (hitting cmd-B with caret at top of
2113 file) there is nothing upstream. Changed this to use the VisiblePosition
2114 deepEquivalent instead.
2116 * khtml/khtml_part.cpp:
2117 (KHTMLPart::computeAndSetTypingStyle):
2121 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2125 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
2127 * khtml/xml/dom_docimpl.cpp:
2128 (DocumentImpl::close): Don't fire the onload handler if there is a
2129 redirect pending. This is a very long-standing bug that was masked
2130 by our previously incorrect redirect logic. It used to be that an
2131 older redirect would always win. Recently we changed things so
2132 that a newer redirect would win, but a script that causes a
2133 redirect would stop parsing once complete (so if there are two
2134 redirects in the same script, the latter wins). However, we should
2135 have also prevented onload in this case. Testing with other
2136 browsers shows that onload handlers do not run at all when there
2137 is a pending redirect.
2139 2004-11-19 Ken Kocienda <kocienda@apple.com>
2141 Reviewed by Harrison
2143 Fix some object lifetime issues in these two commands. This fixes some crashes
2144 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
2146 * khtml/editing/htmlediting.cpp:
2147 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
2148 in the ancestor list. They are not ref'ed when put on list. D'uh.
2149 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
2150 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
2151 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
2153 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
2155 2004-11-19 Ken Kocienda <kocienda@apple.com>
2157 Reviewed by Harrison
2161 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
2163 * khtml/khtml_part.cpp:
2164 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
2165 declaration given the current selection, and then sets the minimum necessary style as the typing
2167 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
2168 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
2170 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
2171 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
2172 * kwq/WebCoreBridge.mm:
2173 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
2174 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
2176 2004-11-18 David Harrison <harrison@apple.com>
2180 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
2181 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
2184 (-[DOMCSSStyleDeclaration setProperty:::]):
2186 2004-11-18 Chris Blumenberg <cblu@apple.com>
2188 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
2192 * kwq/KWQKHTMLPart.mm:
2193 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
2195 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2199 - fix recursive item traversal, use traverseNextNode() instead of
2200 the buggy hand-rolled traversal.
2202 * khtml/xml/dom_nodeimpl.cpp:
2203 (NodeListImpl::recursiveItem):
2205 2004-11-17 Darin Adler <darin@apple.com>
2209 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
2211 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
2212 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
2214 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
2215 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
2216 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
2217 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
2218 an entire category of leaks we have been fixing one by one recently
2219 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
2220 stale RenderObject pointer, although I never saw it do that in practice
2221 - implemented the length and item methods for computed styles
2222 - implemented querying additional properties in computed styles (29 more)
2224 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
2225 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
2226 take a mutable style.
2227 * khtml/khtml_part.cpp:
2228 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
2229 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
2230 a computed style; also change some types to mutable style.
2231 (updateState): Update iteration of CSSProperty objects in a style declaration to use
2232 the new valuesIterator interface.
2233 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
2234 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
2235 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
2236 including accomodating the exception code that setCssText has now.
2237 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
2238 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
2239 the style attributes really was a change, although it's not an important optimization it's
2240 good to do it right.
2242 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
2243 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
2244 calling it were already removing the old property explicitly, so the code in here to remove
2245 the property again was redundant.
2247 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
2248 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
2249 * khtml/css/css_computedstyle.cpp:
2250 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
2251 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
2252 Before we had no guarantee the object would outlast us.
2253 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
2254 exception to NO_MODIFICATION_ALLOWED_ERR.
2255 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
2256 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
2257 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
2258 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
2259 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
2260 page-break-inside, position, unicode-bidi, widows, z-index.
2261 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
2262 exception to NO_MODIFICATION_ALLOWED_ERR.
2263 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
2264 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
2265 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
2266 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
2267 CSSMutableStyleDeclarationImpl.
2268 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
2269 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
2271 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
2272 now a separate class rather than a typedef.
2273 * khtml/css/cssparser.h: Ditto.
2275 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
2276 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
2277 Removed a bunch of redundant stuff from other classes in this file too.
2278 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
2279 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
2280 (DOM::CSSProperty::operator=): Added.
2281 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
2283 * khtml/css/css_valueimpl.cpp:
2284 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
2285 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
2286 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
2287 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
2288 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
2289 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
2290 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
2291 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
2292 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
2293 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
2294 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
2295 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
2296 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
2297 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
2298 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
2299 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
2300 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
2301 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
2302 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
2303 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
2304 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
2305 no styles in the list. Update to use QValueList.
2306 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
2307 parameter and set it.
2308 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
2309 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
2310 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
2311 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
2312 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
2313 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
2315 * khtml/css/cssparser.cpp:
2316 (CSSParser::parseValue): Changed to use addParsedProperties.
2317 (CSSParser::parseDeclaration): Ditto.
2318 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
2320 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
2321 * khtml/css/cssproperties.c: Regenerated.
2322 * khtml/css/cssproperties.h: Regenerated.
2324 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
2325 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
2327 * khtml/dom/css_value.cpp:
2328 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
2329 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
2330 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
2331 first doing getPropertyCSSValue and then doing cssText.
2332 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
2333 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
2334 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
2335 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
2336 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
2337 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
2338 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
2340 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
2341 * khtml/dom/dom_node.cpp: Ditto.
2343 * khtml/editing/htmlediting.h: Change some types to mutable style.
2344 * khtml/editing/htmlediting.cpp:
2345 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
2346 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
2347 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
2348 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
2349 (khtml::EditCommand::setTypingStyle): Ditto.
2350 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
2351 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
2352 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
2353 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
2354 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
2355 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
2356 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
2357 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2358 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
2359 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
2360 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
2361 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
2362 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
2364 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
2365 * khtml/html/html_baseimpl.h: Change type to mutable style.
2366 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
2368 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
2369 class as a base class, and change types to mutable style as needed.
2370 * khtml/html/html_elementimpl.cpp:
2371 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
2372 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
2373 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
2374 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
2375 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
2376 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
2378 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
2381 * khtml/html/html_tableimpl.h: Change types to mutable style.
2382 * khtml/html/html_tableimpl.cpp:
2383 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2384 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
2385 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2387 * khtml/html/htmlparser.cpp:
2388 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
2389 than using an explicit delete to make the node go away, and is required for compatibility with the
2390 changes to the NodeImpl functions.
2391 (KHTMLParser::insertNode): Ditto.
2392 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
2393 the NodeImpl functions.
2395 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
2396 now that there's no need to make the property list explictly.
2399 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
2400 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
2401 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
2403 * khtml/xml/dom_nodeimpl.cpp:
2404 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
2405 function succeeded or not for ownership purposes.
2406 (NodeImpl::replaceChild): Ditto.
2407 (NodeImpl::appendChild): Ditto.
2408 (NodeBaseImpl::insertBefore): Ditto.
2409 (NodeBaseImpl::replaceChild): Ditto.
2410 (NodeBaseImpl::appendChild): Ditto.
2411 (NodeBaseImpl::addChild): Ditto.
2413 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
2414 * WebCore-combined.exp: Regenerated.
2416 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2418 still even more build fixing
2420 * khtml/html/html_miscimpl.cpp:
2421 (HTMLCollectionImpl::resetCollectionInfo):
2423 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2427 * khtml/html/html_miscimpl.cpp:
2428 (HTMLCollectionImpl::resetCollectionInfo):
2430 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2432 Fixed build problem.
2434 * khtml/html/html_miscimpl.h:
2435 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
2437 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2441 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
2443 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
2444 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
2446 This is also a start on fixing 5 other bugs, but those need additional work to make
2447 HTMLFormCollection fast.
2449 * khtml/html/html_documentimpl.h:
2450 (DOM::HTMLDocumentImpl::collectionInfo):
2451 * khtml/html/html_formimpl.cpp:
2452 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2453 (DOM::HTMLFormElementImpl::isURLAttribute):
2454 (DOM::HTMLFormElementImpl::registerImgElement):
2455 (DOM::HTMLFormElementImpl::removeImgElement):
2456 * khtml/html/html_formimpl.h:
2457 * khtml/html/html_imageimpl.cpp:
2458 (HTMLImageElementImpl::HTMLImageElementImpl):
2459 (HTMLImageElementImpl::~HTMLImageElementImpl):
2460 * khtml/html/html_imageimpl.h:
2461 * khtml/html/html_miscimpl.cpp:
2462 (HTMLCollectionImpl::HTMLCollectionImpl):
2463 (HTMLCollectionImpl::~HTMLCollectionImpl):
2464 (HTMLCollectionImpl::updateCollectionInfo):
2465 (HTMLCollectionImpl::length):
2466 (HTMLCollectionImpl::item):
2467 (HTMLCollectionImpl::firstItem):
2468 (HTMLCollectionImpl::nextItem):
2469 (HTMLCollectionImpl::namedItem):
2470 (HTMLCollectionImpl::nextNamedItemInternal):
2471 (HTMLFormCollectionImpl::getNamedFormItem):
2472 * khtml/html/html_miscimpl.h:
2473 (DOM::HTMLCollectionImpl::):
2474 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
2475 * khtml/html/htmlparser.cpp:
2476 (KHTMLParser::getElement):
2477 * khtml/xml/dom_docimpl.cpp:
2478 (DocumentImpl::DocumentImpl):
2479 * khtml/xml/dom_docimpl.h:
2480 (DOM::DocumentImpl::incDOMTreeVersion):
2481 (DOM::DocumentImpl::domTreeVersion):
2482 * khtml/xml/dom_nodeimpl.cpp:
2486 2004-11-18 Kevin Decker <kdecker@apple.com>
2490 fixed: <rdar://problem/3841842> getPropertyID expensive
2493 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
2495 2004-11-17 David Hyatt <hyatt@apple.com>
2497 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
2498 and subsequently backed out).
2500 Reviewed by kocienda
2502 * khtml/html/html_baseimpl.cpp:
2503 (HTMLBodyElementImpl::insertedIntoDocument):
2504 * khtml/html/htmltokenizer.cpp:
2505 (khtml::HTMLTokenizer::reset):
2506 (khtml::HTMLTokenizer::scriptHandler):
2507 (khtml::HTMLTokenizer::scriptExecution):
2508 (khtml::HTMLTokenizer::write):
2509 (khtml::HTMLTokenizer::continueProcessing):
2510 (khtml::HTMLTokenizer::timerEvent):
2511 (khtml::HTMLTokenizer::notifyFinished):
2512 * khtml/html/htmltokenizer.h:
2513 * khtml/khtmlview.cpp:
2514 (KHTMLViewPrivate::KHTMLViewPrivate):
2515 (KHTMLViewPrivate::reset):
2517 (KHTMLView::layout):
2518 (KHTMLView::timerEvent):
2519 (KHTMLView::scheduleRelayout):
2520 (KHTMLView::layoutPending):
2521 (KHTMLView::haveDelayedLayoutScheduled):
2522 (KHTMLView::unscheduleRelayout):
2523 * khtml/khtmlview.h:
2524 * khtml/xml/dom_docimpl.cpp:
2525 (DocumentImpl::DocumentImpl):
2526 (DocumentImpl::close):
2527 (DocumentImpl::setParsing):
2528 (DocumentImpl::shouldScheduleLayout):
2529 (DocumentImpl::minimumLayoutDelay):
2530 (DocumentImpl::write):
2531 (DocumentImpl::finishParsing):
2532 (DocumentImpl::stylesheetLoaded):
2533 (DocumentImpl::updateStyleSelector):
2534 * khtml/xml/dom_docimpl.h:
2535 (DOM::DocumentImpl::parsing):
2536 * kwq/KWQDateTime.mm:
2537 (KWQUIEventTime::uiEventPending):
2539 2004-11-17 David Harrison <harrison@apple.com>
2541 Reviewed by Ken Kocienda.
2543 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
2544 Treat null case as meaning no post-move merge is needed.
2546 * khtml/editing/htmlediting.cpp:
2547 (khtml::DeleteSelectionCommand::initializePositionData):
2549 2004-11-17 David Harrison <harrison@apple.com>
2551 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
2552 * khtml/xml/dom_nodeimpl.cpp:
2553 (NodeImpl::displayNode):
2554 (NodeImpl::displayTree):
2555 (NodeBaseImpl::dispatchChildRemovalEvents):
2556 * khtml/xml/dom_nodeimpl.h:
2558 2004-11-16 John Sullivan <sullivan@apple.com>
2560 Reviewed by Richard.
2562 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
2564 * khtml/khtml_part.cpp:
2566 delete the list we created when we're done with it
2568 2004-11-16 Ken Kocienda <kocienda@apple.com>
2572 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
2573 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
2574 QPtrList when the list goes out of scope.
2576 * khtml/editing/htmlediting.cpp:
2577 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
2578 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
2579 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
2580 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
2581 No longer set lists to autodelete.
2582 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
2583 Call new derefNodesInList helper.
2584 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
2585 of one before, but now it does.
2587 2004-11-15 David Harrison <harrison@apple.com>
2589 Reviewed by Chris and Darin.
2591 <rdar://problem/3880304> Non-linear performance hit for style changes
2593 * khtml/xml/dom_nodeimpl.cpp:
2594 (NodeImpl::traverseNextNode):
2595 (NodeImpl::traverseNextSibling):
2596 (NodeImpl::traversePreviousNodePostOrder):
2597 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
2598 Add asserts that stayWithin is an ancestor of the returned node.
2600 2004-11-15 Darin Adler <darin@apple.com>
2604 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
2606 * khtml/css/css_computedstyle.cpp:
2607 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
2608 since there's no guarantee it's already ref'd.
2609 * khtml/css/css_valueimpl.cpp:
2610 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
2611 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
2612 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
2613 (CSSStyleDeclarationImpl::merge): Ditto.
2614 (CSSStyleDeclarationImpl::diff): Ditto.
2615 * khtml/editing/htmlediting.cpp:
2616 (khtml::StyleChange::currentlyHasStyle): Ditto.
2617 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
2618 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
2619 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
2621 2004-11-15 Darin Adler <darin@apple.com>
2625 Use separate mutable style and computed style types as appropriate.
2626 For now this should have no effect, but it prepares us for refactoring later.
2627 Also remove some unnecessary "DOM::" prefixes and in one case factor out
2630 * khtml/khtml_part.cpp:
2631 (KHTMLPart::typingStyle):
2632 (KHTMLPart::setTypingStyle):
2634 (KHTMLPart::selectionHasStyle):
2635 (KHTMLPart::selectionStartHasStyle):
2636 (KHTMLPart::selectionComputedStyle):
2637 * khtml/khtml_part.h:
2638 * khtml/khtmlpart_p.h:
2640 * khtml/css/css_base.h:
2641 * khtml/css/css_ruleimpl.cpp:
2642 (CSSStyleRuleImpl::setDeclaration):
2643 * khtml/css/css_ruleimpl.h:
2644 (DOM::CSSFontFaceRuleImpl::style):
2645 (DOM::CSSPageRuleImpl::style):
2646 (DOM::CSSStyleRuleImpl::style):
2647 (DOM::CSSStyleRuleImpl::declaration):
2648 * khtml/css/css_valueimpl.h:
2649 (DOM::CSSPrimitiveValueImpl::):
2650 * khtml/css/cssparser.cpp:
2651 (CSSParser::parseValue):
2652 (CSSParser::parseColor):
2653 (CSSParser::parseDeclaration):
2654 (CSSParser::createStyleDeclaration):
2655 * khtml/css/cssparser.h:
2656 * khtml/css/cssstyleselector.cpp:
2657 (khtml::CSSStyleSelector::addMatchedDeclaration):
2658 (khtml::CSSStyleSelector::matchRulesForList):
2659 (khtml::CSSStyleSelector::styleForElement):
2660 (khtml::CSSStyleSelector::applyDeclarations):
2661 * khtml/css/cssstyleselector.h:
2662 * khtml/css/parser.cpp:
2663 * khtml/css/parser.y:
2664 * khtml/dom/css_rule.h:
2665 * khtml/dom/css_stylesheet.h:
2666 * khtml/dom/css_value.h:
2667 * khtml/dom/dom2_views.cpp:
2668 * khtml/xml/dom2_viewsimpl.cpp:
2669 (DOM::AbstractViewImpl::getComputedStyle):
2670 * khtml/xml/dom_docimpl.cpp:
2671 (DocumentImpl::importNode):
2672 (DocumentImpl::setStyleSheet):
2673 * khtml/xml/dom_docimpl.h:
2674 * khtml/xml/dom_xmlimpl.cpp:
2675 (DOM::ProcessingInstructionImpl::setStyleSheet):
2676 * khtml/xml/dom_xmlimpl.h:
2678 * khtml/dom/css_value.cpp:
2679 (DOM::throwException): Added.
2680 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
2681 The real thing is coming with the next change to refactor.
2682 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
2683 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
2685 2004-11-15 Darin Adler <darin@apple.com>
2689 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
2691 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
2692 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
2693 node's attributes changed without sending a misleading childrenChanged call,
2694 but the childrenChanged call can happen at the exact right moment.
2695 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
2696 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
2697 the boolean true is passed in.
2699 * khtml/xml/dom_elementimpl.cpp:
2700 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
2701 (NamedAttrMapImpl::removeAttribute): Ditto.
2703 2004-11-15 John Sullivan <sullivan@apple.com>
2707 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
2708 seen often in Mail and Blot
2710 * khtml/css/css_valueimpl.cpp:
2711 (CSSStyleDeclarationImpl::copyPropertiesInSet):
2712 delete temporary list after we're done using it
2714 2004-11-15 Richard Williamson <rjw@apple.com>
2716 Fixed leak (3879883) that John found. Early return leaked
2721 * khtml/css/css_computedstyle.cpp:
2722 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2724 2004-11-15 Ken Kocienda <kocienda@apple.com>
2730 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
2732 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
2733 EditCommandPtr to its parent, but this caused a a reference cycle in composite
2734 commands as the children held a ref to their parent. Now, the parent variable
2735 is a non-retained reference to an EditCommand *. It would be nice to have a
2736 weak reference to the parent or even override deref in composite commands (but I
2737 can't since deref() is not virtual). However, this should be OK since any
2738 dangling parent pointer is a sign of a bigger object lifetime problem that
2739 would need to be addressed anyway.
2741 * khtml/css/css_valueimpl.cpp:
2742 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
2743 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
2744 just assigning the list variable passed in to the local list variable, or the list will be
2746 * khtml/editing/htmlediting.cpp:
2747 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
2748 (khtml::EditCommand::setEndingSelection): Ditto.
2749 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
2750 Unrelated to the change, but saves some ref's and deref's.
2751 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
2752 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
2753 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
2754 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
2756 2004-11-15 Maciej Stachowiak <mjs@apple.com>
2760 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
2762 * khtml/xml/dom_nodeimpl.cpp:
2763 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
2765 (NodeListImpl::recursiveLength): Adjusted for rename.
2766 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
2767 If the same offset is looked up again, just return it, otherwise, if looking up
2768 a later offset, start at the last item and proceed from there.
2769 (NodeListImpl::itemById): Apply the special document optimization to all
2770 nodes that are either a document or in a document - just walk up to make
2771 sure the node found by ID has the root node as an ancestor.
2772 (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
2773 * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
2775 2004-11-15 John Sullivan <sullivan@apple.com>
2779 - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
2781 * kwq/KWQKHTMLPart.mm:
2782 (KWQKHTMLPart::documentFragmentWithText):
2783 release mutable copy of string after we're done using it
2785 2004-11-14 Kevin Decker <kdecker@apple.com>
2789 fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
2791 * khtml/html/html_elementimpl.cpp:
2792 (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
2793 (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
2795 2004-11-13 Maciej Stachowiak <mjs@apple.com>
2799 <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
2801 * khtml/dom/dom_node.cpp:
2802 (NodeList::itemById): New method, just forward to impl.
2803 * khtml/dom/dom_node.h: Prototype it.
2804 * khtml/ecma/kjs_dom.cpp:
2805 (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
2806 let the NodeList do it. The NodeList might be able to do it more efficiently.
2807 * khtml/xml/dom_nodeimpl.cpp:
2808 (NodeListImpl::itemById): Optimize for the case where the NodeList
2809 covers the whole document. In this case, just use getElementById,
2810 then check that the element satisfies the list criteria.
2811 (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
2812 (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
2813 * khtml/xml/dom_nodeimpl.h:
2815 2004-11-12 Maciej Stachowiak <mjs@apple.com>
2819 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
2820 sometimes using a huge bogus length value.
2822 * khtml/xml/dom_nodeimpl.cpp:
2823 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
2825 2004-11-12 Darin Adler <darin@apple.com>
2829 - fixed an infinite loop in that last check-in
2831 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
2832 Added a ++i to the loop so it won't get stuck on the first element in the list.
2834 2004-11-12 Maciej Stachowiak <mjs@apple.com>
2838 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
2840 I fixed this by changing NodeLists to cache their length, but
2841 invalidate it whenever there is a change in the DOM subtree at
2842 which they are rooted. This makes NodeListImpl::recursiveLength()
2843 drop completely off the profile, since we were repeatedly getting
2844 a length for the same NodeList over and over.
2846 * khtml/xml/dom_nodeimpl.cpp:
2847 (NodeImpl::NodeImpl):
2848 (NodeImpl::~NodeImpl):
2849 (NodeImpl::registerNodeList):
2850 (NodeImpl::unregisterNodeList):
2851 (NodeImpl::notifyLocalNodeListsSubtreeModified):
2852 (NodeImpl::notifyNodeListsSubtreeModified):
2853 (NodeImpl::dispatchSubtreeModifiedEvent):
2854 (NodeListImpl::NodeListImpl):
2855 (NodeListImpl::~NodeListImpl):
2856 (NodeListImpl::recursiveLength):
2857 (NodeListImpl::recursiveItem):
2858 (NodeListImpl::rootNodeSubtreeModified):
2859 (ChildNodeListImpl::ChildNodeListImpl):
2860 (ChildNodeListImpl::length):
2861 (ChildNodeListImpl::item):
2862 (TagNodeListImpl::TagNodeListImpl):
2863 (TagNodeListImpl::length):
2864 (TagNodeListImpl::item):
2865 (NameNodeListImpl::NameNodeListImpl):
2866 (NameNodeListImpl::length):
2867 (NameNodeListImpl::item):
2868 * khtml/xml/dom_nodeimpl.h:
2870 2004-11-12 Darin Adler <darin@apple.com>
2874 - various small cleanups
2876 * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
2877 * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
2879 * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
2880 * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
2881 * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
2882 * khtml/html/htmltokenizer.cpp:
2883 (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
2884 (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
2886 * khtml/khtml_part.h: Removed docImpl function.
2887 * khtml/khtml_part.cpp: Ditto.
2889 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
2890 the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
2892 * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
2893 * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
2894 part of the change last time, which is why the build broke).
2895 (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
2896 (KWQKHTMLPart::setPolicyBaseURL): Ditto.
2897 (KWQKHTMLPart::keyEvent): Ditto.
2898 (KWQKHTMLPart::dispatchCPPEvent): Ditto.
2899 (KWQKHTMLPart::bodyBackgroundColor): Ditto.
2901 2004-11-12 Chris Blumenberg <cblu@apple.com>
2903 <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
2907 * kwq/KWQKHTMLPart.mm:
2908 (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
2912 2004-11-12 Darin Adler <darin@apple.com>
2916 - fixed a couple places that would not work for XML documents
2918 * khtml/ecma/kjs_window.cpp:
2919 (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
2920 is present on the base class.
2921 (WindowFunc::tryCall): More of the same.
2923 2004-11-12 Darin Adler <darin@apple.com>
2925 - land versions of these files generated by the newer gperf
2927 People building on Panther will continue to see these files modified.
2928 A workaround would be to install the newer gperf on our Tiger build machines.
2930 * khtml/css/cssproperties.c: Regenerated.
2931 * khtml/css/cssvalues.c: Regenerated.
2932 * khtml/html/doctypes.cpp: Regenerated.
2933 * khtml/html/kentities.c: Regenerated.
2934 * khtml/misc/htmlattrs.c: Regenerated.
2935 * khtml/misc/htmltags.c: Regenerated.
2936 * kwq/KWQColorData.c: Regenerated.
2938 2004-11-11 Richard Williamson <rjw@apple.com>
2940 Fix build horkage from previous checkin.
2942 * kwq/KWQKHTMLPart.h:
2944 2004-11-11 Darin Adler <darin@apple.com>
2948 - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
2950 * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
2952 * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
2953 * kwq/KWQKHTMLPart.mm:
2954 (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
2955 method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
2956 we started with the NSTextField as first responder, and then took focus away and gave it back, which
2957 makes dragging text work again.
2958 (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
2960 2004-11-11 David Hyatt <hyatt@apple.com>
2962 Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
2966 * khtml/html/htmltokenizer.cpp:
2967 (khtml::HTMLTokenizer::continueProcessing):
2969 2004-11-11 Ken Kocienda <kocienda@apple.com>
2973 * khtml/editing/htmlediting.cpp:
2974 (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
2975 of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
2976 with the prevailing style for the VisiblePosition class.
2977 * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files.
2978 * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
2979 (khtml::visiblePositionsInDifferentBlocks): New helper method.
2980 (khtml::isLastVisiblePositionInBlock): Ditto.
2981 (khtml::isLastVisiblePositionInNode): Ditto.
2982 * khtml/editing/visible_position.h: Add declarations for new functions.
2984 2004-11-11 Ken Kocienda <kocienda@apple.com>
2988 * khtml/editing/htmlediting.cpp:
2989 (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
2990 (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
2991 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2992 (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
2993 (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
2994 * khtml/xml/dom2_rangeimpl.cpp:
2995 (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
2996 * khtml/xml/dom2_rangeimpl.h: Ditto.
2998 2004-11-11 Ken Kocienda <kocienda@apple.com>
3000 Reviewed by Harrison
3002 Some improvements to deleting when complete lines are selected.
3004 * khtml/editing/htmlediting.cpp:
3005 (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
3006 the end of a selection is fully selected. Turn off block merging in this case.
3007 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
3008 whether a BR immediately followed a block. The old code could erroneously skip nodes.
3009 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
3010 start block is selected. This new code will now delete this block in one call, rather
3011 than iterating over each child.
3012 * khtml/editing/visible_position.cpp:
3013 (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
3014 to do the work mentioned above in the comment for that function.
3015 (khtml::isFirstVisiblePositionOnLine): Ditto.
3016 (khtml::isLastVisiblePositionOnLine): Ditto.
3017 * khtml/editing/visible_position.h: Add new functions.
3018 * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
3019 * layout-tests/editing/deleting/delete-line-001.html: Added.
3020 * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
3021 * layout-tests/editing/deleting/delete-line-002.html: Added.
3022 * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
3023 * layout-tests/editing/deleting/delete-line-003.html: Added.
3024 * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
3025 * layout-tests/editing/deleting/delete-line-004.html: Added.
3026 * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
3027 * layout-tests/editing/deleting/delete-line-005.html: Added.
3028 * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
3029 * layout-tests/editing/deleting/delete-line-006.html: Added.
3030 * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
3031 * layout-tests/editing/deleting/delete-line-007.html: Added.
3032 * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
3033 * layout-tests/editing/deleting/delete-line-008.html: Added.
3034 * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
3035 * layout-tests/editing/deleting/delete-line-009.html: Added.
3036 * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
3037 * layout-tests/editing/deleting/delete-line-010.html: Added.
3038 * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
3039 * layout-tests/editing/deleting/delete-line-011.html: Added.
3040 * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
3041 * layout-tests/editing/deleting/delete-line-012.html: Added.
3043 2004-11-11 Ken Kocienda <kocienda@apple.com>
3047 * khtml/editing/htmlediting.cpp:
3048 (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
3050 2004-11-11 Ken Kocienda <kocienda@apple.com>
3056 <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
3057 <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
3059 * khtml/editing/selection.cpp:
3060 (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
3061 the next line position when necessary.
3062 * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
3063 * layout-tests/editing/selection/move-3875618-fix.html: Added.
3064 * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
3065 * layout-tests/editing/selection/move-3875641-fix.html: Added.
3067 2004-11-11 Ken Kocienda <kocienda@apple.com>
3071 Improved some function names, at John's urging. No changes to the
3072 functions themselves.
3074 canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
3075 canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
3076 performGeneralDelete() --> handleGeneralDelete()
3078 * khtml/editing/htmlediting.cpp:
3079 (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
3080 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
3081 (khtml::DeleteSelectionCommand::handleGeneralDelete)
3082 (khtml::DeleteSelectionCommand::doApply)
3083 * khtml/editing/htmlediting.h
3085 2004-11-11 Ken Kocienda <kocienda@apple.com>
3089 Updated some layout test results that changed as a result of my last checking.
3090 Added a new test that has been in my tree for a few days.
3092 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
3093 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
3094 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
3095 * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
3097 2004-11-11 Ken Kocienda <kocienda@apple.com>
3101 * khtml/editing/htmlediting.cpp:
3102 (khtml::debugNode): New debugging helper.
3103 (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
3104 startPositionForDelete() and endPositionForDelete() functions. Just use the
3105 m_selectionToDelete object to determine start and end positions for the delete.
3106 (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
3107 function that creates a special case for deleting all the content in a root
3109 (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
3110 function before BR special case and the general case delete functions.
3111 * khtml/editing/htmlediting.h: Updated for changed functions.
3113 2004-11-10 Kevin Decker <kdecker@apple.com>
3117 Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.
3119 * khtml/ecma/kjs_dom.cpp:
3120 (DOMNodeList::tryGet): Got rid of an unnecessary node traversal.
3122 2004-11-10 Ken Kocienda <kocienda@apple.com>
3126 * khtml/editing/htmlediting.cpp:
3127 (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
3128 smart delete from the two functions below to here. There was an unnecessary double
3129 calculation of the leading and trailing whitespace positions. Also refined the trailing
3130 case so it only acts when the leading position is null (which seems to match TextEdit in
3131 my tests). Also removed some unnecessary copying of Position objects.
3132 (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
3134 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
3136 2004-11-10 Ken Kocienda <kocienda@apple.com>
3138 Reviewed by Harrison
3140 (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
3141 make things more clear.
3142 * khtml/editing/selection.cpp:
3143 (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the
3144 resulting positions do not cross block boundaries. This was a bug and caused some
3145 delete problems when whole blocks were selected. I will be addressing that issue
3146 more fully in upcoming changes.
3148 2004-11-10 Ken Kocienda <kocienda@apple.com>
3150 Reviewed by Harrison
3152 Some cleanups and fixes in upstream and downstream functions.
3154 Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement().
3155 Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the
3156 block's enclosing block will be returned.
3158 Remove code from upstream that confined the serach to block boundaries outside of
3159 the code which runs in the StayInBlock case. This code was redundant, and caused
3160 incorrect results to be returned in the DoNotStayInBlock case.
3162 In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
3163 node, not the the this pointer's node.
3165 * khtml/xml/dom_position.cpp:
3166 (DOM::Position::upstream)
3167 (DOM::Position::downstream)
3169 2004-11-09 David Hyatt <hyatt@apple.com>
3171 Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
3172 loading large local files.
3176 * khtml/html/htmltokenizer.cpp:
3177 (khtml::HTMLTokenizer::HTMLTokenizer):
3178 (khtml::HTMLTokenizer::reset):
3179 (khtml::HTMLTokenizer::write):
3180 (khtml::HTMLTokenizer::stopped):
3181 (khtml::HTMLTokenizer::processingData):
3182 (khtml::HTMLTokenizer::continueProcessing):
3183 (khtml::HTMLTokenizer::timerEvent):
3184 (khtml::HTMLTokenizer::allDataProcessed):
3185 (khtml::HTMLTokenizer::end):
3186 (khtml::HTMLTokenizer::finish):
3187 (khtml::HTMLTokenizer::notifyFinished):
3188 * khtml/html/htmltokenizer.h:
3189 * khtml/khtml_part.cpp:
3190 (KHTMLPart::slotFinished):
3193 * khtml/khtml_part.h:
3194 (KHTMLPart::tokenizerProcessedData):
3195 * khtml/khtmlview.cpp:
3196 * khtml/xml/dom_docimpl.cpp:
3197 * khtml/xml/xml_tokenizer.h:
3198 (khtml::Tokenizer::stopped):
3199 (khtml::Tokenizer::processingData):
3200 * kwq/KWQDateTime.h:
3201 * kwq/KWQDateTime.mm:
3202 (QDateTime::secsTo):
3203 (KWQUIEventTime::uiEventPending):
3204 * kwq/KWQKHTMLPart.h:
3205 * kwq/KWQKHTMLPart.mm:
3206 (KWQKHTMLPart::tokenizerProcessedData):
3207 * kwq/WebCoreBridge.h:
3208 * kwq/WebCoreBridge.mm:
3209 (-[WebCoreBridge stop]):
3210 (-[WebCoreBridge numPendingOrLoadingRequests]):
3211 (-[WebCoreBridge doneProcessingData]):
3213 2004-11-09 David Harrison <harrison@apple.com>
3215 Reviewed by Ken Kocienda.
3217 <rdar://problem/3865837> Wrong text style after delete to start of document
3219 * khtml/editing/htmlediting.cpp:
3220 (khtml::DeleteSelectionCommand::saveTypingStyleState):
3221 Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
3223 2004-11-09 Richard Williamson <rjw@apple.com>
3225 Fixed <rdar://problem/3872440> NSTimer prematurely released.
3234 2004-11-09 Chris Blumenberg <cblu@apple.com>
3238 * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
3240 2004-11-08 David Harrison <harrison@apple.com>
3242 Reviewed by Ken Kocienda.
3244 <rdar://problem/3865854> Deleting first line deletes all lines
3246 * khtml/editing/htmlediting.cpp:
3247 (khtml::DeleteSelectionCommand::performGeneralDelete):
3248 Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
3249 of its ancestors, failed to end the loop that deletes all fully selected nodes. Also,
3250 fixed this code to clear m_trailingWhitespaceValid. Also removed dead m_endingPosition
3251 update because it is handled in calculateEndingPosition now.
3252 * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
3253 * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
3255 2004-11-08 Ken Kocienda <kocienda@apple.com>
3259 * khtml/html/html_elementimpl.cpp:
3260 (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
3261 are added to the DOM.
3262 * khtml/html/html_elementimpl.h: Ditto.
3263 * khtml/html/htmlparser.cpp:
3264 (KHTMLParser::KHTMLParser): Ditto.
3265 (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
3266 * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
3267 * khtml/html/htmltokenizer.cpp:
3268 (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
3269 (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
3270 There were a couple of indexing errors that resulted in the comment text containing part of the
3272 (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
3273 * khtml/html/htmltokenizer.h: Add flag to constructor so callers can request comment nodes.
3275 2004-11-08 Chris Blumenberg <cblu@apple.com>
3277 Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
3281 * WebCore.pbproj/project.pbxproj: stop unnecessary linking
3282 * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
3283 * kwq/KWQKHTMLPart.h: ditto
3285 2004-11-08 Darin Adler <darin@apple.com>
3289 - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
3291 * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
3292 that possibly deletes the QTimer.
3294 2004-11-08 Chris Blumenberg <cblu@apple.com>
3296 Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
3300 * kwq/KWQTextField.mm:
3301 (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
3302 * kwq/WebCoreBridge.h:
3304 2004-11-08 David Harrison <harrison@apple.com>
3308 Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
3310 * khtml/editing/htmlediting.cpp:
3311 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
3312 * khtml/xml/dom_nodeimpl.cpp:
3313 (NodeImpl::enclosingInlineElement):
3314 * khtml/xml/dom_nodeimpl.h:
3316 2004-11-05 Chris Blumenberg <cblu@apple.com>
3318 Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters