1 2004-12-14 John Sullivan <sullivan@apple.com>
5 - added Undo action names for Cut, Paste, and Drag
7 * khtml/editing/htmlediting.h:
8 * khtml/editing/htmlediting.cpp:
9 (khtml::DeleteSelectionCommand::editingAction):
10 overridden to return HTMLEditActionCut
11 (khtml::MoveSelectionCommand::editingAction):
12 overridden to return HTMLEditActionDrag
13 (khtml::ReplaceSelectionCommand::editingAction):
14 overridden to return HTMLEditActionPaste
16 2004-12-14 John Sullivan <sullivan@apple.com>
20 - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu,
21 no specific action names
23 The remaining step is to make each EditCommand subclass override editingAction() to return an
24 appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
25 is not completely straightforward, so this next step isn't trivial.)
27 * khtml/editing/htmlediting.h:
28 new enum for HTMLEditAction
30 * khtml/editing/htmlediting.cpp:
31 (khtml::EditCommandPtr::editingAction):
32 new method, calls through to EditCommand
33 (khtml::EditCommand::editingAction):
34 new method for subclasses to override, returns HTMLEditActionUnspecified at this level
35 (khtml::TypingCommand::editingAction):
36 proof of concept override, returns HTMLEditActionTyping
39 declare new private bottleneck method registerCommandForUndoOrRedo
40 * kwq/KWQKHTMLPart.mm:
41 (KWQKHTMLPart::registerCommandForUndoOrRedo):
42 new bottleneck method to reduce code duplication; now calls over the bridge
43 to get the localized string to use for the Undo action name
44 (KWQKHTMLPart::registerCommandForUndo):
45 now calls new bottleneck method
46 (KWQKHTMLPart::registerCommandForRedo):
47 now calls new bottleneck method
49 * kwq/WebCoreBridge.h:
50 new enum for WebUndoAction, maps directly to HTMLEditAction.
51 Declaration of nameForUndoAction:
53 2004-12-14 Darin Adler <darin@apple.com>
57 - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)
59 * khtml/rendering/render_frames.cpp:
60 (RenderPart::~RenderPart): Check widget for nil.
61 (RenderPart::setWidget): Ditto.
62 (RenderFrame::slotViewCleared): Ditto.
63 (RenderPartObject::slotViewCleared): Ditto.
65 2004-12-13 Darin Adler <darin@apple.com>
69 - moved markup-related functions into new sources files in the editing directory
70 - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster
72 * ForwardingHeaders/editing/markup.h: Added.
73 * khtml/editing/markup.h: Added.
74 * khtml/editing/markup.cpp: Added.
76 * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.
78 * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
79 * khtml/html/html_elementimpl.cpp:
80 (HTMLElementImpl::innerHTML): Changed to call createMarkup.
81 (HTMLElementImpl::outerHTML): Ditto.
83 * khtml/ecma/kjs_window.cpp:
84 (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
85 (Window::retrieveActive): Ditto.
87 * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
88 * khtml/xml/dom_docimpl.h: Ditto.
90 * khtml/khtml_part.cpp:
91 (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
92 (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.
94 * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
95 still works even with the additional replace overloads added to QString.
96 * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.
98 * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
99 base pointer, because it used dynamic_cast in its implementation. Made the other version public.
100 * khtml/rendering/render_object.cpp: Ditto.
101 * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.
103 * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
104 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
105 the support code into markup.cpp.
107 * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
108 * khtml/xml/dom_nodeimpl.cpp: Ditto.
110 * khtml/xml/dom_position.cpp:
111 (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
112 so these return null positions rather than raising exceptions.
113 (DOM::endPosition): Ditto.
115 * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
116 * kwq/KWQFrame.h: Ditto.
117 * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
118 * kwq/KWQKPartsPart.h: Ditto.
119 * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
120 * kwq/KWQScrollView.h: Ditto.
121 * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
122 * kwq/KWQKHTMLPart.h: Ditto.
123 * kwq/KWQKHTMLPart.mm:
124 (KHTMLView::isKHTMLView): Ditto.
125 (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
126 replace overloads added to QString.
127 (KWQKHTMLPart::setStatusBarText): Ditto.
128 (KWQKHTMLPart::runJavaScriptAlert): Ditto.
129 (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
130 (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
131 (KWQKHTMLPart::attributedString): Ditto.
132 (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
133 (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).
135 * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
137 (QObject::inherits): Changed to not use dynamic cast.
138 (QObject::isKHTMLPart): Added. Returns false.
139 (QObject::isKHTMLView): Ditto.
140 (QObject::isKPartsReadOnlyPart): Ditto.
141 (QObject::isQFrame): Ditto.
142 (QObject::isQScrollView): Ditto.
144 * kwq/KWQRenderTreeDebug.cpp:
145 (write): Changed to use inherits rather than dynamic_cast.
146 (writeSelection): Ditto.
148 * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
149 than going straight on to the "no parameters at all" version.
152 * kwq/KWQString.mm: (QString::replace): Added overloads.
153 * kwq/WebCoreBridge.mm:
154 (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
155 (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
156 (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
157 the additional replace overloads added to QString.
158 (-[WebCoreBridge stringForRange:]): Ditto.
159 (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
160 (-[WebCoreBridge elementAtPoint:]): QChar conversion.
161 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
162 (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.
164 2004-12-13 Ken Kocienda <kocienda@apple.com>
170 <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
172 * khtml/editing/htmlediting.cpp:
173 (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
174 leading and trailing whitespace positions was reversed! I must have introduced this error recently
175 when changing around this code.
177 2004-12-13 David Hyatt <hyatt@apple.com>
179 Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing
180 and painting was using the wrong rect when setting up the x/y of the rect.
184 * khtml/rendering/render_block.cpp:
185 (khtml::RenderBlock::paint):
186 (khtml::RenderBlock::nodeAtPoint):
187 * khtml/rendering/render_object.h:
188 (khtml::RenderObject::floatRect):
190 2004-12-13 Ken Kocienda <kocienda@apple.com>
196 <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles
198 Code to figuire out the end node to merge was missing the font tag in the second paragraph
199 written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.
201 * khtml/editing/htmlediting.cpp:
202 (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
203 looking for the node that is the last inline in the last block of the fragment. The old algorithm was
204 insufficiently powerful.
205 (khtml::ReplacementFragment::enclosingBlock): New helper function.
206 * khtml/editing/htmlediting.h: Add declaration for new helper function.
207 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
208 * layout-tests/editing/pasteboard/paste-text-011.html: Added.
210 2004-12-13 Ken Kocienda <kocienda@apple.com>
214 WebCore side of fix for this bug:
216 <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace
218 Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
219 bug. This change involves our half of the needed changes.
221 Note that a lot of this change has to do with changing code to use a <br> element instead of
222 a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
223 other places, code to handle comments in markup can be removed since we do not use comments for
224 such annotations after this change.
226 * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
227 (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
228 (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
229 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
230 convertedSpaceSpanClassString to match other uses of the idiom used here.
231 (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
232 * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
233 (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
234 * khtml/html/html_elementimpl.cpp:
235 (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
236 annotate fragments with comments any longer.
237 * khtml/html/html_elementimpl.h: Ditto.
238 * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
239 (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
240 (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
242 * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
243 * kwq/WebCoreBridge.mm:
244 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
245 in DOM when calling createContextualFragment().
247 2004-12-10 John Sullivan <sullivan@apple.com>
249 fixed deployment build bustage that John Louch ran into
251 * kwq/KWQTextEdit.mm:
252 (QTextEdit::setScrollBarModes):
253 move bool declaration inside exception-handling block to avoid obscure
256 2004-12-10 Maciej Stachowiak <mjs@apple.com>
260 <rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
263 (QWidget::setFocus): Handle the case where setting focus removed
264 us from the superview - this can happen due to style changes on
267 2004-12-10 Ken Kocienda <kocienda@apple.com>
273 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
275 There are a number of interesting things we could do to fix this bug, including SPI and involving
276 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
277 will fix the bug in the general case until such time as we can come up with more specific
280 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
283 * khtml/editing/htmlediting.cpp:
284 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
285 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
286 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
287 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
289 2004-12-10 Darin Adler <darin@apple.com>
293 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
295 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
296 * khtml/rendering/render_form.cpp:
297 (RenderSubmitButton::rawText): Convert to QChar explicitly.
298 (RenderLineEdit::updateFromElement): Ditto.
299 (RenderLineEdit::slotTextChanged): Ditto.
300 (RenderSelect::updateFromElement): Ditto.
301 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
302 that requires a derived class. Now we don't use this class at all for WebCore, but they still
304 (TextAreaWidget::event): Moved out the ifdefs.
305 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
306 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
307 now done in setStyle.
308 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
309 that's needed and WebCore no longer has TextAreaWidget.
310 (RenderTextArea::calcMinMaxWidth): Ditto.
311 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
313 (RenderTextArea::updateFromElement): Use type QTextEdit.
314 (RenderTextArea::text): Ditto.
315 (RenderTextArea::select): Ditto.
317 * kwq/KWQTextArea.mm:
318 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
319 since it's now handled by QTextEdit.
320 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
322 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
323 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
324 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
326 2004-12-10 Ken Kocienda <kocienda@apple.com>
332 <rdar://problem/3915047> HItting return in empty document inserts <p> but
333 insertion point does not move
335 * khtml/editing/htmlediting.cpp:
336 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
337 code to insert the <p> element for the return is not detecting the fact
338 that the document is empty. Inserting a <p> into an empty body will not
339 "add a new line" as the user expects. With this change, we'll add a second
340 <p> when the root editable element has no rendered kids.
342 2004-12-10 Maciej Stachowiak <mjs@apple.com>
346 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
348 * khtml/html/html_miscimpl.cpp:
349 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
350 the initial one step, otherwise we might inadvertantly step
351 outside the collection base, thereby causing assertion failures or
354 2004-12-10 Ken Kocienda <kocienda@apple.com>
358 * khtml/editing/htmlediting.cpp:
359 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
360 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
361 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
362 should do nothing if the starting point for the selection is itself the starting block.
363 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
364 function, though the names and concepts are slightly different.
366 2004-12-10 Maciej Stachowiak <mjs@apple.com>
370 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
372 * khtml/dom/html_document.cpp:
373 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
374 * khtml/dom/html_document.h:
375 * khtml/ecma/kjs_html.cpp:
376 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
377 * khtml/html/html_miscimpl.cpp:
378 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
379 the items that can be accessed directly as a document propery, in particular forms, images,
380 objects, applets and embeds.
381 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
382 (HTMLFormCollectionImpl::updateNameCache): Ditto.
383 * khtml/html/html_miscimpl.h:
384 (DOM::HTMLCollectionImpl::): Added new type.
386 2004-12-10 Ken Kocienda <kocienda@apple.com>
392 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
394 * khtml/rendering/render_text.cpp:
395 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
397 2004-12-10 Ken Kocienda <kocienda@apple.com>
403 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
405 * khtml/editing/htmlediting.cpp:
406 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
407 that was removed from the document when pasting. This caused the disappearance. Now this
408 is detected, and the selection is shifted to a node that is in the document.
410 2004-12-09 Richard Williamson <rjw@apple.com>
412 Check to disable threaded decoding during
413 layout tests wasn't invoking function, just checking address of
414 function, which would always return true.
416 * kwq/WebCoreImageRendererFactory.m:
417 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
419 2004-12-09 David Hyatt <hyatt@apple.com>
421 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
424 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
425 all inlines when repainting.
429 * khtml/rendering/render_block.cpp:
430 (khtml::RenderBlock::layoutBlockChildren):
431 * khtml/rendering/render_flow.cpp:
432 (RenderFlow::getAbsoluteRepaintRect):
434 2004-12-09 David Hyatt <hyatt@apple.com>
436 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
437 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
438 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
439 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
443 * khtml/rendering/render_block.cpp:
444 (khtml::RenderBlock::getClearDelta):
445 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
446 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
447 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
448 * layout-tests/fast/block/margin-collapse/102-expected.txt:
449 * layout-tests/fast/block/margin-collapse/102.html:
451 2004-12-09 Richard Williamson <rjw@apple.com>
453 Fixed <rdar://problem/3914078> worldclock crashing gc related
455 Use ProtectedValue for Context2D instance members.
459 * khtml/ecma/kjs_html.h:
461 2004-12-09 John Sullivan <sullivan@apple.com>
465 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
467 * kwq/KWQAccObject.mm:
468 (-[KWQAccObject title]): moved image alt tag code out of here
469 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
470 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
471 that ordinary elements return; this means that ordinary elements that aren't images will return
472 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
474 (-[KWQAccObject accessibilityAttributeValue:]):
475 call accessibilityDescription when asked for AXDescription
477 2004-12-09 Ken Kocienda <kocienda@apple.com>
483 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
485 * khtml/editing/htmlediting.cpp:
486 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
487 been deleted. If this is the case, set the destination to the node the delete command provides in
488 its ending selection.
492 2004-12-09 Ken Kocienda <kocienda@apple.com>
498 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
500 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
501 callback may not be delivered before the program asks for the dimensions of an image in order to
502 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
503 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
505 * kwq/KWQRenderTreeDebug.cpp:
506 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
507 (externalRepresentation): Sets debuggingRenderTree flag to true;
508 * kwq/KWQRenderTreeDebug.h:
509 * kwq/WebCoreImageRendererFactory.m:
510 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
511 do threaded decoding in any case if the flag is set.
513 2004-12-09 Chris Blumenberg <cblu@apple.com>
515 Fix for busting XMLHTTPRequest.
517 Reviewed by kocienda.
519 * khtml/misc/loader.cpp:
520 (Loader::servePendingRequests): pass true for deliverAllData
522 (KIO::get): take deliverAllData param
523 (KIO::http_post): ditto
524 * kwq/KWQKJobClasses.h:
525 * kwq/KWQKJobClasses.mm:
526 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
527 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
529 2004-12-09 Ken Kocienda <kocienda@apple.com>
533 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
535 * khtml/xml/dom_nodeimpl.cpp:
536 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
538 2004-12-07 Richard Williamson <rjw@apple.com>
540 Support threaded image decoding on machines w/ > 2 CPUs.
542 Reviewed by Maciej and Chris.
544 * khtml/misc/loader.cpp:
545 (CachedImageCallback::notifyUpdate):
546 (CachedImageCallback::notifyFinished):
547 (CachedImageCallback::notifyDecodingError):
548 (CachedImageCallback::handleError):
549 (CachedImageCallback::clear):
550 (CachedImage::CachedImage):
551 (CachedImage::clear):
553 (CachedImage::checkNotify):
554 (Loader::servePendingRequests):
555 (Loader::slotFinished):
556 (Loader::numRequests):
557 (Loader::cancelRequests):
558 (Loader::removeBackgroundDecodingRequest):
559 * khtml/misc/loader.h:
560 (khtml::CachedImageCallback::CachedImageCallback):
561 (khtml::CachedImageCallback::ref):
562 (khtml::CachedImageCallback::deref):
563 (khtml::CachedImage::decoderCallback):
564 * khtml/rendering/render_object.cpp:
565 (RenderObject::setPixmap):
568 (-[WebImageCallback initWithCallback:khtml::]):
569 (-[WebImageCallback _commonTermination]):
570 (-[WebImageCallback dealloc]):
571 (-[WebImageCallback finalize]):
572 (-[WebImageCallback notify]):
573 (-[WebImageCallback setImageSourceStatus:]):
574 (-[WebImageCallback status]):
575 (QPixmap::shouldUseThreadedDecoding):
576 (QPixmap::receivedData):
577 * kwq/WebCoreImageRenderer.h:
578 * kwq/WebCoreImageRendererFactory.h:
579 * kwq/WebCoreImageRendererFactory.m:
580 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
581 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
583 2004-12-07 Ken Kocienda <kocienda@apple.com>
587 * khtml/editing/htmlediting.cpp:
588 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
589 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
590 after new block has been inserted, otherwise a crash can result. Shuffle down call
591 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
594 2004-12-07 Ken Kocienda <kocienda@apple.com>
600 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
602 * khtml/editing/htmlediting.cpp:
603 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
604 for determining the location for inserting content. Do not allow an insert before or after if the
605 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
606 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
607 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
609 2004-12-07 Darin Adler <darin@apple.com>
613 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
615 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
617 2004-12-07 Ken Kocienda <kocienda@apple.com>
621 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
622 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
624 * khtml/editing/html_interchange.h: Name change, as described above.
625 * khtml/editing/htmlediting.cpp:
626 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
627 * khtml/xml/dom2_rangeimpl.cpp:
628 (DOM::RangeImpl::toHTML): Ditto.
630 2004-12-07 Ken Kocienda <kocienda@apple.com>
634 Added a couple more layout tests.
636 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
637 * layout-tests/editing/deleting/delete-line-013.html: Added.
638 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
639 * layout-tests/editing/deleting/delete-line-014.html: Added.
641 2004-12-06 Maciej Stachowiak <mjs@apple.com>
645 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
648 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
649 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
650 (-[KWQListBoxScrollView widget]): See above.
651 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
652 afterMouseDown, to avoid triggering an assertion failure.
654 2004-12-06 David Hyatt <hyatt@apple.com>
656 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
657 made by me, kocienda and harrison to just remove it.
661 * khtml/rendering/bidi.cpp:
662 (khtml::RenderBlock::layoutInlineChildren):
663 * khtml/rendering/render_block.cpp:
664 (khtml:::RenderFlow):
665 * khtml/rendering/render_block.h:
666 * khtml/rendering/render_flow.cpp:
667 (RenderFlow::dirtyLinesFromChangedChild):
669 2004-12-06 David Hyatt <hyatt@apple.com>
671 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
672 not a damage rect that can be changed when intersected with the clip regions of the web page.
676 * khtml/rendering/render_canvas.h:
677 (khtml::RenderCanvas::printRect):
678 (khtml::RenderCanvas::setPrintRect):
679 * khtml/rendering/render_flow.cpp:
680 (RenderFlow::paintLines):
681 * khtml/rendering/render_list.cpp:
682 (RenderListMarker::paint):
683 * kwq/KWQKHTMLPart.mm:
684 (KWQKHTMLPart::adjustPageHeight):
686 2004-12-06 David Harrison <harrison@apple.com>
688 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
690 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
693 * khtml/rendering/render_flow.cpp:
694 (RenderFlow::dirtyLinesFromChangedChild):
695 Dirty the line above because new child can inval the cached line break position of previous line.
697 2004-12-06 David Hyatt <hyatt@apple.com>
699 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
700 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
701 3126929, handle top/left overflow.
703 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
705 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
706 regions and web pages) has been fixed.
710 * khtml/rendering/bidi.cpp:
711 (khtml::RenderBlock::computeHorizontalPositionsForLine):
712 (khtml::RenderBlock::checkLinesForOverflow):
713 * khtml/rendering/render_block.cpp:
714 (khtml:::RenderFlow):
715 (khtml::RenderBlock::overflowHeight):
716 (khtml::RenderBlock::overflowWidth):
717 (khtml::RenderBlock::overflowLeft):
718 (khtml::RenderBlock::overflowTop):
719 (khtml::RenderBlock::overflowRect):
720 (khtml::RenderBlock::layoutBlock):
721 (khtml::RenderBlock::layoutBlockChildren):
722 (khtml::RenderBlock::paint):
723 (khtml::RenderBlock::floatRect):
724 (khtml::RenderBlock::lowestPosition):
725 (khtml::RenderBlock::rightmostPosition):
726 (khtml::RenderBlock::leftmostPosition):
727 (khtml::RenderBlock::nodeAtPoint):
728 * khtml/rendering/render_block.h:
729 * khtml/rendering/render_box.h:
730 (khtml::RenderBox::borderBox):
731 (khtml::RenderBox::borderTopExtra):
732 (khtml::RenderBox::borderBottomExtra):
733 * khtml/rendering/render_layer.cpp:
734 (RenderLayer::paintScrollbars):
735 (mustExamineRenderer):
736 (RenderLayer::intersectsDamageRect):
737 (RenderLayer::containsPoint):
738 * khtml/rendering/render_line.cpp:
739 (khtml::InlineFlowBox::placeBoxesHorizontally):
740 (khtml::InlineFlowBox::verticallyAlignBoxes):
741 * khtml/rendering/render_line.h:
742 (khtml::InlineBox::leftOverflow):
743 (khtml::InlineBox::rightOverflow):
744 (khtml::InlineFlowBox::setVerticalOverflowPositions):
745 (khtml::RootInlineBox::RootInlineBox):
746 (khtml::RootInlineBox::leftOverflow):
747 (khtml::RootInlineBox::rightOverflow):
748 (khtml::RootInlineBox::setVerticalOverflowPositions):
749 (khtml::RootInlineBox::setHorizontalOverflowPositions):
750 * khtml/rendering/render_object.h:
751 (khtml::RenderObject::borderBox):
752 (khtml::RenderObject::overflowLeft):
753 (khtml::RenderObject::overflowTop):
754 (khtml::RenderObject::overflowRect):
755 (khtml::RenderObject::floatRect):
756 * khtml/rendering/render_table.cpp:
757 (RenderTable::layout):
758 (RenderTable::paint):
759 (RenderTable::paintBoxDecorations):
760 (RenderTable::calcMinMaxWidth):
761 * khtml/rendering/render_table.h:
762 (khtml::RenderTableCell::borderTopExtra):
763 (khtml::RenderTableCell::borderBottomExtra):
768 2004-12-06 Maciej Stachowiak <mjs@apple.com>
772 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
774 I changed all unprotected places that can navigate a different
775 window or frame from script to check for a javascript: URL, and if
776 found, to check for safety using cross-site-script rules.
778 I considered a few other possible exploits and made no change:
780 - document.location is already protected because the document
781 object itself is protected
783 - frame.src, frame.location, iframe.src and targetted links are
784 all safe because setting the URL of a frame to a javascript: URL
785 executes the script in the context of the parent
787 * khtml/ecma/kjs_window.cpp:
788 (WindowFunc::tryCall):
790 (LocationFunc::tryCall):
792 2004-12-06 Ken Kocienda <kocienda@apple.com>
798 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
800 * khtml/editing/htmlediting.cpp:
801 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
802 check for one of the special cases being checked for in this function. The specific case
803 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
804 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
805 case where a selection ended in a <br> after a block and would not delete any part of the
806 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
809 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
810 new use of the function exposed this bug:
812 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
814 * khtml/xml/dom_position.cpp:
815 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
816 not have this fatal flaw. It is a much better design as well.
818 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
819 have what I consider to be a better result. Going with it.
821 2004-12-06 Chris Blumenberg <cblu@apple.com>
823 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
828 (-[DOMElement _font]): new SPI for AppKit
831 2004-12-06 Darin Adler <darin@apple.com>
835 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
837 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
838 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
840 2004-12-06 John Sullivan <sullivan@apple.com>
842 Darin found what appears to be the real leak that we were falsely blaming
843 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
846 * khtml/css/cssparser.cpp:
847 (CSSParser::parseValue):
848 call clearProperties() instead of just setting numParsedProperties to 0
849 (CSSParser::parseDeclaration):
851 (CSSParser::createStyleDeclaration):
854 2004-12-06 Ken Kocienda <kocienda@apple.com>
860 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
861 * layout-tests/editing/inserting/insert-div-001.html: Added.
862 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
863 * layout-tests/editing/inserting/insert-div-002.html: Added.
864 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
865 * layout-tests/editing/inserting/insert-div-003.html: Added.
866 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
867 * layout-tests/editing/inserting/insert-div-004.html: Added.
868 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
869 * layout-tests/editing/inserting/insert-div-005.html: Added.
870 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
871 * layout-tests/editing/inserting/insert-div-006.html: Added.
872 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
873 * layout-tests/editing/inserting/insert-div-007.html: Added.
874 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
875 * layout-tests/editing/inserting/insert-div-008.html: Added.
876 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
877 * layout-tests/editing/inserting/insert-div-009.html: Added.
879 2004-12-06 Ken Kocienda <kocienda@apple.com>
885 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
887 * khtml/editing/htmlediting.cpp:
888 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
889 being added to this function. This ensures that the added block has a height.
890 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
892 2004-12-06 Ken Kocienda <kocienda@apple.com>
896 * khtml/dom/dom_string.cpp:
897 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
898 * khtml/dom/dom_string.h: Ditto.
899 * khtml/editing/htmlediting.cpp:
900 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
901 RebalanceWhitespaceCommand instance.
902 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
903 (khtml::InsertLineBreakCommand::doApply): Ditto.
904 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
905 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
906 (khtml::InsertTextCommand::input): Ditto.
907 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
908 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
909 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
910 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
911 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
912 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
913 * khtml/editing/htmlediting.h: Ditto.
914 (khtml::RebalanceWhitespaceCommand::): Ditto.
916 2004-12-05 Darin Adler <darin@apple.com>
918 - fixed small problem in my check-in from yesterday
921 (positionForEvent): Get location from event without raising exception if it's the wrong type.
922 (clickCountForEvent): Same, for clickCount.
923 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
924 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
925 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
927 2004-12-04 Darin Adler <darin@apple.com>
931 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
933 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
934 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
935 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
937 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
939 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
940 * khtml/rendering/render_form.cpp:
941 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
942 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
943 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
945 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
946 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
947 Added a fixState helper method so the constructors can save code.
949 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
950 and added a third constructor that uses the "current event" from AppKit (used above).
951 (QMouseEvent::fixState): Compute state and click count based on event type.
953 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
955 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
956 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
957 underlying cause in CSS.
959 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
961 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
962 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
964 2004-12-03 Chris Blumenberg <cblu@apple.com>
967 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
968 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
969 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
970 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
972 Reviewed by darin, rjw, kocienda.
974 * khtml/misc/loader.cpp:
975 (CachedObject::~CachedObject):
976 (CachedCSSStyleSheet::checkNotify):
977 (Loader::servePendingRequests):
978 (Loader::slotFinished):
979 (Loader::slotReceivedResponse):
980 (Cache::requestImage):
981 (Cache::requestScript):
982 * khtml/misc/loader.h:
983 (khtml::CachedObject::CachedObject):
984 (khtml::CachedObject::response):
985 (khtml::CachedObject::allData):
986 * kwq/KWQKJobClasses.h:
987 * kwq/KWQKJobClasses.mm:
988 (KIO::TransferJobPrivate::TransferJobPrivate):
989 (KIO::TransferJobPrivate::~TransferJobPrivate):
990 (KIO::TransferJob::TransferJob):
991 (KIO::TransferJob::assembleResponseHeaders):
992 (KIO::TransferJob::retrieveCharset):
993 (KIO::TransferJob::emitResult):
994 (KIO::TransferJob::emitReceivedResponse):
997 (KWQHeaderStringFromDictionary):
998 (KWQCheckCacheObjectStatus):
999 (KWQIsResponseURLEqualToURL):
1001 (KWQResponseMIMEType):
1002 (KWQCacheObjectExpiresTime):
1003 (khtml::CachedObject::setResponse):
1004 (khtml::CachedObject::setAllData):
1008 * kwq/KWQResourceLoader.mm:
1009 (-[KWQResourceLoader finishJobAndHandle:]):
1010 (-[KWQResourceLoader cancel]):
1011 (-[KWQResourceLoader reportError]):
1012 (-[KWQResourceLoader finishWithData:]):
1020 * kwq/WebCoreBridge.h:
1021 * kwq/WebCoreResourceLoader.h:
1023 2004-12-04 Darin Adler <darin@apple.com>
1027 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
1029 * khtml/rendering/render_form.cpp:
1030 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
1031 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
1032 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
1033 (RenderSlider::slotSliderValueChanged): Ditto.
1035 2004-12-03 John Sullivan <sullivan@apple.com>
1039 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
1040 khtml::BackgroundLayer::cullEmptyLayers
1042 * khtml/rendering/render_style.cpp:
1043 (BackgroundLayer::cullEmptyLayers):
1044 added missing nil check
1048 2004-12-03 Ken Kocienda <kocienda@apple.com>
1052 Roll out some recent changes by Chris that caused a performance regression.
1053 Fix is in hand, but it is a little risky this close to a submission. So,
1054 we have decided to roll back the change with the regression and roll in
1055 the new code after we submit.
1057 * khtml/css/cssproperties.c:
1060 * khtml/css/cssvalues.c:
1063 * khtml/misc/htmlattrs.c:
1066 * khtml/misc/htmltags.c:
1069 * khtml/misc/loader.cpp:
1070 (CachedObject::~CachedObject):
1071 (CachedObject::setResponse):
1072 (CachedCSSStyleSheet::checkNotify):
1073 (Loader::servePendingRequests):
1074 (Loader::slotFinished):
1075 (Loader::slotReceivedResponse):
1076 (Cache::requestImage):
1077 (Cache::requestScript):
1078 * khtml/misc/loader.h:
1079 (khtml::CachedObject::CachedObject):
1080 (khtml::CachedObject::response):
1081 * kwq/KWQKJobClasses.h:
1082 * kwq/KWQKJobClasses.mm:
1083 (KIO::TransferJobPrivate::TransferJobPrivate):
1084 (KIO::TransferJobPrivate::~TransferJobPrivate):
1085 (KIO::TransferJob::TransferJob):
1086 (KIO::TransferJob::assembleResponseHeaders):
1087 (KIO::TransferJob::retrieveCharset):
1088 (KIO::TransferJob::emitResult):
1089 (KIO::TransferJob::emitReceivedResponse):
1092 (KWQHeaderStringFromDictionary):
1093 (KWQCheckCacheObjectStatus):
1094 (KWQRetainResponse):
1095 (KWQReleaseResponse):
1096 (KWQIsResponseURLEqualToURL):
1098 (KWQResponseMIMEType):
1099 (KWQResponseTextEncodingName):
1100 (KWQResponseHeaderString):
1101 (KWQCacheObjectExpiresTime):
1102 (KWQLoader::KWQLoader):
1106 * kwq/KWQResourceLoader.mm:
1107 (-[KWQResourceLoader finishJobAndHandle]):
1108 (-[KWQResourceLoader cancel]):
1109 (-[KWQResourceLoader reportError]):
1110 (-[KWQResourceLoader finish]):
1118 * kwq/WebCoreBridge.h:
1119 * kwq/WebCoreResourceLoader.h:
1121 2004-12-03 John Sullivan <sullivan@apple.com>
1125 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
1127 * kwq/KWQKHTMLPart.mm:
1128 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
1129 when checking whether we moved the focus to another view, make sure we didn't "move" it to
1130 our documentView, because that's no move at all.
1132 2004-12-03 Darin Adler <darin@apple.com>
1136 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
1138 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
1139 Added missing initialization for base class and node pointer.
1141 - fixed a few places that could leave dangling node pointers
1143 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
1144 Clear out the node pointer when the node is destroyed.
1145 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
1147 2004-12-03 Chris Blumenberg <cblu@apple.com>
1149 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.
1150 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
1154 * khtml/misc/loader.cpp:
1155 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
1156 (Loader::slotFinished): take data param
1157 * khtml/misc/loader.h:
1158 * kwq/KWQKJobClasses.h:
1159 * kwq/KWQKJobClasses.mm:
1160 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
1161 (KIO::TransferJob::emitResult): take data param and pass it
1162 * kwq/KWQResourceLoader.mm:
1163 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
1164 (-[KWQResourceLoader cancel]): pass nil for data
1165 (-[KWQResourceLoader reportError]): ditto
1166 (-[KWQResourceLoader finishWithData:]): pass data
1168 (KWQSlot::KWQSlot): pass data param to slotFinished
1169 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
1171 2004-12-03 Ken Kocienda <kocienda@apple.com>
1175 Did some clean up in the Position class as a result of trying to write some new layout
1176 tests and discovering a bug along the way.
1178 I removed these three functions from the Position class:
1180 1. bool isFirstRenderedPositionOnLine() const;
1181 2. bool isLastRenderedPositionOnLine() const;
1182 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
1183 4. bool inFirstEditableInRootEditableElement() const;
1185 The first two have replacements in the VisiblePosition class, and some code has been
1186 moved to use these new variants. The third function was a helper used only by these
1187 first two function, and can be removed as well. The fourth function was not used by anyone.
1189 * khtml/editing/htmlediting.cpp:
1190 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
1191 * khtml/editing/visible_position.cpp:
1192 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
1193 Incorrect results were being returned when asking about positions at the starts of blocks.
1194 * khtml/xml/dom_position.cpp:
1195 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
1196 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
1197 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
1198 * khtml/xml/dom_position.h: Update header for deletions.
1200 2004-12-03 Ken Kocienda <kocienda@apple.com>
1204 Terminology change in execCommand command identifiers. Specifically, the name of
1205 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
1206 terminology used by AppKit. It is also more accurate, since the insertion of a
1207 "br" element is what the command does. The inspiration for this change is so the
1208 -insertNewline AppKit method can be mapped to insert a new "div" element in
1209 a document and avoid ambiguity with what the javascript editing command does.
1211 * khtml/editing/jsediting.cpp
1212 * layout-tests/editing/deleting/delete-tab-004.html
1213 * layout-tests/editing/editing.js
1214 * layout-tests/editing/inserting/insert-3654864-fix.html
1215 * layout-tests/editing/inserting/insert-3659587-fix.html
1216 * layout-tests/editing/inserting/insert-3775316-fix.html
1217 * layout-tests/editing/inserting/insert-3800346-fix.html
1218 * layout-tests/editing/inserting/insert-br-001.html
1219 * layout-tests/editing/inserting/insert-br-002.html
1220 * layout-tests/editing/inserting/insert-br-003.html
1221 * layout-tests/editing/inserting/insert-br-004.html
1222 * layout-tests/editing/inserting/insert-br-005.html
1223 * layout-tests/editing/inserting/insert-br-006.html
1224 * layout-tests/editing/inserting/insert-br-007.html
1225 * layout-tests/editing/inserting/insert-br-008.html
1226 * layout-tests/editing/inserting/insert-tab-004.html
1227 * layout-tests/editing/inserting/insert-text-with-newlines.html
1228 * layout-tests/editing/pasteboard/paste-text-010.html
1230 2004-12-02 Ken Kocienda <kocienda@apple.com>
1236 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
1238 * khtml/editing/htmlediting.cpp:
1239 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
1240 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
1241 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
1242 in a block and the document is in quirks mode, add an additional br to make the one in the
1243 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
1244 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
1245 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
1247 2004-12-02 Richard Williamson <rjw@apple.com>
1249 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
1251 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
1252 the b/f cache won't incorrectly trash the previous state when restoring.
1256 * kwq/WebCoreBridge.h:
1257 * kwq/WebCoreBridge.mm:
1258 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
1259 (-[WebCoreBridge canCachePage]):
1260 (-[WebCoreBridge clear]):
1262 2004-12-02 Ken Kocienda <kocienda@apple.com>
1268 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
1270 * khtml/xml/dom2_rangeimpl.cpp:
1271 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
1272 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
1273 of this bug where there is content after the body tag). Did a little code clean up as well.
1274 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
1276 2004-12-02 Ken Kocienda <kocienda@apple.com>
1282 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
1284 * khtml/khtml_part.cpp:
1285 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
1286 to figure out which end of the selection to extend.
1288 2004-12-02 David Harrison <harrison@apple.com>
1290 Reviewed by Ken Kocienda.
1292 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
1293 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
1295 * khtml/editing/visible_text.cpp:
1296 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1297 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
1298 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
1299 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
1300 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
1301 Distinguish BR from whitespace.
1302 * khtml/editing/visible_text.h:
1303 Distinguish BR from whitespace.
1304 * khtml/editing/visible_units.cpp:
1305 (khtml::previousWordBoundary):
1306 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.
1308 2004-12-02 Ken Kocienda <kocienda@apple.com>
1314 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
1316 * khtml/xml/dom_position.cpp:
1317 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
1318 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
1319 exception trying to use a Position returned from this function to set the boundary point of a Range (which
1320 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
1321 contract to return a range-compliant position, hence the need for this fix.
1323 2004-12-01 Ken Kocienda <kocienda@apple.com>
1329 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
1330 regard to other editing commands. The class had a name change ages ago, and it was never
1332 * khtml/editing/htmlediting.h: Ditto.
1334 2004-12-01 Ken Kocienda <kocienda@apple.com>
1338 Some improvements for paste, including some new code to annotate
1339 whitespace when writing to the pasteboard to ensure that the meaning
1340 of the markup on the pasteboard is unambiguous.
1342 There is also new code for reading this annotated markup from the pasteboard,
1343 removing the nodes that were added only to prevent ambiguity.
1345 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
1346 The header should have been added earlier, but I did not do so.
1347 * khtml/editing/html_interchange.cpp: Added.
1348 (convertHTMLTextToInterchangeFormat):
1349 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
1350 * khtml/editing/htmlediting.cpp:
1351 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
1352 Also fixed a bug in the code that counts blocks in a fragment.
1353 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
1354 (khtml::ReplacementFragment::insertNodeBefore): New helper.
1355 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
1356 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
1357 * khtml/editing/htmlediting.h: Add some new declarations.
1358 * khtml/xml/dom2_rangeimpl.cpp:
1359 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
1360 * khtml/xml/dom_nodeimpl.cpp:
1361 (NodeImpl::stringValueForRange): New helper.
1362 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
1363 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
1364 should be added. Called by the paste code.
1365 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
1367 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
1368 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
1369 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
1371 2004-11-30 Chris Blumenberg <cblu@apple.com>
1373 * ChangeLog: removed conflict marker
1375 2004-11-30 Chris Blumenberg <cblu@apple.com>
1378 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
1379 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
1383 * khtml/misc/loader.cpp:
1384 (CachedObject::~CachedObject): release m_allData
1385 (CachedObject::setAllData): new
1386 (Loader::servePendingRequests): connect slotAllData
1387 (Loader::slotAllData): new
1388 (Cache::requestImage): tweak
1389 * khtml/misc/loader.h:
1390 (khtml::CachedObject::CachedObject): set allData to 0
1391 (khtml::CachedObject::allData): new
1392 * kwq/KWQKJobClasses.h:
1393 * kwq/KWQKJobClasses.mm:
1394 (KIO::TransferJob::TransferJob): set m_allData
1395 (KIO::TransferJob::emitAllData): new
1397 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
1398 * kwq/KWQResourceLoader.mm:
1399 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
1401 (KWQSlot::KWQSlot): support for slotAllData
1403 * kwq/WebCoreBridge.h:
1404 * kwq/WebCoreResourceLoader.h:
1406 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1410 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1414 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
1416 * khtml/khtml_part.cpp:
1417 (KHTMLPart::begin): call setParsing on document here after opening
1418 - from now on we'll only set parsing to true for a document open
1419 caused by page loading, not a programmatic one.
1420 * khtml/xml/dom_docimpl.cpp:
1421 (DocumentImpl::open): don't setParsing to true here any more.
1423 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1427 - fix recent regression from collection perf fixes.
1429 * khtml/html/html_miscimpl.cpp:
1430 (HTMLFormCollectionImpl::updateNameCache): Look up the name
1431 attribute in the name cache, not the id cache (d'oh!)
1433 2004-11-30 Darin Adler <darin@apple.com>
1437 - rolled in a KDE fix for a problem that may underlie a number of crashes
1439 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
1440 the KDE guys to fix a subtle problem. Code said "n = n =".
1442 - rolled in a KDE fix for a containingBlock crash
1444 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
1445 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
1448 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
1451 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
1452 (-[KWQButton detachQButton]): Added.
1453 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
1454 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
1455 (-[KWQButton widget]): Added.
1456 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
1457 (-[KWQButton resignFirstResponder]): Ditto.
1458 (-[KWQButton canBecomeKeyView]): Ditto.
1459 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
1460 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
1462 * kwq/KWQComboBox.mm:
1463 (QComboBox::~QComboBox): Call detachQComboBox.
1464 (-[KWQPopUpButtonCell detachQComboBox]): Added.
1465 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
1466 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
1467 (-[KWQPopUpButton action:]): Ditto.
1468 (-[KWQPopUpButton widget]): Tweaked.
1469 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
1470 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
1471 (-[KWQPopUpButton resignFirstResponder]): Ditto.
1472 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
1474 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
1476 * kwq/KWQListBox.mm:
1477 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
1479 * kwq/KWQScrollBar.h: Removed m_scroller field.
1480 * kwq/KWQScrollBar.mm:
1481 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
1482 (-[KWQScrollBar detachQScrollBar]): Added.
1483 (-[KWQScrollBar widget]): Added.
1484 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
1485 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
1486 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
1487 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
1488 (QScrollBar::setKnobProportion): Ditto.
1489 (QScrollBar::scrollbarHit): Ditto.
1491 * kwq/KWQScrollView.mm:
1492 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
1493 hack where we don't remove right away when doing mouse tracking.
1494 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
1495 the hack where we don't add right away when doing mouse tracking.
1497 * kwq/KWQSlider.h: Added destructor.
1499 (-[KWQSlider initWithQSlider:]): Tweaked a little.
1500 (-[KWQSlider detachQSlider]): Added.
1501 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
1502 (-[KWQSlider widget]): Added.
1503 (QSlider::~QSlider): Added. Calls detachQSlider.
1505 * kwq/KWQTextArea.h: Added detachQTextEdit method.
1506 * kwq/KWQTextArea.mm:
1507 (-[KWQTextArea detachQTextEdit]): Added.
1508 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
1509 (-[KWQTextArea becomeFirstResponder]): Ditto.
1510 (-[KWQTextArea nextKeyView]): Ditto.
1511 (-[KWQTextArea previousKeyView]): Ditto.
1512 (-[KWQTextArea drawRect:]): Ditto.
1513 (-[KWQTextAreaTextView insertTab:]): Ditto.
1514 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
1515 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
1516 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
1517 (-[KWQTextAreaTextView mouseDown:]): Ditto.
1518 (-[KWQTextAreaTextView keyDown:]): Ditto.
1519 (-[KWQTextAreaTextView keyUp:]): Ditto.
1521 * kwq/KWQTextEdit.h: Added ~QTextEdit.
1522 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
1524 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
1525 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
1527 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
1528 Added beforeMouseDown and afterMouseDown for use in widget implementations.
1529 Removed unused hasMouseTracking function.
1531 (QWidget::QWidget): Initialize two new fields.
1532 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
1533 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
1534 (QWidget::addToSuperview): Added.
1535 (QWidget::removeFromSuperview): Added.
1536 (QWidget::beforeMouseDown): Added.
1537 (QWidget::afterMouseDown): Added.
1539 * khtml/rendering/render_layer.cpp:
1540 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
1541 (RenderLayer::setHasVerticalScrollbar): Ditto.
1543 2004-11-30 Ken Kocienda <kocienda@apple.com>
1549 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
1551 * khtml/khtml_part.cpp:
1552 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
1553 with no blink if it is.
1555 2004-11-30 Ken Kocienda <kocienda@apple.com>
1561 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
1563 * khtml/khtml_part.cpp:
1564 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
1565 or <input type=image> was checked for focus since these elements are keyboard-focusable,
1566 but not mouse focusable. Also, this function did not work hard enough to set the focused
1567 node, and was content to clear it if the first element checked failed the test, rather
1568 than looking more at parents. This would have the effect of clearing, then resetting the
1569 focus on a DIV containing a button or image with content on either side of it in the
1570 process of arrowing over such content.
1572 2004-11-30 Ken Kocienda <kocienda@apple.com>
1576 * khtml/editing/htmlediting.cpp:
1577 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
1578 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
1579 * khtml/khtml_part.cpp:
1580 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
1581 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
1582 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
1583 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
1584 isCharacterSmartReplaceExempt virtual.
1586 2004-11-30 Ken Kocienda <kocienda@apple.com>
1590 * khtml/editing/htmlediting.cpp:
1591 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
1592 Seemed simple enough to land without review.
1594 2004-11-29 Ken Kocienda <kocienda@apple.com>
1598 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
1599 are handled correctly now, including selections that span multiple blocks, and cases
1600 where content on the pasteboard ends in newlines (or what appear to be newlines to a
1601 user, really block ends or BRs). I also made one small, but important change in the
1602 copy code to annotate the markup written to the pasteboard to support these selections
1605 New header that defines a couple of constants used in copying and pasting.
1607 * ForwardingHeaders/editing/html_interchange.h: Added.
1608 * khtml/editing/html_interchange.h: Added.
1610 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
1611 as a new helper class, ReplacementFragment, which encapsulates information and functions
1612 pertaining to a document fragment that is being inserted into a document.
1614 * khtml/editing/htmlediting.cpp:
1615 (khtml::ReplacementFragment::ReplacementFragment):
1616 (khtml::ReplacementFragment::~ReplacementFragment):
1617 (khtml::ReplacementFragment::firstChild): Simple accessor.
1618 (khtml::ReplacementFragment::lastChild): Ditto.
1619 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
1620 the starting node to use for merging into the block containing the start of the selection.
1621 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
1622 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
1623 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
1624 special annotation comment added in by the copy code.
1625 (khtml::ReplacementFragment::removeNode): Simple helper.
1626 (khtml::isComment): Simple helper.
1627 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
1628 I would like to do better than this some day, but this check will hold us until I can do better.
1629 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
1630 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
1631 (khtml::ReplaceSelectionCommand::doApply):
1632 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
1633 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
1634 (khtml::ReplacementFragment::root):
1635 (khtml::ReplacementFragment::type):
1636 (khtml::ReplacementFragment::isEmpty):
1637 (khtml::ReplacementFragment::isSingleTextNode):
1638 (khtml::ReplacementFragment::isTreeFragment):
1639 (khtml::ReplacementFragment::hasMoreThanOneBlock):
1640 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
1642 This smaller set of changes markup generation to add the newline annotation described in the
1643 comment at the start of this entry.
1645 * khtml/xml/dom2_rangeimpl.cpp:
1646 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
1647 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
1648 comment annotations are added to the markup generated.
1649 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
1650 * kwq/WebCoreBridge.mm:
1651 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
1652 DOM::RangeImpl::toHTML uses annotations when generating.
1656 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
1657 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
1658 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
1659 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
1660 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
1661 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
1662 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
1663 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
1664 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
1665 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
1666 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
1667 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
1668 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
1669 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
1670 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
1671 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
1672 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
1673 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
1675 2004-11-29 Ken Kocienda <kocienda@apple.com>
1677 Reviewed by Harrison
1679 Made two small changes that make it possible for comments to have DOM nodes made for them
1680 when pasting. This relies on some earlier work I did some days ago.
1682 * khtml/xml/dom_nodeimpl.cpp:
1683 (NodeImpl::startMarkup): Get the string from the comment.
1684 * kwq/WebCoreBridge.mm:
1685 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
1686 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
1687 be included in the DOM.
1689 2004-11-29 Ken Kocienda <kocienda@apple.com>
1691 Reviewed by Harrison
1693 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
1694 my improved paste code.
1696 * khtml/editing/visible_position.cpp:
1697 (khtml::blockRelationship)
1698 (khtml::visiblePositionsInDifferentBlocks)
1699 (khtml::isFirstVisiblePositionInBlock)
1700 (khtml::isFirstVisiblePositionInNode)
1701 (khtml::isLastVisiblePositionInBlock)
1702 * khtml/editing/visible_position.h
1704 2004-11-29 Ken Kocienda <kocienda@apple.com>
1706 Reviewed by Harrison
1708 * khtml/xml/dom_position.cpp:
1709 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
1710 specified from obeying that directive. The old code would stop at an outer block boundary in
1711 the case where that block had a block as its first child. The correct behavior is to drill into
1712 that inner block (and continue on drilling down, if possible), to find the correct position.
1714 2004-11-29 Ken Kocienda <kocienda@apple.com>
1716 Reviewed by Harrison
1718 Small improvements to the node-display debugging helpers.
1720 * khtml/xml/dom_nodeimpl.cpp:
1721 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
1722 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
1724 2004-11-29 Ken Kocienda <kocienda@apple.com>
1726 Reviewed by Harrison
1728 * khtml/editing/htmlediting.cpp:
1729 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
1730 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
1731 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
1732 place after the delete.
1734 2004-11-29 Ken Kocienda <kocienda@apple.com>
1736 Reviewed by Harrison
1738 Add a new helper function to insert a paragraph separator. Will be used in my
1739 upcoming paste improvments.
1741 * khtml/editing/htmlediting.cpp: Added function
1742 (khtml::CompositeEditCommand::insertParagraphSeparator)
1743 * khtml/editing/htmlediting.h: Ditto.
1745 2004-11-23 David Harrison <harrison@apple.com>
1747 Added various comments.
1749 * khtml/editing/htmlediting.cpp:
1750 (khtml::StyleChange::init):
1751 (khtml::ApplyStyleCommand::doApply):
1752 (khtml::ApplyStyleCommand::applyBlockStyle):
1753 (khtml::ApplyStyleCommand::applyInlineStyle):
1755 2004-11-23 David Hyatt <hyatt@apple.com>
1757 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
1758 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
1760 * khtml/rendering/render_block.cpp:
1761 (khtml::RenderBlock::nodeAtPoint):
1763 2004-11-22 David Hyatt <hyatt@apple.com>
1765 Make sure you can use document.createElement to make a <canvas> element.
1767 * khtml/xml/dom_docimpl.cpp:
1768 (DocumentImpl::createHTMLElement):
1770 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1774 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
1775 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
1776 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
1777 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
1779 * khtml/ecma/kjs_html.cpp:
1780 (KJS::HTMLDocument::tryGet):
1781 * khtml/html/html_formimpl.cpp:
1782 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
1783 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1784 * khtml/html/html_formimpl.h:
1785 * khtml/html/html_miscimpl.cpp:
1786 (HTMLCollectionImpl::HTMLCollectionImpl):
1787 (HTMLCollectionImpl::~HTMLCollectionImpl):
1788 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
1789 (HTMLCollectionImpl::CollectionInfo::reset):
1790 (HTMLCollectionImpl::resetCollectionInfo):
1791 (HTMLCollectionImpl::checkForNameMatch):
1793 (HTMLCollectionImpl::updateNameCache):
1794 (HTMLCollectionImpl::namedItems):
1795 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
1796 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1797 (HTMLFormCollectionImpl::item):
1798 (HTMLFormCollectionImpl::updateNameCache):
1799 * khtml/html/html_miscimpl.h:
1801 2004-11-22 David Hyatt <hyatt@apple.com>
1803 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
1808 * khtml/misc/loader.cpp:
1809 (CachedObject::finish):
1812 * khtml/misc/loader.h:
1813 (khtml::Cache::maxCacheableObjectSize):
1815 2004-11-22 David Hyatt <hyatt@apple.com>
1817 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
1818 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
1819 that lets us short circuit earlier when painting and hit testing.
1823 * khtml/khtml_part.cpp:
1824 (KHTMLPart::isPointInsideSelection):
1825 * khtml/rendering/render_block.cpp:
1826 (khtml::RenderBlock::paint):
1827 (khtml::RenderBlock::paintChildren):
1828 (khtml::RenderBlock::paintObject):
1829 (khtml::RenderBlock::paintFloats):
1830 (khtml::RenderBlock::nodeAtPoint):
1831 * khtml/rendering/render_block.h:
1832 * khtml/rendering/render_box.cpp:
1833 (RenderBox::nodeAtPoint):
1834 * khtml/rendering/render_box.h:
1835 * khtml/rendering/render_br.h:
1836 * khtml/rendering/render_canvas.cpp:
1837 (RenderCanvas::paint):
1838 * khtml/rendering/render_flow.cpp:
1839 (RenderFlow::paintLines):
1840 (RenderFlow::hitTestLines):
1841 (RenderFlow::caretRect):
1842 (RenderFlow::addFocusRingRects):
1843 (RenderFlow::paintFocusRing):
1844 (RenderFlow::paintOutlines):
1845 (RenderFlow::paintOutlineForLine):
1846 * khtml/rendering/render_flow.h:
1847 * khtml/rendering/render_frames.cpp:
1848 (RenderFrameSet::nodeAtPoint):
1849 * khtml/rendering/render_frames.h:
1850 * khtml/rendering/render_image.cpp:
1851 (RenderImage::nodeAtPoint):
1852 * khtml/rendering/render_image.h:
1853 * khtml/rendering/render_inline.cpp:
1854 (RenderInline::paint):
1855 (RenderInline::nodeAtPoint):
1856 * khtml/rendering/render_inline.h:
1857 * khtml/rendering/render_layer.cpp:
1858 (RenderLayer::paintLayer):
1859 (RenderLayer::hitTest):
1860 (RenderLayer::hitTestLayer):
1861 * khtml/rendering/render_layer.h:
1862 * khtml/rendering/render_line.cpp:
1863 (khtml::InlineBox::paint):
1864 (khtml::InlineBox::nodeAtPoint):
1865 (khtml::InlineFlowBox::flowObject):
1866 (khtml::InlineFlowBox::nodeAtPoint):
1867 (khtml::InlineFlowBox::paint):
1868 (khtml::InlineFlowBox::paintBackgrounds):
1869 (khtml::InlineFlowBox::paintBackground):
1870 (khtml::InlineFlowBox::paintBackgroundAndBorder):
1871 (khtml::InlineFlowBox::paintDecorations):
1872 (khtml::EllipsisBox::paint):
1873 (khtml::EllipsisBox::nodeAtPoint):
1874 (khtml::RootInlineBox::paintEllipsisBox):
1875 (khtml::RootInlineBox::paint):
1876 (khtml::RootInlineBox::nodeAtPoint):
1877 * khtml/rendering/render_line.h:
1878 (khtml::InlineRunBox::paintBackgroundAndBorder):
1879 * khtml/rendering/render_object.cpp:
1880 (RenderObject::hitTest):
1881 (RenderObject::setInnerNode):
1882 (RenderObject::nodeAtPoint):
1883 * khtml/rendering/render_object.h:
1884 (khtml::RenderObject::PaintInfo::PaintInfo):
1885 (khtml::RenderObject::PaintInfo::~PaintInfo):
1886 (khtml::RenderObject::paintingRootForChildren):
1887 (khtml::RenderObject::shouldPaintWithinRoot):
1888 * khtml/rendering/render_table.cpp:
1889 (RenderTable::layout):
1890 (RenderTable::paint):
1891 * khtml/rendering/render_text.cpp:
1892 (simpleDifferenceBetweenColors):
1893 (correctedTextColor):
1894 (InlineTextBox::nodeAtPoint):
1895 (InlineTextBox::paint):
1896 (InlineTextBox::selectionStartEnd):
1897 (InlineTextBox::paintSelection):
1898 (InlineTextBox::paintMarkedTextBackground):
1899 (InlineTextBox::paintDecoration):
1900 (RenderText::posOfChar):
1901 * khtml/rendering/render_text.h:
1902 (khtml::RenderText::paint):
1903 (khtml::RenderText::layout):
1904 (khtml::RenderText::nodeAtPoint):
1905 * khtml/xml/dom2_eventsimpl.cpp:
1906 (MouseEventImpl::computeLayerPos):
1907 * khtml/xml/dom_docimpl.cpp:
1908 (DocumentImpl::prepareMouseEvent):
1909 * kwq/KWQAccObject.mm:
1910 (-[KWQAccObject accessibilityHitTest:]):
1911 * kwq/KWQKHTMLPart.mm:
1912 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
1913 (KWQKHTMLPart::eventMayStartDrag):
1914 (KWQKHTMLPart::khtmlMouseMoveEvent):
1915 * kwq/WebCoreBridge.mm:
1916 (-[WebCoreBridge elementAtPoint:]):
1917 (-[WebCoreBridge _positionForPoint:]):
1919 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1923 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
1924 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
1926 This avoids the O(N^2) penalty for named item traversal for form collections.
1928 It also combines the item traversal logic for all non-form
1929 collection operations into a single traverseNextItem
1930 function. This avoids having 5 copies of the big switch statement
1933 Also fixed a bug that prevented the last form element from being removed properly.
1935 * khtml/html/html_formimpl.cpp:
1936 (DOM::removeFromVector):
1937 * khtml/dom/html_misc.cpp:
1938 (HTMLCollection::namedItems):
1939 * khtml/dom/html_misc.h:
1940 * khtml/ecma/kjs_html.cpp:
1941 (KJS::HTMLCollection::getNamedItems):
1942 * khtml/html/html_miscimpl.cpp:
1943 (HTMLCollectionImpl::traverseNextItem):
1944 (HTMLCollectionImpl::calcLength):
1945 (HTMLCollectionImpl::length):
1946 (HTMLCollectionImpl::item):
1947 (HTMLCollectionImpl::nextItem):
1948 (HTMLCollectionImpl::checkForNameMatch):
1949 (HTMLCollectionImpl::namedItem):
1950 (HTMLCollectionImpl::namedItems):
1951 (HTMLCollectionImpl::nextNamedItem):
1952 (HTMLFormCollectionImpl::calcLength):
1953 (HTMLFormCollectionImpl::namedItem):
1954 (HTMLFormCollectionImpl::nextNamedItem):
1955 (HTMLFormCollectionImpl::namedItems):
1956 * khtml/html/html_miscimpl.h:
1958 2004-11-22 Ken Kocienda <kocienda@apple.com>
1960 Reviewed by Harrison
1962 Change around the way we block the Javascript "Paste" command identifier from
1963 being available. Formerly, this was done with an ifdef we never compiled in.
1964 Now, this is done with a couple of cheap runtime checks. The advantage is that
1965 we can now compile this command into development builds, and still yet switch
1966 on the command in deployment builds through the use of WebCore SPI so we can
1967 write and run layout tests with all of our builds.
1969 * khtml/editing/jsediting.cpp:
1970 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
1971 command being queried is the paste command.
1972 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
1973 * khtml/editing/jsediting.h: Ditto.
1974 * khtml/khtml_part.cpp:
1975 (KHTMLPart::pasteFromPasteboard): Added.
1976 (KHTMLPart::canPaste): Added.
1977 * kwq/KWQKHTMLPart.mm:
1978 (KHTMLPart::canPaste): Added.
1979 * kwq/KWQRenderTreeDebug.cpp:
1980 (externalRepresentation): Turn on paste command.
1981 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
1983 2004-11-21 Maciej Stachowiak <mjs@apple.com>
1985 Reviewed by Richard.
1987 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
1989 * khtml/html/html_miscimpl.cpp:
1990 (HTMLCollectionImpl::calcLength):
1991 (HTMLCollectionImpl::getItem):
1992 (HTMLCollectionImpl::item):
1993 (HTMLCollectionImpl::nextItem):
1994 (HTMLCollectionImpl::getNamedItem):
1995 (HTMLCollectionImpl::namedItem):
1996 (HTMLCollectionImpl::nextNamedItemInternal):
1997 (HTMLFormCollectionImpl::nextNamedItemInternal):
1999 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2003 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
2004 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
2005 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
2007 Many optimizations to HTMLFormCollection. Iterating it should not
2008 be N^2 any more, though finding items by name could still be.
2010 * khtml/html/html_formimpl.cpp:
2011 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2012 (DOM::HTMLFormElementImpl::length):
2013 (DOM::HTMLFormElementImpl::submitClick):
2014 (DOM::HTMLFormElementImpl::formData):
2015 (DOM::HTMLFormElementImpl::submit):
2016 (DOM::HTMLFormElementImpl::reset):
2017 (DOM::HTMLFormElementImpl::radioClicked):
2018 (DOM::appendToVector):
2019 (DOM::removeFromVector):
2020 (DOM::HTMLFormElementImpl::registerFormElement):
2021 (DOM::HTMLFormElementImpl::removeFormElement):
2022 (DOM::HTMLFormElementImpl::makeFormElementDormant):
2023 (DOM::HTMLFormElementImpl::registerImgElement):
2024 (DOM::HTMLFormElementImpl::removeImgElement):
2025 * khtml/html/html_formimpl.h:
2026 * khtml/html/html_miscimpl.cpp:
2027 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
2028 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
2029 (HTMLFormCollectionImpl::resetCollectionInfo):
2030 (HTMLFormCollectionImpl::calcLength):
2031 (HTMLFormCollectionImpl::item):
2032 (HTMLFormCollectionImpl::getNamedItem):
2033 (HTMLFormCollectionImpl::getNamedFormItem):
2034 (HTMLFormCollectionImpl::firstItem):
2035 (HTMLFormCollectionImpl::nextItem):
2036 * khtml/html/html_miscimpl.h:
2037 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
2038 * khtml/xml/dom_elementimpl.cpp:
2039 (ElementImpl::setAttribute):
2040 (ElementImpl::setAttributeMap):
2041 * kwq/KWQPtrVector.h:
2042 (QPtrVector::findRef):
2043 * kwq/KWQVectorImpl.h:
2044 * kwq/KWQVectorImpl.mm:
2045 (KWQVectorImpl::findRef):
2046 * kwq/WebCoreBridge.mm:
2047 (-[WebCoreBridge elementWithName:inForm:]):
2048 (-[WebCoreBridge controlsInForm:]):
2050 2004-11-19 David Harrison <harrison@apple.com>
2052 Reviewed by Ken and Darin.
2054 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
2056 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
2057 for the existing style, but in this case (hitting cmd-B with caret at top of
2058 file) there is nothing upstream. Changed this to use the VisiblePosition
2059 deepEquivalent instead.
2061 * khtml/khtml_part.cpp:
2062 (KHTMLPart::computeAndSetTypingStyle):
2066 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2070 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
2072 * khtml/xml/dom_docimpl.cpp:
2073 (DocumentImpl::close): Don't fire the onload handler if there is a
2074 redirect pending. This is a very long-standing bug that was masked
2075 by our previously incorrect redirect logic. It used to be that an
2076 older redirect would always win. Recently we changed things so
2077 that a newer redirect would win, but a script that causes a
2078 redirect would stop parsing once complete (so if there are two
2079 redirects in the same script, the latter wins). However, we should
2080 have also prevented onload in this case. Testing with other
2081 browsers shows that onload handlers do not run at all when there
2082 is a pending redirect.
2084 2004-11-19 Ken Kocienda <kocienda@apple.com>
2086 Reviewed by Harrison
2088 Fix some object lifetime issues in these two commands. This fixes some crashes
2089 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
2091 * khtml/editing/htmlediting.cpp:
2092 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
2093 in the ancestor list. They are not ref'ed when put on list. D'uh.
2094 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
2095 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
2096 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
2098 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
2100 2004-11-19 Ken Kocienda <kocienda@apple.com>
2102 Reviewed by Harrison
2106 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
2108 * khtml/khtml_part.cpp:
2109 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
2110 declaration given the current selection, and then sets the minimum necessary style as the typing
2112 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
2113 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
2115 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
2116 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
2117 * kwq/WebCoreBridge.mm:
2118 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
2119 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
2121 2004-11-18 David Harrison <harrison@apple.com>
2125 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
2126 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
2129 (-[DOMCSSStyleDeclaration setProperty:::]):
2131 2004-11-18 Chris Blumenberg <cblu@apple.com>
2133 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
2137 * kwq/KWQKHTMLPart.mm:
2138 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
2140 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2144 - fix recursive item traversal, use traverseNextNode() instead of
2145 the buggy hand-rolled traversal.
2147 * khtml/xml/dom_nodeimpl.cpp:
2148 (NodeListImpl::recursiveItem):
2150 2004-11-17 Darin Adler <darin@apple.com>
2154 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
2156 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
2157 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
2159 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
2160 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
2161 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
2162 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
2163 an entire category of leaks we have been fixing one by one recently
2164 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
2165 stale RenderObject pointer, although I never saw it do that in practice
2166 - implemented the length and item methods for computed styles
2167 - implemented querying additional properties in computed styles (29 more)
2169 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
2170 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
2171 take a mutable style.
2172 * khtml/khtml_part.cpp:
2173 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
2174 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
2175 a computed style; also change some types to mutable style.
2176 (updateState): Update iteration of CSSProperty objects in a style declaration to use
2177 the new valuesIterator interface.
2178 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
2179 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
2180 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
2181 including accomodating the exception code that setCssText has now.
2182 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
2183 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
2184 the style attributes really was a change, although it's not an important optimization it's
2185 good to do it right.
2187 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
2188 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
2189 calling it were already removing the old property explicitly, so the code in here to remove
2190 the property again was redundant.
2192 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
2193 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
2194 * khtml/css/css_computedstyle.cpp:
2195 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
2196 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
2197 Before we had no guarantee the object would outlast us.
2198 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
2199 exception to NO_MODIFICATION_ALLOWED_ERR.
2200 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
2201 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
2202 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
2203 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
2204 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
2205 page-break-inside, position, unicode-bidi, widows, z-index.
2206 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
2207 exception to NO_MODIFICATION_ALLOWED_ERR.
2208 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
2209 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
2210 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
2211 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
2212 CSSMutableStyleDeclarationImpl.
2213 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
2214 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
2216 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
2217 now a separate class rather than a typedef.
2218 * khtml/css/cssparser.h: Ditto.
2220 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
2221 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
2222 Removed a bunch of redundant stuff from other classes in this file too.
2223 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
2224 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
2225 (DOM::CSSProperty::operator=): Added.
2226 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
2228 * khtml/css/css_valueimpl.cpp:
2229 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
2230 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
2231 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
2232 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
2233 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
2234 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
2235 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
2236 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
2237 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
2238 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
2239 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
2240 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
2241 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
2242 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
2243 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
2244 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
2245 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
2246 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
2247 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
2248 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
2249 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
2250 no styles in the list. Update to use QValueList.
2251 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
2252 parameter and set it.
2253 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
2254 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
2255 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
2256 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
2257 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
2258 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
2260 * khtml/css/cssparser.cpp:
2261 (CSSParser::parseValue): Changed to use addParsedProperties.
2262 (CSSParser::parseDeclaration): Ditto.
2263 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
2265 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
2266 * khtml/css/cssproperties.c: Regenerated.
2267 * khtml/css/cssproperties.h: Regenerated.
2269 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
2270 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
2272 * khtml/dom/css_value.cpp:
2273 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
2274 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
2275 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
2276 first doing getPropertyCSSValue and then doing cssText.
2277 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
2278 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
2279 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
2280 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
2281 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
2282 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
2283 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
2285 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
2286 * khtml/dom/dom_node.cpp: Ditto.
2288 * khtml/editing/htmlediting.h: Change some types to mutable style.
2289 * khtml/editing/htmlediting.cpp:
2290 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
2291 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
2292 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
2293 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
2294 (khtml::EditCommand::setTypingStyle): Ditto.
2295 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
2296 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
2297 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
2298 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
2299 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
2300 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
2301 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
2302 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2303 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
2304 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
2305 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
2306 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
2307 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
2309 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
2310 * khtml/html/html_baseimpl.h: Change type to mutable style.
2311 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
2313 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
2314 class as a base class, and change types to mutable style as needed.
2315 * khtml/html/html_elementimpl.cpp:
2316 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
2317 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
2318 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
2319 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
2320 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
2321 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
2323 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
2326 * khtml/html/html_tableimpl.h: Change types to mutable style.
2327 * khtml/html/html_tableimpl.cpp:
2328 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2329 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
2330 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2332 * khtml/html/htmlparser.cpp:
2333 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
2334 than using an explicit delete to make the node go away, and is required for compatibility with the
2335 changes to the NodeImpl functions.
2336 (KHTMLParser::insertNode): Ditto.
2337 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
2338 the NodeImpl functions.
2340 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
2341 now that there's no need to make the property list explictly.
2344 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
2345 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
2346 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
2348 * khtml/xml/dom_nodeimpl.cpp:
2349 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
2350 function succeeded or not for ownership purposes.
2351 (NodeImpl::replaceChild): Ditto.
2352 (NodeImpl::appendChild): Ditto.
2353 (NodeBaseImpl::insertBefore): Ditto.
2354 (NodeBaseImpl::replaceChild): Ditto.
2355 (NodeBaseImpl::appendChild): Ditto.
2356 (NodeBaseImpl::addChild): Ditto.
2358 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
2359 * WebCore-combined.exp: Regenerated.
2361 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2363 still even more build fixing
2365 * khtml/html/html_miscimpl.cpp:
2366 (HTMLCollectionImpl::resetCollectionInfo):
2368 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2372 * khtml/html/html_miscimpl.cpp:
2373 (HTMLCollectionImpl::resetCollectionInfo):
2375 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2377 Fixed build problem.
2379 * khtml/html/html_miscimpl.h:
2380 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
2382 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2386 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
2388 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
2389 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
2391 This is also a start on fixing 5 other bugs, but those need additional work to make
2392 HTMLFormCollection fast.
2394 * khtml/html/html_documentimpl.h:
2395 (DOM::HTMLDocumentImpl::collectionInfo):
2396 * khtml/html/html_formimpl.cpp:
2397 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2398 (DOM::HTMLFormElementImpl::isURLAttribute):
2399 (DOM::HTMLFormElementImpl::registerImgElement):
2400 (DOM::HTMLFormElementImpl::removeImgElement):
2401 * khtml/html/html_formimpl.h:
2402 * khtml/html/html_imageimpl.cpp:
2403 (HTMLImageElementImpl::HTMLImageElementImpl):
2404 (HTMLImageElementImpl::~HTMLImageElementImpl):
2405 * khtml/html/html_imageimpl.h:
2406 * khtml/html/html_miscimpl.cpp:
2407 (HTMLCollectionImpl::HTMLCollectionImpl):
2408 (HTMLCollectionImpl::~HTMLCollectionImpl):
2409 (HTMLCollectionImpl::updateCollectionInfo):
2410 (HTMLCollectionImpl::length):
2411 (HTMLCollectionImpl::item):
2412 (HTMLCollectionImpl::firstItem):
2413 (HTMLCollectionImpl::nextItem):
2414 (HTMLCollectionImpl::namedItem):
2415 (HTMLCollectionImpl::nextNamedItemInternal):
2416 (HTMLFormCollectionImpl::getNamedFormItem):
2417 * khtml/html/html_miscimpl.h:
2418 (DOM::HTMLCollectionImpl::):
2419 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
2420 * khtml/html/htmlparser.cpp:
2421 (KHTMLParser::getElement):
2422 * khtml/xml/dom_docimpl.cpp:
2423 (DocumentImpl::DocumentImpl):
2424 * khtml/xml/dom_docimpl.h:
2425 (DOM::DocumentImpl::incDOMTreeVersion):
2426 (DOM::DocumentImpl::domTreeVersion):
2427 * khtml/xml/dom_nodeimpl.cpp:
2431 2004-11-18 Kevin Decker <kdecker@apple.com>
2435 fixed: <rdar://problem/3841842> getPropertyID expensive
2438 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
2440 2004-11-17 David Hyatt <hyatt@apple.com>
2442 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
2443 and subsequently backed out).
2445 Reviewed by kocienda
2447 * khtml/html/html_baseimpl.cpp:
2448 (HTMLBodyElementImpl::insertedIntoDocument):
2449 * khtml/html/htmltokenizer.cpp:
2450 (khtml::HTMLTokenizer::reset):
2451 (khtml::HTMLTokenizer::scriptHandler):
2452 (khtml::HTMLTokenizer::scriptExecution):
2453 (khtml::HTMLTokenizer::write):
2454 (khtml::HTMLTokenizer::continueProcessing):
2455 (khtml::HTMLTokenizer::timerEvent):
2456 (khtml::HTMLTokenizer::notifyFinished):
2457 * khtml/html/htmltokenizer.h:
2458 * khtml/khtmlview.cpp:
2459 (KHTMLViewPrivate::KHTMLViewPrivate):
2460 (KHTMLViewPrivate::reset):
2462 (KHTMLView::layout):
2463 (KHTMLView::timerEvent):
2464 (KHTMLView::scheduleRelayout):
2465 (KHTMLView::layoutPending):
2466 (KHTMLView::haveDelayedLayoutScheduled):
2467 (KHTMLView::unscheduleRelayout):
2468 * khtml/khtmlview.h:
2469 * khtml/xml/dom_docimpl.cpp:
2470 (DocumentImpl::DocumentImpl):
2471 (DocumentImpl::close):
2472 (DocumentImpl::setParsing):
2473 (DocumentImpl::shouldScheduleLayout):
2474 (DocumentImpl::minimumLayoutDelay):
2475 (DocumentImpl::write):
2476 (DocumentImpl::finishParsing):
2477 (DocumentImpl::stylesheetLoaded):
2478 (DocumentImpl::updateStyleSelector):
2479 * khtml/xml/dom_docimpl.h:
2480 (DOM::DocumentImpl::parsing):
2481 * kwq/KWQDateTime.mm:
2482 (KWQUIEventTime::uiEventPending):
2484 2004-11-17 David Harrison <harrison@apple.com>
2486 Reviewed by Ken Kocienda.
2488 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
2489 Treat null case as meaning no post-move merge is needed.
2491 * khtml/editing/htmlediting.cpp:
2492 (khtml::DeleteSelectionCommand::initializePositionData):
2494 2004-11-17 David Harrison <harrison@apple.com>
2496 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
2497 * khtml/xml/dom_nodeimpl.cpp:
2498 (NodeImpl::displayNode):
2499 (NodeImpl::displayTree):
2500 (NodeBaseImpl::dispatchChildRemovalEvents):
2501 * khtml/xml/dom_nodeimpl.h:
2503 2004-11-16 John Sullivan <sullivan@apple.com>
2505 Reviewed by Richard.
2507 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
2509 * khtml/khtml_part.cpp:
2511 delete the list we created when we're done with it
2513 2004-11-16 Ken Kocienda <kocienda@apple.com>
2517 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
2518 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
2519 QPtrList when the list goes out of scope.
2521 * khtml/editing/htmlediting.cpp:
2522 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
2523 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
2524 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
2525 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
2526 No longer set lists to autodelete.
2527 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
2528 Call new derefNodesInList helper.
2529 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
2530 of one before, but now it does.
2532 2004-11-15 David Harrison <harrison@apple.com>
2534 Reviewed by Chris and Darin.
2536 <rdar://problem/3880304> Non-linear performance hit for style changes
2538 * khtml/xml/dom_nodeimpl.cpp:
2539 (NodeImpl::traverseNextNode):
2540 (NodeImpl::traverseNextSibling):
2541 (NodeImpl::traversePreviousNodePostOrder):
2542 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
2543 Add asserts that stayWithin is an ancestor of the returned node.
2545 2004-11-15 Darin Adler <darin@apple.com>
2549 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
2551 * khtml/css/css_computedstyle.cpp:
2552 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
2553 since there's no guarantee it's already ref'd.
2554 * khtml/css/css_valueimpl.cpp:
2555 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
2556 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
2557 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
2558 (CSSStyleDeclarationImpl::merge): Ditto.
2559 (CSSStyleDeclarationImpl::diff): Ditto.
2560 * khtml/editing/htmlediting.cpp:
2561 (khtml::StyleChange::currentlyHasStyle): Ditto.
2562 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
2563 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
2564 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
2566 2004-11-15 Darin Adler <darin@apple.com>
2570 Use separate mutable style and computed style types as appropriate.
2571 For now this should have no effect, but it prepares us for refactoring later.
2572 Also remove some unnecessary "DOM::" prefixes and in one case factor out
2575 * khtml/khtml_part.cpp:
2576 (KHTMLPart::typingStyle):
2577 (KHTMLPart::setTypingStyle):
2579 (KHTMLPart::selectionHasStyle):
2580 (KHTMLPart::selectionStartHasStyle):
2581 (KHTMLPart::selectionComputedStyle):
2582 * khtml/khtml_part.h:
2583 * khtml/khtmlpart_p.h:
2585 * khtml/css/css_base.h:
2586 * khtml/css/css_ruleimpl.cpp:
2587 (CSSStyleRuleImpl::setDeclaration):
2588 * khtml/css/css_ruleimpl.h:
2589 (DOM::CSSFontFaceRuleImpl::style):
2590 (DOM::CSSPageRuleImpl::style):
2591 (DOM::CSSStyleRuleImpl::style):
2592 (DOM::CSSStyleRuleImpl::declaration):
2593 * khtml/css/css_valueimpl.h:
2594 (DOM::CSSPrimitiveValueImpl::):
2595 * khtml/css/cssparser.cpp:
2596 (CSSParser::parseValue):
2597 (CSSParser::parseColor):
2598 (CSSParser::parseDeclaration):
2599 (CSSParser::createStyleDeclaration):
2600 * khtml/css/cssparser.h:
2601 * khtml/css/cssstyleselector.cpp:
2602 (khtml::CSSStyleSelector::addMatchedDeclaration):
2603 (khtml::CSSStyleSelector::matchRulesForList):
2604 (khtml::CSSStyleSelector::styleForElement):
2605 (khtml::CSSStyleSelector::applyDeclarations):
2606 * khtml/css/cssstyleselector.h:
2607 * khtml/css/parser.cpp:
2608 * khtml/css/parser.y:
2609 * khtml/dom/css_rule.h:
2610 * khtml/dom/css_stylesheet.h:
2611 * khtml/dom/css_value.h:
2612 * khtml/dom/dom2_views.cpp:
2613 * khtml/xml/dom2_viewsimpl.cpp:
2614 (DOM::AbstractViewImpl::getComputedStyle):
2615 * khtml/xml/dom_docimpl.cpp:
2616 (DocumentImpl::importNode):
2617 (DocumentImpl::setStyleSheet):
2618 * khtml/xml/dom_docimpl.h:
2619 * khtml/xml/dom_xmlimpl.cpp:
2620 (DOM::ProcessingInstructionImpl::setStyleSheet):
2621 * khtml/xml/dom_xmlimpl.h:
2623 * khtml/dom/css_value.cpp:
2624 (DOM::throwException): Added.
2625 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
2626 The real thing is coming with the next change to refactor.
2627 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
2628 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
2630 2004-11-15 Darin Adler <darin@apple.com>
2634 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
2636 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
2637 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
2638 node's attributes changed without sending a misleading childrenChanged call,
2639 but the childrenChanged call can happen at the exact right moment.
2640 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
2641 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
2642 the boolean true is passed in.
2644 * khtml/xml/dom_elementimpl.cpp:
2645 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
2646 (NamedAttrMapImpl::removeAttribute): Ditto.
2648 2004-11-15 John Sullivan <sullivan@apple.com>
2652 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
2653 seen often in Mail and Blot
2655 * khtml/css/css_valueimpl.cpp:
2656 (CSSStyleDeclarationImpl::copyPropertiesInSet):
2657 delete temporary list after we're done using it
2659 2004-11-15 Richard Williamson <rjw@apple.com>
2661 Fixed leak (3879883) that John found. Early return leaked
2666 * khtml/css/css_computedstyle.cpp:
2667 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2669 2004-11-15 Ken Kocienda <kocienda@apple.com>
2675 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
2677 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
2678 EditCommandPtr to its parent, but this caused a a reference cycle in composite
2679 commands as the children held a ref to their parent. Now, the parent variable
2680 is a non-retained reference to an EditCommand *. It would be nice to have a
2681 weak reference to the parent or even override deref in composite commands (but I
2682 can't since deref() is not virtual). However, this should be OK since any
2683 dangling parent pointer is a sign of a bigger object lifetime problem that
2684 would need to be addressed anyway.
2686 * khtml/css/css_valueimpl.cpp:
2687 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
2688 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
2689 just assigning the list variable passed in to the local list variable, or the list will be
2691 * khtml/editing/htmlediting.cpp:
2692 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
2693 (khtml::EditCommand::setEndingSelection): Ditto.
2694 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
2695 Unrelated to the change, but saves some ref's and deref's.
2696 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
2697 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
2698 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
2699 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
2701 2004-11-15 Maciej Stachowiak <mjs@apple.com>
2705 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
2707 * khtml/xml/dom_nodeimpl.cpp:
2708 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
2710 (NodeListImpl::recursiveLength): Adjusted for rename.
2711 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
2712 If the same offset is looked up again, just return it, otherwise, if looking up
2713 a later offset, start at the last item and proceed from there.
2714 (NodeListImpl::itemById): Apply the special document optimization to all
2715 nodes that are either a document or in a document - just walk up to make
2716 sure the node found by ID has the root node as an ancestor.
2717 (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
2718 * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
2720 2004-11-15 John Sullivan <sullivan@apple.com>
2724 - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
2726 * kwq/KWQKHTMLPart.mm:
2727 (KWQKHTMLPart::documentFragmentWithText):
2728 release mutable copy of string after we're done using it
2730 2004-11-14 Kevin Decker <kdecker@apple.com>
2734 fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
2736 * khtml/html/html_elementimpl.cpp:
2737 (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
2738 (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
2740 2004-11-13 Maciej Stachowiak <mjs@apple.com>
2744 <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
2746 * khtml/dom/dom_node.cpp:
2747 (NodeList::itemById): New method, just forward to impl.
2748 * khtml/dom/dom_node.h: Prototype it.
2749 * khtml/ecma/kjs_dom.cpp:
2750 (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
2751 let the NodeList do it. The NodeList might be able to do it more efficiently.
2752 * khtml/xml/dom_nodeimpl.cpp:
2753 (NodeListImpl::itemById): Optimize for the case where the NodeList
2754 covers the whole document. In this case, just use getElementById,
2755 then check that the element satisfies the list criteria.
2756 (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
2757 (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
2758 * khtml/xml/dom_nodeimpl.h:
2760 2004-11-12 Maciej Stachowiak <mjs@apple.com>
2764 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
2765 sometimes using a huge bogus length value.
2767 * khtml/xml/dom_nodeimpl.cpp:
2768 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
2770 2004-11-12 Darin Adler <darin@apple.com>
2774 - fixed an infinite loop in that last check-in
2776 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
2777 Added a ++i to the loop so it won't get stuck on the first element in the list.
2779 2004-11-12 Maciej Stachowiak <mjs@apple.com>
2783 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
2785 I fixed this by changing NodeLists to cache their length, but
2786 invalidate it whenever there is a change in the DOM subtree at
2787 which they are rooted. This makes NodeListImpl::recursiveLength()
2788 drop completely off the profile, since we were repeatedly getting
2789 a length for the same NodeList over and over.
2791 * khtml/xml/dom_nodeimpl.cpp:
2792 (NodeImpl::NodeImpl):
2793 (NodeImpl::~NodeImpl):
2794 (NodeImpl::registerNodeList):
2795 (NodeImpl::unregisterNodeList):
2796 (NodeImpl::notifyLocalNodeListsSubtreeModified):
2797 (NodeImpl::notifyNodeListsSubtreeModified):
2798 (NodeImpl::dispatchSubtreeModifiedEvent):
2799 (NodeListImpl::NodeListImpl):
2800 (NodeListImpl::~NodeListImpl):
2801 (NodeListImpl::recursiveLength):
2802 (NodeListImpl::recursiveItem):
2803 (NodeListImpl::rootNodeSubtreeModified):
2804 (ChildNodeListImpl::ChildNodeListImpl):
2805 (ChildNodeListImpl::length):
2806 (ChildNodeListImpl::item):
2807 (TagNodeListImpl::TagNodeListImpl):
2808 (TagNodeListImpl::length):
2809 (TagNodeListImpl::item):
2810 (NameNodeListImpl::NameNodeListImpl):
2811 (NameNodeListImpl::length):
2812 (NameNodeListImpl::item):
2813 * khtml/xml/dom_nodeimpl.h:
2815 2004-11-12 Darin Adler <darin@apple.com>
2819 - various small cleanups
2821 * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
2822 * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
2824 * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
2825 * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
2826 * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
2827 * khtml/html/htmltokenizer.cpp:
2828 (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
2829 (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
2831 * khtml/khtml_part.h: Removed docImpl function.
2832 * khtml/khtml_part.cpp: Ditto.
2834 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
2835 the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
2837 * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
2838 * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
2839 part of the change last time, which is why the build broke).
2840 (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
2841 (KWQKHTMLPart::setPolicyBaseURL): Ditto.
2842 (KWQKHTMLPart::keyEvent): Ditto.
2843 (KWQKHTMLPart::dispatchCPPEvent): Ditto.
2844 (KWQKHTMLPart::bodyBackgroundColor): Ditto.
2846 2004-11-12 Chris Blumenberg <cblu@apple.com>
2848 <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
2852 * kwq/KWQKHTMLPart.mm:
2853 (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
2857 2004-11-12 Darin Adler <darin@apple.com>
2861 - fixed a couple places that would not work for XML documents
2863 * khtml/ecma/kjs_window.cpp:
2864 (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
2865 is present on the base class.
2866 (WindowFunc::tryCall): More of the same.
2868 2004-11-12 Darin Adler <darin@apple.com>
2870 - land versions of these files generated by the newer gperf
2872 People building on Panther will continue to see these files modified.
2873 A workaround would be to install the newer gperf on our Tiger build machines.
2875 * khtml/css/cssproperties.c: Regenerated.
2876 * khtml/css/cssvalues.c: Regenerated.
2877 * khtml/html/doctypes.cpp: Regenerated.
2878 * khtml/html/kentities.c: Regenerated.
2879 * khtml/misc/htmlattrs.c: Regenerated.
2880 * khtml/misc/htmltags.c: Regenerated.
2881 * kwq/KWQColorData.c: Regenerated.
2883 2004-11-11 Richard Williamson <rjw@apple.com>
2885 Fix build horkage from previous checkin.
2887 * kwq/KWQKHTMLPart.h:
2889 2004-11-11 Darin Adler <darin@apple.com>
2893 - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
2895 * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
2897 * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
2898 * kwq/KWQKHTMLPart.mm:
2899 (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
2900 method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
2901 we started with the NSTextField as first responder, and then took focus away and gave it back, which
2902 makes dragging text work again.
2903 (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
2905 2004-11-11 David Hyatt <hyatt@apple.com>
2907 Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
2911 * khtml/html/htmltokenizer.cpp:
2912 (khtml::HTMLTokenizer::continueProcessing):
2914 2004-11-11 Ken Kocienda <kocienda@apple.com>
2918 * khtml/editing/htmlediting.cpp:
2919 (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
2920 of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
2921 with the prevailing style for the VisiblePosition class.
2922 * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files.
2923 * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
2924 (khtml::visiblePositionsInDifferentBlocks): New helper method.
2925 (khtml::isLastVisiblePositionInBlock): Ditto.
2926 (khtml::isLastVisiblePositionInNode): Ditto.
2927 * khtml/editing/visible_position.h: Add declarations for new functions.
2929 2004-11-11 Ken Kocienda <kocienda@apple.com>
2933 * khtml/editing/htmlediting.cpp:
2934 (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
2935 (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
2936 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2937 (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
2938 (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
2939 * khtml/xml/dom2_rangeimpl.cpp:
2940 (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
2941 * khtml/xml/dom2_rangeimpl.h: Ditto.
2943 2004-11-11 Ken Kocienda <kocienda@apple.com>
2945 Reviewed by Harrison
2947 Some improvements to deleting when complete lines are selected.
2949 * khtml/editing/htmlediting.cpp:
2950 (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
2951 the end of a selection is fully selected. Turn off block merging in this case.
2952 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
2953 whether a BR immediately followed a block. The old code could erroneously skip nodes.
2954 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
2955 start block is selected. This new code will now delete this block in one call, rather
2956 than iterating over each child.
2957 * khtml/editing/visible_position.cpp:
2958 (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
2959 to do the work mentioned above in the comment for that function.
2960 (khtml::isFirstVisiblePositionOnLine): Ditto.
2961 (khtml::isLastVisiblePositionOnLine): Ditto.
2962 * khtml/editing/visible_position.h: Add new functions.
2963 * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
2964 * layout-tests/editing/deleting/delete-line-001.html: Added.
2965 * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
2966 * layout-tests/editing/deleting/delete-line-002.html: Added.
2967 * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
2968 * layout-tests/editing/deleting/delete-line-003.html: Added.
2969 * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
2970 * layout-tests/editing/deleting/delete-line-004.html: Added.
2971 * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
2972 * layout-tests/editing/deleting/delete-line-005.html: Added.
2973 * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
2974 * layout-tests/editing/deleting/delete-line-006.html: Added.
2975 * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
2976 * layout-tests/editing/deleting/delete-line-007.html: Added.
2977 * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
2978 * layout-tests/editing/deleting/delete-line-008.html: Added.
2979 * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
2980 * layout-tests/editing/deleting/delete-line-009.html: Added.
2981 * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
2982 * layout-tests/editing/deleting/delete-line-010.html: Added.
2983 * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
2984 * layout-tests/editing/deleting/delete-line-011.html: Added.
2985 * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
2986 * layout-tests/editing/deleting/delete-line-012.html: Added.
2988 2004-11-11 Ken Kocienda <kocienda@apple.com>
2992 * khtml/editing/htmlediting.cpp:
2993 (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
2995 2004-11-11 Ken Kocienda <kocienda@apple.com>
3001 <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
3002 <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
3004 * khtml/editing/selection.cpp:
3005 (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
3006 the next line position when necessary.
3007 * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
3008 * layout-tests/editing/selection/move-3875618-fix.html: Added.
3009 * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
3010 * layout-tests/editing/selection/move-3875641-fix.html: Added.
3012 2004-11-11 Ken Kocienda <kocienda@apple.com>
3016 Improved some function names, at John's urging. No changes to the
3017 functions themselves.
3019 canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
3020 canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
3021 performGeneralDelete() --> handleGeneralDelete()
3023 * khtml/editing/htmlediting.cpp:
3024 (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
3025 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
3026 (khtml::DeleteSelectionCommand::handleGeneralDelete)
3027 (khtml::DeleteSelectionCommand::doApply)
3028 * khtml/editing/htmlediting.h
3030 2004-11-11 Ken Kocienda <kocienda@apple.com>
3034 Updated some layout test results that changed as a result of my last checking.
3035 Added a new test that has been in my tree for a few days.
3037 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
3038 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
3039 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
3040 * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
3042 2004-11-11 Ken Kocienda <kocienda@apple.com>
3046 * khtml/editing/htmlediting.cpp:
3047 (khtml::debugNode): New debugging helper.
3048 (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
3049 startPositionForDelete() and endPositionForDelete() functions. Just use the
3050 m_selectionToDelete object to determine start and end positions for the delete.
3051 (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
3052 function that creates a special case for deleting all the content in a root
3054 (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
3055 function before BR special case and the general case delete functions.
3056 * khtml/editing/htmlediting.h: Updated for changed functions.
3058 2004-11-10 Kevin Decker <kdecker@apple.com>
3062 Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.
3064 * khtml/ecma/kjs_dom.cpp:
3065 (DOMNodeList::tryGet): Got rid of an unnecessary node traversal.
3067 2004-11-10 Ken Kocienda <kocienda@apple.com>
3071 * khtml/editing/htmlediting.cpp:
3072 (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
3073 smart delete from the two functions below to here. There was an unnecessary double
3074 calculation of the leading and trailing whitespace positions. Also refined the trailing
3075 case so it only acts when the leading position is null (which seems to match TextEdit in
3076 my tests). Also removed some unnecessary copying of Position objects.
3077 (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
3079 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
3081 2004-11-10 Ken Kocienda <kocienda@apple.com>
3083 Reviewed by Harrison
3085 (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
3086 make things more clear.
3087 * khtml/editing/selection.cpp:
3088 (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the
3089 resulting positions do not cross block boundaries. This was a bug and caused some
3090 delete problems when whole blocks were selected. I will be addressing that issue
3091 more fully in upcoming changes.
3093 2004-11-10 Ken Kocienda <kocienda@apple.com>
3095 Reviewed by Harrison
3097 Some cleanups and fixes in upstream and downstream functions.
3099 Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement().
3100 Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the
3101 block's enclosing block will be returned.
3103 Remove code from upstream that confined the serach to block boundaries outside of
3104 the code which runs in the StayInBlock case. This code was redundant, and caused
3105 incorrect results to be returned in the DoNotStayInBlock case.
3107 In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
3108 node, not the the this pointer's node.
3110 * khtml/xml/dom_position.cpp:
3111 (DOM::Position::upstream)
3112 (DOM::Position::downstream)
3114 2004-11-09 David Hyatt <hyatt@apple.com>
3116 Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
3117 loading large local files.
3121 * khtml/html/htmltokenizer.cpp:
3122 (khtml::HTMLTokenizer::HTMLTokenizer):
3123 (khtml::HTMLTokenizer::reset):
3124 (khtml::HTMLTokenizer::write):
3125 (khtml::HTMLTokenizer::stopped):
3126 (khtml::HTMLTokenizer::processingData):
3127 (khtml::HTMLTokenizer::continueProcessing):
3128 (khtml::HTMLTokenizer::timerEvent):
3129 (khtml::HTMLTokenizer::allDataProcessed):
3130 (khtml::HTMLTokenizer::end):
3131 (khtml::HTMLTokenizer::finish):
3132 (khtml::HTMLTokenizer::notifyFinished):
3133 * khtml/html/htmltokenizer.h:
3134 * khtml/khtml_part.cpp:
3135 (KHTMLPart::slotFinished):
3138 * khtml/khtml_part.h:
3139 (KHTMLPart::tokenizerProcessedData):
3140 * khtml/khtmlview.cpp:
3141 * khtml/xml/dom_docimpl.cpp:
3142 * khtml/xml/xml_tokenizer.h:
3143 (khtml::Tokenizer::stopped):
3144 (khtml::Tokenizer::processingData):
3145 * kwq/KWQDateTime.h:
3146 * kwq/KWQDateTime.mm:
3147 (QDateTime::secsTo):
3148 (KWQUIEventTime::uiEventPending):
3149 * kwq/KWQKHTMLPart.h:
3150 * kwq/KWQKHTMLPart.mm:
3151 (KWQKHTMLPart::tokenizerProcessedData):
3152 * kwq/WebCoreBridge.h:
3153 * kwq/WebCoreBridge.mm:
3154 (-[WebCoreBridge stop]):
3155 (-[WebCoreBridge numPendingOrLoadingRequests]):
3156 (-[WebCoreBridge doneProcessingData]):
3158 2004-11-09 David Harrison <harrison@apple.com>
3160 Reviewed by Ken Kocienda.
3162 <rdar://problem/3865837> Wrong text style after delete to start of document
3164 * khtml/editing/htmlediting.cpp:
3165 (khtml::DeleteSelectionCommand::saveTypingStyleState):
3166 Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
3168 2004-11-09 Richard Williamson <rjw@apple.com>
3170 Fixed <rdar://problem/3872440> NSTimer prematurely released.
3179 2004-11-09 Chris Blumenberg <cblu@apple.com>
3183 * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
3185 2004-11-08 David Harrison <harrison@apple.com>
3187 Reviewed by Ken Kocienda.
3189 <rdar://problem/3865854> Deleting first line deletes all lines
3191 * khtml/editing/htmlediting.cpp:
3192 (khtml::DeleteSelectionCommand::performGeneralDelete):
3193 Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
3194 of its ancestors, failed to end the loop that deletes all fully selected nodes. Also,
3195 fixed this code to clear m_trailingWhitespaceValid. Also removed dead m_endingPosition
3196 update because it is handled in calculateEndingPosition now.
3197 * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
3198 * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
3200 2004-11-08 Ken Kocienda <kocienda@apple.com>
3204 * khtml/html/html_elementimpl.cpp:
3205 (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
3206 are added to the DOM.
3207 * khtml/html/html_elementimpl.h: Ditto.
3208 * khtml/html/htmlparser.cpp:
3209 (KHTMLParser::KHTMLParser): Ditto.
3210 (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
3211 * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
3212 * khtml/html/htmltokenizer.cpp:
3213 (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
3214 (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
3215 There were a couple of indexing errors that resulted in the comment text containing part of the
3217 (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
3218 * khtml/html/htmltokenizer.h: Add flag to constructor so callers can request comment nodes.
3220 2004-11-08 Chris Blumenberg <cblu@apple.com>
3222 Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
3226 * WebCore.pbproj/project.pbxproj: stop unnecessary linking
3227 * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
3228 * kwq/KWQKHTMLPart.h: ditto
3230 2004-11-08 Darin Adler <darin@apple.com>
3234 - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
3236 * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
3237 that possibly deletes the QTimer.
3239 2004-11-08 Chris Blumenberg <cblu@apple.com>
3241 Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
3245 * kwq/KWQTextField.mm:
3246 (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
3247 * kwq/WebCoreBridge.h:
3249 2004-11-08 David Harrison <harrison@apple.com>
3253 Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
3255 * khtml/editing/htmlediting.cpp:
3256 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
3257 * khtml/xml/dom_nodeimpl.cpp:
3258 (NodeImpl::enclosingInlineElement):
3259 * khtml/xml/dom_nodeimpl.h:
3261 2004-11-05 Chris Blumenberg <cblu@apple.com>
3263 Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
3267 * khtml/editing/htmlediting.cpp:
3268 (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
3269 * khtml/editing/visible_position.cpp:
3270 (khtml::VisiblePosition::character): new, returns the character for the position
3271 * khtml/editing/visible_position.h:
3272 * kwq/KWQKHTMLPart.h:
3273 * kwq/KWQKHTMLPart.mm:
3274 (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
3275 * kwq/WebCoreBridge.h:
3279 2004-11-05 Adele Amchan <adele@apple.com>
3283 Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
3284 and a workaround for displaying transparent backgrounds for textareas.
3286 * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
3287 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
3288 * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class,
3289 on the contentView, and on the textView.
3291 2004-11-04 David Hyatt <hyatt@apple.com>
3293 Fix for relpositioned inlines. This was reviewed a long time ago, but I can't recall who reviewed it (either
3296 Reviewed by darin or ken
3298 * khtml/rendering/bidi.cpp:
3299 (khtml::appendRunsForObject):
3300 (khtml::RenderBlock::skipWhitespace):
3301 (khtml::RenderBlock::findNextLineBreak):
3302 * khtml/rendering/render_block.cpp:
3303 (khtml::RenderBlock::lowestPosition):
3304 (khtml::RenderBlock::rightmostPosition):
3305 (khtml::RenderBlock::leftmostPosition):
3306 * khtml/rendering/render_box.cpp:
3307 (RenderBox::position):
3308 * khtml/rendering/render_box.h:
3309 (khtml::RenderBox::staticX):
3310 (khtml::RenderBox::staticY):
3311 * khtml/rendering/render_layer.cpp:
3312 (RenderLayer::updateLayerPosition):
3313 (RenderLayer::convertToLayerCoords):
3314 * khtml/rendering/render_line.cpp:
3315 (khtml::InlineFlowBox::placeBoxesHorizontally):
3316 * khtml/rendering/render_object.h:
3317 (khtml::RenderObject::staticX):
3318 (khtml::RenderObject::staticY):
3320 Finish turning on XSLT. Make sure child stylesheets can load.
3322 * khtml/xsl/xslt_processorimpl.cpp:
3323 (DOM::stylesheetLoadFunc):
3324 (DOM::XSLTProcessorImpl::transformDocument):
3326 2004-11-04 David Hyatt <hyatt@apple.com>
3328 Implement CSS3 support for multiple backgrounds. Also fix a bug with background propagation so that it only
3329 happens (from the <body> to the root) for HTML documents. Fixed background-position to handle a mixture of
3330 keyword and length values.
3334 * khtml/css/cssparser.cpp:
3335 (CSSParser::parseValue):
3336 (CSSParser::addBackgroundValue):
3337 (CSSParser::parseBackgroundShorthand):
3338 (CSSParser::parseBackgroundColor):
3339 (CSSParser::parseBackgroundImage):
3340 (CSSParser::parseBackgroundPositionXY):
3341 (CSSParser::parseBackgroundPosition):
3342 (CSSParser::parseBackgroundProperty):
3343 (CSSParser::parseColorFromValue):
3344 * khtml/css/cssparser.h:
3345 * khtml/css/cssstyleselector.cpp:
3346 (khtml::CSSStyleSelector::adjustRenderStyle):
3347 (khtml::CSSStyleSelector::applyProperty):
3348 (khtml::CSSStyleSelector::mapBackgroundAttachment):
3349 (khtml::CSSStyleSelector::mapBackgroundImage):
3350 (khtml::CSSStyleSelector::mapBackgroundRepeat):
3351 (khtml::CSSStyleSelector::mapBackgroundXPosition):
3352 (khtml::CSSStyleSelector::mapBackgroundYPosition):
3353 * khtml/css/cssstyleselector.h:
3354 * khtml/rendering/render_box.cpp:
3355 (RenderBox::paintRootBoxDecorations):
3356 (RenderBox::paintBoxDecorations):
3357 (RenderBox::paintBackgrounds):
3358 (RenderBox::paintBackground):
3359 (RenderBox::paintBackgroundExtended):
3360 * khtml/rendering/render_box.h:
3361 * khtml/rendering/render_form.cpp:
3362 (RenderFieldset::paintBoxDecorations):
3363 * khtml/rendering/render_line.cpp:
3364 (khtml::InlineFlowBox::paintBackgrounds):
3365 (khtml::InlineFlowBox::paintBackground):
3366 (khtml::InlineFlowBox::paintBackgroundAndBorder):
3367 * khtml/rendering/render_line.h:
3368 * khtml/rendering/render_object.cpp:
3369 (RenderObject::setStyle):
3370 (RenderObject::updateBackgroundImages):
3371 (RenderObject::getVerticalPosition):
3372 * khtml/rendering/render_object.h:
3373 (khtml::RenderObject::paintBackgroundExtended):
3374 * khtml/rendering/render_style.cpp:
3376 (BackgroundLayer::BackgroundLayer):
3377 (BackgroundLayer::~BackgroundLayer):
3378 (BackgroundLayer::operator=):
3379 (BackgroundLayer::operator==):
3380 (BackgroundLayer::fillUnsetProperties):
3381 (BackgroundLayer::cullEmptyLayers):
3382 (StyleBackgroundData::StyleBackgroundData):
3383 (StyleBackgroundData::operator==):
3384 (RenderStyle::diff):
3385 (RenderStyle::adjustBackgroundLayers):
3386 * khtml/rendering/render_style.h:
3387 (khtml::OutlineValue::operator==):
3388 (khtml::OutlineValue::operator!=):
3389 (khtml::BackgroundLayer::backgroundImage):
3390 (khtml::BackgroundLayer::backgroundXPosition):
3391 (khtml::BackgroundLayer::backgroundYPosition):
3392 (khtml::BackgroundLayer::backgroundAttachment):
3393 (khtml::BackgroundLayer::backgroundRepeat):
3394 (khtml::BackgroundLayer::next):
3395 (khtml::BackgroundLayer::isBackgroundImageSet):
3396 (khtml::BackgroundLayer::isBackgroundXPositionSet):
3397 (khtml::BackgroundLayer::isBackgroundYPositionSet):
3398 (khtml::BackgroundLayer::isBackgroundAttachmentSet):
3399 (khtml::BackgroundLayer::isBackgroundRepeatSet):
3400 (khtml::BackgroundLayer::setBackgroundImage):
3401 (khtml::BackgroundLayer::setBackgroundXPosition):
3402 (khtml::BackgroundLayer::setBackgroundYPosition):
3403 (khtml::BackgroundLayer::setBackgroundAttachment):
3404 (khtml::BackgroundLayer::setBackgroundRepeat):
3405 (khtml::BackgroundLayer::clearBackgroundImage):
3406 (khtml::BackgroundLayer::clearBackgroundXPosition):
3407 (khtml::BackgroundLayer::clearBackgroundYPosition):
3408 (khtml::BackgroundLayer::clearBackgroundAttachment):
3409 (khtml::BackgroundLayer::clearBackgroundRepeat):
3410 (khtml::BackgroundLayer::setNext):
3411 (khtml::BackgroundLayer::operator!=):
3412 (khtml::BackgroundLayer::containsImage):
3413 (khtml::BackgroundLayer::hasImage):
3414 (khtml::BackgroundLayer::hasFixedImage):
3415 (khtml::RenderStyle::setBitDefaults):
3416 (khtml::RenderStyle::hasBackground):
3417 (khtml::RenderStyle::hasFixedBackgroundImage):
3418 (khtml::RenderStyle::outlineWidth):
3419 (khtml::RenderStyle::outlineStyle):
3420 (khtml::RenderStyle::outlineStyleIsAuto):
3421 (khtml::RenderStyle::outlineColor):
3422 (khtml::RenderStyle::backgroundColor):
3423 (khtml::RenderStyle::backgroundImage):
3424 (khtml::RenderStyle::backgroundRepeat):
3425 (khtml::RenderStyle::backgroundAttachment):
3426 (khtml::RenderStyle::backgroundXPosition):
3427 (khtml::RenderStyle::backgroundYPosition):
3428 (khtml::RenderStyle::accessBackgroundLayers):
3429 (khtml::RenderStyle::backgroundLayers):
3430 (khtml::RenderStyle::outlineOffset):
3431 (khtml::RenderStyle::resetOutline):
3432 (khtml::RenderStyle::setBackgroundColor):
3433 (khtml::RenderStyle::setOutlineWidth):
3434 (khtml::RenderStyle::setOutlineStyle):
3435 (khtml::RenderStyle::setOutlineColor):
3436 (khtml::RenderStyle::clearBackgroundLayers):
3437 (khtml::RenderStyle::inheritBackgroundLayers):
3438 (khtml::RenderStyle::setOutlineOffset):
3439 * khtml/rendering/render_table.cpp:
3440 (RenderTable::paintBoxDecorations):
3441 (RenderTableCell::paintBoxDecorations):
3443 2004-11-04 David Hyatt <hyatt@apple.com>
3445 Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
3446 Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
3450 * kwq/KWQTextCodec.mm:
3451 (KWQTextDecoder::convertLatin1):
3452 (KWQTextDecoder::convertUTF16):
3453 (KWQTextDecoder::convertUsingTEC):
3454 (KWQTextDecoder::toUnicode):
3456 2004-11-04 David Hyatt <hyatt@apple.com>
3458 Make sure line-height returns the correct value for normal.
3462 * khtml/css/css_computedstyle.cpp:
3463 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3465 2004-11-04 David Harrison <harrison@apple.com>
3467 Reviewed by Ken Kocienda.
3469 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
3471 * khtml/editing/htmlediting.cpp:
3472 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
3473 to, but not including, the enclosingBlockFlowElement) rather than just the source element.
3474 Fixed to insert after the destination subtree, rather than the destination element. Handles
3475 edge case of deleting back to the top of the tree, where there is nothing left to insert after.
3476 * khtml/xml/dom_nodeimpl.cpp:
3477 (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
3478 * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
3479 * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
3480 * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
3482 2004-11-03 Ken Kocienda <kocienda@apple.com>
3488 * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
3489 * layout-tests/editing/deleting/delete-br-008.html: Added.
3490 * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
3491 * layout-tests/editing/deleting/delete-br-009.html: Added.
3492 * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
3493 * layout-tests/editing/deleting/delete-br-010.html: Added.
3495 2004-11-03 Maciej Stachowiak <mjs@apple.com>
3497 Fix by Yasuo Kida, reviewed by me.
3499 <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
3501 * kwq/KWQKHTMLPart.mm:
3502 (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
3503 same as a nil range - setting an empty marked range should clear
3504 the marked range entirely.
3506 2004-11-02 Maciej Stachowiak <mjs@apple.com>
3508 Reviewed by Dave Hyatt (when I originally coded it).
3510 WebCore part of fix for:
3512 <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
3514 * kwq/WebCoreBridge.h:
3515 * kwq/WebCoreBridge.mm:
3516 (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
3517 DOMRange, or if the range is split into multiple lines, the rect for the part on
3518 the first line only.
3520 * khtml/rendering/render_object.cpp:
3521 (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
3522 for the overrides below.
3523 * khtml/rendering/render_object.h:
3524 * khtml/rendering/render_box.cpp:
3525 (RenderBox::caretRect):
3526 * khtml/rendering/render_box.h:
3527 * khtml/rendering/render_br.cpp:
3528 (RenderBR::caretRect):
3529 * khtml/rendering/render_br.h:
3530 * khtml/rendering/render_flow.cpp:
3531 (RenderFlow::caretRect):
3532 * khtml/rendering/render_flow.h:
3533 * khtml/rendering/render_text.cpp:
3534 (RenderText::caretRect):
3536 2004-11-02 Ken Kocienda <kocienda@apple.com>
3540 Implemented command to insert a block in response to typing a return key (even though
3541 I am not turning that on by default with this patch....that will come later).
3543 This new command is called InsertParagraphSeparatorCommand.
3545 Reworked the command and function names associated with inserting content into a
3546 document. Before this patch, there were inputXXX and insertXXX variants, with the
3547 former used for more high-level actions and the latter used for lower-level stuff.
3548 However, this was confusing as the AppKit uses insertXXX for everything. This resulted
3549 in an insertXXX command going through an inputXXX WebCore step and then finally to an
3550 insertXXX WebCore step. To make this less confusing, I have changes all the names to
3551 be insertXXX, and modified the lower-level operations so that it is clear what they do.
3553 * khtml/editing/htmlediting.cpp:
3554 (khtml::EditCommandPtr::isInsertTextCommand): Name change.
3555 (khtml::EditCommand::isInsertTextCommand): Ditto.
3556 (khtml::CompositeEditCommand::inputText): Ditto.
3557 (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
3558 (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
3559 (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
3560 (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
3561 (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
3562 (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
3563 (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
3564 (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
3565 (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
3566 (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
3567 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
3568 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
3569 (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
3570 (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
3571 (khtml::InsertIntoTextNode::doApply): Ditto.
3572 (khtml::InsertIntoTextNode::doUnapply): Ditto.
3573 (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
3574 (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
3575 (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
3576 (khtml::InsertLineBreakCommand::doApply):
3577 (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
3578 (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
3579 (khtml::InsertNodeBeforeCommand::doApply): Ditto.
3580 (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
3581 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
3582 (khtml::InsertParagraphSeparatorCommand::doApply):
3583 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
3584 Class name change, was InsertNewlineCommandInQuotedContentCommand.
3585 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
3586 (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
3587 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
3588 (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
3589 (khtml::InsertTextCommand::doApply): Ditto.
3590 (khtml::InsertTextCommand::deleteCharacter): Ditto.
3591 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
3592 (khtml::InsertTextCommand::input): Ditto.
3593 (khtml::InsertTextCommand::insertSpace): Ditto.
3594 (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
3595 (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
3596 (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
3597 (khtml::TypingCommand::insertParagraphSeparator): New function.
3598 (khtml::TypingCommand::doApply): Name changes, as above.
3599 (khtml::TypingCommand::insertText): Ditto.
3600 (khtml::TypingCommand::deleteKeyPressed): Ditto.
3601 (khtml::TypingCommand::preservesTypingStyle): Ditto.
3602 * khtml/editing/htmlediting.h:
3603 (khtml::DeleteFromTextNodeCommand::node): Name change.
3604 (khtml::DeleteFromTextNodeCommand::offset): Ditto.
3605 (khtml::DeleteFromTextNodeCommand::count): Ditto.
3606 (khtml::InsertIntoTextNode::text): Ditto.
3607 (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
3608 (khtml::InsertNodeBeforeCommand::refChild): Ditto.
3609 (khtml::TypingCommand::): Ditto.
3610 * khtml/editing/jsediting.cpp: Name changes, as above.
3611 * kwq/WebCoreBridge.h:
3612 * kwq/WebCoreBridge.mm:
3613 (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
3614 (-[WebCoreBridge insertParagraphSeparator]): New function.
3615 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
3617 2004-11-01 Kevin Decker <kdecker@apple.com>
3621 fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
3624 * khtml/ecma/kjs_window.cpp:
3625 (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
3627 2004-11-01 Darin Adler <darin@apple.com>
3631 - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
3633 * khtml/css/html4.css: Use color: initial for textarea and related ones.
3635 2004-11-01 Ken Kocienda <kocienda@apple.com>
3641 <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
3643 * khtml/css/css_computedstyle.cpp:
3644 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the
3645 implementation here into new copyPropertiesInSet helper. This now calls the
3646 generalized copyPropertiesInSet function with the arguments needed to make copying
3648 * khtml/css/css_computedstyle.h:
3649 * khtml/css/css_valueimpl.cpp:
3650 (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
3651 In order to do apply block properties, "regular" style declarations need to do style
3653 (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
3654 except that it uses a different set of properties that apply only to blocks.
3655 (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
3656 and copies out those properties listed in a pre-defined set.
3657 * khtml/css/css_valueimpl.h:
3658 * khtml/editing/htmlediting.cpp:
3659 (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
3660 block, factoring out some of the special case code that should now only run in the inline case.
3661 (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
3662 (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
3663 special handling for "legacy" HTML styles like <B> and <I>.
3664 (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
3665 style changes into different kinds. CSS specifies certain properties only apply to certain
3666 element types. This set of changes now recognizes two such separate cases: styles that apply
3667 to blocks, and styles that apply to inlines.
3668 (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
3669 (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
3670 (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
3671 with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
3672 done so that the function can be passed a portion of the styles being applied so that block styles
3673 and inline styles can be handled separately.
3674 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
3675 (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
3676 (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
3677 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
3678 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
3679 * khtml/editing/htmlediting.h:
3680 (khtml::StyleChange::): Changed as described above.
3681 (khtml::StyleChange::usesLegacyStyles):
3682 (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
3683 it needs to layout, even though it has not changed position in the DOM. For instance, this is needed
3684 when text align changes.
3685 * khtml/khtml_part.cpp:
3686 (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
3687 the passed-in argument.
3688 (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
3689 is a caret. Formerly, this just set typing style and made no visible changes to the document.
3693 * layout-tests/editing/editing.js: Added some glue to change text align.
3694 * layout-tests/editing/style/block-style-001-expected.txt: Added.
3695 * layout-tests/editing/style/block-style-001.html: Added.
3696 * layout-tests/editing/style/block-style-002-expected.txt: Added.
3697 * layout-tests/editing/style/block-style-002.html: Added.
3698 * layout-tests/editing/style/block-style-003-expected.txt: Added.
3699 * layout-tests/editing/style/block-style-003.html: Added.
3703 2004-10-29 Darin Adler <darin@apple.com>
3707 - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
3709 * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
3710 before advancing one character; before it did it backwards.
3712 2004-10-29 Chris Blumenberg <cblu@apple.com>
3714 Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
3716 Reviewed by kocienda, adele.
3718 * khtml/rendering/render_frames.cpp:
3719 (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
3721 2004-10-29 Darin Adler <darin@apple.com>
3725 - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
3727 * khtml/khtmlview.cpp:
3728 (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
3729 deleted before this function finishes running.
3730 (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
3731 (KHTMLView::viewportMouseReleaseEvent): Ditto.
3732 (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
3733 is guaranteed to do ref/deref as needed.
3735 * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
3737 2004-10-28 Chris Blumenberg <cblu@apple.com>
3739 Enabled XSLT on Panther. See intrigue mail for compiling instructions.
3743 * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
3744 * WebCorePrefix.h: always use XSLT
3746 2004-10-28 Ken Kocienda <kocienda@apple.com>
3752 <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
3753 <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
3755 * khtml/editing/htmlediting.cpp:
3756 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members
3757 to initialization list, zeroing them out.
3758 (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
3759 handle a delete of content in special cases where the only thing selected is a BR. This
3760 code path is much simpler than the newly-named performGeneralDelete, and detects when no
3761 content merging should be done between blocks. This aspect of the change fixes 3854848.
3762 One of the special cases added fixes 3803832.
3763 (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
3764 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
3765 like the other helpers in this class.
3766 (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
3767 (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
3768 * khtml/editing/htmlediting.h: Added new helper and changed an old one.
3770 2004-10-28 Chris Blumenberg <cblu@apple.com>
3772 Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
3776 * kwq/KWQKHTMLPart.mm:
3777 (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
3779 2004-10-28 Ken Kocienda <kocienda@apple.com>
3781 Reviewed by Harrison
3783 Reorganization of delete command functionality so that doApply is not
3784 several hundred lines long. This is not a squeaky-clean cleanup, but
3785 it is a step in the right direction. No functionality changes.
3787 * khtml/editing/htmlediting.cpp:
3788 (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
3789 (khtml::DeleteSelectionCommand::initializePositionData): New helper.
3790 (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
3791 (khtml::DeleteSelectionCommand::performDelete): Ditto.
3792 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
3793 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
3794 (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
3795 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
3796 (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
3797 (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
3798 * khtml/editing/htmlediting.h:
3800 2004-10-28 Ken Kocienda <kocienda@apple.com>
3804 * khtml/editing/htmlediting.cpp:
3805 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
3806 new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
3808 2004-10-27 Ken Kocienda <kocienda@apple.com>
3812 * khtml/editing/htmlediting.cpp:
3813 (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
3814 whether content not in the block containing the start of the selection is moved to that block
3815 after the selection is deleted.
3816 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
3817 (khtml::DeleteSelectionCommand::doApply): Ditto.
3818 (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
3819 to handle the case of inserting a newline when in quoted content in Mail.
3820 (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
3821 (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
3822 (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
3823 (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
3824 (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
3825 (khtml::TypingCommand::doApply): Ditto.
3826 (khtml::TypingCommand::preservesTypingStyle): Ditto.
3827 * khtml/editing/htmlediting.h: Add new delclarations.
3828 (khtml::TypingCommand::): Ditto.
3829 * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
3830 * kwq/WebCoreBridge.mm:
3831 (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
3833 2004-10-26 Chris Blumenberg <cblu@apple.com>
3835 Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
3839 * khtml/ecma/kjs_dom.cpp:
3840 (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
3841 * khtml/ecma/kjs_dom.h:
3842 (KJS::DOMElement::):
3843 * khtml/ecma/kjs_dom.lut.h:
3846 2004-10-26 David Hyatt <hyatt@apple.com>
3848 Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
3851 Reviewed by kocienda
3853 * khtml/rendering/bidi.cpp:
3854 (khtml::RenderBlock::layoutInlineChildren):