1 2004-12-21 Ken Kocienda <kocienda@apple.com>
7 <rdar://problem/3928305> selecting an entire line and typing over causes new inserted text at top of document
9 * khtml/editing/htmlediting.cpp:
10 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent): New function to detect case
11 formerly undetected and unhandled. This is the crux of the bug fix.
12 (khtml::DeleteSelectionCommand::doApply): Call insertPlaceholderForAncestorBlockContent() during
14 * khtml/editing/htmlediting.h: Declare new function.
15 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt: Added.
16 * layout-tests/editing/deleting/delete-3928305-fix.html: Added.
18 2004-12-21 Ken Kocienda <kocienda@apple.com>
22 * khtml/editing/htmlediting.cpp:
23 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Note to self: Must compile code before
24 checking in (aka must return false from function returning bool).
26 2004-12-21 Ken Kocienda <kocienda@apple.com>
32 <rdar://problem/3927752> Crash in khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded(DOM::NodeImpl*)
34 * khtml/editing/htmlediting.cpp:
35 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Added some null checks.
36 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Ditto.
38 2004-12-21 Ken Kocienda <kocienda@apple.com>
42 * khtml/editing/htmlediting.cpp:
43 (khtml::ReplacementFragment::mergeStartNode): Refine concept of how this node is found based on
45 (khtml::ReplaceSelectionCommand::doApply): Add a special case for determining merges that need to
46 be done if the insertion point is in an empty block.
47 * layout-tests/editing/pasteboard/paste-text-012-expected.txt: Added.
48 * layout-tests/editing/pasteboard/paste-text-012.html: Added.
49 * layout-tests/editing/pasteboard/paste-text-013-expected.txt: Added.
50 * layout-tests/editing/pasteboard/paste-text-013.html: Added.
51 * layout-tests/editing/pasteboard/paste-text-014-expected.txt: Added.
52 * layout-tests/editing/pasteboard/paste-text-014.html: Added.
54 2004-12-21 Darin Adler <darin@apple.com>
58 - fixed <rdar://problem/3899133> text search in a Safari window takes a very long time on Tiger updates page (and some other pages)
60 * khtml/editing/visible_text.h: Add an "offset base node" parameter to emitCharacter, and also
61 add a field to track it. Must make a few things mutable so we can update them in the range accessor.
62 * khtml/editing/visible_text.cpp:
63 (khtml::TextIterator::advance): Pass in base node and offsets rather than computing actual offsets
64 using the node's index. We only compute the node index if actually asked for the range.
65 (khtml::TextIterator::handleTextNode): Pass 0 for base node and set base node to 0 when setting
67 (khtml::TextIterator::handleTextBox): Ditto.
68 (khtml::TextIterator::handleReplacedElement): Pass base node and set base node instead of calling
70 (khtml::TextIterator::handleNonTextNode): Pass 0 for offset.
71 (khtml::TextIterator::exitNode): More of the same.
72 (khtml::TextIterator::emitCharacter): Ditto.
73 (khtml::TextIterator::range): If an offset base node is stored, then get its node index, and then
74 add that in to the offsets. Doing the work here guarantees it's done only once when doing a text search.
78 * khtml/khtml_part.cpp: Removed SPEED_DEBUG define. Not sure why it was on.
82 2004-12-20 Ken Kocienda <kocienda@apple.com>
86 * khtml/editing/htmlediting.cpp:
87 (khtml::DeleteSelectionCommand::moveNodesAfterNode): My one-liner for this bug introduced layout test
88 regressions: <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
89 Rolling out until I can develop a real fix.
91 2004-12-20 David Harrison <harrison@apple.com>
93 Reviewed by Dave Hyatt.
95 Initial checkin of AXTextMarkerRef support.
97 * khtml/xml/dom_docimpl.cpp:
98 (DocumentImpl::updateSelection):
99 (DocumentImpl::setFocusNode):
100 * kwq/KWQAccObject.h:
101 * kwq/KWQAccObject.mm:
102 (-[KWQAccObject detach]):
103 (-[KWQAccObject anchorElement]):
104 (-[KWQAccObject addChildrenToArray:]):
105 (-[KWQAccObject accessibilityAttributeNames]):
106 (-[KWQAccObject accessibilityActionDescription:]):
107 (-[KWQAccObject accessibilityPerformAction:]):
108 (-[KWQAccObject textMarkerRangeFromMarkers:andEndMarker:]):
109 (-[KWQAccObject textMarkerForVisiblePosition:]):
110 (-[KWQAccObject visiblePositionForTextMarker:]):
111 (-[KWQAccObject AXTextMarkerRangeCopyStartMarkerWrapper:]):
112 (-[KWQAccObject AXTextMarkerRangeCopyEndMarkerWrapper:]):
113 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
114 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
115 (-[KWQAccObject accessibilityAttributeValue:]):
116 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
117 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
118 (-[KWQAccObject getSelectedTextMarkerRange]):
119 (-[KWQAccObject doAXLineForTextMarker:]):
120 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
121 (-[KWQAccObject doAXStringForTextMarkerRange:]):
122 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
123 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
124 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
125 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
126 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
127 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
128 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
129 (-[KWQAccObject accessibilityFocusedUIElement]):
130 (-[KWQAccObject clearChildren]):
131 (-[KWQAccObject accObjectID]):
132 (-[KWQAccObject setAccObjectID:]):
133 (-[KWQAccObject removeAccObjectID]):
134 * kwq/KWQAccObjectCache.h:
135 * kwq/KWQAccObjectCache.mm:
136 (KWQAccObjectCache::KWQAccObjectCache):
137 (KWQAccObjectCache::~KWQAccObjectCache):
138 (KWQAccObjectCache::getAccObjectID):
139 (KWQAccObjectCache::removeAccObjectID):
140 (KWQAccObjectCache::textMarkerForVisiblePosition):
141 (KWQAccObjectCache::visiblePositionForTextMarker):
143 2004-12-19 Darin Adler <darin@apple.com>
145 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added nil check.
147 2004-12-19 Darin Adler <darin@apple.com>
151 - a garbage collection fix
153 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added a more-extensive comment and fixed the BUILDING_ON_PANTHER
154 #ifndef to use #if (in practice, either is OK).
155 * kwq/KWQKURL.mm: (KURL::getNSURL): Use KWQCFAutorelease instead of autorelease.
157 2004-12-17 David Hyatt <hyatt@apple.com>
159 Fix for 3923255, specified percentage heights of divs with overflow auto inside tables not honored.
163 * khtml/rendering/render_box.cpp:
164 (RenderBox::calcPercentageHeight):
165 * khtml/rendering/render_table.cpp:
166 (RenderTableSection::layoutRows):
168 2004-12-17 David Harrison <harrison@apple.com>
170 Reviewed by Ken Kocienda.
172 <rdar://problem/3924930> REGRESSION: triple click does not select to end of line
174 * khtml/editing/visible_units.cpp:
175 (khtml::endOfParagraph):
176 When includeLineBreak is true, allow traversal to next node after enclosingBlockFlowElement.
178 2004-12-17 Ken Kocienda <kocienda@apple.com>
182 * khtml/editing/htmlediting.cpp:
183 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Missed deleting some now-obsolete expcetion
184 codes when I added the createBreakElement() function.
186 2004-12-17 Richard Williamson <rjw@apple.com>
188 Set the floor of max cacheable object size to 40K. This restores
189 the long standing floor. Lower floor deleteriously impacts the PLT.
192 * khtml/khtml_part.cpp:
193 (KHTMLPart::checkCompleted):
194 * khtml/misc/loader.cpp:
197 2004-12-17 Ken Kocienda <kocienda@apple.com>
203 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
205 * khtml/editing/htmlediting.cpp:
206 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Stop merging nodes when a <br> is hit.
207 Formerly checked only for block boundary.
209 2004-12-17 David Harrison <harrison@apple.com>
213 Add KWQCFAutorelease for autoreleasing CF objects.
214 * kwq/KWQFoundationExtras.h:
218 2004-12-17 David Harrison <harrison@apple.com>
222 Fix GC compatibility in getNSString.
225 (QString::getNSString):
226 Use NSString allocator instead of CFString, so that autorelease works under GC.
228 2004-12-17 Ken Kocienda <kocienda@apple.com>
234 <rdar://problem/3890973> REGRESSION (Mail): Deleting reorders remaining text
236 * khtml/editing/htmlediting.cpp:
237 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Added check to ensure that moving content will not
238 move it after the <body> element.
240 2004-12-17 Ken Kocienda <kocienda@apple.com>
244 Added new layout tests covering cases from recent bug fixes.
246 * layout-tests/editing/inserting/insert-div-018-expected.txt: Added.
247 * layout-tests/editing/inserting/insert-div-018.html: Added.
248 * layout-tests/editing/inserting/insert-div-019-expected.txt: Added.
249 * layout-tests/editing/inserting/insert-div-019.html: Added.
250 * layout-tests/editing/inserting/insert-div-020-expected.txt: Added.
251 * layout-tests/editing/inserting/insert-div-020.html: Added.
252 * layout-tests/editing/inserting/insert-div-021-expected.txt: Added.
253 * layout-tests/editing/inserting/insert-div-021.html: Added.
255 2004-12-17 Ken Kocienda <kocienda@apple.com>
259 Changes in layout resulting from giving <p> elements no margin rather than 0.1em margin.
261 * layout-tests/editing/inserting/insert-div-013-expected.txt
262 * layout-tests/editing/inserting/insert-div-014-expected.txt
264 2004-12-17 Ken Kocienda <kocienda@apple.com>
270 <rdar://problem/3925317> Increase quote in email and with cursor below the quote the new line appears above the quote
272 * khtml/editing/htmlediting.cpp:
273 (khtml::InsertParagraphSeparatorCommand::doApply):
274 * khtml/editing/visible_position.cpp: Refine rules for whether to use the starting node or the starting
275 block as the reference node for the insertion of the new block.
276 (khtml::isLastVisiblePositionInBlock): Tweak rules again. Descendants of following blocks should answer true.
277 I worked this all out on the whiteboard this time. This should be the last tweak.
279 2004-12-17 Kevin Decker <kdecker@apple.com>
283 Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs
285 * khtml/xml/xml_tokenizer.cpp:
286 (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.
288 2004-12-16 Ken Kocienda <kocienda@apple.com>
294 <rdar://problem/3924888> REGRESSION (Mail): Hitting return key at end of line does not insert visible newline
296 * khtml/editing/htmlediting.cpp:
297 (khtml::InsertParagraphSeparatorCommand::doApply): Tweaked code I added just before to fix 3924486, so that
298 it checks the downstream node for the starting position.
300 2004-12-16 Ken Kocienda <kocienda@apple.com>
304 Added new createBreakElement() function that makes creating a <br> element a one-liner.
305 Converted all the code that used to call the DocumentImpl, and dealt with the exceptionCode,
306 over to this new helper.
308 * khtml/editing/htmlediting.cpp:
309 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Now uses new helper function.
310 (khtml::InsertLineBreakCommand::doApply): Ditto.
311 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
312 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
313 (khtml::ReplaceSelectionCommand::doApply): Ditto.
314 (khtml::createBreakElement): New helper.
315 * khtml/editing/htmlediting.h: Ditto.
317 2004-12-16 David Hyatt <hyatt@apple.com>
319 Fix a bug where vertical-align values that depended on their parent's value went crazy if the parent was
320 vertical-align top or bottom. The bug is 3771007, bankofamerica's ebills page.
324 * khtml/rendering/render_object.cpp:
325 (RenderObject::getVerticalPosition):
327 2004-12-16 Ken Kocienda <kocienda@apple.com>
333 <rdar://problem/3924486> REGRESSION (Mail): Hitting return key does not insert visible newline
334 <rdar://problem/3924579> REGRESSION (Mail): After deleting, hitting return key does not insert visible newline
336 * khtml/editing/htmlediting.cpp:
337 (khtml::InsertParagraphSeparatorCommand::doApply): For the first bug, detect when inserting a <p> will
338 make a visible <br> collapse. For the second bug, move the code that inserts the new <p> after
339 a check which may move the node used as the reference node for the insertion. Also change this code to
340 insert the <p> after the last sibling of the starting position, to move it past the nodes we're going
341 to want to shift into the new <p>.
343 2004-12-16 Darin Adler <darin@apple.com>
347 - use <p> elements rather than <br> when pasting plain text; also use margin of 0 rather than 0.1 em
348 after talking this over with Dave and Ken
350 * khtml/editing/htmlediting.h: Added createDefaultParagraphElement and createBlockPlaceholderElement.
351 * khtml/editing/htmlediting.cpp:
352 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Use new createBlockPlaceholderElement
353 helper so this can share code with the plain-text conversion code.
354 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): Use new createDefaultParagraphElement
355 helper so this can share code with the plain-text conversion code.
356 (khtml::createDefaultParagraphElement): Added.
357 (khtml::createBlockPlaceholderElement): Added.
359 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Use paragraphs rather than
360 <br> elements for pasting plain text.
362 - regenerated these files with the newer gperf
364 * khtml/css/cssproperties.c: Regenerated.
365 * khtml/css/cssvalues.c: Regenerated.
366 * khtml/misc/htmlattrs.c: Regenerated.
367 * khtml/misc/htmltags.c: Regenerated.
369 2004-12-16 Ken Kocienda <kocienda@apple.com>
375 <rdar://problem/3924291> REGRESSION (Mail): Crash deleting content following a <p> element
377 * khtml/xml/dom_nodeimpl.cpp:
378 (NodeImpl::enclosingInlineElement): Fixed problem in this function where recursive search for
379 parent that is not an inline would skip past previous siblings of nodes which were blocks. Now
380 it stops looking in this situation. This problem eventually caused the delete code to try to
381 merge a node under a descendent.
383 2004-12-16 Adele Amchan <adele@apple.com>
385 Change by Richard, reviewed by me.
387 Fix for: <rdar://problem/3923983> background image decoding prevents page with 0Kb image from finishing to load
389 * khtml/misc/loader.cpp: (CachedImage::data): Added call to notifyFinished so the 0Kb image case finishes loading.
391 2004-12-16 Adele Amchan <adele@apple.com>
395 Fix for: <rdar://problem/3534824> VIP: some navigation links on safeway.com don't work due to a JavaScript quirk
397 Added a call to ObjectImp::get before Window::get just returns Undefined.
398 This was preventing us from getting the toString function from a Window object.
400 * khtml/ecma/kjs_window.cpp: (Window::get):
402 2004-12-16 Ken Kocienda <kocienda@apple.com>
408 <rdar://problem/3918351> REGRESSION (Mail, 173-175+): Return before first char of line leaves insertion point in wrong place
410 * khtml/editing/htmlediting.cpp:
411 (khtml::InsertParagraphSeparatorCommand::doApply): Basically, did a rewrite of this function
412 to do a better job than it was doing before. Added several test cases to prove I am on a
414 * khtml/editing/visible_position.cpp:
415 (khtml::isFirstVisiblePositionInBlock): Tweaked the rules a bit to fix an issue very similar to the
416 leaving-the-bar-node case problem I just fixed in a recent checkin (relevant markup: <p>foo</p>bar).
417 This function was returning true for the first position in "bar". Wrong. Also tightened up other
418 rule: Should not report true when relationship between blocks cannot be determined.
419 (khtml::isLastVisiblePositionInBlock): Tightened up rule as above: Should not report true
420 when relationship between blocks cannot be determined.
421 * layout-tests/editing/inserting/insert-div-010-expected.txt: Added.
422 * layout-tests/editing/inserting/insert-div-010.html: Added.
423 * layout-tests/editing/inserting/insert-div-011-expected.txt: Added.
424 * layout-tests/editing/inserting/insert-div-011.html: Added.
425 * layout-tests/editing/inserting/insert-div-012-expected.txt: Added.
426 * layout-tests/editing/inserting/insert-div-012.html: Added.
427 * layout-tests/editing/inserting/insert-div-013-expected.txt: Added.
428 * layout-tests/editing/inserting/insert-div-013.html: Added.
429 * layout-tests/editing/inserting/insert-div-014-expected.txt: Added.
430 * layout-tests/editing/inserting/insert-div-014.html: Added.
431 * layout-tests/editing/inserting/insert-div-015-expected.txt: Added.
432 * layout-tests/editing/inserting/insert-div-015.html: Added.
433 * layout-tests/editing/inserting/insert-div-016-expected.txt: Added.
434 * layout-tests/editing/inserting/insert-div-016.html: Added.
435 * layout-tests/editing/inserting/insert-div-017-expected.txt: Added.
436 * layout-tests/editing/inserting/insert-div-017.html: Added.
438 2004-12-16 Ken Kocienda <kocienda@apple.com>
442 Added a layout test based on my last checkin.
444 * layout-tests/editing/selection/move-by-word-001-expected.txt: Added.
445 * layout-tests/editing/selection/move-by-word-001.html: Added.
447 2004-12-16 Ken Kocienda <kocienda@apple.com>
453 <rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps
455 * khtml/editing/visible_text.cpp:
456 (khtml::SimplifiedBackwardsTextIterator::advance): Add new check for leaving a text node and iterating
457 backwards into a different block that is an descendent of the block containing the text node (as in leaving
458 the "bar" node in this example: <p>foo</p>bar).
459 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Call new emitNewlineForBROrText helper.
460 (khtml::SimplifiedBackwardsTextIterator::emitNewlineForBROrText): Factor out code from handleNonTextNode, since
461 it is called from there, and now also from advance().
463 2004-12-15 Darin Adler <darin@apple.com>
467 - fixed problem where plain-text would put a blank line between each <p> even when they have no margins
469 * khtml/editing/visible_text.cpp: (khtml::TextIterator::exitNode): Add more checks and only set the
470 "add one more newline" flag if the margin is sufficient. A more complete fix would ignore the node
471 type altogether and use the render tree instead.
473 2004-12-14 John Sullivan <sullivan@apple.com>
477 - rest of WebCore fix for <rdar://problem/3790011> undoable operations all say "Undo"
478 in the menu, no specific action names
480 * khtml/editing/edit_actions.h: new header, contains EditAction enum
481 (renamed from HTMLEditAction, formerly in htmlediting.h)
483 * ForwardingHeaders/editing/edit_actions.h: new forwarding header
485 * khtml/editing/htmlediting.h:
486 removed HTMLEditAction enum in favor of including edit_actions.h; added khtml::
487 namespace to EditAction usages; added m_editingAction ivar to ApplyStyleCommand
489 * khtml/editing/htmlediting.cpp:
490 (khtml::EditCommandPtr::editingAction):
491 update for enum name change
492 (khtml::EditCommand::editingAction):
494 (khtml::ApplyStyleCommand::ApplyStyleCommand):
495 added editingAction parameter to this constructor
496 (khtml::ApplyStyleCommand::editingAction):
498 (khtml::DeleteSelectionCommand::editingAction):
499 update for enum name change
500 (khtml::MoveSelectionCommand::editingAction):
502 (khtml::TypingCommand::editingAction):
504 (khtml::ReplaceSelectionCommand::editingAction):
507 * khtml/khtml_part.h:
508 added EditAction parameter to applyStyle and computeAndSetTypingStyle
509 * khtml/khtml_part.cpp:
510 (KHTMLPart::computeAndSetTypingStyle):
511 added EditAction parameter
512 (KHTMLPart::applyStyle):
515 * kwq/KWQKHTMLPart.mm:
516 (KWQKHTMLPart::registerCommandForUndoOrRedo):
517 do the cast from EditAction to WebUndoAction a different way to match other code
519 * kwq/WebCoreBridge.h:
520 * kwq/WebCoreBridge.mm:
521 (-[WebCoreBridge setTypingStyle:withUndoAction:]):
522 added WebUndoAction parameter, passed into ApplyStyleCommand constructor
523 (-[WebCoreBridge applyStyle:withUndoAction:]):
526 * WebCore.pbproj/project.pbxproj:
527 updated for new files
529 2004-12-14 David Hyatt <hyatt@apple.com>
531 Fix for 3562458, rowspan and colspan converted to ints so that large values will work for them. Remove
532 the ridiculous 1024 limit on the span values.
534 * khtml/html/html_tableimpl.cpp:
535 (HTMLTableCellElementImpl::parseHTMLAttribute):
536 * khtml/rendering/render_table.cpp:
537 (RenderTableCell::collapsedBottomBorder):
538 * khtml/rendering/render_table.h:
539 (khtml::RenderTableCell::colSpan):
540 (khtml::RenderTableCell::setColSpan):
541 (khtml::RenderTableCell::rowSpan):
542 (khtml::RenderTableCell::setRowSpan):
543 (khtml::RenderTableCol::span):
544 (khtml::RenderTableCol::setSpan):
546 2004-12-14 David Hyatt <hyatt@apple.com>
548 Make sure <col> and <colgroup> can have spans updated dynamically as well.
552 * khtml/html/html_tableimpl.cpp:
553 (HTMLTableColElementImpl::parseHTMLAttribute):
554 * khtml/rendering/render_table.cpp:
555 (RenderTableCell::updateFromElement):
556 (RenderTableCol::updateFromElement):
558 2004-12-14 David Hyatt <hyatt@apple.com>
560 Fix for 3833123, setting a cell's colspan does not update rendering like it should.
564 * khtml/html/html_tableimpl.cpp:
565 (HTMLTableCellElementImpl::parseHTMLAttribute):
566 * khtml/rendering/render_table.cpp:
567 (RenderTableCell::RenderTableCell):
568 (RenderTableCell::updateFromElement):
570 2004-12-14 Chris Blumenberg <cblu@apple.com>
572 Fixed: <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
576 * khtml/editing/markup.cpp:
577 (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it
579 2004-12-14 David Hyatt <hyatt@apple.com>
581 Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position.
582 This is actually a regression from my positioned object DHTML optimization.
586 * khtml/rendering/render_object.cpp:
587 (RenderObject::setStyle):
589 2004-12-14 David Hyatt <hyatt@apple.com>
591 Make sure the class attribute works when newlines are present in the attribute.
595 * khtml/html/html_elementimpl.cpp:
596 (HTMLNamedAttrMapImpl::parseClassAttribute):
598 2004-12-14 David Hyatt <hyatt@apple.com>
600 Fix for 3724938, float element is duplicated and paints twice. The logic for when to paint floats was
601 actually fairly screwed up. This patch simplifies the logic and makes addOverhangingFloats easier to
602 read by splitting it into two separate functions.
606 * khtml/rendering/render_block.cpp:
607 (khtml::RenderBlock::layoutBlockChildren):
608 (khtml::RenderBlock::clearFloats):
609 (khtml::RenderBlock::addOverhangingFloats):
610 (khtml::RenderBlock::addIntrudingFloats):
611 * khtml/rendering/render_block.h:
613 2004-12-14 John Sullivan <sullivan@apple.com>
617 - added Undo action names for Cut, Paste, and Drag
619 * khtml/editing/htmlediting.h:
620 * khtml/editing/htmlediting.cpp:
621 (khtml::DeleteSelectionCommand::editingAction):
622 overridden to return HTMLEditActionCut
623 (khtml::MoveSelectionCommand::editingAction):
624 overridden to return HTMLEditActionDrag
625 (khtml::ReplaceSelectionCommand::editingAction):
626 overridden to return HTMLEditActionPaste
628 2004-12-14 John Sullivan <sullivan@apple.com>
632 - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu,
633 no specific action names
635 The remaining step is to make each EditCommand subclass override editingAction() to return an
636 appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
637 is not completely straightforward, so this next step isn't trivial.)
639 * khtml/editing/htmlediting.h:
640 new enum for HTMLEditAction
642 * khtml/editing/htmlediting.cpp:
643 (khtml::EditCommandPtr::editingAction):
644 new method, calls through to EditCommand
645 (khtml::EditCommand::editingAction):
646 new method for subclasses to override, returns HTMLEditActionUnspecified at this level
647 (khtml::TypingCommand::editingAction):
648 proof of concept override, returns HTMLEditActionTyping
650 * kwq/KWQKHTMLPart.h:
651 declare new private bottleneck method registerCommandForUndoOrRedo
652 * kwq/KWQKHTMLPart.mm:
653 (KWQKHTMLPart::registerCommandForUndoOrRedo):
654 new bottleneck method to reduce code duplication; now calls over the bridge
655 to get the localized string to use for the Undo action name
656 (KWQKHTMLPart::registerCommandForUndo):
657 now calls new bottleneck method
658 (KWQKHTMLPart::registerCommandForRedo):
659 now calls new bottleneck method
661 * kwq/WebCoreBridge.h:
662 new enum for WebUndoAction, maps directly to HTMLEditAction.
663 Declaration of nameForUndoAction:
665 2004-12-14 Darin Adler <darin@apple.com>
669 - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)
671 * khtml/rendering/render_frames.cpp:
672 (RenderPart::~RenderPart): Check widget for nil.
673 (RenderPart::setWidget): Ditto.
674 (RenderFrame::slotViewCleared): Ditto.
675 (RenderPartObject::slotViewCleared): Ditto.
677 2004-12-13 Darin Adler <darin@apple.com>
681 - moved markup-related functions into new sources files in the editing directory
682 - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster
684 * ForwardingHeaders/editing/markup.h: Added.
685 * khtml/editing/markup.h: Added.
686 * khtml/editing/markup.cpp: Added.
688 * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.
690 * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
691 * khtml/html/html_elementimpl.cpp:
692 (HTMLElementImpl::innerHTML): Changed to call createMarkup.
693 (HTMLElementImpl::outerHTML): Ditto.
695 * khtml/ecma/kjs_window.cpp:
696 (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
697 (Window::retrieveActive): Ditto.
699 * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
700 * khtml/xml/dom_docimpl.h: Ditto.
702 * khtml/khtml_part.cpp:
703 (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
704 (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.
706 * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
707 still works even with the additional replace overloads added to QString.
708 * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.
710 * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
711 base pointer, because it used dynamic_cast in its implementation. Made the other version public.
712 * khtml/rendering/render_object.cpp: Ditto.
713 * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.
715 * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
716 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
717 the support code into markup.cpp.
719 * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
720 * khtml/xml/dom_nodeimpl.cpp: Ditto.
722 * khtml/xml/dom_position.cpp:
723 (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
724 so these return null positions rather than raising exceptions.
725 (DOM::endPosition): Ditto.
727 * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
728 * kwq/KWQFrame.h: Ditto.
729 * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
730 * kwq/KWQKPartsPart.h: Ditto.
731 * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
732 * kwq/KWQScrollView.h: Ditto.
733 * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
734 * kwq/KWQKHTMLPart.h: Ditto.
735 * kwq/KWQKHTMLPart.mm:
736 (KHTMLView::isKHTMLView): Ditto.
737 (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
738 replace overloads added to QString.
739 (KWQKHTMLPart::setStatusBarText): Ditto.
740 (KWQKHTMLPart::runJavaScriptAlert): Ditto.
741 (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
742 (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
743 (KWQKHTMLPart::attributedString): Ditto.
744 (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
745 (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).
747 * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
749 (QObject::inherits): Changed to not use dynamic cast.
750 (QObject::isKHTMLPart): Added. Returns false.
751 (QObject::isKHTMLView): Ditto.
752 (QObject::isKPartsReadOnlyPart): Ditto.
753 (QObject::isQFrame): Ditto.
754 (QObject::isQScrollView): Ditto.
756 * kwq/KWQRenderTreeDebug.cpp:
757 (write): Changed to use inherits rather than dynamic_cast.
758 (writeSelection): Ditto.
760 * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
761 than going straight on to the "no parameters at all" version.
764 * kwq/KWQString.mm: (QString::replace): Added overloads.
765 * kwq/WebCoreBridge.mm:
766 (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
767 (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
768 (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
769 the additional replace overloads added to QString.
770 (-[WebCoreBridge stringForRange:]): Ditto.
771 (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
772 (-[WebCoreBridge elementAtPoint:]): QChar conversion.
773 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
774 (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.
776 2004-12-13 Ken Kocienda <kocienda@apple.com>
782 <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
784 * khtml/editing/htmlediting.cpp:
785 (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
786 leading and trailing whitespace positions was reversed! I must have introduced this error recently
787 when changing around this code.
789 2004-12-13 David Hyatt <hyatt@apple.com>
791 Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing
792 and painting was using the wrong rect when setting up the x/y of the rect.
796 * khtml/rendering/render_block.cpp:
797 (khtml::RenderBlock::paint):
798 (khtml::RenderBlock::nodeAtPoint):
799 * khtml/rendering/render_object.h:
800 (khtml::RenderObject::floatRect):
802 2004-12-13 Ken Kocienda <kocienda@apple.com>
808 <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles
810 Code to figuire out the end node to merge was missing the font tag in the second paragraph
811 written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.
813 * khtml/editing/htmlediting.cpp:
814 (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
815 looking for the node that is the last inline in the last block of the fragment. The old algorithm was
816 insufficiently powerful.
817 (khtml::ReplacementFragment::enclosingBlock): New helper function.
818 * khtml/editing/htmlediting.h: Add declaration for new helper function.
819 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
820 * layout-tests/editing/pasteboard/paste-text-011.html: Added.
822 2004-12-13 Ken Kocienda <kocienda@apple.com>
826 WebCore side of fix for this bug:
828 <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace
830 Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
831 bug. This change involves our half of the needed changes.
833 Note that a lot of this change has to do with changing code to use a <br> element instead of
834 a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
835 other places, code to handle comments in markup can be removed since we do not use comments for
836 such annotations after this change.
838 * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
839 (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
840 (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
841 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
842 convertedSpaceSpanClassString to match other uses of the idiom used here.
843 (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
844 * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
845 (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
846 * khtml/html/html_elementimpl.cpp:
847 (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
848 annotate fragments with comments any longer.
849 * khtml/html/html_elementimpl.h: Ditto.
850 * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
851 (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
852 (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
854 * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
855 * kwq/WebCoreBridge.mm:
856 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
857 in DOM when calling createContextualFragment().
859 2004-12-10 John Sullivan <sullivan@apple.com>
861 fixed deployment build bustage that John Louch ran into
863 * kwq/KWQTextEdit.mm:
864 (QTextEdit::setScrollBarModes):
865 move bool declaration inside exception-handling block to avoid obscure
868 2004-12-10 Maciej Stachowiak <mjs@apple.com>
872 <rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
875 (QWidget::setFocus): Handle the case where setting focus removed
876 us from the superview - this can happen due to style changes on
879 2004-12-10 Ken Kocienda <kocienda@apple.com>
885 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
887 There are a number of interesting things we could do to fix this bug, including SPI and involving
888 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
889 will fix the bug in the general case until such time as we can come up with more specific
892 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
895 * khtml/editing/htmlediting.cpp:
896 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
897 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
898 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
899 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
901 2004-12-10 Darin Adler <darin@apple.com>
905 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
907 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
908 * khtml/rendering/render_form.cpp:
909 (RenderSubmitButton::rawText): Convert to QChar explicitly.
910 (RenderLineEdit::updateFromElement): Ditto.
911 (RenderLineEdit::slotTextChanged): Ditto.
912 (RenderSelect::updateFromElement): Ditto.
913 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
914 that requires a derived class. Now we don't use this class at all for WebCore, but they still
916 (TextAreaWidget::event): Moved out the ifdefs.
917 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
918 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
919 now done in setStyle.
920 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
921 that's needed and WebCore no longer has TextAreaWidget.
922 (RenderTextArea::calcMinMaxWidth): Ditto.
923 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
925 (RenderTextArea::updateFromElement): Use type QTextEdit.
926 (RenderTextArea::text): Ditto.
927 (RenderTextArea::select): Ditto.
929 * kwq/KWQTextArea.mm:
930 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
931 since it's now handled by QTextEdit.
932 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
934 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
935 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
936 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
938 2004-12-10 Ken Kocienda <kocienda@apple.com>
944 <rdar://problem/3915047> HItting return in empty document inserts <p> but
945 insertion point does not move
947 * khtml/editing/htmlediting.cpp:
948 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
949 code to insert the <p> element for the return is not detecting the fact
950 that the document is empty. Inserting a <p> into an empty body will not
951 "add a new line" as the user expects. With this change, we'll add a second
952 <p> when the root editable element has no rendered kids.
954 2004-12-10 Maciej Stachowiak <mjs@apple.com>
958 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
960 * khtml/html/html_miscimpl.cpp:
961 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
962 the initial one step, otherwise we might inadvertantly step
963 outside the collection base, thereby causing assertion failures or
966 2004-12-10 Ken Kocienda <kocienda@apple.com>
970 * khtml/editing/htmlediting.cpp:
971 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
972 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
973 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
974 should do nothing if the starting point for the selection is itself the starting block.
975 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
976 function, though the names and concepts are slightly different.
978 2004-12-10 Maciej Stachowiak <mjs@apple.com>
982 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
984 * khtml/dom/html_document.cpp:
985 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
986 * khtml/dom/html_document.h:
987 * khtml/ecma/kjs_html.cpp:
988 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
989 * khtml/html/html_miscimpl.cpp:
990 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
991 the items that can be accessed directly as a document propery, in particular forms, images,
992 objects, applets and embeds.
993 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
994 (HTMLFormCollectionImpl::updateNameCache): Ditto.
995 * khtml/html/html_miscimpl.h:
996 (DOM::HTMLCollectionImpl::): Added new type.
998 2004-12-10 Ken Kocienda <kocienda@apple.com>
1004 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
1006 * khtml/rendering/render_text.cpp:
1007 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
1009 2004-12-10 Ken Kocienda <kocienda@apple.com>
1015 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
1017 * khtml/editing/htmlediting.cpp:
1018 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
1019 that was removed from the document when pasting. This caused the disappearance. Now this
1020 is detected, and the selection is shifted to a node that is in the document.
1022 2004-12-09 Richard Williamson <rjw@apple.com>
1024 Check to disable threaded decoding during
1025 layout tests wasn't invoking function, just checking address of
1026 function, which would always return true.
1028 * kwq/WebCoreImageRendererFactory.m:
1029 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
1031 2004-12-09 David Hyatt <hyatt@apple.com>
1033 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
1036 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
1037 all inlines when repainting.
1041 * khtml/rendering/render_block.cpp:
1042 (khtml::RenderBlock::layoutBlockChildren):
1043 * khtml/rendering/render_flow.cpp:
1044 (RenderFlow::getAbsoluteRepaintRect):
1046 2004-12-09 David Hyatt <hyatt@apple.com>
1048 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
1049 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
1050 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
1051 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
1055 * khtml/rendering/render_block.cpp:
1056 (khtml::RenderBlock::getClearDelta):
1057 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
1058 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
1059 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
1060 * layout-tests/fast/block/margin-collapse/102-expected.txt:
1061 * layout-tests/fast/block/margin-collapse/102.html:
1063 2004-12-09 Richard Williamson <rjw@apple.com>
1065 Fixed <rdar://problem/3914078> worldclock crashing gc related
1067 Use ProtectedValue for Context2D instance members.
1071 * khtml/ecma/kjs_html.h:
1073 2004-12-09 John Sullivan <sullivan@apple.com>
1077 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
1079 * kwq/KWQAccObject.mm:
1080 (-[KWQAccObject title]): moved image alt tag code out of here
1081 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
1082 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
1083 that ordinary elements return; this means that ordinary elements that aren't images will return
1084 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
1086 (-[KWQAccObject accessibilityAttributeValue:]):
1087 call accessibilityDescription when asked for AXDescription
1089 2004-12-09 Ken Kocienda <kocienda@apple.com>
1091 Reviewed by Harrison
1095 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
1097 * khtml/editing/htmlediting.cpp:
1098 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
1099 been deleted. If this is the case, set the destination to the node the delete command provides in
1100 its ending selection.
1104 2004-12-09 Ken Kocienda <kocienda@apple.com>
1110 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
1112 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
1113 callback may not be delivered before the program asks for the dimensions of an image in order to
1114 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
1115 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
1117 * kwq/KWQRenderTreeDebug.cpp:
1118 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
1119 (externalRepresentation): Sets debuggingRenderTree flag to true;
1120 * kwq/KWQRenderTreeDebug.h:
1121 * kwq/WebCoreImageRendererFactory.m:
1122 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
1123 do threaded decoding in any case if the flag is set.
1125 2004-12-09 Chris Blumenberg <cblu@apple.com>
1127 Fix for busting XMLHTTPRequest.
1129 Reviewed by kocienda.
1131 * khtml/misc/loader.cpp:
1132 (Loader::servePendingRequests): pass true for deliverAllData
1134 (KIO::get): take deliverAllData param
1135 (KIO::http_post): ditto
1136 * kwq/KWQKJobClasses.h:
1137 * kwq/KWQKJobClasses.mm:
1138 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
1139 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
1141 2004-12-09 Ken Kocienda <kocienda@apple.com>
1145 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
1147 * khtml/xml/dom_nodeimpl.cpp:
1148 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
1150 2004-12-07 Richard Williamson <rjw@apple.com>
1152 Support threaded image decoding on machines w/ > 2 CPUs.
1154 Reviewed by Maciej and Chris.
1156 * khtml/misc/loader.cpp:
1157 (CachedImageCallback::notifyUpdate):
1158 (CachedImageCallback::notifyFinished):
1159 (CachedImageCallback::notifyDecodingError):
1160 (CachedImageCallback::handleError):
1161 (CachedImageCallback::clear):
1162 (CachedImage::CachedImage):
1163 (CachedImage::clear):
1164 (CachedImage::data):
1165 (CachedImage::checkNotify):
1166 (Loader::servePendingRequests):
1167 (Loader::slotFinished):
1168 (Loader::numRequests):
1169 (Loader::cancelRequests):
1170 (Loader::removeBackgroundDecodingRequest):
1171 * khtml/misc/loader.h:
1172 (khtml::CachedImageCallback::CachedImageCallback):
1173 (khtml::CachedImageCallback::ref):
1174 (khtml::CachedImageCallback::deref):
1175 (khtml::CachedImage::decoderCallback):
1176 * khtml/rendering/render_object.cpp:
1177 (RenderObject::setPixmap):
1180 (-[WebImageCallback initWithCallback:khtml::]):
1181 (-[WebImageCallback _commonTermination]):
1182 (-[WebImageCallback dealloc]):
1183 (-[WebImageCallback finalize]):
1184 (-[WebImageCallback notify]):
1185 (-[WebImageCallback setImageSourceStatus:]):
1186 (-[WebImageCallback status]):
1187 (QPixmap::shouldUseThreadedDecoding):
1188 (QPixmap::receivedData):
1189 * kwq/WebCoreImageRenderer.h:
1190 * kwq/WebCoreImageRendererFactory.h:
1191 * kwq/WebCoreImageRendererFactory.m:
1192 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
1193 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
1195 2004-12-07 Ken Kocienda <kocienda@apple.com>
1199 * khtml/editing/htmlediting.cpp:
1200 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
1201 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
1202 after new block has been inserted, otherwise a crash can result. Shuffle down call
1203 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
1206 2004-12-07 Ken Kocienda <kocienda@apple.com>
1212 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
1214 * khtml/editing/htmlediting.cpp:
1215 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
1216 for determining the location for inserting content. Do not allow an insert before or after if the
1217 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
1218 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
1219 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
1221 2004-12-07 Darin Adler <darin@apple.com>
1225 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
1227 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
1229 2004-12-07 Ken Kocienda <kocienda@apple.com>
1233 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
1234 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
1236 * khtml/editing/html_interchange.h: Name change, as described above.
1237 * khtml/editing/htmlediting.cpp:
1238 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
1239 * khtml/xml/dom2_rangeimpl.cpp:
1240 (DOM::RangeImpl::toHTML): Ditto.
1242 2004-12-07 Ken Kocienda <kocienda@apple.com>
1246 Added a couple more layout tests.
1248 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
1249 * layout-tests/editing/deleting/delete-line-013.html: Added.
1250 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
1251 * layout-tests/editing/deleting/delete-line-014.html: Added.
1253 2004-12-06 Maciej Stachowiak <mjs@apple.com>
1257 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
1259 * kwq/KWQListBox.mm:
1260 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
1261 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
1262 (-[KWQListBoxScrollView widget]): See above.
1263 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
1264 afterMouseDown, to avoid triggering an assertion failure.
1266 2004-12-06 David Hyatt <hyatt@apple.com>
1268 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
1269 made by me, kocienda and harrison to just remove it.
1273 * khtml/rendering/bidi.cpp:
1274 (khtml::RenderBlock::layoutInlineChildren):
1275 * khtml/rendering/render_block.cpp:
1276 (khtml:::RenderFlow):
1277 * khtml/rendering/render_block.h:
1278 * khtml/rendering/render_flow.cpp:
1279 (RenderFlow::dirtyLinesFromChangedChild):
1281 2004-12-06 David Hyatt <hyatt@apple.com>
1283 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
1284 not a damage rect that can be changed when intersected with the clip regions of the web page.
1288 * khtml/rendering/render_canvas.h:
1289 (khtml::RenderCanvas::printRect):
1290 (khtml::RenderCanvas::setPrintRect):
1291 * khtml/rendering/render_flow.cpp:
1292 (RenderFlow::paintLines):
1293 * khtml/rendering/render_list.cpp:
1294 (RenderListMarker::paint):
1295 * kwq/KWQKHTMLPart.mm:
1296 (KWQKHTMLPart::adjustPageHeight):
1298 2004-12-06 David Harrison <harrison@apple.com>
1300 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
1302 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
1305 * khtml/rendering/render_flow.cpp:
1306 (RenderFlow::dirtyLinesFromChangedChild):
1307 Dirty the line above because new child can inval the cached line break position of previous line.
1309 2004-12-06 David Hyatt <hyatt@apple.com>
1311 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
1312 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
1313 3126929, handle top/left overflow.
1315 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
1317 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
1318 regions and web pages) has been fixed.
1322 * khtml/rendering/bidi.cpp:
1323 (khtml::RenderBlock::computeHorizontalPositionsForLine):
1324 (khtml::RenderBlock::checkLinesForOverflow):
1325 * khtml/rendering/render_block.cpp:
1326 (khtml:::RenderFlow):
1327 (khtml::RenderBlock::overflowHeight):
1328 (khtml::RenderBlock::overflowWidth):
1329 (khtml::RenderBlock::overflowLeft):
1330 (khtml::RenderBlock::overflowTop):
1331 (khtml::RenderBlock::overflowRect):
1332 (khtml::RenderBlock::layoutBlock):
1333 (khtml::RenderBlock::layoutBlockChildren):
1334 (khtml::RenderBlock::paint):
1335 (khtml::RenderBlock::floatRect):
1336 (khtml::RenderBlock::lowestPosition):
1337 (khtml::RenderBlock::rightmostPosition):
1338 (khtml::RenderBlock::leftmostPosition):
1339 (khtml::RenderBlock::nodeAtPoint):
1340 * khtml/rendering/render_block.h:
1341 * khtml/rendering/render_box.h:
1342 (khtml::RenderBox::borderBox):
1343 (khtml::RenderBox::borderTopExtra):
1344 (khtml::RenderBox::borderBottomExtra):
1345 * khtml/rendering/render_layer.cpp:
1346 (RenderLayer::paintScrollbars):
1347 (mustExamineRenderer):
1348 (RenderLayer::intersectsDamageRect):
1349 (RenderLayer::containsPoint):
1350 * khtml/rendering/render_line.cpp:
1351 (khtml::InlineFlowBox::placeBoxesHorizontally):
1352 (khtml::InlineFlowBox::verticallyAlignBoxes):
1353 * khtml/rendering/render_line.h:
1354 (khtml::InlineBox::leftOverflow):
1355 (khtml::InlineBox::rightOverflow):
1356 (khtml::InlineFlowBox::setVerticalOverflowPositions):
1357 (khtml::RootInlineBox::RootInlineBox):
1358 (khtml::RootInlineBox::leftOverflow):
1359 (khtml::RootInlineBox::rightOverflow):
1360 (khtml::RootInlineBox::setVerticalOverflowPositions):
1361 (khtml::RootInlineBox::setHorizontalOverflowPositions):
1362 * khtml/rendering/render_object.h:
1363 (khtml::RenderObject::borderBox):
1364 (khtml::RenderObject::overflowLeft):
1365 (khtml::RenderObject::overflowTop):
1366 (khtml::RenderObject::overflowRect):
1367 (khtml::RenderObject::floatRect):
1368 * khtml/rendering/render_table.cpp:
1369 (RenderTable::layout):
1370 (RenderTable::paint):
1371 (RenderTable::paintBoxDecorations):
1372 (RenderTable::calcMinMaxWidth):
1373 * khtml/rendering/render_table.h:
1374 (khtml::RenderTableCell::borderTopExtra):
1375 (khtml::RenderTableCell::borderBottomExtra):
1380 2004-12-06 Maciej Stachowiak <mjs@apple.com>
1384 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
1386 I changed all unprotected places that can navigate a different
1387 window or frame from script to check for a javascript: URL, and if
1388 found, to check for safety using cross-site-script rules.
1390 I considered a few other possible exploits and made no change:
1392 - document.location is already protected because the document
1393 object itself is protected
1395 - frame.src, frame.location, iframe.src and targetted links are
1396 all safe because setting the URL of a frame to a javascript: URL
1397 executes the script in the context of the parent
1399 * khtml/ecma/kjs_window.cpp:
1400 (WindowFunc::tryCall):
1402 (LocationFunc::tryCall):
1404 2004-12-06 Ken Kocienda <kocienda@apple.com>
1410 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
1412 * khtml/editing/htmlediting.cpp:
1413 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
1414 check for one of the special cases being checked for in this function. The specific case
1415 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
1416 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
1417 case where a selection ended in a <br> after a block and would not delete any part of the
1418 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
1421 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
1422 new use of the function exposed this bug:
1424 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
1426 * khtml/xml/dom_position.cpp:
1427 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
1428 not have this fatal flaw. It is a much better design as well.
1430 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
1431 have what I consider to be a better result. Going with it.
1433 2004-12-06 Chris Blumenberg <cblu@apple.com>
1435 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
1440 (-[DOMElement _font]): new SPI for AppKit
1443 2004-12-06 Darin Adler <darin@apple.com>
1447 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
1449 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
1450 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
1452 2004-12-06 John Sullivan <sullivan@apple.com>
1454 Darin found what appears to be the real leak that we were falsely blaming
1455 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
1456 sure nothing barfed.
1458 * khtml/css/cssparser.cpp:
1459 (CSSParser::parseValue):
1460 call clearProperties() instead of just setting numParsedProperties to 0
1461 (CSSParser::parseDeclaration):
1463 (CSSParser::createStyleDeclaration):
1466 2004-12-06 Ken Kocienda <kocienda@apple.com>
1472 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
1473 * layout-tests/editing/inserting/insert-div-001.html: Added.
1474 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
1475 * layout-tests/editing/inserting/insert-div-002.html: Added.
1476 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
1477 * layout-tests/editing/inserting/insert-div-003.html: Added.
1478 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
1479 * layout-tests/editing/inserting/insert-div-004.html: Added.
1480 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
1481 * layout-tests/editing/inserting/insert-div-005.html: Added.
1482 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
1483 * layout-tests/editing/inserting/insert-div-006.html: Added.
1484 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
1485 * layout-tests/editing/inserting/insert-div-007.html: Added.
1486 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
1487 * layout-tests/editing/inserting/insert-div-008.html: Added.
1488 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
1489 * layout-tests/editing/inserting/insert-div-009.html: Added.
1491 2004-12-06 Ken Kocienda <kocienda@apple.com>
1493 Reviewed by Harrison
1497 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
1499 * khtml/editing/htmlediting.cpp:
1500 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
1501 being added to this function. This ensures that the added block has a height.
1502 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1504 2004-12-06 Ken Kocienda <kocienda@apple.com>
1508 * khtml/dom/dom_string.cpp:
1509 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
1510 * khtml/dom/dom_string.h: Ditto.
1511 * khtml/editing/htmlediting.cpp:
1512 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
1513 RebalanceWhitespaceCommand instance.
1514 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
1515 (khtml::InsertLineBreakCommand::doApply): Ditto.
1516 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1517 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1518 (khtml::InsertTextCommand::input): Ditto.
1519 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
1520 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
1521 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
1522 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
1523 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
1524 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
1525 * khtml/editing/htmlediting.h: Ditto.
1526 (khtml::RebalanceWhitespaceCommand::): Ditto.
1528 2004-12-05 Darin Adler <darin@apple.com>
1530 - fixed small problem in my check-in from yesterday
1533 (positionForEvent): Get location from event without raising exception if it's the wrong type.
1534 (clickCountForEvent): Same, for clickCount.
1535 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
1536 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
1537 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
1539 2004-12-04 Darin Adler <darin@apple.com>
1543 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
1545 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
1546 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
1547 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
1549 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
1551 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
1552 * khtml/rendering/render_form.cpp:
1553 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
1554 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
1555 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
1557 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
1558 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
1559 Added a fixState helper method so the constructors can save code.
1561 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
1562 and added a third constructor that uses the "current event" from AppKit (used above).
1563 (QMouseEvent::fixState): Compute state and click count based on event type.
1565 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
1567 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
1568 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
1569 underlying cause in CSS.
1571 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
1573 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
1574 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
1576 2004-12-03 Chris Blumenberg <cblu@apple.com>
1579 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
1580 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
1581 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
1582 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
1584 Reviewed by darin, rjw, kocienda.
1586 * khtml/misc/loader.cpp:
1587 (CachedObject::~CachedObject):
1588 (CachedCSSStyleSheet::checkNotify):
1589 (Loader::servePendingRequests):
1590 (Loader::slotFinished):
1591 (Loader::slotReceivedResponse):
1592 (Cache::requestImage):
1593 (Cache::requestScript):
1594 * khtml/misc/loader.h:
1595 (khtml::CachedObject::CachedObject):
1596 (khtml::CachedObject::response):
1597 (khtml::CachedObject::allData):
1598 * kwq/KWQKJobClasses.h:
1599 * kwq/KWQKJobClasses.mm:
1600 (KIO::TransferJobPrivate::TransferJobPrivate):
1601 (KIO::TransferJobPrivate::~TransferJobPrivate):
1602 (KIO::TransferJob::TransferJob):
1603 (KIO::TransferJob::assembleResponseHeaders):
1604 (KIO::TransferJob::retrieveCharset):
1605 (KIO::TransferJob::emitResult):
1606 (KIO::TransferJob::emitReceivedResponse):
1609 (KWQHeaderStringFromDictionary):
1610 (KWQCheckCacheObjectStatus):
1611 (KWQIsResponseURLEqualToURL):
1613 (KWQResponseMIMEType):
1614 (KWQCacheObjectExpiresTime):
1615 (khtml::CachedObject::setResponse):
1616 (khtml::CachedObject::setAllData):
1620 * kwq/KWQResourceLoader.mm:
1621 (-[KWQResourceLoader finishJobAndHandle:]):
1622 (-[KWQResourceLoader cancel]):
1623 (-[KWQResourceLoader reportError]):
1624 (-[KWQResourceLoader finishWithData:]):
1632 * kwq/WebCoreBridge.h:
1633 * kwq/WebCoreResourceLoader.h:
1635 2004-12-04 Darin Adler <darin@apple.com>
1639 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
1641 * khtml/rendering/render_form.cpp:
1642 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
1643 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
1644 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
1645 (RenderSlider::slotSliderValueChanged): Ditto.
1647 2004-12-03 John Sullivan <sullivan@apple.com>
1651 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
1652 khtml::BackgroundLayer::cullEmptyLayers
1654 * khtml/rendering/render_style.cpp:
1655 (BackgroundLayer::cullEmptyLayers):
1656 added missing nil check
1660 2004-12-03 Ken Kocienda <kocienda@apple.com>
1664 Roll out some recent changes by Chris that caused a performance regression.
1665 Fix is in hand, but it is a little risky this close to a submission. So,
1666 we have decided to roll back the change with the regression and roll in
1667 the new code after we submit.
1669 * khtml/css/cssproperties.c:
1672 * khtml/css/cssvalues.c:
1675 * khtml/misc/htmlattrs.c:
1678 * khtml/misc/htmltags.c:
1681 * khtml/misc/loader.cpp:
1682 (CachedObject::~CachedObject):
1683 (CachedObject::setResponse):
1684 (CachedCSSStyleSheet::checkNotify):
1685 (Loader::servePendingRequests):
1686 (Loader::slotFinished):
1687 (Loader::slotReceivedResponse):
1688 (Cache::requestImage):
1689 (Cache::requestScript):
1690 * khtml/misc/loader.h:
1691 (khtml::CachedObject::CachedObject):
1692 (khtml::CachedObject::response):
1693 * kwq/KWQKJobClasses.h:
1694 * kwq/KWQKJobClasses.mm:
1695 (KIO::TransferJobPrivate::TransferJobPrivate):
1696 (KIO::TransferJobPrivate::~TransferJobPrivate):
1697 (KIO::TransferJob::TransferJob):
1698 (KIO::TransferJob::assembleResponseHeaders):
1699 (KIO::TransferJob::retrieveCharset):
1700 (KIO::TransferJob::emitResult):
1701 (KIO::TransferJob::emitReceivedResponse):
1704 (KWQHeaderStringFromDictionary):
1705 (KWQCheckCacheObjectStatus):
1706 (KWQRetainResponse):
1707 (KWQReleaseResponse):
1708 (KWQIsResponseURLEqualToURL):
1710 (KWQResponseMIMEType):
1711 (KWQResponseTextEncodingName):
1712 (KWQResponseHeaderString):
1713 (KWQCacheObjectExpiresTime):
1714 (KWQLoader::KWQLoader):
1718 * kwq/KWQResourceLoader.mm:
1719 (-[KWQResourceLoader finishJobAndHandle]):
1720 (-[KWQResourceLoader cancel]):
1721 (-[KWQResourceLoader reportError]):
1722 (-[KWQResourceLoader finish]):
1730 * kwq/WebCoreBridge.h:
1731 * kwq/WebCoreResourceLoader.h:
1733 2004-12-03 John Sullivan <sullivan@apple.com>
1737 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
1739 * kwq/KWQKHTMLPart.mm:
1740 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
1741 when checking whether we moved the focus to another view, make sure we didn't "move" it to
1742 our documentView, because that's no move at all.
1744 2004-12-03 Darin Adler <darin@apple.com>
1748 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
1750 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
1751 Added missing initialization for base class and node pointer.
1753 - fixed a few places that could leave dangling node pointers
1755 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
1756 Clear out the node pointer when the node is destroyed.
1757 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
1759 2004-12-03 Chris Blumenberg <cblu@apple.com>
1761 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.
1762 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
1766 * khtml/misc/loader.cpp:
1767 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
1768 (Loader::slotFinished): take data param
1769 * khtml/misc/loader.h:
1770 * kwq/KWQKJobClasses.h:
1771 * kwq/KWQKJobClasses.mm:
1772 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
1773 (KIO::TransferJob::emitResult): take data param and pass it
1774 * kwq/KWQResourceLoader.mm:
1775 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
1776 (-[KWQResourceLoader cancel]): pass nil for data
1777 (-[KWQResourceLoader reportError]): ditto
1778 (-[KWQResourceLoader finishWithData:]): pass data
1780 (KWQSlot::KWQSlot): pass data param to slotFinished
1781 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
1783 2004-12-03 Ken Kocienda <kocienda@apple.com>
1787 Did some clean up in the Position class as a result of trying to write some new layout
1788 tests and discovering a bug along the way.
1790 I removed these three functions from the Position class:
1792 1. bool isFirstRenderedPositionOnLine() const;
1793 2. bool isLastRenderedPositionOnLine() const;
1794 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
1795 4. bool inFirstEditableInRootEditableElement() const;
1797 The first two have replacements in the VisiblePosition class, and some code has been
1798 moved to use these new variants. The third function was a helper used only by these
1799 first two function, and can be removed as well. The fourth function was not used by anyone.
1801 * khtml/editing/htmlediting.cpp:
1802 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
1803 * khtml/editing/visible_position.cpp:
1804 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
1805 Incorrect results were being returned when asking about positions at the starts of blocks.
1806 * khtml/xml/dom_position.cpp:
1807 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
1808 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
1809 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
1810 * khtml/xml/dom_position.h: Update header for deletions.
1812 2004-12-03 Ken Kocienda <kocienda@apple.com>
1816 Terminology change in execCommand command identifiers. Specifically, the name of
1817 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
1818 terminology used by AppKit. It is also more accurate, since the insertion of a
1819 "br" element is what the command does. The inspiration for this change is so the
1820 -insertNewline AppKit method can be mapped to insert a new "div" element in
1821 a document and avoid ambiguity with what the javascript editing command does.
1823 * khtml/editing/jsediting.cpp
1824 * layout-tests/editing/deleting/delete-tab-004.html
1825 * layout-tests/editing/editing.js
1826 * layout-tests/editing/inserting/insert-3654864-fix.html
1827 * layout-tests/editing/inserting/insert-3659587-fix.html
1828 * layout-tests/editing/inserting/insert-3775316-fix.html
1829 * layout-tests/editing/inserting/insert-3800346-fix.html
1830 * layout-tests/editing/inserting/insert-br-001.html
1831 * layout-tests/editing/inserting/insert-br-002.html
1832 * layout-tests/editing/inserting/insert-br-003.html
1833 * layout-tests/editing/inserting/insert-br-004.html
1834 * layout-tests/editing/inserting/insert-br-005.html
1835 * layout-tests/editing/inserting/insert-br-006.html
1836 * layout-tests/editing/inserting/insert-br-007.html
1837 * layout-tests/editing/inserting/insert-br-008.html
1838 * layout-tests/editing/inserting/insert-tab-004.html
1839 * layout-tests/editing/inserting/insert-text-with-newlines.html
1840 * layout-tests/editing/pasteboard/paste-text-010.html
1842 2004-12-02 Ken Kocienda <kocienda@apple.com>
1848 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
1850 * khtml/editing/htmlediting.cpp:
1851 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
1852 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
1853 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
1854 in a block and the document is in quirks mode, add an additional br to make the one in the
1855 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
1856 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
1857 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
1859 2004-12-02 Richard Williamson <rjw@apple.com>
1861 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
1863 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
1864 the b/f cache won't incorrectly trash the previous state when restoring.
1868 * kwq/WebCoreBridge.h:
1869 * kwq/WebCoreBridge.mm:
1870 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
1871 (-[WebCoreBridge canCachePage]):
1872 (-[WebCoreBridge clear]):
1874 2004-12-02 Ken Kocienda <kocienda@apple.com>
1880 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
1882 * khtml/xml/dom2_rangeimpl.cpp:
1883 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
1884 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
1885 of this bug where there is content after the body tag). Did a little code clean up as well.
1886 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
1888 2004-12-02 Ken Kocienda <kocienda@apple.com>
1894 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
1896 * khtml/khtml_part.cpp:
1897 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
1898 to figure out which end of the selection to extend.
1900 2004-12-02 David Harrison <harrison@apple.com>
1902 Reviewed by Ken Kocienda.
1904 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
1905 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
1907 * khtml/editing/visible_text.cpp:
1908 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1909 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
1910 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
1911 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
1912 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
1913 Distinguish BR from whitespace.
1914 * khtml/editing/visible_text.h:
1915 Distinguish BR from whitespace.
1916 * khtml/editing/visible_units.cpp:
1917 (khtml::previousWordBoundary):
1918 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.
1920 2004-12-02 Ken Kocienda <kocienda@apple.com>
1926 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
1928 * khtml/xml/dom_position.cpp:
1929 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
1930 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
1931 exception trying to use a Position returned from this function to set the boundary point of a Range (which
1932 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
1933 contract to return a range-compliant position, hence the need for this fix.
1935 2004-12-01 Ken Kocienda <kocienda@apple.com>
1941 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
1942 regard to other editing commands. The class had a name change ages ago, and it was never
1944 * khtml/editing/htmlediting.h: Ditto.
1946 2004-12-01 Ken Kocienda <kocienda@apple.com>
1950 Some improvements for paste, including some new code to annotate
1951 whitespace when writing to the pasteboard to ensure that the meaning
1952 of the markup on the pasteboard is unambiguous.
1954 There is also new code for reading this annotated markup from the pasteboard,
1955 removing the nodes that were added only to prevent ambiguity.
1957 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
1958 The header should have been added earlier, but I did not do so.
1959 * khtml/editing/html_interchange.cpp: Added.
1960 (convertHTMLTextToInterchangeFormat):
1961 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
1962 * khtml/editing/htmlediting.cpp:
1963 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
1964 Also fixed a bug in the code that counts blocks in a fragment.
1965 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
1966 (khtml::ReplacementFragment::insertNodeBefore): New helper.
1967 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
1968 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
1969 * khtml/editing/htmlediting.h: Add some new declarations.
1970 * khtml/xml/dom2_rangeimpl.cpp:
1971 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
1972 * khtml/xml/dom_nodeimpl.cpp:
1973 (NodeImpl::stringValueForRange): New helper.
1974 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
1975 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
1976 should be added. Called by the paste code.
1977 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
1979 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
1980 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
1981 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
1983 2004-11-30 Chris Blumenberg <cblu@apple.com>
1985 * ChangeLog: removed conflict marker
1987 2004-11-30 Chris Blumenberg <cblu@apple.com>
1990 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
1991 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
1995 * khtml/misc/loader.cpp:
1996 (CachedObject::~CachedObject): release m_allData
1997 (CachedObject::setAllData): new
1998 (Loader::servePendingRequests): connect slotAllData
1999 (Loader::slotAllData): new
2000 (Cache::requestImage): tweak
2001 * khtml/misc/loader.h:
2002 (khtml::CachedObject::CachedObject): set allData to 0
2003 (khtml::CachedObject::allData): new
2004 * kwq/KWQKJobClasses.h:
2005 * kwq/KWQKJobClasses.mm:
2006 (KIO::TransferJob::TransferJob): set m_allData
2007 (KIO::TransferJob::emitAllData): new
2009 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
2010 * kwq/KWQResourceLoader.mm:
2011 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
2013 (KWQSlot::KWQSlot): support for slotAllData
2015 * kwq/WebCoreBridge.h:
2016 * kwq/WebCoreResourceLoader.h:
2018 2004-11-30 Maciej Stachowiak <mjs@apple.com>
2022 2004-11-30 Maciej Stachowiak <mjs@apple.com>
2026 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
2028 * khtml/khtml_part.cpp:
2029 (KHTMLPart::begin): call setParsing on document here after opening
2030 - from now on we'll only set parsing to true for a document open
2031 caused by page loading, not a programmatic one.
2032 * khtml/xml/dom_docimpl.cpp:
2033 (DocumentImpl::open): don't setParsing to true here any more.
2035 2004-11-30 Maciej Stachowiak <mjs@apple.com>
2039 - fix recent regression from collection perf fixes.
2041 * khtml/html/html_miscimpl.cpp:
2042 (HTMLFormCollectionImpl::updateNameCache): Look up the name
2043 attribute in the name cache, not the id cache (d'oh!)
2045 2004-11-30 Darin Adler <darin@apple.com>
2049 - rolled in a KDE fix for a problem that may underlie a number of crashes
2051 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
2052 the KDE guys to fix a subtle problem. Code said "n = n =".
2054 - rolled in a KDE fix for a containingBlock crash
2056 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
2057 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
2060 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
2063 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
2064 (-[KWQButton detachQButton]): Added.
2065 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
2066 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
2067 (-[KWQButton widget]): Added.
2068 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
2069 (-[KWQButton resignFirstResponder]): Ditto.
2070 (-[KWQButton canBecomeKeyView]): Ditto.
2071 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
2072 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
2074 * kwq/KWQComboBox.mm:
2075 (QComboBox::~QComboBox): Call detachQComboBox.
2076 (-[KWQPopUpButtonCell detachQComboBox]): Added.
2077 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
2078 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
2079 (-[KWQPopUpButton action:]): Ditto.
2080 (-[KWQPopUpButton widget]): Tweaked.
2081 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
2082 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
2083 (-[KWQPopUpButton resignFirstResponder]): Ditto.
2084 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
2086 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
2088 * kwq/KWQListBox.mm:
2089 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
2091 * kwq/KWQScrollBar.h: Removed m_scroller field.
2092 * kwq/KWQScrollBar.mm:
2093 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
2094 (-[KWQScrollBar detachQScrollBar]): Added.
2095 (-[KWQScrollBar widget]): Added.
2096 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
2097 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
2098 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
2099 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
2100 (QScrollBar::setKnobProportion): Ditto.
2101 (QScrollBar::scrollbarHit): Ditto.
2103 * kwq/KWQScrollView.mm:
2104 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
2105 hack where we don't remove right away when doing mouse tracking.
2106 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
2107 the hack where we don't add right away when doing mouse tracking.
2109 * kwq/KWQSlider.h: Added destructor.
2111 (-[KWQSlider initWithQSlider:]): Tweaked a little.
2112 (-[KWQSlider detachQSlider]): Added.
2113 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
2114 (-[KWQSlider widget]): Added.
2115 (QSlider::~QSlider): Added. Calls detachQSlider.
2117 * kwq/KWQTextArea.h: Added detachQTextEdit method.
2118 * kwq/KWQTextArea.mm:
2119 (-[KWQTextArea detachQTextEdit]): Added.
2120 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
2121 (-[KWQTextArea becomeFirstResponder]): Ditto.
2122 (-[KWQTextArea nextKeyView]): Ditto.
2123 (-[KWQTextArea previousKeyView]): Ditto.
2124 (-[KWQTextArea drawRect:]): Ditto.
2125 (-[KWQTextAreaTextView insertTab:]): Ditto.
2126 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
2127 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
2128 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
2129 (-[KWQTextAreaTextView mouseDown:]): Ditto.
2130 (-[KWQTextAreaTextView keyDown:]): Ditto.
2131 (-[KWQTextAreaTextView keyUp:]): Ditto.
2133 * kwq/KWQTextEdit.h: Added ~QTextEdit.
2134 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
2136 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
2137 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
2139 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
2140 Added beforeMouseDown and afterMouseDown for use in widget implementations.
2141 Removed unused hasMouseTracking function.
2143 (QWidget::QWidget): Initialize two new fields.
2144 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
2145 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
2146 (QWidget::addToSuperview): Added.
2147 (QWidget::removeFromSuperview): Added.
2148 (QWidget::beforeMouseDown): Added.
2149 (QWidget::afterMouseDown): Added.
2151 * khtml/rendering/render_layer.cpp:
2152 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
2153 (RenderLayer::setHasVerticalScrollbar): Ditto.
2155 2004-11-30 Ken Kocienda <kocienda@apple.com>
2161 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
2163 * khtml/khtml_part.cpp:
2164 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
2165 with no blink if it is.
2167 2004-11-30 Ken Kocienda <kocienda@apple.com>
2173 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
2175 * khtml/khtml_part.cpp:
2176 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
2177 or <input type=image> was checked for focus since these elements are keyboard-focusable,
2178 but not mouse focusable. Also, this function did not work hard enough to set the focused
2179 node, and was content to clear it if the first element checked failed the test, rather
2180 than looking more at parents. This would have the effect of clearing, then resetting the
2181 focus on a DIV containing a button or image with content on either side of it in the
2182 process of arrowing over such content.
2184 2004-11-30 Ken Kocienda <kocienda@apple.com>
2188 * khtml/editing/htmlediting.cpp:
2189 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
2190 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
2191 * khtml/khtml_part.cpp:
2192 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
2193 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
2194 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
2195 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
2196 isCharacterSmartReplaceExempt virtual.
2198 2004-11-30 Ken Kocienda <kocienda@apple.com>
2202 * khtml/editing/htmlediting.cpp:
2203 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
2204 Seemed simple enough to land without review.
2206 2004-11-29 Ken Kocienda <kocienda@apple.com>
2210 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
2211 are handled correctly now, including selections that span multiple blocks, and cases
2212 where content on the pasteboard ends in newlines (or what appear to be newlines to a
2213 user, really block ends or BRs). I also made one small, but important change in the
2214 copy code to annotate the markup written to the pasteboard to support these selections
2217 New header that defines a couple of constants used in copying and pasting.
2219 * ForwardingHeaders/editing/html_interchange.h: Added.
2220 * khtml/editing/html_interchange.h: Added.
2222 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
2223 as a new helper class, ReplacementFragment, which encapsulates information and functions
2224 pertaining to a document fragment that is being inserted into a document.
2226 * khtml/editing/htmlediting.cpp:
2227 (khtml::ReplacementFragment::ReplacementFragment):
2228 (khtml::ReplacementFragment::~ReplacementFragment):
2229 (khtml::ReplacementFragment::firstChild): Simple accessor.
2230 (khtml::ReplacementFragment::lastChild): Ditto.
2231 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
2232 the starting node to use for merging into the block containing the start of the selection.
2233 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
2234 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
2235 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
2236 special annotation comment added in by the copy code.
2237 (khtml::ReplacementFragment::removeNode): Simple helper.
2238 (khtml::isComment): Simple helper.
2239 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
2240 I would like to do better than this some day, but this check will hold us until I can do better.
2241 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
2242 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
2243 (khtml::ReplaceSelectionCommand::doApply):
2244 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
2245 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
2246 (khtml::ReplacementFragment::root):
2247 (khtml::ReplacementFragment::type):
2248 (khtml::ReplacementFragment::isEmpty):
2249 (khtml::ReplacementFragment::isSingleTextNode):
2250 (khtml::ReplacementFragment::isTreeFragment):
2251 (khtml::ReplacementFragment::hasMoreThanOneBlock):
2252 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
2254 This smaller set of changes markup generation to add the newline annotation described in the
2255 comment at the start of this entry.
2257 * khtml/xml/dom2_rangeimpl.cpp:
2258 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
2259 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
2260 comment annotations are added to the markup generated.
2261 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
2262 * kwq/WebCoreBridge.mm:
2263 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
2264 DOM::RangeImpl::toHTML uses annotations when generating.
2268 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
2269 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
2270 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
2271 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
2272 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
2273 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
2274 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
2275 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
2276 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
2277 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
2278 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
2279 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
2280 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
2281 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
2282 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
2283 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
2284 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
2285 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
2287 2004-11-29 Ken Kocienda <kocienda@apple.com>
2289 Reviewed by Harrison
2291 Made two small changes that make it possible for comments to have DOM nodes made for them
2292 when pasting. This relies on some earlier work I did some days ago.
2294 * khtml/xml/dom_nodeimpl.cpp:
2295 (NodeImpl::startMarkup): Get the string from the comment.
2296 * kwq/WebCoreBridge.mm:
2297 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
2298 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
2299 be included in the DOM.
2301 2004-11-29 Ken Kocienda <kocienda@apple.com>
2303 Reviewed by Harrison
2305 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
2306 my improved paste code.
2308 * khtml/editing/visible_position.cpp:
2309 (khtml::blockRelationship)
2310 (khtml::visiblePositionsInDifferentBlocks)
2311 (khtml::isFirstVisiblePositionInBlock)
2312 (khtml::isFirstVisiblePositionInNode)
2313 (khtml::isLastVisiblePositionInBlock)
2314 * khtml/editing/visible_position.h
2316 2004-11-29 Ken Kocienda <kocienda@apple.com>
2318 Reviewed by Harrison
2320 * khtml/xml/dom_position.cpp:
2321 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
2322 specified from obeying that directive. The old code would stop at an outer block boundary in
2323 the case where that block had a block as its first child. The correct behavior is to drill into
2324 that inner block (and continue on drilling down, if possible), to find the correct position.
2326 2004-11-29 Ken Kocienda <kocienda@apple.com>
2328 Reviewed by Harrison
2330 Small improvements to the node-display debugging helpers.
2332 * khtml/xml/dom_nodeimpl.cpp:
2333 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
2334 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
2336 2004-11-29 Ken Kocienda <kocienda@apple.com>
2338 Reviewed by Harrison
2340 * khtml/editing/htmlediting.cpp:
2341 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
2342 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
2343 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
2344 place after the delete.
2346 2004-11-29 Ken Kocienda <kocienda@apple.com>
2348 Reviewed by Harrison
2350 Add a new helper function to insert a paragraph separator. Will be used in my
2351 upcoming paste improvments.
2353 * khtml/editing/htmlediting.cpp: Added function
2354 (khtml::CompositeEditCommand::insertParagraphSeparator)
2355 * khtml/editing/htmlediting.h: Ditto.
2357 2004-11-23 David Harrison <harrison@apple.com>
2359 Added various comments.
2361 * khtml/editing/htmlediting.cpp:
2362 (khtml::StyleChange::init):
2363 (khtml::ApplyStyleCommand::doApply):
2364 (khtml::ApplyStyleCommand::applyBlockStyle):
2365 (khtml::ApplyStyleCommand::applyInlineStyle):
2367 2004-11-23 David Hyatt <hyatt@apple.com>
2369 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
2370 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
2372 * khtml/rendering/render_block.cpp:
2373 (khtml::RenderBlock::nodeAtPoint):
2375 2004-11-22 David Hyatt <hyatt@apple.com>
2377 Make sure you can use document.createElement to make a <canvas> element.
2379 * khtml/xml/dom_docimpl.cpp:
2380 (DocumentImpl::createHTMLElement):
2382 2004-11-22 Maciej Stachowiak <mjs@apple.com>
2386 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
2387 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
2388 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
2389 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
2391 * khtml/ecma/kjs_html.cpp:
2392 (KJS::HTMLDocument::tryGet):
2393 * khtml/html/html_formimpl.cpp:
2394 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
2395 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2396 * khtml/html/html_formimpl.h:
2397 * khtml/html/html_miscimpl.cpp:
2398 (HTMLCollectionImpl::HTMLCollectionImpl):
2399 (HTMLCollectionImpl::~HTMLCollectionImpl):
2400 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
2401 (HTMLCollectionImpl::CollectionInfo::reset):
2402 (HTMLCollectionImpl::resetCollectionInfo):
2403 (HTMLCollectionImpl::checkForNameMatch):
2405 (HTMLCollectionImpl::updateNameCache):
2406 (HTMLCollectionImpl::namedItems):
2407 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
2408 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
2409 (HTMLFormCollectionImpl::item):
2410 (HTMLFormCollectionImpl::updateNameCache):
2411 * khtml/html/html_miscimpl.h:
2413 2004-11-22 David Hyatt <hyatt@apple.com>
2415 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
2420 * khtml/misc/loader.cpp:
2421 (CachedObject::finish):
2424 * khtml/misc/loader.h:
2425 (khtml::Cache::maxCacheableObjectSize):
2427 2004-11-22 David Hyatt <hyatt@apple.com>
2429 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
2430 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
2431 that lets us short circuit earlier when painting and hit testing.
2435 * khtml/khtml_part.cpp:
2436 (KHTMLPart::isPointInsideSelection):
2437 * khtml/rendering/render_block.cpp:
2438 (khtml::RenderBlock::paint):
2439 (khtml::RenderBlock::paintChildren):
2440 (khtml::RenderBlock::paintObject):
2441 (khtml::RenderBlock::paintFloats):
2442 (khtml::RenderBlock::nodeAtPoint):
2443 * khtml/rendering/render_block.h:
2444 * khtml/rendering/render_box.cpp:
2445 (RenderBox::nodeAtPoint):
2446 * khtml/rendering/render_box.h:
2447 * khtml/rendering/render_br.h:
2448 * khtml/rendering/render_canvas.cpp:
2449 (RenderCanvas::paint):
2450 * khtml/rendering/render_flow.cpp:
2451 (RenderFlow::paintLines):
2452 (RenderFlow::hitTestLines):
2453 (RenderFlow::caretRect):
2454 (RenderFlow::addFocusRingRects):
2455 (RenderFlow::paintFocusRing):
2456 (RenderFlow::paintOutlines):
2457 (RenderFlow::paintOutlineForLine):
2458 * khtml/rendering/render_flow.h:
2459 * khtml/rendering/render_frames.cpp:
2460 (RenderFrameSet::nodeAtPoint):
2461 * khtml/rendering/render_frames.h:
2462 * khtml/rendering/render_image.cpp:
2463 (RenderImage::nodeAtPoint):
2464 * khtml/rendering/render_image.h:
2465 * khtml/rendering/render_inline.cpp:
2466 (RenderInline::paint):
2467 (RenderInline::nodeAtPoint):
2468 * khtml/rendering/render_inline.h:
2469 * khtml/rendering/render_layer.cpp:
2470 (RenderLayer::paintLayer):
2471 (RenderLayer::hitTest):
2472 (RenderLayer::hitTestLayer):
2473 * khtml/rendering/render_layer.h:
2474 * khtml/rendering/render_line.cpp:
2475 (khtml::InlineBox::paint):
2476 (khtml::InlineBox::nodeAtPoint):
2477 (khtml::InlineFlowBox::flowObject):
2478 (khtml::InlineFlowBox::nodeAtPoint):
2479 (khtml::InlineFlowBox::paint):
2480 (khtml::InlineFlowBox::paintBackgrounds):
2481 (khtml::InlineFlowBox::paintBackground):
2482 (khtml::InlineFlowBox::paintBackgroundAndBorder):
2483 (khtml::InlineFlowBox::paintDecorations):
2484 (khtml::EllipsisBox::paint):
2485 (khtml::EllipsisBox::nodeAtPoint):
2486 (khtml::RootInlineBox::paintEllipsisBox):
2487 (khtml::RootInlineBox::paint):
2488 (khtml::RootInlineBox::nodeAtPoint):
2489 * khtml/rendering/render_line.h:
2490 (khtml::InlineRunBox::paintBackgroundAndBorder):
2491 * khtml/rendering/render_object.cpp:
2492 (RenderObject::hitTest):
2493 (RenderObject::setInnerNode):
2494 (RenderObject::nodeAtPoint):
2495 * khtml/rendering/render_object.h:
2496 (khtml::RenderObject::PaintInfo::PaintInfo):
2497 (khtml::RenderObject::PaintInfo::~PaintInfo):
2498 (khtml::RenderObject::paintingRootForChildren):
2499 (khtml::RenderObject::shouldPaintWithinRoot):
2500 * khtml/rendering/render_table.cpp:
2501 (RenderTable::layout):
2502 (RenderTable::paint):
2503 * khtml/rendering/render_text.cpp:
2504 (simpleDifferenceBetweenColors):
2505 (correctedTextColor):
2506 (InlineTextBox::nodeAtPoint):
2507 (InlineTextBox::paint):
2508 (InlineTextBox::selectionStartEnd):
2509 (InlineTextBox::paintSelection):
2510 (InlineTextBox::paintMarkedTextBackground):
2511 (InlineTextBox::paintDecoration):
2512 (RenderText::posOfChar):
2513 * khtml/rendering/render_text.h:
2514 (khtml::RenderText::paint):
2515 (khtml::RenderText::layout):
2516 (khtml::RenderText::nodeAtPoint):
2517 * khtml/xml/dom2_eventsimpl.cpp:
2518 (MouseEventImpl::computeLayerPos):
2519 * khtml/xml/dom_docimpl.cpp:
2520 (DocumentImpl::prepareMouseEvent):
2521 * kwq/KWQAccObject.mm:
2522 (-[KWQAccObject accessibilityHitTest:]):
2523 * kwq/KWQKHTMLPart.mm:
2524 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
2525 (KWQKHTMLPart::eventMayStartDrag):
2526 (KWQKHTMLPart::khtmlMouseMoveEvent):
2527 * kwq/WebCoreBridge.mm:
2528 (-[WebCoreBridge elementAtPoint:]):
2529 (-[WebCoreBridge _positionForPoint:]):
2531 2004-11-22 Maciej Stachowiak <mjs@apple.com>
2535 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
2536 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
2538 This avoids the O(N^2) penalty for named item traversal for form collections.
2540 It also combines the item traversal logic for all non-form
2541 collection operations into a single traverseNextItem
2542 function. This avoids having 5 copies of the big switch statement
2545 Also fixed a bug that prevented the last form element from being removed properly.
2547 * khtml/html/html_formimpl.cpp:
2548 (DOM::removeFromVector):
2549 * khtml/dom/html_misc.cpp:
2550 (HTMLCollection::namedItems):
2551 * khtml/dom/html_misc.h:
2552 * khtml/ecma/kjs_html.cpp:
2553 (KJS::HTMLCollection::getNamedItems):
2554 * khtml/html/html_miscimpl.cpp:
2555 (HTMLCollectionImpl::traverseNextItem):
2556 (HTMLCollectionImpl::calcLength):
2557 (HTMLCollectionImpl::length):
2558 (HTMLCollectionImpl::item):
2559 (HTMLCollectionImpl::nextItem):
2560 (HTMLCollectionImpl::checkForNameMatch):
2561 (HTMLCollectionImpl::namedItem):
2562 (HTMLCollectionImpl::namedItems):
2563 (HTMLCollectionImpl::nextNamedItem):
2564 (HTMLFormCollectionImpl::calcLength):
2565 (HTMLFormCollectionImpl::namedItem):
2566 (HTMLFormCollectionImpl::nextNamedItem):
2567 (HTMLFormCollectionImpl::namedItems):
2568 * khtml/html/html_miscimpl.h:
2570 2004-11-22 Ken Kocienda <kocienda@apple.com>
2572 Reviewed by Harrison
2574 Change around the way we block the Javascript "Paste" command identifier from
2575 being available. Formerly, this was done with an ifdef we never compiled in.
2576 Now, this is done with a couple of cheap runtime checks. The advantage is that
2577 we can now compile this command into development builds, and still yet switch
2578 on the command in deployment builds through the use of WebCore SPI so we can
2579 write and run layout tests with all of our builds.
2581 * khtml/editing/jsediting.cpp:
2582 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
2583 command being queried is the paste command.
2584 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
2585 * khtml/editing/jsediting.h: Ditto.
2586 * khtml/khtml_part.cpp:
2587 (KHTMLPart::pasteFromPasteboard): Added.
2588 (KHTMLPart::canPaste): Added.
2589 * kwq/KWQKHTMLPart.mm:
2590 (KHTMLPart::canPaste): Added.
2591 * kwq/KWQRenderTreeDebug.cpp:
2592 (externalRepresentation): Turn on paste command.
2593 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
2595 2004-11-21 Maciej Stachowiak <mjs@apple.com>
2597 Reviewed by Richard.
2599 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
2601 * khtml/html/html_miscimpl.cpp:
2602 (HTMLCollectionImpl::calcLength):
2603 (HTMLCollectionImpl::getItem):
2604 (HTMLCollectionImpl::item):
2605 (HTMLCollectionImpl::nextItem):
2606 (HTMLCollectionImpl::getNamedItem):
2607 (HTMLCollectionImpl::namedItem):
2608 (HTMLCollectionImpl::nextNamedItemInternal):
2609 (HTMLFormCollectionImpl::nextNamedItemInternal):
2611 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2615 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
2616 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
2617 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
2619 Many optimizations to HTMLFormCollection. Iterating it should not
2620 be N^2 any more, though finding items by name could still be.
2622 * khtml/html/html_formimpl.cpp:
2623 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2624 (DOM::HTMLFormElementImpl::length):
2625 (DOM::HTMLFormElementImpl::submitClick):
2626 (DOM::HTMLFormElementImpl::formData):
2627 (DOM::HTMLFormElementImpl::submit):
2628 (DOM::HTMLFormElementImpl::reset):
2629 (DOM::HTMLFormElementImpl::radioClicked):
2630 (DOM::appendToVector):
2631 (DOM::removeFromVector):
2632 (DOM::HTMLFormElementImpl::registerFormElement):
2633 (DOM::HTMLFormElementImpl::removeFormElement):
2634 (DOM::HTMLFormElementImpl::makeFormElementDormant):
2635 (DOM::HTMLFormElementImpl::registerImgElement):
2636 (DOM::HTMLFormElementImpl::removeImgElement):
2637 * khtml/html/html_formimpl.h:
2638 * khtml/html/html_miscimpl.cpp:
2639 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
2640 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
2641 (HTMLFormCollectionImpl::resetCollectionInfo):
2642 (HTMLFormCollectionImpl::calcLength):
2643 (HTMLFormCollectionImpl::item):
2644 (HTMLFormCollectionImpl::getNamedItem):
2645 (HTMLFormCollectionImpl::getNamedFormItem):
2646 (HTMLFormCollectionImpl::firstItem):
2647 (HTMLFormCollectionImpl::nextItem):
2648 * khtml/html/html_miscimpl.h:
2649 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
2650 * khtml/xml/dom_elementimpl.cpp:
2651 (ElementImpl::setAttribute):
2652 (ElementImpl::setAttributeMap):
2653 * kwq/KWQPtrVector.h:
2654 (QPtrVector::findRef):
2655 * kwq/KWQVectorImpl.h:
2656 * kwq/KWQVectorImpl.mm:
2657 (KWQVectorImpl::findRef):
2658 * kwq/WebCoreBridge.mm:
2659 (-[WebCoreBridge elementWithName:inForm:]):
2660 (-[WebCoreBridge controlsInForm:]):
2662 2004-11-19 David Harrison <harrison@apple.com>
2664 Reviewed by Ken and Darin.
2666 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
2668 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
2669 for the existing style, but in this case (hitting cmd-B with caret at top of
2670 file) there is nothing upstream. Changed this to use the VisiblePosition
2671 deepEquivalent instead.
2673 * khtml/khtml_part.cpp:
2674 (KHTMLPart::computeAndSetTypingStyle):
2678 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2682 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
2684 * khtml/xml/dom_docimpl.cpp:
2685 (DocumentImpl::close): Don't fire the onload handler if there is a
2686 redirect pending. This is a very long-standing bug that was masked
2687 by our previously incorrect redirect logic. It used to be that an
2688 older redirect would always win. Recently we changed things so
2689 that a newer redirect would win, but a script that causes a
2690 redirect would stop parsing once complete (so if there are two
2691 redirects in the same script, the latter wins). However, we should
2692 have also prevented onload in this case. Testing with other
2693 browsers shows that onload handlers do not run at all when there
2694 is a pending redirect.
2696 2004-11-19 Ken Kocienda <kocienda@apple.com>
2698 Reviewed by Harrison
2700 Fix some object lifetime issues in these two commands. This fixes some crashes
2701 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
2703 * khtml/editing/htmlediting.cpp:
2704 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
2705 in the ancestor list. They are not ref'ed when put on list. D'uh.
2706 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
2707 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
2708 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
2710 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
2712 2004-11-19 Ken Kocienda <kocienda@apple.com>
2714 Reviewed by Harrison
2718 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
2720 * khtml/khtml_part.cpp:
2721 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
2722 declaration given the current selection, and then sets the minimum necessary style as the typing
2724 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
2725 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
2727 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
2728 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
2729 * kwq/WebCoreBridge.mm:
2730 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
2731 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
2733 2004-11-18 David Harrison <harrison@apple.com>
2737 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
2738 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
2741 (-[DOMCSSStyleDeclaration setProperty:::]):
2743 2004-11-18 Chris Blumenberg <cblu@apple.com>
2745 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
2749 * kwq/KWQKHTMLPart.mm:
2750 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
2752 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2756 - fix recursive item traversal, use traverseNextNode() instead of
2757 the buggy hand-rolled traversal.
2759 * khtml/xml/dom_nodeimpl.cpp:
2760 (NodeListImpl::recursiveItem):
2762 2004-11-17 Darin Adler <darin@apple.com>
2766 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
2768 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
2769 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
2771 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
2772 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
2773 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
2774 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
2775 an entire category of leaks we have been fixing one by one recently
2776 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
2777 stale RenderObject pointer, although I never saw it do that in practice
2778 - implemented the length and item methods for computed styles
2779 - implemented querying additional properties in computed styles (29 more)
2781 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
2782 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
2783 take a mutable style.
2784 * khtml/khtml_part.cpp:
2785 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
2786 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
2787 a computed style; also change some types to mutable style.
2788 (updateState): Update iteration of CSSProperty objects in a style declaration to use
2789 the new valuesIterator interface.
2790 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
2791 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
2792 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
2793 including accomodating the exception code that setCssText has now.
2794 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
2795 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
2796 the style attributes really was a change, although it's not an important optimization it's
2797 good to do it right.
2799 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
2800 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
2801 calling it were already removing the old property explicitly, so the code in here to remove
2802 the property again was redundant.
2804 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
2805 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
2806 * khtml/css/css_computedstyle.cpp:
2807 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
2808 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
2809 Before we had no guarantee the object would outlast us.
2810 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
2811 exception to NO_MODIFICATION_ALLOWED_ERR.
2812 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
2813 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
2814 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
2815 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
2816 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
2817 page-break-inside, position, unicode-bidi, widows, z-index.
2818 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
2819 exception to NO_MODIFICATION_ALLOWED_ERR.
2820 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
2821 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
2822 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
2823 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
2824 CSSMutableStyleDeclarationImpl.
2825 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
2826 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
2828 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
2829 now a separate class rather than a typedef.
2830 * khtml/css/cssparser.h: Ditto.
2832 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
2833 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
2834 Removed a bunch of redundant stuff from other classes in this file too.
2835 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
2836 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
2837 (DOM::CSSProperty::operator=): Added.
2838 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
2840 * khtml/css/css_valueimpl.cpp:
2841 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
2842 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
2843 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
2844 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
2845 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
2846 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
2847 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
2848 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
2849 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
2850 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
2851 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
2852 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
2853 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
2854 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
2855 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
2856 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
2857 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
2858 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
2859 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
2860 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
2861 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
2862 no styles in the list. Update to use QValueList.
2863 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
2864 parameter and set it.
2865 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
2866 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
2867 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
2868 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
2869 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
2870 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
2872 * khtml/css/cssparser.cpp:
2873 (CSSParser::parseValue): Changed to use addParsedProperties.
2874 (CSSParser::parseDeclaration): Ditto.
2875 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
2877 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
2878 * khtml/css/cssproperties.c: Regenerated.
2879 * khtml/css/cssproperties.h: Regenerated.
2881 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
2882 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
2884 * khtml/dom/css_value.cpp:
2885 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
2886 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
2887 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
2888 first doing getPropertyCSSValue and then doing cssText.
2889 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
2890 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
2891 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
2892 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
2893 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
2894 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
2895 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
2897 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
2898 * khtml/dom/dom_node.cpp: Ditto.
2900 * khtml/editing/htmlediting.h: Change some types to mutable style.
2901 * khtml/editing/htmlediting.cpp:
2902 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
2903 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
2904 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
2905 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
2906 (khtml::EditCommand::setTypingStyle): Ditto.
2907 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
2908 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
2909 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
2910 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
2911 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
2912 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
2913 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
2914 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2915 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
2916 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
2917 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
2918 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
2919 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
2921 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
2922 * khtml/html/html_baseimpl.h: Change type to mutable style.
2923 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
2925 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
2926 class as a base class, and change types to mutable style as needed.
2927 * khtml/html/html_elementimpl.cpp:
2928 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
2929 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
2930 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
2931 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
2932 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
2933 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
2935 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
2938 * khtml/html/html_tableimpl.h: Change types to mutable style.
2939 * khtml/html/html_tableimpl.cpp:
2940 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2941 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
2942 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2944 * khtml/html/htmlparser.cpp:
2945 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
2946 than using an explicit delete to make the node go away, and is required for compatibility with the
2947 changes to the NodeImpl functions.
2948 (KHTMLParser::insertNode): Ditto.
2949 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
2950 the NodeImpl functions.
2952 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
2953 now that there's no need to make the property list explictly.
2956 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
2957 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
2958 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
2960 * khtml/xml/dom_nodeimpl.cpp:
2961 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
2962 function succeeded or not for ownership purposes.
2963 (NodeImpl::replaceChild): Ditto.
2964 (NodeImpl::appendChild): Ditto.
2965 (NodeBaseImpl::insertBefore): Ditto.
2966 (NodeBaseImpl::replaceChild): Ditto.
2967 (NodeBaseImpl::appendChild): Ditto.
2968 (NodeBaseImpl::addChild): Ditto.
2970 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
2971 * WebCore-combined.exp: Regenerated.
2973 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2975 still even more build fixing
2977 * khtml/html/html_miscimpl.cpp:
2978 (HTMLCollectionImpl::resetCollectionInfo):
2980 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2984 * khtml/html/html_miscimpl.cpp:
2985 (HTMLCollectionImpl::resetCollectionInfo):
2987 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2989 Fixed build problem.
2991 * khtml/html/html_miscimpl.h:
2992 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
2994 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2998 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
3000 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
3001 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
3003 This is also a start on fixing 5 other bugs, but those need additional work to make
3004 HTMLFormCollection fast.
3006 * khtml/html/html_documentimpl.h:
3007 (DOM::HTMLDocumentImpl::collectionInfo):
3008 * khtml/html/html_formimpl.cpp:
3009 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
3010 (DOM::HTMLFormElementImpl::isURLAttribute):
3011 (DOM::HTMLFormElementImpl::registerImgElement):
3012 (DOM::HTMLFormElementImpl::removeImgElement):
3013 * khtml/html/html_formimpl.h:
3014 * khtml/html/html_imageimpl.cpp:
3015 (HTMLImageElementImpl::HTMLImageElementImpl):
3016 (HTMLImageElementImpl::~HTMLImageElementImpl):
3017 * khtml/html/html_imageimpl.h:
3018 * khtml/html/html_miscimpl.cpp:
3019 (HTMLCollectionImpl::HTMLCollectionImpl):
3020 (HTMLCollectionImpl::~HTMLCollectionImpl):
3021 (HTMLCollectionImpl::updateCollectionInfo):
3022 (HTMLCollectionImpl::length):
3023 (HTMLCollectionImpl::item):
3024 (HTMLCollectionImpl::firstItem):
3025 (HTMLCollectionImpl::nextItem):
3026 (HTMLCollectionImpl::namedItem):
3027 (HTMLCollectionImpl::nextNamedItemInternal):
3028 (HTMLFormCollectionImpl::getNamedFormItem):
3029 * khtml/html/html_miscimpl.h:
3030 (DOM::HTMLCollectionImpl::):
3031 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
3032 * khtml/html/htmlparser.cpp:
3033 (KHTMLParser::getElement):
3034 * khtml/xml/dom_docimpl.cpp:
3035 (DocumentImpl::DocumentImpl):
3036 * khtml/xml/dom_docimpl.h:
3037 (DOM::DocumentImpl::incDOMTreeVersion):
3038 (DOM::DocumentImpl::domTreeVersion):
3039 * khtml/xml/dom_nodeimpl.cpp:
3043 2004-11-18 Kevin Decker <kdecker@apple.com>
3047 fixed: <rdar://problem/3841842> getPropertyID expensive
3050 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
3052 2004-11-17 David Hyatt <hyatt@apple.com>
3054 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
3055 and subsequently backed out).
3057 Reviewed by kocienda
3059 * khtml/html/html_baseimpl.cpp:
3060 (HTMLBodyElementImpl::insertedIntoDocument):
3061 * khtml/html/htmltokenizer.cpp:
3062 (khtml::HTMLTokenizer::reset):
3063 (khtml::HTMLTokenizer::scriptHandler):
3064 (khtml::HTMLTokenizer::scriptExecution):
3065 (khtml::HTMLTokenizer::write):
3066 (khtml::HTMLTokenizer::continueProcessing):
3067 (khtml::HTMLTokenizer::timerEvent):
3068 (khtml::HTMLTokenizer::notifyFinished):
3069 * khtml/html/htmltokenizer.h:
3070 * khtml/khtmlview.cpp:
3071 (KHTMLViewPrivate::KHTMLViewPrivate):
3072 (KHTMLViewPrivate::reset):
3074 (KHTMLView::layout):
3075 (KHTMLView::timerEvent):
3076 (KHTMLView::scheduleRelayout):
3077 (KHTMLView::layoutPending):
3078 (KHTMLView::haveDelayedLayoutScheduled):
3079 (KHTMLView::unscheduleRelayout):
3080 * khtml/khtmlview.h:
3081 * khtml/xml/dom_docimpl.cpp:
3082 (DocumentImpl::DocumentImpl):
3083 (DocumentImpl::close):
3084 (DocumentImpl::setParsing):
3085 (DocumentImpl::shouldScheduleLayout):
3086 (DocumentImpl::minimumLayoutDelay):
3087 (DocumentImpl::write):
3088 (DocumentImpl::finishParsing):
3089 (DocumentImpl::stylesheetLoaded):
3090 (DocumentImpl::updateStyleSelector):
3091 * khtml/xml/dom_docimpl.h:
3092 (DOM::DocumentImpl::parsing):
3093 * kwq/KWQDateTime.mm:
3094 (KWQUIEventTime::uiEventPending):
3096 2004-11-17 David Harrison <harrison@apple.com>
3098 Reviewed by Ken Kocienda.
3100 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
3101 Treat null case as meaning no post-move merge is needed.
3103 * khtml/editing/htmlediting.cpp:
3104 (khtml::DeleteSelectionCommand::initializePositionData):
3106 2004-11-17 David Harrison <harrison@apple.com>
3108 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
3109 * khtml/xml/dom_nodeimpl.cpp:
3110 (NodeImpl::displayNode):
3111 (NodeImpl::displayTree):
3112 (NodeBaseImpl::dispatchChildRemovalEvents):
3113 * khtml/xml/dom_nodeimpl.h:
3115 2004-11-16 John Sullivan <sullivan@apple.com>
3117 Reviewed by Richard.
3119 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
3121 * khtml/khtml_part.cpp:
3123 delete the list we created when we're done with it
3125 2004-11-16 Ken Kocienda <kocienda@apple.com>
3129 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
3130 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
3131 QPtrList when the list goes out of scope.
3133 * khtml/editing/htmlediting.cpp:
3134 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
3135 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
3136 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
3137 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
3138 No longer set lists to autodelete.
3139 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
3140 Call new derefNodesInList helper.
3141 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
3142 of one before, but now it does.
3144 2004-11-15 David Harrison <harrison@apple.com>
3146 Reviewed by Chris and Darin.
3148 <rdar://problem/3880304> Non-linear performance hit for style changes
3150 * khtml/xml/dom_nodeimpl.cpp:
3151 (NodeImpl::traverseNextNode):
3152 (NodeImpl::traverseNextSibling):
3153 (NodeImpl::traversePreviousNodePostOrder):
3154 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
3155 Add asserts that stayWithin is an ancestor of the returned node.
3157 2004-11-15 Darin Adler <darin@apple.com>
3161 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
3163 * khtml/css/css_computedstyle.cpp:
3164 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
3165 since there's no guarantee it's already ref'd.
3166 * khtml/css/css_valueimpl.cpp:
3167 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
3168 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
3169 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
3170 (CSSStyleDeclarationImpl::merge): Ditto.
3171 (CSSStyleDeclarationImpl::diff): Ditto.
3172 * khtml/editing/htmlediting.cpp:
3173 (khtml::StyleChange::currentlyHasStyle): Ditto.
3174 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
3175 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
3176 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
3178 2004-11-15 Darin Adler <darin@apple.com>
3182 Use separate mutable style and computed style types as appropriate.
3183 For now this should have no effect, but it prepares us for refactoring later.
3184 Also remove some unnecessary "DOM::" prefixes and in one case factor out
3187 * khtml/khtml_part.cpp:
3188 (KHTMLPart::typingStyle):
3189 (KHTMLPart::setTypingStyle):
3191 (KHTMLPart::selectionHasStyle):
3192 (KHTMLPart::selectionStartHasStyle):
3193 (KHTMLPart::selectionComputedStyle):
3194 * khtml/khtml_part.h:
3195 * khtml/khtmlpart_p.h:
3197 * khtml/css/css_base.h:
3198 * khtml/css/css_ruleimpl.cpp:
3199 (CSSStyleRuleImpl::setDeclaration):
3200 * khtml/css/css_ruleimpl.h:
3201 (DOM::CSSFontFaceRuleImpl::style):
3202 (DOM::CSSPageRuleImpl::style):
3203 (DOM::CSSStyleRuleImpl::style):
3204 (DOM::CSSStyleRuleImpl::declaration):
3205 * khtml/css/css_valueimpl.h:
3206 (DOM::CSSPrimitiveValueImpl::):
3207 * khtml/css/cssparser.cpp:
3208 (CSSParser::parseValue):
3209 (CSSParser::parseColor):
3210 (CSSParser::parseDeclaration):
3211 (CSSParser::createStyleDeclaration):
3212 * khtml/css/cssparser.h:
3213 * khtml/css/cssstyleselector.cpp:
3214 (khtml::CSSStyleSelector::addMatchedDeclaration):
3215 (khtml::CSSStyleSelector::matchRulesForList):
3216 (khtml::CSSStyleSelector::styleForElement):
3217 (khtml::CSSStyleSelector::applyDeclarations):
3218 * khtml/css/cssstyleselector.h:
3219 * khtml/css/parser.cpp:
3220 * khtml/css/parser.y:
3221 * khtml/dom/css_rule.h:
3222 * khtml/dom/css_stylesheet.h:
3223 * khtml/dom/css_value.h:
3224 * khtml/dom/dom2_views.cpp:
3225 * khtml/xml/dom2_viewsimpl.cpp:
3226 (DOM::AbstractViewImpl::getComputedStyle):
3227 * khtml/xml/dom_docimpl.cpp:
3228 (DocumentImpl::importNode):
3229 (DocumentImpl::setStyleSheet):
3230 * khtml/xml/dom_docimpl.h:
3231 * khtml/xml/dom_xmlimpl.cpp:
3232 (DOM::ProcessingInstructionImpl::setStyleSheet):
3233 * khtml/xml/dom_xmlimpl.h:
3235 * khtml/dom/css_value.cpp:
3236 (DOM::throwException): Added.
3237 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
3238 The real thing is coming with the next change to refactor.
3239 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
3240 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
3242 2004-11-15 Darin Adler <darin@apple.com>
3246 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
3248 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
3249 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
3250 node's attributes changed without sending a misleading childrenChanged call,
3251 but the childrenChanged call can happen at the exact right moment.
3252 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
3253 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
3254 the boolean true is passed in.
3256 * khtml/xml/dom_elementimpl.cpp:
3257 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
3258 (NamedAttrMapImpl::removeAttribute): Ditto.
3260 2004-11-15 John Sullivan <sullivan@apple.com>
3264 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
3265 seen often in Mail and Blot
3267 * khtml/css/css_valueimpl.cpp:
3268 (CSSStyleDeclarationImpl::copyPropertiesInSet):
3269 delete temporary list after we're done using it
3271 2004-11-15 Richard Williamson <rjw@apple.com>
3273 Fixed leak (3879883) that John found. Early return leaked
3278 * khtml/css/css_computedstyle.cpp:
3279 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3281 2004-11-15 Ken Kocienda <kocienda@apple.com>
3287 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
3289 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
3290 EditCommandPtr to its parent, but this caused a a reference cycle in composite
3291 commands as the children held a ref to their parent. Now, the parent variable
3292 is a non-retained reference to an EditCommand *. It would be nice to have a
3293 weak reference to the parent or even override deref in composite commands (but I
3294 can't since deref() is not virtual). However, this should be OK since any
3295 dangling parent pointer is a sign of a bigger object lifetime problem that
3296 would need to be addressed anyway.
3298 * khtml/css/css_valueimpl.cpp:
3299 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
3300 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
3301 just assigning the list variable passed in to the local list variable, or the list will be
3303 * khtml/editing/htmlediting.cpp:
3304 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
3305 (khtml::EditCommand::setEndingSelection): Ditto.
3306 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
3307 Unrelated to the change, but saves some ref's and deref's.
3308 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
3309 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
3310 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
3311 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
3313 2004-11-15 Maciej Stachowiak <mjs@apple.com>
3317 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
3319 * khtml/xml/dom_nodeimpl.cpp:
3320 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
3322 (NodeListImpl::recursiveLength): Adjusted for rename.
3323 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.