1 2004-12-10 Ken Kocienda <kocienda@apple.com>
7 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
9 There are a number of interesting things we could do to fix this bug, including SPI and involving
10 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
11 will fix the bug in the general case until such time as we can come up with more specific
14 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
17 * khtml/editing/htmlediting.cpp:
18 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
19 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
20 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
21 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
23 2004-12-10 Darin Adler <darin@apple.com>
27 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
29 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
30 * khtml/rendering/render_form.cpp:
31 (RenderSubmitButton::rawText): Convert to QChar explicitly.
32 (RenderLineEdit::updateFromElement): Ditto.
33 (RenderLineEdit::slotTextChanged): Ditto.
34 (RenderSelect::updateFromElement): Ditto.
35 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
36 that requires a derived class. Now we don't use this class at all for WebCore, but they still
38 (TextAreaWidget::event): Moved out the ifdefs.
39 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
40 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
42 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
43 that's needed and WebCore no longer has TextAreaWidget.
44 (RenderTextArea::calcMinMaxWidth): Ditto.
45 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
47 (RenderTextArea::updateFromElement): Use type QTextEdit.
48 (RenderTextArea::text): Ditto.
49 (RenderTextArea::select): Ditto.
52 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
53 since it's now handled by QTextEdit.
54 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
56 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
57 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
58 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
60 2004-12-10 Ken Kocienda <kocienda@apple.com>
66 <rdar://problem/3915047> HItting return in empty document inserts <p> but
67 insertion point does not move
69 * khtml/editing/htmlediting.cpp:
70 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
71 code to insert the <p> element for the return is not detecting the fact
72 that the document is empty. Inserting a <p> into an empty body will not
73 "add a new line" as the user expects. With this change, we'll add a second
74 <p> when the root editable element has no rendered kids.
76 2004-12-10 Maciej Stachowiak <mjs@apple.com>
80 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
82 * khtml/html/html_miscimpl.cpp:
83 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
84 the initial one step, otherwise we might inadvertantly step
85 outside the collection base, thereby causing assertion failures or
88 2004-12-10 Ken Kocienda <kocienda@apple.com>
92 * khtml/editing/htmlediting.cpp:
93 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
94 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
95 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
96 should do nothing if the starting point for the selection is itself the starting block.
97 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
98 function, though the names and concepts are slightly different.
100 2004-12-10 Maciej Stachowiak <mjs@apple.com>
104 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
106 * khtml/dom/html_document.cpp:
107 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
108 * khtml/dom/html_document.h:
109 * khtml/ecma/kjs_html.cpp:
110 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
111 * khtml/html/html_miscimpl.cpp:
112 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
113 the items that can be accessed directly as a document propery, in particular forms, images,
114 objects, applets and embeds.
115 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
116 (HTMLFormCollectionImpl::updateNameCache): Ditto.
117 * khtml/html/html_miscimpl.h:
118 (DOM::HTMLCollectionImpl::): Added new type.
120 2004-12-10 Ken Kocienda <kocienda@apple.com>
126 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
128 * khtml/rendering/render_text.cpp:
129 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
131 2004-12-10 Ken Kocienda <kocienda@apple.com>
137 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
139 * khtml/editing/htmlediting.cpp:
140 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
141 that was removed from the document when pasting. This caused the disappearance. Now this
142 is detected, and the selection is shifted to a node that is in the document.
144 2004-12-09 Richard Williamson <rjw@apple.com>
146 Check to disable threaded decoding during
147 layout tests wasn't invoking function, just checking address of
148 function, which would always return true.
150 * kwq/WebCoreImageRendererFactory.m:
151 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
153 2004-12-09 David Hyatt <hyatt@apple.com>
155 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
158 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
159 all inlines when repainting.
163 * khtml/rendering/render_block.cpp:
164 (khtml::RenderBlock::layoutBlockChildren):
165 * khtml/rendering/render_flow.cpp:
166 (RenderFlow::getAbsoluteRepaintRect):
168 2004-12-09 David Hyatt <hyatt@apple.com>
170 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
171 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
172 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
173 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
177 * khtml/rendering/render_block.cpp:
178 (khtml::RenderBlock::getClearDelta):
179 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
180 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
181 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
182 * layout-tests/fast/block/margin-collapse/102-expected.txt:
183 * layout-tests/fast/block/margin-collapse/102.html:
185 2004-12-09 Richard Williamson <rjw@apple.com>
187 Fixed <rdar://problem/3914078> worldclock crashing gc related
189 Use ProtectedValue for Context2D instance members.
193 * khtml/ecma/kjs_html.h:
195 2004-12-09 John Sullivan <sullivan@apple.com>
199 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
201 * kwq/KWQAccObject.mm:
202 (-[KWQAccObject title]): moved image alt tag code out of here
203 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
204 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
205 that ordinary elements return; this means that ordinary elements that aren't images will return
206 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
208 (-[KWQAccObject accessibilityAttributeValue:]):
209 call accessibilityDescription when asked for AXDescription
211 2004-12-09 Ken Kocienda <kocienda@apple.com>
217 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
219 * khtml/editing/htmlediting.cpp:
220 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
221 been deleted. If this is the case, set the destination to the node the delete command provides in
222 its ending selection.
226 2004-12-09 Ken Kocienda <kocienda@apple.com>
232 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
234 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
235 callback may not be delivered before the program asks for the dimensions of an image in order to
236 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
237 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
239 * kwq/KWQRenderTreeDebug.cpp:
240 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
241 (externalRepresentation): Sets debuggingRenderTree flag to true;
242 * kwq/KWQRenderTreeDebug.h:
243 * kwq/WebCoreImageRendererFactory.m:
244 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
245 do threaded decoding in any case if the flag is set.
247 2004-12-09 Chris Blumenberg <cblu@apple.com>
249 Fix for busting XMLHTTPRequest.
251 Reviewed by kocienda.
253 * khtml/misc/loader.cpp:
254 (Loader::servePendingRequests): pass true for deliverAllData
256 (KIO::get): take deliverAllData param
257 (KIO::http_post): ditto
258 * kwq/KWQKJobClasses.h:
259 * kwq/KWQKJobClasses.mm:
260 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
261 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
263 2004-12-09 Ken Kocienda <kocienda@apple.com>
267 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
269 * khtml/xml/dom_nodeimpl.cpp:
270 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
272 2004-12-07 Richard Williamson <rjw@apple.com>
274 Support threaded image decoding on machines w/ > 2 CPUs.
276 Reviewed by Maciej and Chris.
278 * khtml/misc/loader.cpp:
279 (CachedImageCallback::notifyUpdate):
280 (CachedImageCallback::notifyFinished):
281 (CachedImageCallback::notifyDecodingError):
282 (CachedImageCallback::handleError):
283 (CachedImageCallback::clear):
284 (CachedImage::CachedImage):
285 (CachedImage::clear):
287 (CachedImage::checkNotify):
288 (Loader::servePendingRequests):
289 (Loader::slotFinished):
290 (Loader::numRequests):
291 (Loader::cancelRequests):
292 (Loader::removeBackgroundDecodingRequest):
293 * khtml/misc/loader.h:
294 (khtml::CachedImageCallback::CachedImageCallback):
295 (khtml::CachedImageCallback::ref):
296 (khtml::CachedImageCallback::deref):
297 (khtml::CachedImage::decoderCallback):
298 * khtml/rendering/render_object.cpp:
299 (RenderObject::setPixmap):
302 (-[WebImageCallback initWithCallback:khtml::]):
303 (-[WebImageCallback _commonTermination]):
304 (-[WebImageCallback dealloc]):
305 (-[WebImageCallback finalize]):
306 (-[WebImageCallback notify]):
307 (-[WebImageCallback setImageSourceStatus:]):
308 (-[WebImageCallback status]):
309 (QPixmap::shouldUseThreadedDecoding):
310 (QPixmap::receivedData):
311 * kwq/WebCoreImageRenderer.h:
312 * kwq/WebCoreImageRendererFactory.h:
313 * kwq/WebCoreImageRendererFactory.m:
314 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
315 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
317 2004-12-07 Ken Kocienda <kocienda@apple.com>
321 * khtml/editing/htmlediting.cpp:
322 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
323 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
324 after new block has been inserted, otherwise a crash can result. Shuffle down call
325 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
328 2004-12-07 Ken Kocienda <kocienda@apple.com>
334 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
336 * khtml/editing/htmlediting.cpp:
337 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
338 for determining the location for inserting content. Do not allow an insert before or after if the
339 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
340 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
341 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
343 2004-12-07 Darin Adler <darin@apple.com>
347 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
349 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
351 2004-12-07 Ken Kocienda <kocienda@apple.com>
355 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
356 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
358 * khtml/editing/html_interchange.h: Name change, as described above.
359 * khtml/editing/htmlediting.cpp:
360 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
361 * khtml/xml/dom2_rangeimpl.cpp:
362 (DOM::RangeImpl::toHTML): Ditto.
364 2004-12-07 Ken Kocienda <kocienda@apple.com>
368 Added a couple more layout tests.
370 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
371 * layout-tests/editing/deleting/delete-line-013.html: Added.
372 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
373 * layout-tests/editing/deleting/delete-line-014.html: Added.
375 2004-12-06 Maciej Stachowiak <mjs@apple.com>
379 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
382 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
383 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
384 (-[KWQListBoxScrollView widget]): See above.
385 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
386 afterMouseDown, to avoid triggering an assertion failure.
388 2004-12-06 David Hyatt <hyatt@apple.com>
390 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
391 made by me, kocienda and harrison to just remove it.
395 * khtml/rendering/bidi.cpp:
396 (khtml::RenderBlock::layoutInlineChildren):
397 * khtml/rendering/render_block.cpp:
398 (khtml:::RenderFlow):
399 * khtml/rendering/render_block.h:
400 * khtml/rendering/render_flow.cpp:
401 (RenderFlow::dirtyLinesFromChangedChild):
403 2004-12-06 David Hyatt <hyatt@apple.com>
405 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
406 not a damage rect that can be changed when intersected with the clip regions of the web page.
410 * khtml/rendering/render_canvas.h:
411 (khtml::RenderCanvas::printRect):
412 (khtml::RenderCanvas::setPrintRect):
413 * khtml/rendering/render_flow.cpp:
414 (RenderFlow::paintLines):
415 * khtml/rendering/render_list.cpp:
416 (RenderListMarker::paint):
417 * kwq/KWQKHTMLPart.mm:
418 (KWQKHTMLPart::adjustPageHeight):
420 2004-12-06 David Harrison <harrison@apple.com>
422 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
424 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
427 * khtml/rendering/render_flow.cpp:
428 (RenderFlow::dirtyLinesFromChangedChild):
429 Dirty the line above because new child can inval the cached line break position of previous line.
431 2004-12-06 David Hyatt <hyatt@apple.com>
433 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
434 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
435 3126929, handle top/left overflow.
437 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
439 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
440 regions and web pages) has been fixed.
444 * khtml/rendering/bidi.cpp:
445 (khtml::RenderBlock::computeHorizontalPositionsForLine):
446 (khtml::RenderBlock::checkLinesForOverflow):
447 * khtml/rendering/render_block.cpp:
448 (khtml:::RenderFlow):
449 (khtml::RenderBlock::overflowHeight):
450 (khtml::RenderBlock::overflowWidth):
451 (khtml::RenderBlock::overflowLeft):
452 (khtml::RenderBlock::overflowTop):
453 (khtml::RenderBlock::overflowRect):
454 (khtml::RenderBlock::layoutBlock):
455 (khtml::RenderBlock::layoutBlockChildren):
456 (khtml::RenderBlock::paint):
457 (khtml::RenderBlock::floatRect):
458 (khtml::RenderBlock::lowestPosition):
459 (khtml::RenderBlock::rightmostPosition):
460 (khtml::RenderBlock::leftmostPosition):
461 (khtml::RenderBlock::nodeAtPoint):
462 * khtml/rendering/render_block.h:
463 * khtml/rendering/render_box.h:
464 (khtml::RenderBox::borderBox):
465 (khtml::RenderBox::borderTopExtra):
466 (khtml::RenderBox::borderBottomExtra):
467 * khtml/rendering/render_layer.cpp:
468 (RenderLayer::paintScrollbars):
469 (mustExamineRenderer):
470 (RenderLayer::intersectsDamageRect):
471 (RenderLayer::containsPoint):
472 * khtml/rendering/render_line.cpp:
473 (khtml::InlineFlowBox::placeBoxesHorizontally):
474 (khtml::InlineFlowBox::verticallyAlignBoxes):
475 * khtml/rendering/render_line.h:
476 (khtml::InlineBox::leftOverflow):
477 (khtml::InlineBox::rightOverflow):
478 (khtml::InlineFlowBox::setVerticalOverflowPositions):
479 (khtml::RootInlineBox::RootInlineBox):
480 (khtml::RootInlineBox::leftOverflow):
481 (khtml::RootInlineBox::rightOverflow):
482 (khtml::RootInlineBox::setVerticalOverflowPositions):
483 (khtml::RootInlineBox::setHorizontalOverflowPositions):
484 * khtml/rendering/render_object.h:
485 (khtml::RenderObject::borderBox):
486 (khtml::RenderObject::overflowLeft):
487 (khtml::RenderObject::overflowTop):
488 (khtml::RenderObject::overflowRect):
489 (khtml::RenderObject::floatRect):
490 * khtml/rendering/render_table.cpp:
491 (RenderTable::layout):
492 (RenderTable::paint):
493 (RenderTable::paintBoxDecorations):
494 (RenderTable::calcMinMaxWidth):
495 * khtml/rendering/render_table.h:
496 (khtml::RenderTableCell::borderTopExtra):
497 (khtml::RenderTableCell::borderBottomExtra):
502 2004-12-06 Maciej Stachowiak <mjs@apple.com>
506 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
508 I changed all unprotected places that can navigate a different
509 window or frame from script to check for a javascript: URL, and if
510 found, to check for safety using cross-site-script rules.
512 I considered a few other possible exploits and made no change:
514 - document.location is already protected because the document
515 object itself is protected
517 - frame.src, frame.location, iframe.src and targetted links are
518 all safe because setting the URL of a frame to a javascript: URL
519 executes the script in the context of the parent
521 * khtml/ecma/kjs_window.cpp:
522 (WindowFunc::tryCall):
524 (LocationFunc::tryCall):
526 2004-12-06 Ken Kocienda <kocienda@apple.com>
532 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
534 * khtml/editing/htmlediting.cpp:
535 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
536 check for one of the special cases being checked for in this function. The specific case
537 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
538 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
539 case where a selection ended in a <br> after a block and would not delete any part of the
540 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
543 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
544 new use of the function exposed this bug:
546 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
548 * khtml/xml/dom_position.cpp:
549 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
550 not have this fatal flaw. It is a much better design as well.
552 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
553 have what I consider to be a better result. Going with it.
555 2004-12-06 Chris Blumenberg <cblu@apple.com>
557 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
562 (-[DOMElement _font]): new SPI for AppKit
565 2004-12-06 Darin Adler <darin@apple.com>
569 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
571 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
572 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
574 2004-12-06 John Sullivan <sullivan@apple.com>
576 Darin found what appears to be the real leak that we were falsely blaming
577 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
580 * khtml/css/cssparser.cpp:
581 (CSSParser::parseValue):
582 call clearProperties() instead of just setting numParsedProperties to 0
583 (CSSParser::parseDeclaration):
585 (CSSParser::createStyleDeclaration):
588 2004-12-06 Ken Kocienda <kocienda@apple.com>
594 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
595 * layout-tests/editing/inserting/insert-div-001.html: Added.
596 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
597 * layout-tests/editing/inserting/insert-div-002.html: Added.
598 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
599 * layout-tests/editing/inserting/insert-div-003.html: Added.
600 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
601 * layout-tests/editing/inserting/insert-div-004.html: Added.
602 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
603 * layout-tests/editing/inserting/insert-div-005.html: Added.
604 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
605 * layout-tests/editing/inserting/insert-div-006.html: Added.
606 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
607 * layout-tests/editing/inserting/insert-div-007.html: Added.
608 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
609 * layout-tests/editing/inserting/insert-div-008.html: Added.
610 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
611 * layout-tests/editing/inserting/insert-div-009.html: Added.
613 2004-12-06 Ken Kocienda <kocienda@apple.com>
619 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
621 * khtml/editing/htmlediting.cpp:
622 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
623 being added to this function. This ensures that the added block has a height.
624 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
626 2004-12-06 Ken Kocienda <kocienda@apple.com>
630 * khtml/dom/dom_string.cpp:
631 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
632 * khtml/dom/dom_string.h: Ditto.
633 * khtml/editing/htmlediting.cpp:
634 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
635 RebalanceWhitespaceCommand instance.
636 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
637 (khtml::InsertLineBreakCommand::doApply): Ditto.
638 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
639 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
640 (khtml::InsertTextCommand::input): Ditto.
641 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
642 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
643 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
644 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
645 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
646 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
647 * khtml/editing/htmlediting.h: Ditto.
648 (khtml::RebalanceWhitespaceCommand::): Ditto.
650 2004-12-05 Darin Adler <darin@apple.com>
652 - fixed small problem in my check-in from yesterday
655 (positionForEvent): Get location from event without raising exception if it's the wrong type.
656 (clickCountForEvent): Same, for clickCount.
657 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
658 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
659 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
661 2004-12-04 Darin Adler <darin@apple.com>
665 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
667 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
668 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
669 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
671 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
673 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
674 * khtml/rendering/render_form.cpp:
675 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
676 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
677 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
679 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
680 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
681 Added a fixState helper method so the constructors can save code.
683 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
684 and added a third constructor that uses the "current event" from AppKit (used above).
685 (QMouseEvent::fixState): Compute state and click count based on event type.
687 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
689 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
690 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
691 underlying cause in CSS.
693 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
695 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
696 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
698 2004-12-03 Chris Blumenberg <cblu@apple.com>
701 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
702 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
703 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
704 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
706 Reviewed by darin, rjw, kocienda.
708 * khtml/misc/loader.cpp:
709 (CachedObject::~CachedObject):
710 (CachedCSSStyleSheet::checkNotify):
711 (Loader::servePendingRequests):
712 (Loader::slotFinished):
713 (Loader::slotReceivedResponse):
714 (Cache::requestImage):
715 (Cache::requestScript):
716 * khtml/misc/loader.h:
717 (khtml::CachedObject::CachedObject):
718 (khtml::CachedObject::response):
719 (khtml::CachedObject::allData):
720 * kwq/KWQKJobClasses.h:
721 * kwq/KWQKJobClasses.mm:
722 (KIO::TransferJobPrivate::TransferJobPrivate):
723 (KIO::TransferJobPrivate::~TransferJobPrivate):
724 (KIO::TransferJob::TransferJob):
725 (KIO::TransferJob::assembleResponseHeaders):
726 (KIO::TransferJob::retrieveCharset):
727 (KIO::TransferJob::emitResult):
728 (KIO::TransferJob::emitReceivedResponse):
731 (KWQHeaderStringFromDictionary):
732 (KWQCheckCacheObjectStatus):
733 (KWQIsResponseURLEqualToURL):
735 (KWQResponseMIMEType):
736 (KWQCacheObjectExpiresTime):
737 (khtml::CachedObject::setResponse):
738 (khtml::CachedObject::setAllData):
742 * kwq/KWQResourceLoader.mm:
743 (-[KWQResourceLoader finishJobAndHandle:]):
744 (-[KWQResourceLoader cancel]):
745 (-[KWQResourceLoader reportError]):
746 (-[KWQResourceLoader finishWithData:]):
754 * kwq/WebCoreBridge.h:
755 * kwq/WebCoreResourceLoader.h:
757 2004-12-04 Darin Adler <darin@apple.com>
761 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
763 * khtml/rendering/render_form.cpp:
764 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
765 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
766 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
767 (RenderSlider::slotSliderValueChanged): Ditto.
769 2004-12-03 John Sullivan <sullivan@apple.com>
773 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
774 khtml::BackgroundLayer::cullEmptyLayers
776 * khtml/rendering/render_style.cpp:
777 (BackgroundLayer::cullEmptyLayers):
778 added missing nil check
782 2004-12-03 Ken Kocienda <kocienda@apple.com>
786 Roll out some recent changes by Chris that caused a performance regression.
787 Fix is in hand, but it is a little risky this close to a submission. So,
788 we have decided to roll back the change with the regression and roll in
789 the new code after we submit.
791 * khtml/css/cssproperties.c:
794 * khtml/css/cssvalues.c:
797 * khtml/misc/htmlattrs.c:
800 * khtml/misc/htmltags.c:
803 * khtml/misc/loader.cpp:
804 (CachedObject::~CachedObject):
805 (CachedObject::setResponse):
806 (CachedCSSStyleSheet::checkNotify):
807 (Loader::servePendingRequests):
808 (Loader::slotFinished):
809 (Loader::slotReceivedResponse):
810 (Cache::requestImage):
811 (Cache::requestScript):
812 * khtml/misc/loader.h:
813 (khtml::CachedObject::CachedObject):
814 (khtml::CachedObject::response):
815 * kwq/KWQKJobClasses.h:
816 * kwq/KWQKJobClasses.mm:
817 (KIO::TransferJobPrivate::TransferJobPrivate):
818 (KIO::TransferJobPrivate::~TransferJobPrivate):
819 (KIO::TransferJob::TransferJob):
820 (KIO::TransferJob::assembleResponseHeaders):
821 (KIO::TransferJob::retrieveCharset):
822 (KIO::TransferJob::emitResult):
823 (KIO::TransferJob::emitReceivedResponse):
826 (KWQHeaderStringFromDictionary):
827 (KWQCheckCacheObjectStatus):
829 (KWQReleaseResponse):
830 (KWQIsResponseURLEqualToURL):
832 (KWQResponseMIMEType):
833 (KWQResponseTextEncodingName):
834 (KWQResponseHeaderString):
835 (KWQCacheObjectExpiresTime):
836 (KWQLoader::KWQLoader):
840 * kwq/KWQResourceLoader.mm:
841 (-[KWQResourceLoader finishJobAndHandle]):
842 (-[KWQResourceLoader cancel]):
843 (-[KWQResourceLoader reportError]):
844 (-[KWQResourceLoader finish]):
852 * kwq/WebCoreBridge.h:
853 * kwq/WebCoreResourceLoader.h:
855 2004-12-03 John Sullivan <sullivan@apple.com>
859 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
861 * kwq/KWQKHTMLPart.mm:
862 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
863 when checking whether we moved the focus to another view, make sure we didn't "move" it to
864 our documentView, because that's no move at all.
866 2004-12-03 Darin Adler <darin@apple.com>
870 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
872 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
873 Added missing initialization for base class and node pointer.
875 - fixed a few places that could leave dangling node pointers
877 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
878 Clear out the node pointer when the node is destroyed.
879 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
881 2004-12-03 Chris Blumenberg <cblu@apple.com>
883 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.
884 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
888 * khtml/misc/loader.cpp:
889 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
890 (Loader::slotFinished): take data param
891 * khtml/misc/loader.h:
892 * kwq/KWQKJobClasses.h:
893 * kwq/KWQKJobClasses.mm:
894 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
895 (KIO::TransferJob::emitResult): take data param and pass it
896 * kwq/KWQResourceLoader.mm:
897 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
898 (-[KWQResourceLoader cancel]): pass nil for data
899 (-[KWQResourceLoader reportError]): ditto
900 (-[KWQResourceLoader finishWithData:]): pass data
902 (KWQSlot::KWQSlot): pass data param to slotFinished
903 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
905 2004-12-03 Ken Kocienda <kocienda@apple.com>
909 Did some clean up in the Position class as a result of trying to write some new layout
910 tests and discovering a bug along the way.
912 I removed these three functions from the Position class:
914 1. bool isFirstRenderedPositionOnLine() const;
915 2. bool isLastRenderedPositionOnLine() const;
916 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
917 4. bool inFirstEditableInRootEditableElement() const;
919 The first two have replacements in the VisiblePosition class, and some code has been
920 moved to use these new variants. The third function was a helper used only by these
921 first two function, and can be removed as well. The fourth function was not used by anyone.
923 * khtml/editing/htmlediting.cpp:
924 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
925 * khtml/editing/visible_position.cpp:
926 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
927 Incorrect results were being returned when asking about positions at the starts of blocks.
928 * khtml/xml/dom_position.cpp:
929 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
930 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
931 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
932 * khtml/xml/dom_position.h: Update header for deletions.
934 2004-12-03 Ken Kocienda <kocienda@apple.com>
938 Terminology change in execCommand command identifiers. Specifically, the name of
939 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
940 terminology used by AppKit. It is also more accurate, since the insertion of a
941 "br" element is what the command does. The inspiration for this change is so the
942 -insertNewline AppKit method can be mapped to insert a new "div" element in
943 a document and avoid ambiguity with what the javascript editing command does.
945 * khtml/editing/jsediting.cpp
946 * layout-tests/editing/deleting/delete-tab-004.html
947 * layout-tests/editing/editing.js
948 * layout-tests/editing/inserting/insert-3654864-fix.html
949 * layout-tests/editing/inserting/insert-3659587-fix.html
950 * layout-tests/editing/inserting/insert-3775316-fix.html
951 * layout-tests/editing/inserting/insert-3800346-fix.html
952 * layout-tests/editing/inserting/insert-br-001.html
953 * layout-tests/editing/inserting/insert-br-002.html
954 * layout-tests/editing/inserting/insert-br-003.html
955 * layout-tests/editing/inserting/insert-br-004.html
956 * layout-tests/editing/inserting/insert-br-005.html
957 * layout-tests/editing/inserting/insert-br-006.html
958 * layout-tests/editing/inserting/insert-br-007.html
959 * layout-tests/editing/inserting/insert-br-008.html
960 * layout-tests/editing/inserting/insert-tab-004.html
961 * layout-tests/editing/inserting/insert-text-with-newlines.html
962 * layout-tests/editing/pasteboard/paste-text-010.html
964 2004-12-02 Ken Kocienda <kocienda@apple.com>
970 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
972 * khtml/editing/htmlediting.cpp:
973 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
974 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
975 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
976 in a block and the document is in quirks mode, add an additional br to make the one in the
977 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
978 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
979 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
981 2004-12-02 Richard Williamson <rjw@apple.com>
983 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
985 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
986 the b/f cache won't incorrectly trash the previous state when restoring.
990 * kwq/WebCoreBridge.h:
991 * kwq/WebCoreBridge.mm:
992 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
993 (-[WebCoreBridge canCachePage]):
994 (-[WebCoreBridge clear]):
996 2004-12-02 Ken Kocienda <kocienda@apple.com>
1002 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
1004 * khtml/xml/dom2_rangeimpl.cpp:
1005 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
1006 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
1007 of this bug where there is content after the body tag). Did a little code clean up as well.
1008 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
1010 2004-12-02 Ken Kocienda <kocienda@apple.com>
1016 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
1018 * khtml/khtml_part.cpp:
1019 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
1020 to figure out which end of the selection to extend.
1022 2004-12-02 David Harrison <harrison@apple.com>
1024 Reviewed by Ken Kocienda.
1026 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
1027 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
1029 * khtml/editing/visible_text.cpp:
1030 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1031 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
1032 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
1033 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
1034 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
1035 Distinguish BR from whitespace.
1036 * khtml/editing/visible_text.h:
1037 Distinguish BR from whitespace.
1038 * khtml/editing/visible_units.cpp:
1039 (khtml::previousWordBoundary):
1040 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.
1042 2004-12-02 Ken Kocienda <kocienda@apple.com>
1048 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
1050 * khtml/xml/dom_position.cpp:
1051 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
1052 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
1053 exception trying to use a Position returned from this function to set the boundary point of a Range (which
1054 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
1055 contract to return a range-compliant position, hence the need for this fix.
1057 2004-12-01 Ken Kocienda <kocienda@apple.com>
1063 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
1064 regard to other editing commands. The class had a name change ages ago, and it was never
1066 * khtml/editing/htmlediting.h: Ditto.
1068 2004-12-01 Ken Kocienda <kocienda@apple.com>
1072 Some improvements for paste, including some new code to annotate
1073 whitespace when writing to the pasteboard to ensure that the meaning
1074 of the markup on the pasteboard is unambiguous.
1076 There is also new code for reading this annotated markup from the pasteboard,
1077 removing the nodes that were added only to prevent ambiguity.
1079 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
1080 The header should have been added earlier, but I did not do so.
1081 * khtml/editing/html_interchange.cpp: Added.
1082 (convertHTMLTextToInterchangeFormat):
1083 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
1084 * khtml/editing/htmlediting.cpp:
1085 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
1086 Also fixed a bug in the code that counts blocks in a fragment.
1087 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
1088 (khtml::ReplacementFragment::insertNodeBefore): New helper.
1089 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
1090 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
1091 * khtml/editing/htmlediting.h: Add some new declarations.
1092 * khtml/xml/dom2_rangeimpl.cpp:
1093 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
1094 * khtml/xml/dom_nodeimpl.cpp:
1095 (NodeImpl::stringValueForRange): New helper.
1096 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
1097 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
1098 should be added. Called by the paste code.
1099 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
1101 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
1102 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
1103 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
1105 2004-11-30 Chris Blumenberg <cblu@apple.com>
1107 * ChangeLog: removed conflict marker
1109 2004-11-30 Chris Blumenberg <cblu@apple.com>
1112 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
1113 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
1117 * khtml/misc/loader.cpp:
1118 (CachedObject::~CachedObject): release m_allData
1119 (CachedObject::setAllData): new
1120 (Loader::servePendingRequests): connect slotAllData
1121 (Loader::slotAllData): new
1122 (Cache::requestImage): tweak
1123 * khtml/misc/loader.h:
1124 (khtml::CachedObject::CachedObject): set allData to 0
1125 (khtml::CachedObject::allData): new
1126 * kwq/KWQKJobClasses.h:
1127 * kwq/KWQKJobClasses.mm:
1128 (KIO::TransferJob::TransferJob): set m_allData
1129 (KIO::TransferJob::emitAllData): new
1131 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
1132 * kwq/KWQResourceLoader.mm:
1133 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
1135 (KWQSlot::KWQSlot): support for slotAllData
1137 * kwq/WebCoreBridge.h:
1138 * kwq/WebCoreResourceLoader.h:
1140 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1144 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1148 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
1150 * khtml/khtml_part.cpp:
1151 (KHTMLPart::begin): call setParsing on document here after opening
1152 - from now on we'll only set parsing to true for a document open
1153 caused by page loading, not a programmatic one.
1154 * khtml/xml/dom_docimpl.cpp:
1155 (DocumentImpl::open): don't setParsing to true here any more.
1157 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1161 - fix recent regression from collection perf fixes.
1163 * khtml/html/html_miscimpl.cpp:
1164 (HTMLFormCollectionImpl::updateNameCache): Look up the name
1165 attribute in the name cache, not the id cache (d'oh!)
1167 2004-11-30 Darin Adler <darin@apple.com>
1171 - rolled in a KDE fix for a problem that may underlie a number of crashes
1173 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
1174 the KDE guys to fix a subtle problem. Code said "n = n =".
1176 - rolled in a KDE fix for a containingBlock crash
1178 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
1179 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
1182 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
1185 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
1186 (-[KWQButton detachQButton]): Added.
1187 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
1188 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
1189 (-[KWQButton widget]): Added.
1190 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
1191 (-[KWQButton resignFirstResponder]): Ditto.
1192 (-[KWQButton canBecomeKeyView]): Ditto.
1193 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
1194 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
1196 * kwq/KWQComboBox.mm:
1197 (QComboBox::~QComboBox): Call detachQComboBox.
1198 (-[KWQPopUpButtonCell detachQComboBox]): Added.
1199 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
1200 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
1201 (-[KWQPopUpButton action:]): Ditto.
1202 (-[KWQPopUpButton widget]): Tweaked.
1203 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
1204 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
1205 (-[KWQPopUpButton resignFirstResponder]): Ditto.
1206 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
1208 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
1210 * kwq/KWQListBox.mm:
1211 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
1213 * kwq/KWQScrollBar.h: Removed m_scroller field.
1214 * kwq/KWQScrollBar.mm:
1215 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
1216 (-[KWQScrollBar detachQScrollBar]): Added.
1217 (-[KWQScrollBar widget]): Added.
1218 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
1219 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
1220 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
1221 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
1222 (QScrollBar::setKnobProportion): Ditto.
1223 (QScrollBar::scrollbarHit): Ditto.
1225 * kwq/KWQScrollView.mm:
1226 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
1227 hack where we don't remove right away when doing mouse tracking.
1228 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
1229 the hack where we don't add right away when doing mouse tracking.
1231 * kwq/KWQSlider.h: Added destructor.
1233 (-[KWQSlider initWithQSlider:]): Tweaked a little.
1234 (-[KWQSlider detachQSlider]): Added.
1235 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
1236 (-[KWQSlider widget]): Added.
1237 (QSlider::~QSlider): Added. Calls detachQSlider.
1239 * kwq/KWQTextArea.h: Added detachQTextEdit method.
1240 * kwq/KWQTextArea.mm:
1241 (-[KWQTextArea detachQTextEdit]): Added.
1242 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
1243 (-[KWQTextArea becomeFirstResponder]): Ditto.
1244 (-[KWQTextArea nextKeyView]): Ditto.
1245 (-[KWQTextArea previousKeyView]): Ditto.
1246 (-[KWQTextArea drawRect:]): Ditto.
1247 (-[KWQTextAreaTextView insertTab:]): Ditto.
1248 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
1249 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
1250 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
1251 (-[KWQTextAreaTextView mouseDown:]): Ditto.
1252 (-[KWQTextAreaTextView keyDown:]): Ditto.
1253 (-[KWQTextAreaTextView keyUp:]): Ditto.
1255 * kwq/KWQTextEdit.h: Added ~QTextEdit.
1256 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
1258 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
1259 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
1261 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
1262 Added beforeMouseDown and afterMouseDown for use in widget implementations.
1263 Removed unused hasMouseTracking function.
1265 (QWidget::QWidget): Initialize two new fields.
1266 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
1267 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
1268 (QWidget::addToSuperview): Added.
1269 (QWidget::removeFromSuperview): Added.
1270 (QWidget::beforeMouseDown): Added.
1271 (QWidget::afterMouseDown): Added.
1273 * khtml/rendering/render_layer.cpp:
1274 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
1275 (RenderLayer::setHasVerticalScrollbar): Ditto.
1277 2004-11-30 Ken Kocienda <kocienda@apple.com>
1283 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
1285 * khtml/khtml_part.cpp:
1286 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
1287 with no blink if it is.
1289 2004-11-30 Ken Kocienda <kocienda@apple.com>
1295 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
1297 * khtml/khtml_part.cpp:
1298 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
1299 or <input type=image> was checked for focus since these elements are keyboard-focusable,
1300 but not mouse focusable. Also, this function did not work hard enough to set the focused
1301 node, and was content to clear it if the first element checked failed the test, rather
1302 than looking more at parents. This would have the effect of clearing, then resetting the
1303 focus on a DIV containing a button or image with content on either side of it in the
1304 process of arrowing over such content.
1306 2004-11-30 Ken Kocienda <kocienda@apple.com>
1310 * khtml/editing/htmlediting.cpp:
1311 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
1312 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
1313 * khtml/khtml_part.cpp:
1314 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
1315 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
1316 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
1317 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
1318 isCharacterSmartReplaceExempt virtual.
1320 2004-11-30 Ken Kocienda <kocienda@apple.com>
1324 * khtml/editing/htmlediting.cpp:
1325 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
1326 Seemed simple enough to land without review.
1328 2004-11-29 Ken Kocienda <kocienda@apple.com>
1332 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
1333 are handled correctly now, including selections that span multiple blocks, and cases
1334 where content on the pasteboard ends in newlines (or what appear to be newlines to a
1335 user, really block ends or BRs). I also made one small, but important change in the
1336 copy code to annotate the markup written to the pasteboard to support these selections
1339 New header that defines a couple of constants used in copying and pasting.
1341 * ForwardingHeaders/editing/html_interchange.h: Added.
1342 * khtml/editing/html_interchange.h: Added.
1344 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
1345 as a new helper class, ReplacementFragment, which encapsulates information and functions
1346 pertaining to a document fragment that is being inserted into a document.
1348 * khtml/editing/htmlediting.cpp:
1349 (khtml::ReplacementFragment::ReplacementFragment):
1350 (khtml::ReplacementFragment::~ReplacementFragment):
1351 (khtml::ReplacementFragment::firstChild): Simple accessor.
1352 (khtml::ReplacementFragment::lastChild): Ditto.
1353 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
1354 the starting node to use for merging into the block containing the start of the selection.
1355 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
1356 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
1357 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
1358 special annotation comment added in by the copy code.
1359 (khtml::ReplacementFragment::removeNode): Simple helper.
1360 (khtml::isComment): Simple helper.
1361 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
1362 I would like to do better than this some day, but this check will hold us until I can do better.
1363 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
1364 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
1365 (khtml::ReplaceSelectionCommand::doApply):
1366 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
1367 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
1368 (khtml::ReplacementFragment::root):
1369 (khtml::ReplacementFragment::type):
1370 (khtml::ReplacementFragment::isEmpty):
1371 (khtml::ReplacementFragment::isSingleTextNode):
1372 (khtml::ReplacementFragment::isTreeFragment):
1373 (khtml::ReplacementFragment::hasMoreThanOneBlock):
1374 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
1376 This smaller set of changes markup generation to add the newline annotation described in the
1377 comment at the start of this entry.
1379 * khtml/xml/dom2_rangeimpl.cpp:
1380 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
1381 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
1382 comment annotations are added to the markup generated.
1383 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
1384 * kwq/WebCoreBridge.mm:
1385 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
1386 DOM::RangeImpl::toHTML uses annotations when generating.
1390 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
1391 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
1392 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
1393 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
1394 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
1395 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
1396 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
1397 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
1398 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
1399 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
1400 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
1401 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
1402 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
1403 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
1404 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
1405 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
1406 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
1407 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
1409 2004-11-29 Ken Kocienda <kocienda@apple.com>
1411 Reviewed by Harrison
1413 Made two small changes that make it possible for comments to have DOM nodes made for them
1414 when pasting. This relies on some earlier work I did some days ago.
1416 * khtml/xml/dom_nodeimpl.cpp:
1417 (NodeImpl::startMarkup): Get the string from the comment.
1418 * kwq/WebCoreBridge.mm:
1419 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
1420 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
1421 be included in the DOM.
1423 2004-11-29 Ken Kocienda <kocienda@apple.com>
1425 Reviewed by Harrison
1427 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
1428 my improved paste code.
1430 * khtml/editing/visible_position.cpp:
1431 (khtml::blockRelationship)
1432 (khtml::visiblePositionsInDifferentBlocks)
1433 (khtml::isFirstVisiblePositionInBlock)
1434 (khtml::isFirstVisiblePositionInNode)
1435 (khtml::isLastVisiblePositionInBlock)
1436 * khtml/editing/visible_position.h
1438 2004-11-29 Ken Kocienda <kocienda@apple.com>
1440 Reviewed by Harrison
1442 * khtml/xml/dom_position.cpp:
1443 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
1444 specified from obeying that directive. The old code would stop at an outer block boundary in
1445 the case where that block had a block as its first child. The correct behavior is to drill into
1446 that inner block (and continue on drilling down, if possible), to find the correct position.
1448 2004-11-29 Ken Kocienda <kocienda@apple.com>
1450 Reviewed by Harrison
1452 Small improvements to the node-display debugging helpers.
1454 * khtml/xml/dom_nodeimpl.cpp:
1455 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
1456 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
1458 2004-11-29 Ken Kocienda <kocienda@apple.com>
1460 Reviewed by Harrison
1462 * khtml/editing/htmlediting.cpp:
1463 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
1464 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
1465 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
1466 place after the delete.
1468 2004-11-29 Ken Kocienda <kocienda@apple.com>
1470 Reviewed by Harrison
1472 Add a new helper function to insert a paragraph separator. Will be used in my
1473 upcoming paste improvments.
1475 * khtml/editing/htmlediting.cpp: Added function
1476 (khtml::CompositeEditCommand::insertParagraphSeparator)
1477 * khtml/editing/htmlediting.h: Ditto.
1479 2004-11-23 David Harrison <harrison@apple.com>
1481 Added various comments.
1483 * khtml/editing/htmlediting.cpp:
1484 (khtml::StyleChange::init):
1485 (khtml::ApplyStyleCommand::doApply):
1486 (khtml::ApplyStyleCommand::applyBlockStyle):
1487 (khtml::ApplyStyleCommand::applyInlineStyle):
1489 2004-11-23 David Hyatt <hyatt@apple.com>
1491 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
1492 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
1494 * khtml/rendering/render_block.cpp:
1495 (khtml::RenderBlock::nodeAtPoint):
1497 2004-11-22 David Hyatt <hyatt@apple.com>
1499 Make sure you can use document.createElement to make a <canvas> element.
1501 * khtml/xml/dom_docimpl.cpp:
1502 (DocumentImpl::createHTMLElement):
1504 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1508 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
1509 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
1510 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
1511 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
1513 * khtml/ecma/kjs_html.cpp:
1514 (KJS::HTMLDocument::tryGet):
1515 * khtml/html/html_formimpl.cpp:
1516 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
1517 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1518 * khtml/html/html_formimpl.h:
1519 * khtml/html/html_miscimpl.cpp:
1520 (HTMLCollectionImpl::HTMLCollectionImpl):
1521 (HTMLCollectionImpl::~HTMLCollectionImpl):
1522 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
1523 (HTMLCollectionImpl::CollectionInfo::reset):
1524 (HTMLCollectionImpl::resetCollectionInfo):
1525 (HTMLCollectionImpl::checkForNameMatch):
1527 (HTMLCollectionImpl::updateNameCache):
1528 (HTMLCollectionImpl::namedItems):
1529 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
1530 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1531 (HTMLFormCollectionImpl::item):
1532 (HTMLFormCollectionImpl::updateNameCache):
1533 * khtml/html/html_miscimpl.h:
1535 2004-11-22 David Hyatt <hyatt@apple.com>
1537 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
1542 * khtml/misc/loader.cpp:
1543 (CachedObject::finish):
1546 * khtml/misc/loader.h:
1547 (khtml::Cache::maxCacheableObjectSize):
1549 2004-11-22 David Hyatt <hyatt@apple.com>
1551 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
1552 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
1553 that lets us short circuit earlier when painting and hit testing.
1557 * khtml/khtml_part.cpp:
1558 (KHTMLPart::isPointInsideSelection):
1559 * khtml/rendering/render_block.cpp:
1560 (khtml::RenderBlock::paint):
1561 (khtml::RenderBlock::paintChildren):
1562 (khtml::RenderBlock::paintObject):
1563 (khtml::RenderBlock::paintFloats):
1564 (khtml::RenderBlock::nodeAtPoint):
1565 * khtml/rendering/render_block.h:
1566 * khtml/rendering/render_box.cpp:
1567 (RenderBox::nodeAtPoint):
1568 * khtml/rendering/render_box.h:
1569 * khtml/rendering/render_br.h:
1570 * khtml/rendering/render_canvas.cpp:
1571 (RenderCanvas::paint):
1572 * khtml/rendering/render_flow.cpp:
1573 (RenderFlow::paintLines):
1574 (RenderFlow::hitTestLines):
1575 (RenderFlow::caretRect):
1576 (RenderFlow::addFocusRingRects):
1577 (RenderFlow::paintFocusRing):
1578 (RenderFlow::paintOutlines):
1579 (RenderFlow::paintOutlineForLine):
1580 * khtml/rendering/render_flow.h:
1581 * khtml/rendering/render_frames.cpp:
1582 (RenderFrameSet::nodeAtPoint):
1583 * khtml/rendering/render_frames.h:
1584 * khtml/rendering/render_image.cpp:
1585 (RenderImage::nodeAtPoint):
1586 * khtml/rendering/render_image.h:
1587 * khtml/rendering/render_inline.cpp:
1588 (RenderInline::paint):
1589 (RenderInline::nodeAtPoint):
1590 * khtml/rendering/render_inline.h:
1591 * khtml/rendering/render_layer.cpp:
1592 (RenderLayer::paintLayer):
1593 (RenderLayer::hitTest):
1594 (RenderLayer::hitTestLayer):
1595 * khtml/rendering/render_layer.h:
1596 * khtml/rendering/render_line.cpp:
1597 (khtml::InlineBox::paint):
1598 (khtml::InlineBox::nodeAtPoint):
1599 (khtml::InlineFlowBox::flowObject):
1600 (khtml::InlineFlowBox::nodeAtPoint):
1601 (khtml::InlineFlowBox::paint):
1602 (khtml::InlineFlowBox::paintBackgrounds):
1603 (khtml::InlineFlowBox::paintBackground):
1604 (khtml::InlineFlowBox::paintBackgroundAndBorder):
1605 (khtml::InlineFlowBox::paintDecorations):
1606 (khtml::EllipsisBox::paint):
1607 (khtml::EllipsisBox::nodeAtPoint):
1608 (khtml::RootInlineBox::paintEllipsisBox):
1609 (khtml::RootInlineBox::paint):
1610 (khtml::RootInlineBox::nodeAtPoint):
1611 * khtml/rendering/render_line.h:
1612 (khtml::InlineRunBox::paintBackgroundAndBorder):
1613 * khtml/rendering/render_object.cpp:
1614 (RenderObject::hitTest):
1615 (RenderObject::setInnerNode):
1616 (RenderObject::nodeAtPoint):
1617 * khtml/rendering/render_object.h:
1618 (khtml::RenderObject::PaintInfo::PaintInfo):
1619 (khtml::RenderObject::PaintInfo::~PaintInfo):
1620 (khtml::RenderObject::paintingRootForChildren):
1621 (khtml::RenderObject::shouldPaintWithinRoot):
1622 * khtml/rendering/render_table.cpp:
1623 (RenderTable::layout):
1624 (RenderTable::paint):
1625 * khtml/rendering/render_text.cpp:
1626 (simpleDifferenceBetweenColors):
1627 (correctedTextColor):
1628 (InlineTextBox::nodeAtPoint):
1629 (InlineTextBox::paint):
1630 (InlineTextBox::selectionStartEnd):
1631 (InlineTextBox::paintSelection):
1632 (InlineTextBox::paintMarkedTextBackground):
1633 (InlineTextBox::paintDecoration):
1634 (RenderText::posOfChar):
1635 * khtml/rendering/render_text.h:
1636 (khtml::RenderText::paint):
1637 (khtml::RenderText::layout):
1638 (khtml::RenderText::nodeAtPoint):
1639 * khtml/xml/dom2_eventsimpl.cpp:
1640 (MouseEventImpl::computeLayerPos):
1641 * khtml/xml/dom_docimpl.cpp:
1642 (DocumentImpl::prepareMouseEvent):
1643 * kwq/KWQAccObject.mm:
1644 (-[KWQAccObject accessibilityHitTest:]):
1645 * kwq/KWQKHTMLPart.mm:
1646 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
1647 (KWQKHTMLPart::eventMayStartDrag):
1648 (KWQKHTMLPart::khtmlMouseMoveEvent):
1649 * kwq/WebCoreBridge.mm:
1650 (-[WebCoreBridge elementAtPoint:]):
1651 (-[WebCoreBridge _positionForPoint:]):
1653 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1657 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
1658 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
1660 This avoids the O(N^2) penalty for named item traversal for form collections.
1662 It also combines the item traversal logic for all non-form
1663 collection operations into a single traverseNextItem
1664 function. This avoids having 5 copies of the big switch statement
1667 Also fixed a bug that prevented the last form element from being removed properly.
1669 * khtml/html/html_formimpl.cpp:
1670 (DOM::removeFromVector):
1671 * khtml/dom/html_misc.cpp:
1672 (HTMLCollection::namedItems):
1673 * khtml/dom/html_misc.h:
1674 * khtml/ecma/kjs_html.cpp:
1675 (KJS::HTMLCollection::getNamedItems):
1676 * khtml/html/html_miscimpl.cpp:
1677 (HTMLCollectionImpl::traverseNextItem):
1678 (HTMLCollectionImpl::calcLength):
1679 (HTMLCollectionImpl::length):
1680 (HTMLCollectionImpl::item):
1681 (HTMLCollectionImpl::nextItem):
1682 (HTMLCollectionImpl::checkForNameMatch):
1683 (HTMLCollectionImpl::namedItem):
1684 (HTMLCollectionImpl::namedItems):
1685 (HTMLCollectionImpl::nextNamedItem):
1686 (HTMLFormCollectionImpl::calcLength):
1687 (HTMLFormCollectionImpl::namedItem):
1688 (HTMLFormCollectionImpl::nextNamedItem):
1689 (HTMLFormCollectionImpl::namedItems):
1690 * khtml/html/html_miscimpl.h:
1692 2004-11-22 Ken Kocienda <kocienda@apple.com>
1694 Reviewed by Harrison
1696 Change around the way we block the Javascript "Paste" command identifier from
1697 being available. Formerly, this was done with an ifdef we never compiled in.
1698 Now, this is done with a couple of cheap runtime checks. The advantage is that
1699 we can now compile this command into development builds, and still yet switch
1700 on the command in deployment builds through the use of WebCore SPI so we can
1701 write and run layout tests with all of our builds.
1703 * khtml/editing/jsediting.cpp:
1704 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
1705 command being queried is the paste command.
1706 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
1707 * khtml/editing/jsediting.h: Ditto.
1708 * khtml/khtml_part.cpp:
1709 (KHTMLPart::pasteFromPasteboard): Added.
1710 (KHTMLPart::canPaste): Added.
1711 * kwq/KWQKHTMLPart.mm:
1712 (KHTMLPart::canPaste): Added.
1713 * kwq/KWQRenderTreeDebug.cpp:
1714 (externalRepresentation): Turn on paste command.
1715 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
1717 2004-11-21 Maciej Stachowiak <mjs@apple.com>
1719 Reviewed by Richard.
1721 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
1723 * khtml/html/html_miscimpl.cpp:
1724 (HTMLCollectionImpl::calcLength):
1725 (HTMLCollectionImpl::getItem):
1726 (HTMLCollectionImpl::item):
1727 (HTMLCollectionImpl::nextItem):
1728 (HTMLCollectionImpl::getNamedItem):
1729 (HTMLCollectionImpl::namedItem):
1730 (HTMLCollectionImpl::nextNamedItemInternal):
1731 (HTMLFormCollectionImpl::nextNamedItemInternal):
1733 2004-11-19 Maciej Stachowiak <mjs@apple.com>
1737 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
1738 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
1739 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
1741 Many optimizations to HTMLFormCollection. Iterating it should not
1742 be N^2 any more, though finding items by name could still be.
1744 * khtml/html/html_formimpl.cpp:
1745 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1746 (DOM::HTMLFormElementImpl::length):
1747 (DOM::HTMLFormElementImpl::submitClick):
1748 (DOM::HTMLFormElementImpl::formData):
1749 (DOM::HTMLFormElementImpl::submit):
1750 (DOM::HTMLFormElementImpl::reset):
1751 (DOM::HTMLFormElementImpl::radioClicked):
1752 (DOM::appendToVector):
1753 (DOM::removeFromVector):
1754 (DOM::HTMLFormElementImpl::registerFormElement):
1755 (DOM::HTMLFormElementImpl::removeFormElement):
1756 (DOM::HTMLFormElementImpl::makeFormElementDormant):
1757 (DOM::HTMLFormElementImpl::registerImgElement):
1758 (DOM::HTMLFormElementImpl::removeImgElement):
1759 * khtml/html/html_formimpl.h:
1760 * khtml/html/html_miscimpl.cpp:
1761 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
1762 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
1763 (HTMLFormCollectionImpl::resetCollectionInfo):
1764 (HTMLFormCollectionImpl::calcLength):
1765 (HTMLFormCollectionImpl::item):
1766 (HTMLFormCollectionImpl::getNamedItem):
1767 (HTMLFormCollectionImpl::getNamedFormItem):
1768 (HTMLFormCollectionImpl::firstItem):
1769 (HTMLFormCollectionImpl::nextItem):
1770 * khtml/html/html_miscimpl.h:
1771 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1772 * khtml/xml/dom_elementimpl.cpp:
1773 (ElementImpl::setAttribute):
1774 (ElementImpl::setAttributeMap):
1775 * kwq/KWQPtrVector.h:
1776 (QPtrVector::findRef):
1777 * kwq/KWQVectorImpl.h:
1778 * kwq/KWQVectorImpl.mm:
1779 (KWQVectorImpl::findRef):
1780 * kwq/WebCoreBridge.mm:
1781 (-[WebCoreBridge elementWithName:inForm:]):
1782 (-[WebCoreBridge controlsInForm:]):
1784 2004-11-19 David Harrison <harrison@apple.com>
1786 Reviewed by Ken and Darin.
1788 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
1790 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
1791 for the existing style, but in this case (hitting cmd-B with caret at top of
1792 file) there is nothing upstream. Changed this to use the VisiblePosition
1793 deepEquivalent instead.
1795 * khtml/khtml_part.cpp:
1796 (KHTMLPart::computeAndSetTypingStyle):
1800 2004-11-19 Maciej Stachowiak <mjs@apple.com>
1804 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
1806 * khtml/xml/dom_docimpl.cpp:
1807 (DocumentImpl::close): Don't fire the onload handler if there is a
1808 redirect pending. This is a very long-standing bug that was masked
1809 by our previously incorrect redirect logic. It used to be that an
1810 older redirect would always win. Recently we changed things so
1811 that a newer redirect would win, but a script that causes a
1812 redirect would stop parsing once complete (so if there are two
1813 redirects in the same script, the latter wins). However, we should
1814 have also prevented onload in this case. Testing with other
1815 browsers shows that onload handlers do not run at all when there
1816 is a pending redirect.
1818 2004-11-19 Ken Kocienda <kocienda@apple.com>
1820 Reviewed by Harrison
1822 Fix some object lifetime issues in these two commands. This fixes some crashes
1823 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
1825 * khtml/editing/htmlediting.cpp:
1826 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
1827 in the ancestor list. They are not ref'ed when put on list. D'uh.
1828 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
1829 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
1830 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
1832 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
1834 2004-11-19 Ken Kocienda <kocienda@apple.com>
1836 Reviewed by Harrison
1840 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
1842 * khtml/khtml_part.cpp:
1843 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
1844 declaration given the current selection, and then sets the minimum necessary style as the typing
1846 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
1847 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
1849 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
1850 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
1851 * kwq/WebCoreBridge.mm:
1852 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
1853 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
1855 2004-11-18 David Harrison <harrison@apple.com>
1859 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
1860 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
1863 (-[DOMCSSStyleDeclaration setProperty:::]):
1865 2004-11-18 Chris Blumenberg <cblu@apple.com>
1867 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
1871 * kwq/KWQKHTMLPart.mm:
1872 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
1874 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1878 - fix recursive item traversal, use traverseNextNode() instead of
1879 the buggy hand-rolled traversal.
1881 * khtml/xml/dom_nodeimpl.cpp:
1882 (NodeListImpl::recursiveItem):
1884 2004-11-17 Darin Adler <darin@apple.com>
1888 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
1890 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
1891 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
1893 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
1894 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
1895 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
1896 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
1897 an entire category of leaks we have been fixing one by one recently
1898 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
1899 stale RenderObject pointer, although I never saw it do that in practice
1900 - implemented the length and item methods for computed styles
1901 - implemented querying additional properties in computed styles (29 more)
1903 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1904 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
1905 take a mutable style.
1906 * khtml/khtml_part.cpp:
1907 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
1908 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
1909 a computed style; also change some types to mutable style.
1910 (updateState): Update iteration of CSSProperty objects in a style declaration to use
1911 the new valuesIterator interface.
1912 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
1913 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
1914 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
1915 including accomodating the exception code that setCssText has now.
1916 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
1917 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
1918 the style attributes really was a change, although it's not an important optimization it's
1919 good to do it right.
1921 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
1922 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
1923 calling it were already removing the old property explicitly, so the code in here to remove
1924 the property again was redundant.
1926 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
1927 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
1928 * khtml/css/css_computedstyle.cpp:
1929 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
1930 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
1931 Before we had no guarantee the object would outlast us.
1932 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
1933 exception to NO_MODIFICATION_ALLOWED_ERR.
1934 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
1935 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
1936 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
1937 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
1938 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
1939 page-break-inside, position, unicode-bidi, widows, z-index.
1940 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
1941 exception to NO_MODIFICATION_ALLOWED_ERR.
1942 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
1943 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
1944 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
1945 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
1946 CSSMutableStyleDeclarationImpl.
1947 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
1948 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
1950 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1951 now a separate class rather than a typedef.
1952 * khtml/css/cssparser.h: Ditto.
1954 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
1955 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
1956 Removed a bunch of redundant stuff from other classes in this file too.
1957 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
1958 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
1959 (DOM::CSSProperty::operator=): Added.
1960 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
1962 * khtml/css/css_valueimpl.cpp:
1963 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
1964 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
1965 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
1966 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
1967 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
1968 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
1969 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
1970 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
1971 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
1972 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
1973 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
1974 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
1975 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
1976 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
1977 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
1978 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
1979 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
1980 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
1981 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
1982 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
1983 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
1984 no styles in the list. Update to use QValueList.
1985 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
1986 parameter and set it.
1987 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
1988 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
1989 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
1990 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
1991 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
1992 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
1994 * khtml/css/cssparser.cpp:
1995 (CSSParser::parseValue): Changed to use addParsedProperties.
1996 (CSSParser::parseDeclaration): Ditto.
1997 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
1999 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
2000 * khtml/css/cssproperties.c: Regenerated.
2001 * khtml/css/cssproperties.h: Regenerated.
2003 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
2004 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
2006 * khtml/dom/css_value.cpp:
2007 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
2008 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
2009 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
2010 first doing getPropertyCSSValue and then doing cssText.
2011 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
2012 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
2013 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
2014 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
2015 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
2016 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
2017 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
2019 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
2020 * khtml/dom/dom_node.cpp: Ditto.
2022 * khtml/editing/htmlediting.h: Change some types to mutable style.
2023 * khtml/editing/htmlediting.cpp:
2024 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
2025 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
2026 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
2027 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
2028 (khtml::EditCommand::setTypingStyle): Ditto.
2029 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
2030 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
2031 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
2032 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
2033 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
2034 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
2035 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
2036 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2037 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
2038 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
2039 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
2040 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
2041 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
2043 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
2044 * khtml/html/html_baseimpl.h: Change type to mutable style.
2045 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
2047 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
2048 class as a base class, and change types to mutable style as needed.
2049 * khtml/html/html_elementimpl.cpp:
2050 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
2051 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
2052 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
2053 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
2054 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
2055 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
2057 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
2060 * khtml/html/html_tableimpl.h: Change types to mutable style.
2061 * khtml/html/html_tableimpl.cpp:
2062 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2063 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
2064 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2066 * khtml/html/htmlparser.cpp:
2067 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
2068 than using an explicit delete to make the node go away, and is required for compatibility with the
2069 changes to the NodeImpl functions.
2070 (KHTMLParser::insertNode): Ditto.
2071 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
2072 the NodeImpl functions.
2074 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
2075 now that there's no need to make the property list explictly.
2078 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
2079 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
2080 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
2082 * khtml/xml/dom_nodeimpl.cpp:
2083 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
2084 function succeeded or not for ownership purposes.
2085 (NodeImpl::replaceChild): Ditto.
2086 (NodeImpl::appendChild): Ditto.
2087 (NodeBaseImpl::insertBefore): Ditto.
2088 (NodeBaseImpl::replaceChild): Ditto.
2089 (NodeBaseImpl::appendChild): Ditto.
2090 (NodeBaseImpl::addChild): Ditto.
2092 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
2093 * WebCore-combined.exp: Regenerated.
2095 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2097 still even more build fixing
2099 * khtml/html/html_miscimpl.cpp:
2100 (HTMLCollectionImpl::resetCollectionInfo):
2102 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2106 * khtml/html/html_miscimpl.cpp:
2107 (HTMLCollectionImpl::resetCollectionInfo):
2109 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2111 Fixed build problem.
2113 * khtml/html/html_miscimpl.h:
2114 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
2116 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2120 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
2122 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
2123 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
2125 This is also a start on fixing 5 other bugs, but those need additional work to make
2126 HTMLFormCollection fast.
2128 * khtml/html/html_documentimpl.h:
2129 (DOM::HTMLDocumentImpl::collectionInfo):
2130 * khtml/html/html_formimpl.cpp:
2131 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2132 (DOM::HTMLFormElementImpl::isURLAttribute):
2133 (DOM::HTMLFormElementImpl::registerImgElement):
2134 (DOM::HTMLFormElementImpl::removeImgElement):
2135 * khtml/html/html_formimpl.h:
2136 * khtml/html/html_imageimpl.cpp:
2137 (HTMLImageElementImpl::HTMLImageElementImpl):
2138 (HTMLImageElementImpl::~HTMLImageElementImpl):
2139 * khtml/html/html_imageimpl.h:
2140 * khtml/html/html_miscimpl.cpp:
2141 (HTMLCollectionImpl::HTMLCollectionImpl):
2142 (HTMLCollectionImpl::~HTMLCollectionImpl):
2143 (HTMLCollectionImpl::updateCollectionInfo):
2144 (HTMLCollectionImpl::length):
2145 (HTMLCollectionImpl::item):
2146 (HTMLCollectionImpl::firstItem):
2147 (HTMLCollectionImpl::nextItem):
2148 (HTMLCollectionImpl::namedItem):
2149 (HTMLCollectionImpl::nextNamedItemInternal):
2150 (HTMLFormCollectionImpl::getNamedFormItem):
2151 * khtml/html/html_miscimpl.h:
2152 (DOM::HTMLCollectionImpl::):
2153 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
2154 * khtml/html/htmlparser.cpp:
2155 (KHTMLParser::getElement):
2156 * khtml/xml/dom_docimpl.cpp:
2157 (DocumentImpl::DocumentImpl):
2158 * khtml/xml/dom_docimpl.h:
2159 (DOM::DocumentImpl::incDOMTreeVersion):
2160 (DOM::DocumentImpl::domTreeVersion):
2161 * khtml/xml/dom_nodeimpl.cpp:
2165 2004-11-18 Kevin Decker <kdecker@apple.com>
2169 fixed: <rdar://problem/3841842> getPropertyID expensive
2172 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
2174 2004-11-17 David Hyatt <hyatt@apple.com>
2176 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
2177 and subsequently backed out).
2179 Reviewed by kocienda
2181 * khtml/html/html_baseimpl.cpp:
2182 (HTMLBodyElementImpl::insertedIntoDocument):
2183 * khtml/html/htmltokenizer.cpp:
2184 (khtml::HTMLTokenizer::reset):
2185 (khtml::HTMLTokenizer::scriptHandler):
2186 (khtml::HTMLTokenizer::scriptExecution):
2187 (khtml::HTMLTokenizer::write):
2188 (khtml::HTMLTokenizer::continueProcessing):
2189 (khtml::HTMLTokenizer::timerEvent):
2190 (khtml::HTMLTokenizer::notifyFinished):
2191 * khtml/html/htmltokenizer.h:
2192 * khtml/khtmlview.cpp:
2193 (KHTMLViewPrivate::KHTMLViewPrivate):
2194 (KHTMLViewPrivate::reset):
2196 (KHTMLView::layout):
2197 (KHTMLView::timerEvent):
2198 (KHTMLView::scheduleRelayout):
2199 (KHTMLView::layoutPending):
2200 (KHTMLView::haveDelayedLayoutScheduled):
2201 (KHTMLView::unscheduleRelayout):
2202 * khtml/khtmlview.h:
2203 * khtml/xml/dom_docimpl.cpp:
2204 (DocumentImpl::DocumentImpl):
2205 (DocumentImpl::close):
2206 (DocumentImpl::setParsing):
2207 (DocumentImpl::shouldScheduleLayout):
2208 (DocumentImpl::minimumLayoutDelay):
2209 (DocumentImpl::write):
2210 (DocumentImpl::finishParsing):
2211 (DocumentImpl::stylesheetLoaded):
2212 (DocumentImpl::updateStyleSelector):
2213 * khtml/xml/dom_docimpl.h:
2214 (DOM::DocumentImpl::parsing):
2215 * kwq/KWQDateTime.mm:
2216 (KWQUIEventTime::uiEventPending):
2218 2004-11-17 David Harrison <harrison@apple.com>
2220 Reviewed by Ken Kocienda.
2222 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
2223 Treat null case as meaning no post-move merge is needed.
2225 * khtml/editing/htmlediting.cpp:
2226 (khtml::DeleteSelectionCommand::initializePositionData):
2228 2004-11-17 David Harrison <harrison@apple.com>
2230 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
2231 * khtml/xml/dom_nodeimpl.cpp:
2232 (NodeImpl::displayNode):
2233 (NodeImpl::displayTree):
2234 (NodeBaseImpl::dispatchChildRemovalEvents):
2235 * khtml/xml/dom_nodeimpl.h:
2237 2004-11-16 John Sullivan <sullivan@apple.com>
2239 Reviewed by Richard.
2241 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
2243 * khtml/khtml_part.cpp:
2245 delete the list we created when we're done with it
2247 2004-11-16 Ken Kocienda <kocienda@apple.com>
2251 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
2252 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
2253 QPtrList when the list goes out of scope.
2255 * khtml/editing/htmlediting.cpp:
2256 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
2257 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
2258 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
2259 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
2260 No longer set lists to autodelete.
2261 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
2262 Call new derefNodesInList helper.
2263 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
2264 of one before, but now it does.
2266 2004-11-15 David Harrison <harrison@apple.com>
2268 Reviewed by Chris and Darin.
2270 <rdar://problem/3880304> Non-linear performance hit for style changes
2272 * khtml/xml/dom_nodeimpl.cpp:
2273 (NodeImpl::traverseNextNode):
2274 (NodeImpl::traverseNextSibling):
2275 (NodeImpl::traversePreviousNodePostOrder):
2276 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
2277 Add asserts that stayWithin is an ancestor of the returned node.
2279 2004-11-15 Darin Adler <darin@apple.com>
2283 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
2285 * khtml/css/css_computedstyle.cpp:
2286 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
2287 since there's no guarantee it's already ref'd.
2288 * khtml/css/css_valueimpl.cpp:
2289 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
2290 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
2291 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
2292 (CSSStyleDeclarationImpl::merge): Ditto.
2293 (CSSStyleDeclarationImpl::diff): Ditto.
2294 * khtml/editing/htmlediting.cpp:
2295 (khtml::StyleChange::currentlyHasStyle): Ditto.
2296 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
2297 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
2298 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
2300 2004-11-15 Darin Adler <darin@apple.com>
2304 Use separate mutable style and computed style types as appropriate.
2305 For now this should have no effect, but it prepares us for refactoring later.
2306 Also remove some unnecessary "DOM::" prefixes and in one case factor out
2309 * khtml/khtml_part.cpp:
2310 (KHTMLPart::typingStyle):
2311 (KHTMLPart::setTypingStyle):
2313 (KHTMLPart::selectionHasStyle):
2314 (KHTMLPart::selectionStartHasStyle):
2315 (KHTMLPart::selectionComputedStyle):
2316 * khtml/khtml_part.h:
2317 * khtml/khtmlpart_p.h:
2319 * khtml/css/css_base.h:
2320 * khtml/css/css_ruleimpl.cpp:
2321 (CSSStyleRuleImpl::setDeclaration):
2322 * khtml/css/css_ruleimpl.h:
2323 (DOM::CSSFontFaceRuleImpl::style):
2324 (DOM::CSSPageRuleImpl::style):
2325 (DOM::CSSStyleRuleImpl::style):
2326 (DOM::CSSStyleRuleImpl::declaration):
2327 * khtml/css/css_valueimpl.h:
2328 (DOM::CSSPrimitiveValueImpl::):
2329 * khtml/css/cssparser.cpp:
2330 (CSSParser::parseValue):
2331 (CSSParser::parseColor):
2332 (CSSParser::parseDeclaration):
2333 (CSSParser::createStyleDeclaration):
2334 * khtml/css/cssparser.h:
2335 * khtml/css/cssstyleselector.cpp:
2336 (khtml::CSSStyleSelector::addMatchedDeclaration):
2337 (khtml::CSSStyleSelector::matchRulesForList):
2338 (khtml::CSSStyleSelector::styleForElement):
2339 (khtml::CSSStyleSelector::applyDeclarations):
2340 * khtml/css/cssstyleselector.h:
2341 * khtml/css/parser.cpp:
2342 * khtml/css/parser.y:
2343 * khtml/dom/css_rule.h:
2344 * khtml/dom/css_stylesheet.h:
2345 * khtml/dom/css_value.h:
2346 * khtml/dom/dom2_views.cpp:
2347 * khtml/xml/dom2_viewsimpl.cpp:
2348 (DOM::AbstractViewImpl::getComputedStyle):
2349 * khtml/xml/dom_docimpl.cpp:
2350 (DocumentImpl::importNode):
2351 (DocumentImpl::setStyleSheet):
2352 * khtml/xml/dom_docimpl.h:
2353 * khtml/xml/dom_xmlimpl.cpp:
2354 (DOM::ProcessingInstructionImpl::setStyleSheet):
2355 * khtml/xml/dom_xmlimpl.h:
2357 * khtml/dom/css_value.cpp:
2358 (DOM::throwException): Added.
2359 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
2360 The real thing is coming with the next change to refactor.
2361 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
2362 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
2364 2004-11-15 Darin Adler <darin@apple.com>
2368 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
2370 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
2371 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
2372 node's attributes changed without sending a misleading childrenChanged call,
2373 but the childrenChanged call can happen at the exact right moment.
2374 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
2375 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
2376 the boolean true is passed in.
2378 * khtml/xml/dom_elementimpl.cpp:
2379 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
2380 (NamedAttrMapImpl::removeAttribute): Ditto.
2382 2004-11-15 John Sullivan <sullivan@apple.com>
2386 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
2387 seen often in Mail and Blot
2389 * khtml/css/css_valueimpl.cpp:
2390 (CSSStyleDeclarationImpl::copyPropertiesInSet):
2391 delete temporary list after we're done using it
2393 2004-11-15 Richard Williamson <rjw@apple.com>
2395 Fixed leak (3879883) that John found. Early return leaked
2400 * khtml/css/css_computedstyle.cpp:
2401 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2403 2004-11-15 Ken Kocienda <kocienda@apple.com>
2409 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
2411 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
2412 EditCommandPtr to its parent, but this caused a a reference cycle in composite
2413 commands as the children held a ref to their parent. Now, the parent variable
2414 is a non-retained reference to an EditCommand *. It would be nice to have a
2415 weak reference to the parent or even override deref in composite commands (but I
2416 can't since deref() is not virtual). However, this should be OK since any
2417 dangling parent pointer is a sign of a bigger object lifetime problem that
2418 would need to be addressed anyway.
2420 * khtml/css/css_valueimpl.cpp:
2421 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
2422 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
2423 just assigning the list variable passed in to the local list variable, or the list will be
2425 * khtml/editing/htmlediting.cpp:
2426 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
2427 (khtml::EditCommand::setEndingSelection): Ditto.
2428 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
2429 Unrelated to the change, but saves some ref's and deref's.
2430 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
2431 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
2432 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
2433 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
2435 2004-11-15 Maciej Stachowiak <mjs@apple.com>
2439 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
2441 * khtml/xml/dom_nodeimpl.cpp:
2442 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
2444 (NodeListImpl::recursiveLength): Adjusted for rename.
2445 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
2446 If the same offset is looked up again, just return it, otherwise, if looking up
2447 a later offset, start at the last item and proceed from there.
2448 (NodeListImpl::itemById): Apply the special document optimization to all
2449 nodes that are either a document or in a document - just walk up to make
2450 sure the node found by ID has the root node as an ancestor.
2451 (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
2452 * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
2454 2004-11-15 John Sullivan <sullivan@apple.com>
2458 - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
2460 * kwq/KWQKHTMLPart.mm:
2461 (KWQKHTMLPart::documentFragmentWithText):
2462 release mutable copy of string after we're done using it
2464 2004-11-14 Kevin Decker <kdecker@apple.com>
2468 fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
2470 * khtml/html/html_elementimpl.cpp:
2471 (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
2472 (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
2474 2004-11-13 Maciej Stachowiak <mjs@apple.com>
2478 <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
2480 * khtml/dom/dom_node.cpp:
2481 (NodeList::itemById): New method, just forward to impl.
2482 * khtml/dom/dom_node.h: Prototype it.
2483 * khtml/ecma/kjs_dom.cpp:
2484 (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
2485 let the NodeList do it. The NodeList might be able to do it more efficiently.
2486 * khtml/xml/dom_nodeimpl.cpp:
2487 (NodeListImpl::itemById): Optimize for the case where the NodeList
2488 covers the whole document. In this case, just use getElementById,
2489 then check that the element satisfies the list criteria.
2490 (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
2491 (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
2492 * khtml/xml/dom_nodeimpl.h:
2494 2004-11-12 Maciej Stachowiak <mjs@apple.com>
2498 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
2499 sometimes using a huge bogus length value.
2501 * khtml/xml/dom_nodeimpl.cpp:
2502 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
2504 2004-11-12 Darin Adler <darin@apple.com>
2508 - fixed an infinite loop in that last check-in
2510 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
2511 Added a ++i to the loop so it won't get stuck on the first element in the list.
2513 2004-11-12 Maciej Stachowiak <mjs@apple.com>
2517 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
2519 I fixed this by changing NodeLists to cache their length, but
2520 invalidate it whenever there is a change in the DOM subtree at
2521 which they are rooted. This makes NodeListImpl::recursiveLength()
2522 drop completely off the profile, since we were repeatedly getting
2523 a length for the same NodeList over and over.
2525 * khtml/xml/dom_nodeimpl.cpp:
2526 (NodeImpl::NodeImpl):
2527 (NodeImpl::~NodeImpl):
2528 (NodeImpl::registerNodeList):
2529 (NodeImpl::unregisterNodeList):
2530 (NodeImpl::notifyLocalNodeListsSubtreeModified):
2531 (NodeImpl::notifyNodeListsSubtreeModified):
2532 (NodeImpl::dispatchSubtreeModifiedEvent):
2533 (NodeListImpl::NodeListImpl):
2534 (NodeListImpl::~NodeListImpl):
2535 (NodeListImpl::recursiveLength):
2536 (NodeListImpl::recursiveItem):
2537 (NodeListImpl::rootNodeSubtreeModified):
2538 (ChildNodeListImpl::ChildNodeListImpl):
2539 (ChildNodeListImpl::length):
2540 (ChildNodeListImpl::item):
2541 (TagNodeListImpl::TagNodeListImpl):
2542 (TagNodeListImpl::length):
2543 (TagNodeListImpl::item):
2544 (NameNodeListImpl::NameNodeListImpl):
2545 (NameNodeListImpl::length):
2546 (NameNodeListImpl::item):
2547 * khtml/xml/dom_nodeimpl.h:
2549 2004-11-12 Darin Adler <darin@apple.com>
2553 - various small cleanups
2555 * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
2556 * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
2558 * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
2559 * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
2560 * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
2561 * khtml/html/htmltokenizer.cpp:
2562 (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
2563 (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
2565 * khtml/khtml_part.h: Removed docImpl function.
2566 * khtml/khtml_part.cpp: Ditto.
2568 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
2569 the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
2571 * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
2572 * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
2573 part of the change last time, which is why the build broke).
2574 (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
2575 (KWQKHTMLPart::setPolicyBaseURL): Ditto.
2576 (KWQKHTMLPart::keyEvent): Ditto.
2577 (KWQKHTMLPart::dispatchCPPEvent): Ditto.
2578 (KWQKHTMLPart::bodyBackgroundColor): Ditto.
2580 2004-11-12 Chris Blumenberg <cblu@apple.com>
2582 <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
2586 * kwq/KWQKHTMLPart.mm:
2587 (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
2591 2004-11-12 Darin Adler <darin@apple.com>
2595 - fixed a couple places that would not work for XML documents
2597 * khtml/ecma/kjs_window.cpp:
2598 (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
2599 is present on the base class.
2600 (WindowFunc::tryCall): More of the same.
2602 2004-11-12 Darin Adler <darin@apple.com>
2604 - land versions of these files generated by the newer gperf
2606 People building on Panther will continue to see these files modified.
2607 A workaround would be to install the newer gperf on our Tiger build machines.
2609 * khtml/css/cssproperties.c: Regenerated.
2610 * khtml/css/cssvalues.c: Regenerated.
2611 * khtml/html/doctypes.cpp: Regenerated.
2612 * khtml/html/kentities.c: Regenerated.
2613 * khtml/misc/htmlattrs.c: Regenerated.
2614 * khtml/misc/htmltags.c: Regenerated.
2615 * kwq/KWQColorData.c: Regenerated.
2617 2004-11-11 Richard Williamson <rjw@apple.com>
2619 Fix build horkage from previous checkin.
2621 * kwq/KWQKHTMLPart.h:
2623 2004-11-11 Darin Adler <darin@apple.com>
2627 - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
2629 * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
2631 * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
2632 * kwq/KWQKHTMLPart.mm:
2633 (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
2634 method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
2635 we started with the NSTextField as first responder, and then took focus away and gave it back, which
2636 makes dragging text work again.
2637 (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
2639 2004-11-11 David Hyatt <hyatt@apple.com>
2641 Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
2645 * khtml/html/htmltokenizer.cpp:
2646 (khtml::HTMLTokenizer::continueProcessing):
2648 2004-11-11 Ken Kocienda <kocienda@apple.com>
2652 * khtml/editing/htmlediting.cpp:
2653 (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
2654 of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
2655 with the prevailing style for the VisiblePosition class.
2656 * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files.
2657 * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
2658 (khtml::visiblePositionsInDifferentBlocks): New helper method.
2659 (khtml::isLastVisiblePositionInBlock): Ditto.
2660 (khtml::isLastVisiblePositionInNode): Ditto.
2661 * khtml/editing/visible_position.h: Add declarations for new functions.
2663 2004-11-11 Ken Kocienda <kocienda@apple.com>
2667 * khtml/editing/htmlediting.cpp:
2668 (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
2669 (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
2670 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2671 (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
2672 (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
2673 * khtml/xml/dom2_rangeimpl.cpp:
2674 (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
2675 * khtml/xml/dom2_rangeimpl.h: Ditto.
2677 2004-11-11 Ken Kocienda <kocienda@apple.com>
2679 Reviewed by Harrison
2681 Some improvements to deleting when complete lines are selected.
2683 * khtml/editing/htmlediting.cpp:
2684 (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
2685 the end of a selection is fully selected. Turn off block merging in this case.
2686 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
2687 whether a BR immediately followed a block. The old code could erroneously skip nodes.
2688 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
2689 start block is selected. This new code will now delete this block in one call, rather
2690 than iterating over each child.
2691 * khtml/editing/visible_position.cpp:
2692 (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
2693 to do the work mentioned above in the comment for that function.
2694 (khtml::isFirstVisiblePositionOnLine): Ditto.
2695 (khtml::isLastVisiblePositionOnLine): Ditto.
2696 * khtml/editing/visible_position.h: Add new functions.
2697 * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
2698 * layout-tests/editing/deleting/delete-line-001.html: Added.
2699 * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
2700 * layout-tests/editing/deleting/delete-line-002.html: Added.
2701 * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
2702 * layout-tests/editing/deleting/delete-line-003.html: Added.
2703 * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
2704 * layout-tests/editing/deleting/delete-line-004.html: Added.
2705 * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
2706 * layout-tests/editing/deleting/delete-line-005.html: Added.
2707 * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
2708 * layout-tests/editing/deleting/delete-line-006.html: Added.
2709 * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
2710 * layout-tests/editing/deleting/delete-line-007.html: Added.
2711 * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
2712 * layout-tests/editing/deleting/delete-line-008.html: Added.
2713 * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
2714 * layout-tests/editing/deleting/delete-line-009.html: Added.
2715 * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
2716 * layout-tests/editing/deleting/delete-line-010.html: Added.
2717 * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
2718 * layout-tests/editing/deleting/delete-line-011.html: Added.
2719 * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
2720 * layout-tests/editing/deleting/delete-line-012.html: Added.
2722 2004-11-11 Ken Kocienda <kocienda@apple.com>
2726 * khtml/editing/htmlediting.cpp:
2727 (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
2729 2004-11-11 Ken Kocienda <kocienda@apple.com>
2735 <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
2736 <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
2738 * khtml/editing/selection.cpp:
2739 (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
2740 the next line position when necessary.
2741 * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
2742 * layout-tests/editing/selection/move-3875618-fix.html: Added.
2743 * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
2744 * layout-tests/editing/selection/move-3875641-fix.html: Added.
2746 2004-11-11 Ken Kocienda <kocienda@apple.com>
2750 Improved some function names, at John's urging. No changes to the
2751 functions themselves.
2753 canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
2754 canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
2755 performGeneralDelete() --> handleGeneralDelete()
2757 * khtml/editing/htmlediting.cpp:
2758 (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
2759 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
2760 (khtml::DeleteSelectionCommand::handleGeneralDelete)
2761 (khtml::DeleteSelectionCommand::doApply)
2762 * khtml/editing/htmlediting.h
2764 2004-11-11 Ken Kocienda <kocienda@apple.com>
2768 Updated some layout test results that changed as a result of my last checking.
2769 Added a new test that has been in my tree for a few days.
2771 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
2772 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
2773 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
2774 * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
2776 2004-11-11 Ken Kocienda <kocienda@apple.com>
2780 * khtml/editing/htmlediting.cpp:
2781 (khtml::debugNode): New debugging helper.
2782 (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
2783 startPositionForDelete() and endPositionForDelete() functions. Just use the
2784 m_selectionToDelete object to determine start and end positions for the delete.
2785 (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
2786 function that creates a special case for deleting all the content in a root
2788 (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
2789 function before BR special case and the general case delete functions.
2790 * khtml/editing/htmlediting.h: Updated for changed functions.
2792 2004-11-10 Kevin Decker <kdecker@apple.com>
2796 Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.
2798 * khtml/ecma/kjs_dom.cpp:
2799 (DOMNodeList::tryGet): Got rid of an unnecessary node traversal.
2801 2004-11-10 Ken Kocienda <kocienda@apple.com>
2805 * khtml/editing/htmlediting.cpp:
2806 (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
2807 smart delete from the two functions below to here. There was an unnecessary double
2808 calculation of the leading and trailing whitespace positions. Also refined the trailing
2809 case so it only acts when the leading position is null (which seems to match TextEdit in
2810 my tests). Also removed some unnecessary copying of Position objects.
2811 (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
2813 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
2815 2004-11-10 Ken Kocienda <kocienda@apple.com>
2817 Reviewed by Harrison
2819 (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
2820 make things more clear.
2821 * khtml/editing/selection.cpp:
2822 (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the
2823 resulting positions do not cross block boundaries. This was a bug and caused some
2824 delete problems when whole blocks were selected. I will be addressing that issue
2825 more fully in upcoming changes.
2827 2004-11-10 Ken Kocienda <kocienda@apple.com>
2829 Reviewed by Harrison
2831 Some cleanups and fixes in upstream and downstream functions.
2833 Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement().
2834 Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the
2835 block's enclosing block will be returned.
2837 Remove code from upstream that confined the serach to block boundaries outside of
2838 the code which runs in the StayInBlock case. This code was redundant, and caused
2839 incorrect results to be returned in the DoNotStayInBlock case.
2841 In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
2842 node, not the the this pointer's node.
2844 * khtml/xml/dom_position.cpp:
2845 (DOM::Position::upstream)
2846 (DOM::Position::downstream)
2848 2004-11-09 David Hyatt <hyatt@apple.com>
2850 Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
2851 loading large local files.
2855 * khtml/html/htmltokenizer.cpp:
2856 (khtml::HTMLTokenizer::HTMLTokenizer):
2857 (khtml::HTMLTokenizer::reset):
2858 (khtml::HTMLTokenizer::write):
2859 (khtml::HTMLTokenizer::stopped):
2860 (khtml::HTMLTokenizer::processingData):
2861 (khtml::HTMLTokenizer::continueProcessing):
2862 (khtml::HTMLTokenizer::timerEvent):
2863 (khtml::HTMLTokenizer::allDataProcessed):
2864 (khtml::HTMLTokenizer::end):
2865 (khtml::HTMLTokenizer::finish):
2866 (khtml::HTMLTokenizer::notifyFinished):
2867 * khtml/html/htmltokenizer.h:
2868 * khtml/khtml_part.cpp:
2869 (KHTMLPart::slotFinished):
2872 * khtml/khtml_part.h:
2873 (KHTMLPart::tokenizerProcessedData):
2874 * khtml/khtmlview.cpp:
2875 * khtml/xml/dom_docimpl.cpp:
2876 * khtml/xml/xml_tokenizer.h:
2877 (khtml::Tokenizer::stopped):
2878 (khtml::Tokenizer::processingData):
2879 * kwq/KWQDateTime.h:
2880 * kwq/KWQDateTime.mm:
2881 (QDateTime::secsTo):
2882 (KWQUIEventTime::uiEventPending):
2883 * kwq/KWQKHTMLPart.h:
2884 * kwq/KWQKHTMLPart.mm:
2885 (KWQKHTMLPart::tokenizerProcessedData):
2886 * kwq/WebCoreBridge.h:
2887 * kwq/WebCoreBridge.mm:
2888 (-[WebCoreBridge stop]):
2889 (-[WebCoreBridge numPendingOrLoadingRequests]):
2890 (-[WebCoreBridge doneProcessingData]):
2892 2004-11-09 David Harrison <harrison@apple.com>
2894 Reviewed by Ken Kocienda.
2896 <rdar://problem/3865837> Wrong text style after delete to start of document
2898 * khtml/editing/htmlediting.cpp:
2899 (khtml::DeleteSelectionCommand::saveTypingStyleState):
2900 Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
2902 2004-11-09 Richard Williamson <rjw@apple.com>
2904 Fixed <rdar://problem/3872440> NSTimer prematurely released.
2913 2004-11-09 Chris Blumenberg <cblu@apple.com>
2917 * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
2919 2004-11-08 David Harrison <harrison@apple.com>
2921 Reviewed by Ken Kocienda.
2923 <rdar://problem/3865854> Deleting first line deletes all lines
2925 * khtml/editing/htmlediting.cpp:
2926 (khtml::DeleteSelectionCommand::performGeneralDelete):
2927 Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
2928 of its ancestors, failed to end the loop that deletes all fully selected nodes. Also,
2929 fixed this code to clear m_trailingWhitespaceValid. Also removed dead m_endingPosition
2930 update because it is handled in calculateEndingPosition now.
2931 * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
2932 * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
2934 2004-11-08 Ken Kocienda <kocienda@apple.com>
2938 * khtml/html/html_elementimpl.cpp:
2939 (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
2940 are added to the DOM.
2941 * khtml/html/html_elementimpl.h: Ditto.
2942 * khtml/html/htmlparser.cpp:
2943 (KHTMLParser::KHTMLParser): Ditto.
2944 (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
2945 * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
2946 * khtml/html/htmltokenizer.cpp:
2947 (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
2948 (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
2949 There were a couple of indexing errors that resulted in the comment text containing part of the
2951 (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
2952 * khtml/html/htmltokenizer.h: Add flag to constructor so callers can request comment nodes.
2954 2004-11-08 Chris Blumenberg <cblu@apple.com>
2956 Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
2960 * WebCore.pbproj/project.pbxproj: stop unnecessary linking
2961 * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
2962 * kwq/KWQKHTMLPart.h: ditto
2964 2004-11-08 Darin Adler <darin@apple.com>
2968 - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
2970 * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
2971 that possibly deletes the QTimer.
2973 2004-11-08 Chris Blumenberg <cblu@apple.com>
2975 Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
2979 * kwq/KWQTextField.mm:
2980 (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
2981 * kwq/WebCoreBridge.h:
2983 2004-11-08 David Harrison <harrison@apple.com>
2987 Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
2989 * khtml/editing/htmlediting.cpp:
2990 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
2991 * khtml/xml/dom_nodeimpl.cpp:
2992 (NodeImpl::enclosingInlineElement):
2993 * khtml/xml/dom_nodeimpl.h:
2995 2004-11-05 Chris Blumenberg <cblu@apple.com>
2997 Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
3001 * khtml/editing/htmlediting.cpp:
3002 (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
3003 * khtml/editing/visible_position.cpp:
3004 (khtml::VisiblePosition::character): new, returns the character for the position
3005 * khtml/editing/visible_position.h:
3006 * kwq/KWQKHTMLPart.h:
3007 * kwq/KWQKHTMLPart.mm:
3008 (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
3009 * kwq/WebCoreBridge.h:
3013 2004-11-05 Adele Amchan <adele@apple.com>
3017 Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
3018 and a workaround for displaying transparent backgrounds for textareas.
3020 * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
3021 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
3022 * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class,
3023 on the contentView, and on the textView.
3025 2004-11-04 David Hyatt <hyatt@apple.com>
3027 Fix for relpositioned inlines. This was reviewed a long time ago, but I can't recall who reviewed it (either
3030 Reviewed by darin or ken
3032 * khtml/rendering/bidi.cpp:
3033 (khtml::appendRunsForObject):
3034 (khtml::RenderBlock::skipWhitespace):
3035 (khtml::RenderBlock::findNextLineBreak):
3036 * khtml/rendering/render_block.cpp:
3037 (khtml::RenderBlock::lowestPosition):
3038 (khtml::RenderBlock::rightmostPosition):
3039 (khtml::RenderBlock::leftmostPosition):
3040 * khtml/rendering/render_box.cpp:
3041 (RenderBox::position):
3042 * khtml/rendering/render_box.h:
3043 (khtml::RenderBox::staticX):
3044 (khtml::RenderBox::staticY):
3045 * khtml/rendering/render_layer.cpp:
3046 (RenderLayer::updateLayerPosition):
3047 (RenderLayer::convertToLayerCoords):
3048 * khtml/rendering/render_line.cpp:
3049 (khtml::InlineFlowBox::placeBoxesHorizontally):
3050 * khtml/rendering/render_object.h:
3051 (khtml::RenderObject::staticX):
3052 (khtml::RenderObject::staticY):
3054 Finish turning on XSLT. Make sure child stylesheets can load.
3056 * khtml/xsl/xslt_processorimpl.cpp:
3057 (DOM::stylesheetLoadFunc):
3058 (DOM::XSLTProcessorImpl::transformDocument):
3060 2004-11-04 David Hyatt <hyatt@apple.com>
3062 Implement CSS3 support for multiple backgrounds. Also fix a bug with background propagation so that it only
3063 happens (from the <body> to the root) for HTML documents. Fixed background-position to handle a mixture of
3064 keyword and length values.
3068 * khtml/css/cssparser.cpp:
3069 (CSSParser::parseValue):
3070 (CSSParser::addBackgroundValue):
3071 (CSSParser::parseBackgroundShorthand):
3072 (CSSParser::parseBackgroundColor):
3073 (CSSParser::parseBackgroundImage):
3074 (CSSParser::parseBackgroundPositionXY):
3075 (CSSParser::parseBackgroundPosition):
3076 (CSSParser::parseBackgroundProperty):
3077 (CSSParser::parseColorFromValue):
3078 * khtml/css/cssparser.h:
3079 * khtml/css/cssstyleselector.cpp:
3080 (khtml::CSSStyleSelector::adjustRenderStyle):
3081 (khtml::CSSStyleSelector::applyProperty):
3082 (khtml::CSSStyleSelector::mapBackgroundAttachment):
3083 (khtml::CSSStyleSelector::mapBackgroundImage):
3084 (khtml::CSSStyleSelector::mapBackgroundRepeat):
3085 (khtml::CSSStyleSelector::mapBackgroundXPosition):
3086 (khtml::CSSStyleSelector::mapBackgroundYPosition):
3087 * khtml/css/cssstyleselector.h:
3088 * khtml/rendering/render_box.cpp:
3089 (RenderBox::paintRootBoxDecorations):
3090 (RenderBox::paintBoxDecorations):
3091 (RenderBox::paintBackgrounds):
3092 (RenderBox::paintBackground):
3093 (RenderBox::paintBackgroundExtended):
3094 * khtml/rendering/render_box.h:
3095 * khtml/rendering/render_form.cpp:
3096 (RenderFieldset::paintBoxDecorations):
3097 * khtml/rendering/render_line.cpp:
3098 (khtml::InlineFlowBox::paintBackgrounds):
3099 (khtml::InlineFlowBox::paintBackground):
3100 (khtml::InlineFlowBox::paintBackgroundAndBorder):
3101 * khtml/rendering/render_line.h:
3102 * khtml/rendering/render_object.cpp:
3103 (RenderObject::setStyle):
3104 (RenderObject::updateBackgroundImages):
3105 (RenderObject::getVerticalPosition):
3106 * khtml/rendering/render_object.h:
3107 (khtml::RenderObject::paintBackgroundExtended):
3108 * khtml/rendering/render_style.cpp:
3110 (BackgroundLayer::BackgroundLayer):
3111 (BackgroundLayer::~BackgroundLayer):
3112 (BackgroundLayer::operator=):
3113 (BackgroundLayer::operator==):
3114 (BackgroundLayer::fillUnsetProperties):
3115 (BackgroundLayer::cullEmptyLayers):
3116 (StyleBackgroundData::StyleBackgroundData):
3117 (StyleBackgroundData::operator==):
3118 (RenderStyle::diff):
3119 (RenderStyle::adjustBackgroundLayers):
3120 * khtml/rendering/render_style.h:
3121 (khtml::OutlineValue::operator==):
3122 (khtml::OutlineValue::operator!=):
3123 (khtml::BackgroundLayer::backgroundImage):
3124 (khtml::BackgroundLayer::backgroundXPosition):
3125 (khtml::BackgroundLayer::backgroundYPosition):
3126 (khtml::BackgroundLayer::backgroundAttachment):
3127 (khtml::BackgroundLayer::backgroundRepeat):
3128 (khtml::BackgroundLayer::next):
3129 (khtml::BackgroundLayer::isBackgroundImageSet):
3130 (khtml::BackgroundLayer::isBackgroundXPositionSet):
3131 (khtml::BackgroundLayer::isBackgroundYPositionSet):
3132 (khtml::BackgroundLayer::isBackgroundAttachmentSet):
3133 (khtml::BackgroundLayer::isBackgroundRepeatSet):
3134 (khtml::BackgroundLayer::setBackgroundImage):
3135 (khtml::BackgroundLayer::setBackgroundXPosition):
3136 (khtml::BackgroundLayer::setBackgroundYPosition):
3137 (khtml::BackgroundLayer::setBackgroundAttachment):
3138 (khtml::BackgroundLayer::setBackgroundRepeat):
3139 (khtml::BackgroundLayer::clearBackgroundImage):
3140 (khtml::BackgroundLayer::clearBackgroundXPosition):
3141 (khtml::BackgroundLayer::clearBackgroundYPosition):
3142 (khtml::BackgroundLayer::clearBackgroundAttachment):
3143 (khtml::BackgroundLayer::clearBackgroundRepeat):
3144 (khtml::BackgroundLayer::setNext):
3145 (khtml::BackgroundLayer::operator!=):
3146 (khtml::BackgroundLayer::containsImage):
3147 (khtml::BackgroundLayer::hasImage):
3148 (khtml::BackgroundLayer::hasFixedImage):
3149 (khtml::RenderStyle::setBitDefaults):
3150 (khtml::RenderStyle::hasBackground):
3151 (khtml::RenderStyle::hasFixedBackgroundImage):
3152 (khtml::RenderStyle::outlineWidth):
3153 (khtml::RenderStyle::outlineStyle):
3154 (khtml::RenderStyle::outlineStyleIsAuto):
3155 (khtml::RenderStyle::outlineColor):
3156 (khtml::RenderStyle::backgroundColor):
3157 (khtml::RenderStyle::backgroundImage):
3158 (khtml::RenderStyle::backgroundRepeat):
3159 (khtml::RenderStyle::backgroundAttachment):
3160 (khtml::RenderStyle::backgroundXPosition):
3161 (khtml::RenderStyle::backgroundYPosition):
3162 (khtml::RenderStyle::accessBackgroundLayers):
3163 (khtml::RenderStyle::backgroundLayers):
3164 (khtml::RenderStyle::outlineOffset):
3165 (khtml::RenderStyle::resetOutline):
3166 (khtml::RenderStyle::setBackgroundColor):
3167 (khtml::RenderStyle::setOutlineWidth):
3168 (khtml::RenderStyle::setOutlineStyle):
3169 (khtml::RenderStyle::setOutlineColor):
3170 (khtml::RenderStyle::clearBackgroundLayers):
3171 (khtml::RenderStyle::inheritBackgroundLayers):
3172 (khtml::RenderStyle::setOutlineOffset):
3173 * khtml/rendering/render_table.cpp:
3174 (RenderTable::paintBoxDecorations):
3175 (RenderTableCell::paintBoxDecorations):
3177 2004-11-04 David Hyatt <hyatt@apple.com>
3179 Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
3180 Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
3184 * kwq/KWQTextCodec.mm:
3185 (KWQTextDecoder::convertLatin1):
3186 (KWQTextDecoder::convertUTF16):
3187 (KWQTextDecoder::convertUsingTEC):
3188 (KWQTextDecoder::toUnicode):
3190 2004-11-04 David Hyatt <hyatt@apple.com>
3192 Make sure line-height returns the correct value for normal.
3196 * khtml/css/css_computedstyle.cpp:
3197 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3199 2004-11-04 David Harrison <harrison@apple.com>
3201 Reviewed by Ken Kocienda.
3203 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
3205 * khtml/editing/htmlediting.cpp:
3206 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
3207 to, but not including, the enclosingBlockFlowElement) rather than just the source element.
3208 Fixed to insert after the destination subtree, rather than the destination element. Handles
3209 edge case of deleting back to the top of the tree, where there is nothing left to insert after.
3210 * khtml/xml/dom_nodeimpl.cpp:
3211 (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
3212 * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
3213 * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
3214 * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
3216 2004-11-03 Ken Kocienda <kocienda@apple.com>
3222 * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
3223 * layout-tests/editing/deleting/delete-br-008.html: Added.
3224 * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
3225 * layout-tests/editing/deleting/delete-br-009.html: Added.
3226 * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
3227 * layout-tests/editing/deleting/delete-br-010.html: Added.
3229 2004-11-03 Maciej Stachowiak <mjs@apple.com>
3231 Fix by Yasuo Kida, reviewed by me.
3233 <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
3235 * kwq/KWQKHTMLPart.mm:
3236 (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
3237 same as a nil range - setting an empty marked range should clear
3238 the marked range entirely.
3240 2004-11-02 Maciej Stachowiak <mjs@apple.com>
3242 Reviewed by Dave Hyatt (when I originally coded it).
3244 WebCore part of fix for:
3246 <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
3248 * kwq/WebCoreBridge.h:
3249 * kwq/WebCoreBridge.mm:
3250 (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
3251 DOMRange, or if the range is split into multiple lines, the rect for the part on
3252 the first line only.
3254 * khtml/rendering/render_object.cpp:
3255 (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
3256 for the overrides below.
3257 * khtml/rendering/render_object.h:
3258 * khtml/rendering/render_box.cpp:
3259 (RenderBox::caretRect):
3260 * khtml/rendering/render_box.h:
3261 * khtml/rendering/render_br.cpp:
3262 (RenderBR::caretRect):
3263 * khtml/rendering/render_br.h:
3264 * khtml/rendering/render_flow.cpp:
3265 (RenderFlow::caretRect):
3266 * khtml/rendering/render_flow.h:
3267 * khtml/rendering/render_text.cpp:
3268 (RenderText::caretRect):
3270 2004-11-02 Ken Kocienda <kocienda@apple.com>
3274 Implemented command to insert a block in response to typing a return key (even though
3275 I am not turning that on by default with this patch....that will come later).
3277 This new command is called InsertParagraphSeparatorCommand.
3279 Reworked the command and function names associated with inserting content into a
3280 document. Before this patch, there were inputXXX and insertXXX variants, with the
3281 former used for more high-level actions and the latter used for lower-level stuff.
3282 However, this was confusing as the AppKit uses insertXXX for everything. This resulted
3283 in an insertXXX command going through an inputXXX WebCore step and then finally to an
3284 insertXXX WebCore step. To make this less confusing, I have changes all the names to
3285 be insertXXX, and modified the lower-level operations so that it is clear what they do.
3287 * khtml/editing/htmlediting.cpp:
3288 (khtml::EditCommandPtr::isInsertTextCommand): Name change.
3289 (khtml::EditCommand::isInsertTextCommand): Ditto.
3290 (khtml::CompositeEditCommand::inputText): Ditto.
3291 (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
3292 (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
3293 (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
3294 (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
3295 (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
3296 (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
3297 (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
3298 (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
3299 (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
3300 (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
3301 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
3302 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
3303 (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
3304 (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
3305 (khtml::InsertIntoTextNode::doApply): Ditto.
3306 (khtml::InsertIntoTextNode::doUnapply): Ditto.
3307 (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
3308 (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
3309 (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
3310 (khtml::InsertLineBreakCommand::doApply):
3311 (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
3312 (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
3313 (khtml::InsertNodeBeforeCommand::doApply): Ditto.
3314 (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
3315 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
3316 (khtml::InsertParagraphSeparatorCommand::doApply):
3317 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
3318 Class name change, was InsertNewlineCommandInQuotedContentCommand.
3319 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
3320 (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
3321 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
3322 (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
3323 (khtml::InsertTextCommand::doApply): Ditto.
3324 (khtml::InsertTextCommand::deleteCharacter): Ditto.
3325 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
3326 (khtml::InsertTextCommand::input): Ditto.
3327 (khtml::InsertTextCommand::insertSpace): Ditto.
3328 (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
3329 (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
3330 (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
3331 (khtml::TypingCommand::insertParagraphSeparator): New function.
3332 (khtml::TypingCommand::doApply): Name changes, as above.
3333 (khtml::TypingCommand::insertText): Ditto.
3334 (khtml::TypingCommand::deleteKeyPressed): Ditto.
3335 (khtml::TypingCommand::preservesTypingStyle): Ditto.
3336 * khtml/editing/htmlediting.h:
3337 (khtml::DeleteFromTextNodeCommand::node): Name change.
3338 (khtml::DeleteFromTextNodeCommand::offset): Ditto.
3339 (khtml::DeleteFromTextNodeCommand::count): Ditto.
3340 (khtml::InsertIntoTextNode::text): Ditto.
3341 (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
3342 (khtml::InsertNodeBeforeCommand::refChild): Ditto.
3343 (khtml::TypingCommand::): Ditto.
3344 * khtml/editing/jsediting.cpp: Name changes, as above.
3345 * kwq/WebCoreBridge.h:
3346 * kwq/WebCoreBridge.mm:
3347 (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
3348 (-[WebCoreBridge insertParagraphSeparator]): New function.
3349 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
3351 2004-11-01 Kevin Decker <kdecker@apple.com>
3355 fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
3358 * khtml/ecma/kjs_window.cpp:
3359 (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
3361 2004-11-01 Darin Adler <darin@apple.com>
3365 - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
3367 * khtml/css/html4.css: Use color: initial for textarea and related ones.
3369 2004-11-01 Ken Kocienda <kocienda@apple.com>
3375 <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
3377 * khtml/css/css_computedstyle.cpp:
3378 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the
3379 implementation here into new copyPropertiesInSet helper. This now calls the
3380 generalized copyPropertiesInSet function with the arguments needed to make copying
3382 * khtml/css/css_computedstyle.h:
3383 * khtml/css/css_valueimpl.cpp:
3384 (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
3385 In order to do apply block properties, "regular" style declarations need to do style
3387 (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
3388 except that it uses a different set of properties that apply only to blocks.
3389 (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
3390 and copies out those properties listed in a pre-defined set.
3391 * khtml/css/css_valueimpl.h:
3392 * khtml/editing/htmlediting.cpp:
3393 (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
3394 block, factoring out some of the special case code that should now only run in the inline case.
3395 (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
3396 (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
3397 special handling for "legacy" HTML styles like <B> and <I>.
3398 (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
3399 style changes into different kinds. CSS specifies certain properties only apply to certain
3400 element types. This set of changes now recognizes two such separate cases: styles that apply
3401 to blocks, and styles that apply to inlines.
3402 (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
3403 (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
3404 (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
3405 with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
3406 done so that the function can be passed a portion of the styles being applied so that block styles
3407 and inline styles can be handled separately.
3408 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
3409 (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
3410 (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
3411 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
3412 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
3413 * khtml/editing/htmlediting.h:
3414 (khtml::StyleChange::): Changed as described above.
3415 (khtml::StyleChange::usesLegacyStyles):
3416 (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
3417 it needs to layout, even though it has not changed position in the DOM. For instance, this is needed
3418 when text align changes.
3419 * khtml/khtml_part.cpp:
3420 (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
3421 the passed-in argument.
3422 (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
3423 is a caret. Formerly, this just set typing style and made no visible changes to the document.
3427 * layout-tests/editing/editing.js: Added some glue to change text align.
3428 * layout-tests/editing/style/block-style-001-expected.txt: Added.
3429 * layout-tests/editing/style/block-style-001.html: Added.
3430 * layout-tests/editing/style/block-style-002-expected.txt: Added.
3431 * layout-tests/editing/style/block-style-002.html: Added.
3432 * layout-tests/editing/style/block-style-003-expected.txt: Added.
3433 * layout-tests/editing/style/block-style-003.html: Added.
3437 2004-10-29 Darin Adler <darin@apple.com>
3441 - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
3443 * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
3444 before advancing one character; before it did it backwards.
3446 2004-10-29 Chris Blumenberg <cblu@apple.com>
3448 Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
3450 Reviewed by kocienda, adele.
3452 * khtml/rendering/render_frames.cpp:
3453 (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
3455 2004-10-29 Darin Adler <darin@apple.com>
3459 - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
3461 * khtml/khtmlview.cpp:
3462 (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
3463 deleted before this function finishes running.
3464 (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
3465 (KHTMLView::viewportMouseReleaseEvent): Ditto.
3466 (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
3467 is guaranteed to do ref/deref as needed.
3469 * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
3471 2004-10-28 Chris Blumenberg <cblu@apple.com>
3473 Enabled XSLT on Panther. See intrigue mail for compiling instructions.
3477 * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
3478 * WebCorePrefix.h: always use XSLT
3480 2004-10-28 Ken Kocienda <kocienda@apple.com>
3486 <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
3487 <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
3489 * khtml/editing/htmlediting.cpp:
3490 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members
3491 to initialization list, zeroing them out.
3492 (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
3493 handle a delete of content in special cases where the only thing selected is a BR. This
3494 code path is much simpler than the newly-named performGeneralDelete, and detects when no
3495 content merging should be done between blocks. This aspect of the change fixes 3854848.
3496 One of the special cases added fixes 3803832.
3497 (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
3498 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
3499 like the other helpers in this class.
3500 (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
3501 (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
3502 * khtml/editing/htmlediting.h: Added new helper and changed an old one.
3504 2004-10-28 Chris Blumenberg <cblu@apple.com>
3506 Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
3510 * kwq/KWQKHTMLPart.mm:
3511 (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
3513 2004-10-28 Ken Kocienda <kocienda@apple.com>
3515 Reviewed by Harrison
3517 Reorganization of delete command functionality so that doApply is not
3518 several hundred lines long. This is not a squeaky-clean cleanup, but
3519 it is a step in the right direction. No functionality changes.
3521 * khtml/editing/htmlediting.cpp:
3522 (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
3523 (khtml::DeleteSelectionCommand::initializePositionData): New helper.
3524 (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
3525 (khtml::DeleteSelectionCommand::performDelete): Ditto.
3526 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
3527 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
3528 (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
3529 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
3530 (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
3531 (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
3532 * khtml/editing/htmlediting.h:
3534 2004-10-28 Ken Kocienda <kocienda@apple.com>
3538 * khtml/editing/htmlediting.cpp:
3539 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
3540 new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
3542 2004-10-27 Ken Kocienda <kocienda@apple.com>
3546 * khtml/editing/htmlediting.cpp:
3547 (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
3548 whether content not in the block containing the start of the selection is moved to that block
3549 after the selection is deleted.
3550 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
3551 (khtml::DeleteSelectionCommand::doApply): Ditto.
3552 (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
3553 to handle the case of inserting a newline when in quoted content in Mail.
3554 (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
3555 (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
3556 (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
3557 (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
3558 (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
3559 (khtml::TypingCommand::doApply): Ditto.
3560 (khtml::TypingCommand::preservesTypingStyle): Ditto.
3561 * khtml/editing/htmlediting.h: Add new delclarations.
3562 (khtml::TypingCommand::): Ditto.
3563 * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
3564 * kwq/WebCoreBridge.mm:
3565 (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
3567 2004-10-26 Chris Blumenberg <cblu@apple.com>
3569 Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
3573 * khtml/ecma/kjs_dom.cpp:
3574 (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
3575 * khtml/ecma/kjs_dom.h:
3576 (KJS::DOMElement::):
3577 * khtml/ecma/kjs_dom.lut.h:
3580 2004-10-26 David Hyatt <hyatt@apple.com>
3582 Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
3585 Reviewed by kocienda
3587 * khtml/rendering/bidi.cpp:
3588 (khtml::RenderBlock::layoutInlineChildren):
3590 2004-10-26 David Hyatt <hyatt@apple.com>
3592 Convert selectionRect() from using a list to a dict and patch it to be like setSelection. It was still trying
3593 to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
3595 Reviewed by kocienda
3597 * khtml/rendering/render_canvas.cpp:
3598 (RenderCanvas::selectionRect):
3599 * khtml/rendering/render_object.h:
3600 (khtml::RenderObject::hasSelectedChildren):
3602 2004-10-26 Ken Kocienda <kocienda@apple.com>
3608 <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
3610 * khtml/editing/htmlediting.cpp:
3611 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
3612 let the caller know if a placeholder was removed.
3613 (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
3614 removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
3615 some cases, the selection was still set on the removed BR, and this was the cause of the
3617 * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
3619 2004-10-26 Darin Adler <darin@apple.com>
3623 - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
3625 * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
3627 2004-10-26 Ken Kocienda <kocienda@apple.com>
3631 * khtml/editing/htmlediting.cpp:
3632 (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
3633 with a zero-length string. That triggers an assert. Call deleteText instead,
3634 using the same indices that are passed to replaceText.
3636 Cleaned up the asserts in these three functions below, making them
3637 more consistent. This is not needed for the fix, but I tripped over
3638 these in the course of debugging.
3640 (khtml::InsertTextCommand::InsertTextCommand):
3641 (khtml::InsertTextCommand::doApply):
3642 (khtml::InsertTextCommand::doUnapply):
3644 2004-10-25 Adele Amchan <adele@apple.com>
3648 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
3649 * khtml/xml/dom_docimpl.h:
3651 2004-10-25 Adele Amchan <adele@apple.com>
3653 Reviewed by me, code change by Darin.
3655 * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
3657 2004-10-25 Ken Kocienda <kocienda@apple.com>
3659 Oops. These two test results changed with my last checkin, for the better.
3661 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
3662 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
3664 2004-10-25 Ken Kocienda <kocienda@apple.com>
3670 <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
3672 * khtml/editing/htmlediting.cpp:
3673 (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
3674 expand the selection outwards when the selection is on the visible boundary of a root
3675 editable element. This fixes the bug. Note that this function also contains a little code
3676 I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
3677 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
3678 (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
3679 * khtml/editing/htmlediting.h: Declare new helpers.
3680 * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
3681 * layout-tests/editing/deleting/delete-select-all-001.html: Added.
3682 * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
3683 * layout-tests/editing/deleting/delete-select-all-002.html: Added.
3684 * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
3685 * layout-tests/editing/deleting/delete-select-all-003.html: Added.
3687 2004-10-25 Ken Kocienda <kocienda@apple.com>
3689 Added some more editing layout tests.
3691 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
3692 * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
3693 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
3694 * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
3695 * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
3696 * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
3697 * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
3698 * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
3699 * layout-tests/editing/inserting/typing-003-expected.txt: Added.
3700 * layout-tests/editing/inserting/typing-003.html: Added.
3702 2004-10-25 Ken Kocienda <kocienda@apple.com>
3706 * khtml/rendering/bidi.cpp:
3707 (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
3708 yesterday quite right: words that should have been placed on the next line were instead
3709 appearing on the line before, beyond the right margin. This was a one-word only error
3710 based on moving the line break object when it should have stayed put. Here is the rule:
3711 The line break object only moves to after the whitespace on the end of a line if that
3712 whitespace caused line overflow when its width is added in.
3714 2004-10-25 Adele Amchan <adele@apple.com>
3718 Fix for <rdar://problem/3619890> Feature request: designMode
3720 This change implements the designMode property of a document. This is an IE property that is also supported by Mozilla.
3721 This will enable more JS editing compatibility.
3723 * khtml/ecma/kjs_html.cpp:
3724 (KJS::HTMLDocument::tryGet): added case for designMode
3725 (KJS::HTMLDocument::putValue): added case for designMode
3726 * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
3727 * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
3728 * khtml/xml/dom_docimpl.cpp:
3729 (DocumentImpl::DocumentImpl): initialize m_designMode member variable
3730 (DocumentImpl::setDesignMode): added function to assign m_designMode value
3731 (DocumentImpl::getDesignMode): return m_designMode value
3732 (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value.
3733 Otherwise, it will just return the m_designMode value.
3734 (DocumentImpl::parentDocument):
3735 * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
3736 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
3738 2004-10-22 Ken Kocienda <kocienda@apple.com>
3744 <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
3746 * khtml/editing/htmlediting.cpp:
3747 (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
3748 everything that could be affected.
3749 (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
3750 braces, making it act as a comma operator, with a zero value as the right value!!! This made
3751 an important check always fail!!! It turns out that we do not want the constant at all, since
3752 that constant is only needed when checking a computed style, not an inline style as is being
3754 (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
3755 (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
3756 RangeImpl::compareBoundaryPoints to perform the required check.
3757 * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
3759 2004-10-22 Ken Kocienda <kocienda@apple.com>
3765 <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
3766 <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
3768 * khtml/rendering/bidi.cpp:
3769 (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
3770 it is when we are editing, add in the space of the current character when calculating the width
3771 of committed plus uncommitted characters. If this value exceeds the width of the line, move up
3772 the line break object and call skipWhitespace to move past the end of the whitespace.
3776 2004-10-22 Ken Kocienda <kocienda@apple.com>
3778 * WebCore.pbproj/project.pbxproj:
3779 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
3781 2004-10-21 David Hyatt <hyatt@apple.com>
3785 Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
3787 <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
3788 <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
3790 * khtml/rendering/render_block.cpp:
3791 (khtml::getInlineRun):
3792 (khtml::RenderBlock::makeChildrenNonInline):
3794 2004-10-21 David Hyatt <hyatt@apple.com>
3796 Fix for 3810389, crash because of continuation() craziness. Revert back to the old behavior of
3797 making sure that all line boxes get deleted and recreated when inlines are split because of a block.
3801 * khtml/rendering/render_inline.cpp:
3802 (RenderInline::splitFlow):
3804 2004-10-21 Ken Kocienda <kocienda@apple.com>
3808 Significant improvement to the way that whitespace is handled during editing.
3810 * khtml/editing/htmlediting.cpp:
3811 (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
3812 two being added with this name) that delete "insignificant" unrendered text.
3813 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
3814 calculates the downstream position to use as the endpoint for the deletion, and
3815 then calls deleteInsignificantText with this start and end.
3816 (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
3817 (khtml::InputNewlineCommand::doApply): Ditto.
3818 (khtml::InputTextCommand::input): Ditto.
3819 * khtml/editing/htmlediting.h: Add new declarations.
3821 Modified layout test results:
3822 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
3823 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
3824 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
3825 * layout-tests/editing/deleting/delete-selection-001-expected.txt:
3826 * layout-tests/editing/deleting/delete-tab-001-expected.txt:
3827 * layout-tests/editing/deleting/delete-tab-004-expected.txt:
3828 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
3829 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
3830 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
3831 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
3832 * layout-tests/editing/inserting/insert-br-001-expected.txt:
3833 * layout-tests/editing/inserting/insert-br-004-expected.txt:
3834 * layout-tests/editing/inserting/insert-br-005-expected.txt:
3835 * layout-tests/editing/inserting/insert-br-006-expected.txt:
3836 * layout-tests/editing/inserting/insert-tab-001-expected.txt:
3837 * layout-tests/editing/inserting/insert-tab-002-expected.txt:
3838 * layout-tests/editing/inserting/insert-tab-004-expected.txt:
3839 * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
3840 * layout-tests/editing/inserting/typing-001-expected.txt:
3841 * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
3842 * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
3843 * layout-tests/editing/style/typing-style-003-expected.txt:
3844 * layout-tests/editing/undo/redo-typing-001-expected.txt:
3845 * layout-tests/editing/undo/undo-typing-001-expected.txt:
3847 2004-10-21 David Hyatt <hyatt@apple.com>
3849 Fix for 3847054, assertion failure in RenderText::layout() on news.com page. Fix getInlineRun so that
3850 it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
3854 * khtml/rendering/render_block.cpp:
3855 (khtml::getInlineRun):
3857 2004-10-20 David Hyatt <hyatt@apple.com>