1 2004-12-21 Maciej Stachowiak <mjs@apple.com>
5 <rdar://problem/3929187> WebKit needs to restrict access to certain window operations by domain
7 * khtml/ecma/kjs_window.cpp:
8 (Window::get): Change most window functions to be restricted by
11 2004-12-21 Ken Kocienda <kocienda@apple.com>
17 <rdar://problem/3928305> selecting an entire line and typing over causes new inserted text at top of document
19 * khtml/editing/htmlediting.cpp:
20 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent): New function to detect case
21 formerly undetected and unhandled. This is the crux of the bug fix.
22 (khtml::DeleteSelectionCommand::doApply): Call insertPlaceholderForAncestorBlockContent() during
24 * khtml/editing/htmlediting.h: Declare new function.
25 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt: Added.
26 * layout-tests/editing/deleting/delete-3928305-fix.html: Added.
28 2004-12-21 Ken Kocienda <kocienda@apple.com>
32 * khtml/editing/htmlediting.cpp:
33 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Note to self: Must compile code before
34 checking in (aka must return false from function returning bool).
36 2004-12-21 Ken Kocienda <kocienda@apple.com>
42 <rdar://problem/3927752> Crash in khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded(DOM::NodeImpl*)
44 * khtml/editing/htmlediting.cpp:
45 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Added some null checks.
46 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Ditto.
48 2004-12-21 Ken Kocienda <kocienda@apple.com>
52 * khtml/editing/htmlediting.cpp:
53 (khtml::ReplacementFragment::mergeStartNode): Refine concept of how this node is found based on
55 (khtml::ReplaceSelectionCommand::doApply): Add a special case for determining merges that need to
56 be done if the insertion point is in an empty block.
57 * layout-tests/editing/pasteboard/paste-text-012-expected.txt: Added.
58 * layout-tests/editing/pasteboard/paste-text-012.html: Added.
59 * layout-tests/editing/pasteboard/paste-text-013-expected.txt: Added.
60 * layout-tests/editing/pasteboard/paste-text-013.html: Added.
61 * layout-tests/editing/pasteboard/paste-text-014-expected.txt: Added.
62 * layout-tests/editing/pasteboard/paste-text-014.html: Added.
64 2004-12-21 Darin Adler <darin@apple.com>
68 - fixed <rdar://problem/3899133> text search in a Safari window takes a very long time on Tiger updates page (and some other pages)
70 * khtml/editing/visible_text.h: Add an "offset base node" parameter to emitCharacter, and also
71 add a field to track it. Must make a few things mutable so we can update them in the range accessor.
72 * khtml/editing/visible_text.cpp:
73 (khtml::TextIterator::advance): Pass in base node and offsets rather than computing actual offsets
74 using the node's index. We only compute the node index if actually asked for the range.
75 (khtml::TextIterator::handleTextNode): Pass 0 for base node and set base node to 0 when setting
77 (khtml::TextIterator::handleTextBox): Ditto.
78 (khtml::TextIterator::handleReplacedElement): Pass base node and set base node instead of calling
80 (khtml::TextIterator::handleNonTextNode): Pass 0 for offset.
81 (khtml::TextIterator::exitNode): More of the same.
82 (khtml::TextIterator::emitCharacter): Ditto.
83 (khtml::TextIterator::range): If an offset base node is stored, then get its node index, and then
84 add that in to the offsets. Doing the work here guarantees it's done only once when doing a text search.
88 * khtml/khtml_part.cpp: Removed SPEED_DEBUG define. Not sure why it was on.
92 2004-12-20 Ken Kocienda <kocienda@apple.com>
96 * khtml/editing/htmlediting.cpp:
97 (khtml::DeleteSelectionCommand::moveNodesAfterNode): My one-liner for this bug introduced layout test
98 regressions: <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
99 Rolling out until I can develop a real fix.
101 2004-12-20 David Harrison <harrison@apple.com>
103 Reviewed by Dave Hyatt.
105 Initial checkin of AXTextMarkerRef support.
107 * khtml/xml/dom_docimpl.cpp:
108 (DocumentImpl::updateSelection):
109 (DocumentImpl::setFocusNode):
110 * kwq/KWQAccObject.h:
111 * kwq/KWQAccObject.mm:
112 (-[KWQAccObject detach]):
113 (-[KWQAccObject anchorElement]):
114 (-[KWQAccObject addChildrenToArray:]):
115 (-[KWQAccObject accessibilityAttributeNames]):
116 (-[KWQAccObject accessibilityActionDescription:]):
117 (-[KWQAccObject accessibilityPerformAction:]):
118 (-[KWQAccObject textMarkerRangeFromMarkers:andEndMarker:]):
119 (-[KWQAccObject textMarkerForVisiblePosition:]):
120 (-[KWQAccObject visiblePositionForTextMarker:]):
121 (-[KWQAccObject AXTextMarkerRangeCopyStartMarkerWrapper:]):
122 (-[KWQAccObject AXTextMarkerRangeCopyEndMarkerWrapper:]):
123 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
124 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
125 (-[KWQAccObject accessibilityAttributeValue:]):
126 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
127 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
128 (-[KWQAccObject getSelectedTextMarkerRange]):
129 (-[KWQAccObject doAXLineForTextMarker:]):
130 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
131 (-[KWQAccObject doAXStringForTextMarkerRange:]):
132 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
133 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
134 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
135 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
136 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
137 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
138 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
139 (-[KWQAccObject accessibilityFocusedUIElement]):
140 (-[KWQAccObject clearChildren]):
141 (-[KWQAccObject accObjectID]):
142 (-[KWQAccObject setAccObjectID:]):
143 (-[KWQAccObject removeAccObjectID]):
144 * kwq/KWQAccObjectCache.h:
145 * kwq/KWQAccObjectCache.mm:
146 (KWQAccObjectCache::KWQAccObjectCache):
147 (KWQAccObjectCache::~KWQAccObjectCache):
148 (KWQAccObjectCache::getAccObjectID):
149 (KWQAccObjectCache::removeAccObjectID):
150 (KWQAccObjectCache::textMarkerForVisiblePosition):
151 (KWQAccObjectCache::visiblePositionForTextMarker):
153 2004-12-19 Darin Adler <darin@apple.com>
155 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added nil check.
157 2004-12-19 Darin Adler <darin@apple.com>
161 - a garbage collection fix
163 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added a more-extensive comment and fixed the BUILDING_ON_PANTHER
164 #ifndef to use #if (in practice, either is OK).
165 * kwq/KWQKURL.mm: (KURL::getNSURL): Use KWQCFAutorelease instead of autorelease.
167 2004-12-17 David Hyatt <hyatt@apple.com>
169 Fix for 3923255, specified percentage heights of divs with overflow auto inside tables not honored.
173 * khtml/rendering/render_box.cpp:
174 (RenderBox::calcPercentageHeight):
175 * khtml/rendering/render_table.cpp:
176 (RenderTableSection::layoutRows):
178 2004-12-17 David Harrison <harrison@apple.com>
180 Reviewed by Ken Kocienda.
182 <rdar://problem/3924930> REGRESSION: triple click does not select to end of line
184 * khtml/editing/visible_units.cpp:
185 (khtml::endOfParagraph):
186 When includeLineBreak is true, allow traversal to next node after enclosingBlockFlowElement.
188 2004-12-17 Ken Kocienda <kocienda@apple.com>
192 * khtml/editing/htmlediting.cpp:
193 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Missed deleting some now-obsolete expcetion
194 codes when I added the createBreakElement() function.
196 2004-12-17 Richard Williamson <rjw@apple.com>
198 Set the floor of max cacheable object size to 40K. This restores
199 the long standing floor. Lower floor deleteriously impacts the PLT.
202 * khtml/khtml_part.cpp:
203 (KHTMLPart::checkCompleted):
204 * khtml/misc/loader.cpp:
207 2004-12-17 Ken Kocienda <kocienda@apple.com>
213 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
215 * khtml/editing/htmlediting.cpp:
216 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Stop merging nodes when a <br> is hit.
217 Formerly checked only for block boundary.
219 2004-12-17 David Harrison <harrison@apple.com>
223 Add KWQCFAutorelease for autoreleasing CF objects.
224 * kwq/KWQFoundationExtras.h:
228 2004-12-17 David Harrison <harrison@apple.com>
232 Fix GC compatibility in getNSString.
235 (QString::getNSString):
236 Use NSString allocator instead of CFString, so that autorelease works under GC.
238 2004-12-17 Ken Kocienda <kocienda@apple.com>
244 <rdar://problem/3890973> REGRESSION (Mail): Deleting reorders remaining text
246 * khtml/editing/htmlediting.cpp:
247 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Added check to ensure that moving content will not
248 move it after the <body> element.
250 2004-12-17 Ken Kocienda <kocienda@apple.com>
254 Added new layout tests covering cases from recent bug fixes.
256 * layout-tests/editing/inserting/insert-div-018-expected.txt: Added.
257 * layout-tests/editing/inserting/insert-div-018.html: Added.
258 * layout-tests/editing/inserting/insert-div-019-expected.txt: Added.
259 * layout-tests/editing/inserting/insert-div-019.html: Added.
260 * layout-tests/editing/inserting/insert-div-020-expected.txt: Added.
261 * layout-tests/editing/inserting/insert-div-020.html: Added.
262 * layout-tests/editing/inserting/insert-div-021-expected.txt: Added.
263 * layout-tests/editing/inserting/insert-div-021.html: Added.
265 2004-12-17 Ken Kocienda <kocienda@apple.com>
269 Changes in layout resulting from giving <p> elements no margin rather than 0.1em margin.
271 * layout-tests/editing/inserting/insert-div-013-expected.txt
272 * layout-tests/editing/inserting/insert-div-014-expected.txt
274 2004-12-17 Ken Kocienda <kocienda@apple.com>
280 <rdar://problem/3925317> Increase quote in email and with cursor below the quote the new line appears above the quote
282 * khtml/editing/htmlediting.cpp:
283 (khtml::InsertParagraphSeparatorCommand::doApply):
284 * khtml/editing/visible_position.cpp: Refine rules for whether to use the starting node or the starting
285 block as the reference node for the insertion of the new block.
286 (khtml::isLastVisiblePositionInBlock): Tweak rules again. Descendants of following blocks should answer true.
287 I worked this all out on the whiteboard this time. This should be the last tweak.
289 2004-12-17 Kevin Decker <kdecker@apple.com>
293 Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs
295 * khtml/xml/xml_tokenizer.cpp:
296 (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.
298 2004-12-16 Ken Kocienda <kocienda@apple.com>
304 <rdar://problem/3924888> REGRESSION (Mail): Hitting return key at end of line does not insert visible newline
306 * khtml/editing/htmlediting.cpp:
307 (khtml::InsertParagraphSeparatorCommand::doApply): Tweaked code I added just before to fix 3924486, so that
308 it checks the downstream node for the starting position.
310 2004-12-16 Ken Kocienda <kocienda@apple.com>
314 Added new createBreakElement() function that makes creating a <br> element a one-liner.
315 Converted all the code that used to call the DocumentImpl, and dealt with the exceptionCode,
316 over to this new helper.
318 * khtml/editing/htmlediting.cpp:
319 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Now uses new helper function.
320 (khtml::InsertLineBreakCommand::doApply): Ditto.
321 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
322 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
323 (khtml::ReplaceSelectionCommand::doApply): Ditto.
324 (khtml::createBreakElement): New helper.
325 * khtml/editing/htmlediting.h: Ditto.
327 2004-12-16 David Hyatt <hyatt@apple.com>
329 Fix a bug where vertical-align values that depended on their parent's value went crazy if the parent was
330 vertical-align top or bottom. The bug is 3771007, bankofamerica's ebills page.
334 * khtml/rendering/render_object.cpp:
335 (RenderObject::getVerticalPosition):
337 2004-12-16 Ken Kocienda <kocienda@apple.com>
343 <rdar://problem/3924486> REGRESSION (Mail): Hitting return key does not insert visible newline
344 <rdar://problem/3924579> REGRESSION (Mail): After deleting, hitting return key does not insert visible newline
346 * khtml/editing/htmlediting.cpp:
347 (khtml::InsertParagraphSeparatorCommand::doApply): For the first bug, detect when inserting a <p> will
348 make a visible <br> collapse. For the second bug, move the code that inserts the new <p> after
349 a check which may move the node used as the reference node for the insertion. Also change this code to
350 insert the <p> after the last sibling of the starting position, to move it past the nodes we're going
351 to want to shift into the new <p>.
353 2004-12-16 Darin Adler <darin@apple.com>
357 - use <p> elements rather than <br> when pasting plain text; also use margin of 0 rather than 0.1 em
358 after talking this over with Dave and Ken
360 * khtml/editing/htmlediting.h: Added createDefaultParagraphElement and createBlockPlaceholderElement.
361 * khtml/editing/htmlediting.cpp:
362 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Use new createBlockPlaceholderElement
363 helper so this can share code with the plain-text conversion code.
364 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): Use new createDefaultParagraphElement
365 helper so this can share code with the plain-text conversion code.
366 (khtml::createDefaultParagraphElement): Added.
367 (khtml::createBlockPlaceholderElement): Added.
369 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Use paragraphs rather than
370 <br> elements for pasting plain text.
372 - regenerated these files with the newer gperf
374 * khtml/css/cssproperties.c: Regenerated.
375 * khtml/css/cssvalues.c: Regenerated.
376 * khtml/misc/htmlattrs.c: Regenerated.
377 * khtml/misc/htmltags.c: Regenerated.
379 2004-12-16 Ken Kocienda <kocienda@apple.com>
385 <rdar://problem/3924291> REGRESSION (Mail): Crash deleting content following a <p> element
387 * khtml/xml/dom_nodeimpl.cpp:
388 (NodeImpl::enclosingInlineElement): Fixed problem in this function where recursive search for
389 parent that is not an inline would skip past previous siblings of nodes which were blocks. Now
390 it stops looking in this situation. This problem eventually caused the delete code to try to
391 merge a node under a descendent.
393 2004-12-16 Adele Amchan <adele@apple.com>
395 Change by Richard, reviewed by me.
397 Fix for: <rdar://problem/3923983> background image decoding prevents page with 0Kb image from finishing to load
399 * khtml/misc/loader.cpp: (CachedImage::data): Added call to notifyFinished so the 0Kb image case finishes loading.
401 2004-12-16 Adele Amchan <adele@apple.com>
405 Fix for: <rdar://problem/3534824> VIP: some navigation links on safeway.com don't work due to a JavaScript quirk
407 Added a call to ObjectImp::get before Window::get just returns Undefined.
408 This was preventing us from getting the toString function from a Window object.
410 * khtml/ecma/kjs_window.cpp: (Window::get):
412 2004-12-16 Ken Kocienda <kocienda@apple.com>
418 <rdar://problem/3918351> REGRESSION (Mail, 173-175+): Return before first char of line leaves insertion point in wrong place
420 * khtml/editing/htmlediting.cpp:
421 (khtml::InsertParagraphSeparatorCommand::doApply): Basically, did a rewrite of this function
422 to do a better job than it was doing before. Added several test cases to prove I am on a
424 * khtml/editing/visible_position.cpp:
425 (khtml::isFirstVisiblePositionInBlock): Tweaked the rules a bit to fix an issue very similar to the
426 leaving-the-bar-node case problem I just fixed in a recent checkin (relevant markup: <p>foo</p>bar).
427 This function was returning true for the first position in "bar". Wrong. Also tightened up other
428 rule: Should not report true when relationship between blocks cannot be determined.
429 (khtml::isLastVisiblePositionInBlock): Tightened up rule as above: Should not report true
430 when relationship between blocks cannot be determined.
431 * layout-tests/editing/inserting/insert-div-010-expected.txt: Added.
432 * layout-tests/editing/inserting/insert-div-010.html: Added.
433 * layout-tests/editing/inserting/insert-div-011-expected.txt: Added.
434 * layout-tests/editing/inserting/insert-div-011.html: Added.
435 * layout-tests/editing/inserting/insert-div-012-expected.txt: Added.
436 * layout-tests/editing/inserting/insert-div-012.html: Added.
437 * layout-tests/editing/inserting/insert-div-013-expected.txt: Added.
438 * layout-tests/editing/inserting/insert-div-013.html: Added.
439 * layout-tests/editing/inserting/insert-div-014-expected.txt: Added.
440 * layout-tests/editing/inserting/insert-div-014.html: Added.
441 * layout-tests/editing/inserting/insert-div-015-expected.txt: Added.
442 * layout-tests/editing/inserting/insert-div-015.html: Added.
443 * layout-tests/editing/inserting/insert-div-016-expected.txt: Added.
444 * layout-tests/editing/inserting/insert-div-016.html: Added.
445 * layout-tests/editing/inserting/insert-div-017-expected.txt: Added.
446 * layout-tests/editing/inserting/insert-div-017.html: Added.
448 2004-12-16 Ken Kocienda <kocienda@apple.com>
452 Added a layout test based on my last checkin.
454 * layout-tests/editing/selection/move-by-word-001-expected.txt: Added.
455 * layout-tests/editing/selection/move-by-word-001.html: Added.
457 2004-12-16 Ken Kocienda <kocienda@apple.com>
463 <rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps
465 * khtml/editing/visible_text.cpp:
466 (khtml::SimplifiedBackwardsTextIterator::advance): Add new check for leaving a text node and iterating
467 backwards into a different block that is an descendent of the block containing the text node (as in leaving
468 the "bar" node in this example: <p>foo</p>bar).
469 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Call new emitNewlineForBROrText helper.
470 (khtml::SimplifiedBackwardsTextIterator::emitNewlineForBROrText): Factor out code from handleNonTextNode, since
471 it is called from there, and now also from advance().
473 2004-12-15 Darin Adler <darin@apple.com>
477 - fixed problem where plain-text would put a blank line between each <p> even when they have no margins
479 * khtml/editing/visible_text.cpp: (khtml::TextIterator::exitNode): Add more checks and only set the
480 "add one more newline" flag if the margin is sufficient. A more complete fix would ignore the node
481 type altogether and use the render tree instead.
483 2004-12-14 John Sullivan <sullivan@apple.com>
487 - rest of WebCore fix for <rdar://problem/3790011> undoable operations all say "Undo"
488 in the menu, no specific action names
490 * khtml/editing/edit_actions.h: new header, contains EditAction enum
491 (renamed from HTMLEditAction, formerly in htmlediting.h)
493 * ForwardingHeaders/editing/edit_actions.h: new forwarding header
495 * khtml/editing/htmlediting.h:
496 removed HTMLEditAction enum in favor of including edit_actions.h; added khtml::
497 namespace to EditAction usages; added m_editingAction ivar to ApplyStyleCommand
499 * khtml/editing/htmlediting.cpp:
500 (khtml::EditCommandPtr::editingAction):
501 update for enum name change
502 (khtml::EditCommand::editingAction):
504 (khtml::ApplyStyleCommand::ApplyStyleCommand):
505 added editingAction parameter to this constructor
506 (khtml::ApplyStyleCommand::editingAction):
508 (khtml::DeleteSelectionCommand::editingAction):
509 update for enum name change
510 (khtml::MoveSelectionCommand::editingAction):
512 (khtml::TypingCommand::editingAction):
514 (khtml::ReplaceSelectionCommand::editingAction):
517 * khtml/khtml_part.h:
518 added EditAction parameter to applyStyle and computeAndSetTypingStyle
519 * khtml/khtml_part.cpp:
520 (KHTMLPart::computeAndSetTypingStyle):
521 added EditAction parameter
522 (KHTMLPart::applyStyle):
525 * kwq/KWQKHTMLPart.mm:
526 (KWQKHTMLPart::registerCommandForUndoOrRedo):
527 do the cast from EditAction to WebUndoAction a different way to match other code
529 * kwq/WebCoreBridge.h:
530 * kwq/WebCoreBridge.mm:
531 (-[WebCoreBridge setTypingStyle:withUndoAction:]):
532 added WebUndoAction parameter, passed into ApplyStyleCommand constructor
533 (-[WebCoreBridge applyStyle:withUndoAction:]):
536 * WebCore.pbproj/project.pbxproj:
537 updated for new files
539 2004-12-14 David Hyatt <hyatt@apple.com>
541 Fix for 3562458, rowspan and colspan converted to ints so that large values will work for them. Remove
542 the ridiculous 1024 limit on the span values.
544 * khtml/html/html_tableimpl.cpp:
545 (HTMLTableCellElementImpl::parseHTMLAttribute):
546 * khtml/rendering/render_table.cpp:
547 (RenderTableCell::collapsedBottomBorder):
548 * khtml/rendering/render_table.h:
549 (khtml::RenderTableCell::colSpan):
550 (khtml::RenderTableCell::setColSpan):
551 (khtml::RenderTableCell::rowSpan):
552 (khtml::RenderTableCell::setRowSpan):
553 (khtml::RenderTableCol::span):
554 (khtml::RenderTableCol::setSpan):
556 2004-12-14 David Hyatt <hyatt@apple.com>
558 Make sure <col> and <colgroup> can have spans updated dynamically as well.
562 * khtml/html/html_tableimpl.cpp:
563 (HTMLTableColElementImpl::parseHTMLAttribute):
564 * khtml/rendering/render_table.cpp:
565 (RenderTableCell::updateFromElement):
566 (RenderTableCol::updateFromElement):
568 2004-12-14 David Hyatt <hyatt@apple.com>
570 Fix for 3833123, setting a cell's colspan does not update rendering like it should.
574 * khtml/html/html_tableimpl.cpp:
575 (HTMLTableCellElementImpl::parseHTMLAttribute):
576 * khtml/rendering/render_table.cpp:
577 (RenderTableCell::RenderTableCell):
578 (RenderTableCell::updateFromElement):
580 2004-12-14 Chris Blumenberg <cblu@apple.com>
582 Fixed: <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
586 * khtml/editing/markup.cpp:
587 (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it
589 2004-12-14 David Hyatt <hyatt@apple.com>
591 Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position.
592 This is actually a regression from my positioned object DHTML optimization.
596 * khtml/rendering/render_object.cpp:
597 (RenderObject::setStyle):
599 2004-12-14 David Hyatt <hyatt@apple.com>
601 Make sure the class attribute works when newlines are present in the attribute.
605 * khtml/html/html_elementimpl.cpp:
606 (HTMLNamedAttrMapImpl::parseClassAttribute):
608 2004-12-14 David Hyatt <hyatt@apple.com>
610 Fix for 3724938, float element is duplicated and paints twice. The logic for when to paint floats was
611 actually fairly screwed up. This patch simplifies the logic and makes addOverhangingFloats easier to
612 read by splitting it into two separate functions.
616 * khtml/rendering/render_block.cpp:
617 (khtml::RenderBlock::layoutBlockChildren):
618 (khtml::RenderBlock::clearFloats):
619 (khtml::RenderBlock::addOverhangingFloats):
620 (khtml::RenderBlock::addIntrudingFloats):
621 * khtml/rendering/render_block.h:
623 2004-12-14 John Sullivan <sullivan@apple.com>
627 - added Undo action names for Cut, Paste, and Drag
629 * khtml/editing/htmlediting.h:
630 * khtml/editing/htmlediting.cpp:
631 (khtml::DeleteSelectionCommand::editingAction):
632 overridden to return HTMLEditActionCut
633 (khtml::MoveSelectionCommand::editingAction):
634 overridden to return HTMLEditActionDrag
635 (khtml::ReplaceSelectionCommand::editingAction):
636 overridden to return HTMLEditActionPaste
638 2004-12-14 John Sullivan <sullivan@apple.com>
642 - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu,
643 no specific action names
645 The remaining step is to make each EditCommand subclass override editingAction() to return an
646 appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
647 is not completely straightforward, so this next step isn't trivial.)
649 * khtml/editing/htmlediting.h:
650 new enum for HTMLEditAction
652 * khtml/editing/htmlediting.cpp:
653 (khtml::EditCommandPtr::editingAction):
654 new method, calls through to EditCommand
655 (khtml::EditCommand::editingAction):
656 new method for subclasses to override, returns HTMLEditActionUnspecified at this level
657 (khtml::TypingCommand::editingAction):
658 proof of concept override, returns HTMLEditActionTyping
660 * kwq/KWQKHTMLPart.h:
661 declare new private bottleneck method registerCommandForUndoOrRedo
662 * kwq/KWQKHTMLPart.mm:
663 (KWQKHTMLPart::registerCommandForUndoOrRedo):
664 new bottleneck method to reduce code duplication; now calls over the bridge
665 to get the localized string to use for the Undo action name
666 (KWQKHTMLPart::registerCommandForUndo):
667 now calls new bottleneck method
668 (KWQKHTMLPart::registerCommandForRedo):
669 now calls new bottleneck method
671 * kwq/WebCoreBridge.h:
672 new enum for WebUndoAction, maps directly to HTMLEditAction.
673 Declaration of nameForUndoAction:
675 2004-12-14 Darin Adler <darin@apple.com>
679 - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)
681 * khtml/rendering/render_frames.cpp:
682 (RenderPart::~RenderPart): Check widget for nil.
683 (RenderPart::setWidget): Ditto.
684 (RenderFrame::slotViewCleared): Ditto.
685 (RenderPartObject::slotViewCleared): Ditto.
687 2004-12-13 Darin Adler <darin@apple.com>
691 - moved markup-related functions into new sources files in the editing directory
692 - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster
694 * ForwardingHeaders/editing/markup.h: Added.
695 * khtml/editing/markup.h: Added.
696 * khtml/editing/markup.cpp: Added.
698 * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.
700 * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
701 * khtml/html/html_elementimpl.cpp:
702 (HTMLElementImpl::innerHTML): Changed to call createMarkup.
703 (HTMLElementImpl::outerHTML): Ditto.
705 * khtml/ecma/kjs_window.cpp:
706 (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
707 (Window::retrieveActive): Ditto.
709 * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
710 * khtml/xml/dom_docimpl.h: Ditto.
712 * khtml/khtml_part.cpp:
713 (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
714 (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.
716 * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
717 still works even with the additional replace overloads added to QString.
718 * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.
720 * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
721 base pointer, because it used dynamic_cast in its implementation. Made the other version public.
722 * khtml/rendering/render_object.cpp: Ditto.
723 * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.
725 * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
726 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
727 the support code into markup.cpp.
729 * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
730 * khtml/xml/dom_nodeimpl.cpp: Ditto.
732 * khtml/xml/dom_position.cpp:
733 (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
734 so these return null positions rather than raising exceptions.
735 (DOM::endPosition): Ditto.
737 * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
738 * kwq/KWQFrame.h: Ditto.
739 * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
740 * kwq/KWQKPartsPart.h: Ditto.
741 * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
742 * kwq/KWQScrollView.h: Ditto.
743 * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
744 * kwq/KWQKHTMLPart.h: Ditto.
745 * kwq/KWQKHTMLPart.mm:
746 (KHTMLView::isKHTMLView): Ditto.
747 (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
748 replace overloads added to QString.
749 (KWQKHTMLPart::setStatusBarText): Ditto.
750 (KWQKHTMLPart::runJavaScriptAlert): Ditto.
751 (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
752 (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
753 (KWQKHTMLPart::attributedString): Ditto.
754 (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
755 (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).
757 * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
759 (QObject::inherits): Changed to not use dynamic cast.
760 (QObject::isKHTMLPart): Added. Returns false.
761 (QObject::isKHTMLView): Ditto.
762 (QObject::isKPartsReadOnlyPart): Ditto.
763 (QObject::isQFrame): Ditto.
764 (QObject::isQScrollView): Ditto.
766 * kwq/KWQRenderTreeDebug.cpp:
767 (write): Changed to use inherits rather than dynamic_cast.
768 (writeSelection): Ditto.
770 * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
771 than going straight on to the "no parameters at all" version.
774 * kwq/KWQString.mm: (QString::replace): Added overloads.
775 * kwq/WebCoreBridge.mm:
776 (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
777 (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
778 (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
779 the additional replace overloads added to QString.
780 (-[WebCoreBridge stringForRange:]): Ditto.
781 (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
782 (-[WebCoreBridge elementAtPoint:]): QChar conversion.
783 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
784 (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.
786 2004-12-13 Ken Kocienda <kocienda@apple.com>
792 <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
794 * khtml/editing/htmlediting.cpp:
795 (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
796 leading and trailing whitespace positions was reversed! I must have introduced this error recently
797 when changing around this code.
799 2004-12-13 David Hyatt <hyatt@apple.com>
801 Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing
802 and painting was using the wrong rect when setting up the x/y of the rect.
806 * khtml/rendering/render_block.cpp:
807 (khtml::RenderBlock::paint):
808 (khtml::RenderBlock::nodeAtPoint):
809 * khtml/rendering/render_object.h:
810 (khtml::RenderObject::floatRect):
812 2004-12-13 Ken Kocienda <kocienda@apple.com>
818 <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles
820 Code to figuire out the end node to merge was missing the font tag in the second paragraph
821 written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.
823 * khtml/editing/htmlediting.cpp:
824 (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
825 looking for the node that is the last inline in the last block of the fragment. The old algorithm was
826 insufficiently powerful.
827 (khtml::ReplacementFragment::enclosingBlock): New helper function.
828 * khtml/editing/htmlediting.h: Add declaration for new helper function.
829 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
830 * layout-tests/editing/pasteboard/paste-text-011.html: Added.
832 2004-12-13 Ken Kocienda <kocienda@apple.com>
836 WebCore side of fix for this bug:
838 <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace
840 Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
841 bug. This change involves our half of the needed changes.
843 Note that a lot of this change has to do with changing code to use a <br> element instead of
844 a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
845 other places, code to handle comments in markup can be removed since we do not use comments for
846 such annotations after this change.
848 * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
849 (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
850 (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
851 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
852 convertedSpaceSpanClassString to match other uses of the idiom used here.
853 (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
854 * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
855 (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
856 * khtml/html/html_elementimpl.cpp:
857 (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
858 annotate fragments with comments any longer.
859 * khtml/html/html_elementimpl.h: Ditto.
860 * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
861 (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
862 (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
864 * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
865 * kwq/WebCoreBridge.mm:
866 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
867 in DOM when calling createContextualFragment().
869 2004-12-10 John Sullivan <sullivan@apple.com>
871 fixed deployment build bustage that John Louch ran into
873 * kwq/KWQTextEdit.mm:
874 (QTextEdit::setScrollBarModes):
875 move bool declaration inside exception-handling block to avoid obscure
878 2004-12-10 Maciej Stachowiak <mjs@apple.com>
882 <rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
885 (QWidget::setFocus): Handle the case where setting focus removed
886 us from the superview - this can happen due to style changes on
889 2004-12-10 Ken Kocienda <kocienda@apple.com>
895 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
897 There are a number of interesting things we could do to fix this bug, including SPI and involving
898 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
899 will fix the bug in the general case until such time as we can come up with more specific
902 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
905 * khtml/editing/htmlediting.cpp:
906 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
907 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
908 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
909 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
911 2004-12-10 Darin Adler <darin@apple.com>
915 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
917 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
918 * khtml/rendering/render_form.cpp:
919 (RenderSubmitButton::rawText): Convert to QChar explicitly.
920 (RenderLineEdit::updateFromElement): Ditto.
921 (RenderLineEdit::slotTextChanged): Ditto.
922 (RenderSelect::updateFromElement): Ditto.
923 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
924 that requires a derived class. Now we don't use this class at all for WebCore, but they still
926 (TextAreaWidget::event): Moved out the ifdefs.
927 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
928 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
929 now done in setStyle.
930 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
931 that's needed and WebCore no longer has TextAreaWidget.
932 (RenderTextArea::calcMinMaxWidth): Ditto.
933 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
935 (RenderTextArea::updateFromElement): Use type QTextEdit.
936 (RenderTextArea::text): Ditto.
937 (RenderTextArea::select): Ditto.
939 * kwq/KWQTextArea.mm:
940 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
941 since it's now handled by QTextEdit.
942 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
944 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
945 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
946 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
948 2004-12-10 Ken Kocienda <kocienda@apple.com>
954 <rdar://problem/3915047> HItting return in empty document inserts <p> but
955 insertion point does not move
957 * khtml/editing/htmlediting.cpp:
958 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
959 code to insert the <p> element for the return is not detecting the fact
960 that the document is empty. Inserting a <p> into an empty body will not
961 "add a new line" as the user expects. With this change, we'll add a second
962 <p> when the root editable element has no rendered kids.
964 2004-12-10 Maciej Stachowiak <mjs@apple.com>
968 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
970 * khtml/html/html_miscimpl.cpp:
971 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
972 the initial one step, otherwise we might inadvertantly step
973 outside the collection base, thereby causing assertion failures or
976 2004-12-10 Ken Kocienda <kocienda@apple.com>
980 * khtml/editing/htmlediting.cpp:
981 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
982 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
983 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
984 should do nothing if the starting point for the selection is itself the starting block.
985 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
986 function, though the names and concepts are slightly different.
988 2004-12-10 Maciej Stachowiak <mjs@apple.com>
992 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
994 * khtml/dom/html_document.cpp:
995 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
996 * khtml/dom/html_document.h:
997 * khtml/ecma/kjs_html.cpp:
998 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
999 * khtml/html/html_miscimpl.cpp:
1000 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
1001 the items that can be accessed directly as a document propery, in particular forms, images,
1002 objects, applets and embeds.
1003 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
1004 (HTMLFormCollectionImpl::updateNameCache): Ditto.
1005 * khtml/html/html_miscimpl.h:
1006 (DOM::HTMLCollectionImpl::): Added new type.
1008 2004-12-10 Ken Kocienda <kocienda@apple.com>
1014 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
1016 * khtml/rendering/render_text.cpp:
1017 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
1019 2004-12-10 Ken Kocienda <kocienda@apple.com>
1025 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
1027 * khtml/editing/htmlediting.cpp:
1028 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
1029 that was removed from the document when pasting. This caused the disappearance. Now this
1030 is detected, and the selection is shifted to a node that is in the document.
1032 2004-12-09 Richard Williamson <rjw@apple.com>
1034 Check to disable threaded decoding during
1035 layout tests wasn't invoking function, just checking address of
1036 function, which would always return true.
1038 * kwq/WebCoreImageRendererFactory.m:
1039 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
1041 2004-12-09 David Hyatt <hyatt@apple.com>
1043 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
1046 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
1047 all inlines when repainting.
1051 * khtml/rendering/render_block.cpp:
1052 (khtml::RenderBlock::layoutBlockChildren):
1053 * khtml/rendering/render_flow.cpp:
1054 (RenderFlow::getAbsoluteRepaintRect):
1056 2004-12-09 David Hyatt <hyatt@apple.com>
1058 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
1059 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
1060 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
1061 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
1065 * khtml/rendering/render_block.cpp:
1066 (khtml::RenderBlock::getClearDelta):
1067 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
1068 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
1069 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
1070 * layout-tests/fast/block/margin-collapse/102-expected.txt:
1071 * layout-tests/fast/block/margin-collapse/102.html:
1073 2004-12-09 Richard Williamson <rjw@apple.com>
1075 Fixed <rdar://problem/3914078> worldclock crashing gc related
1077 Use ProtectedValue for Context2D instance members.
1081 * khtml/ecma/kjs_html.h:
1083 2004-12-09 John Sullivan <sullivan@apple.com>
1087 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
1089 * kwq/KWQAccObject.mm:
1090 (-[KWQAccObject title]): moved image alt tag code out of here
1091 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
1092 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
1093 that ordinary elements return; this means that ordinary elements that aren't images will return
1094 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
1096 (-[KWQAccObject accessibilityAttributeValue:]):
1097 call accessibilityDescription when asked for AXDescription
1099 2004-12-09 Ken Kocienda <kocienda@apple.com>
1101 Reviewed by Harrison
1105 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
1107 * khtml/editing/htmlediting.cpp:
1108 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
1109 been deleted. If this is the case, set the destination to the node the delete command provides in
1110 its ending selection.
1114 2004-12-09 Ken Kocienda <kocienda@apple.com>
1120 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
1122 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
1123 callback may not be delivered before the program asks for the dimensions of an image in order to
1124 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
1125 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
1127 * kwq/KWQRenderTreeDebug.cpp:
1128 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
1129 (externalRepresentation): Sets debuggingRenderTree flag to true;
1130 * kwq/KWQRenderTreeDebug.h:
1131 * kwq/WebCoreImageRendererFactory.m:
1132 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
1133 do threaded decoding in any case if the flag is set.
1135 2004-12-09 Chris Blumenberg <cblu@apple.com>
1137 Fix for busting XMLHTTPRequest.
1139 Reviewed by kocienda.
1141 * khtml/misc/loader.cpp:
1142 (Loader::servePendingRequests): pass true for deliverAllData
1144 (KIO::get): take deliverAllData param
1145 (KIO::http_post): ditto
1146 * kwq/KWQKJobClasses.h:
1147 * kwq/KWQKJobClasses.mm:
1148 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
1149 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
1151 2004-12-09 Ken Kocienda <kocienda@apple.com>
1155 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
1157 * khtml/xml/dom_nodeimpl.cpp:
1158 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
1160 2004-12-07 Richard Williamson <rjw@apple.com>
1162 Support threaded image decoding on machines w/ > 2 CPUs.
1164 Reviewed by Maciej and Chris.
1166 * khtml/misc/loader.cpp:
1167 (CachedImageCallback::notifyUpdate):
1168 (CachedImageCallback::notifyFinished):
1169 (CachedImageCallback::notifyDecodingError):
1170 (CachedImageCallback::handleError):
1171 (CachedImageCallback::clear):
1172 (CachedImage::CachedImage):
1173 (CachedImage::clear):
1174 (CachedImage::data):
1175 (CachedImage::checkNotify):
1176 (Loader::servePendingRequests):
1177 (Loader::slotFinished):
1178 (Loader::numRequests):
1179 (Loader::cancelRequests):
1180 (Loader::removeBackgroundDecodingRequest):
1181 * khtml/misc/loader.h:
1182 (khtml::CachedImageCallback::CachedImageCallback):
1183 (khtml::CachedImageCallback::ref):
1184 (khtml::CachedImageCallback::deref):
1185 (khtml::CachedImage::decoderCallback):
1186 * khtml/rendering/render_object.cpp:
1187 (RenderObject::setPixmap):
1190 (-[WebImageCallback initWithCallback:khtml::]):
1191 (-[WebImageCallback _commonTermination]):
1192 (-[WebImageCallback dealloc]):
1193 (-[WebImageCallback finalize]):
1194 (-[WebImageCallback notify]):
1195 (-[WebImageCallback setImageSourceStatus:]):
1196 (-[WebImageCallback status]):
1197 (QPixmap::shouldUseThreadedDecoding):
1198 (QPixmap::receivedData):
1199 * kwq/WebCoreImageRenderer.h:
1200 * kwq/WebCoreImageRendererFactory.h:
1201 * kwq/WebCoreImageRendererFactory.m:
1202 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
1203 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
1205 2004-12-07 Ken Kocienda <kocienda@apple.com>
1209 * khtml/editing/htmlediting.cpp:
1210 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
1211 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
1212 after new block has been inserted, otherwise a crash can result. Shuffle down call
1213 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
1216 2004-12-07 Ken Kocienda <kocienda@apple.com>
1222 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
1224 * khtml/editing/htmlediting.cpp:
1225 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
1226 for determining the location for inserting content. Do not allow an insert before or after if the
1227 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
1228 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
1229 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
1231 2004-12-07 Darin Adler <darin@apple.com>
1235 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
1237 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
1239 2004-12-07 Ken Kocienda <kocienda@apple.com>
1243 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
1244 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
1246 * khtml/editing/html_interchange.h: Name change, as described above.
1247 * khtml/editing/htmlediting.cpp:
1248 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
1249 * khtml/xml/dom2_rangeimpl.cpp:
1250 (DOM::RangeImpl::toHTML): Ditto.
1252 2004-12-07 Ken Kocienda <kocienda@apple.com>
1256 Added a couple more layout tests.
1258 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
1259 * layout-tests/editing/deleting/delete-line-013.html: Added.
1260 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
1261 * layout-tests/editing/deleting/delete-line-014.html: Added.
1263 2004-12-06 Maciej Stachowiak <mjs@apple.com>
1267 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
1269 * kwq/KWQListBox.mm:
1270 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
1271 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
1272 (-[KWQListBoxScrollView widget]): See above.
1273 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
1274 afterMouseDown, to avoid triggering an assertion failure.
1276 2004-12-06 David Hyatt <hyatt@apple.com>
1278 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
1279 made by me, kocienda and harrison to just remove it.
1283 * khtml/rendering/bidi.cpp:
1284 (khtml::RenderBlock::layoutInlineChildren):
1285 * khtml/rendering/render_block.cpp:
1286 (khtml:::RenderFlow):
1287 * khtml/rendering/render_block.h:
1288 * khtml/rendering/render_flow.cpp:
1289 (RenderFlow::dirtyLinesFromChangedChild):
1291 2004-12-06 David Hyatt <hyatt@apple.com>
1293 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
1294 not a damage rect that can be changed when intersected with the clip regions of the web page.
1298 * khtml/rendering/render_canvas.h:
1299 (khtml::RenderCanvas::printRect):
1300 (khtml::RenderCanvas::setPrintRect):
1301 * khtml/rendering/render_flow.cpp:
1302 (RenderFlow::paintLines):
1303 * khtml/rendering/render_list.cpp:
1304 (RenderListMarker::paint):
1305 * kwq/KWQKHTMLPart.mm:
1306 (KWQKHTMLPart::adjustPageHeight):
1308 2004-12-06 David Harrison <harrison@apple.com>
1310 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
1312 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
1315 * khtml/rendering/render_flow.cpp:
1316 (RenderFlow::dirtyLinesFromChangedChild):
1317 Dirty the line above because new child can inval the cached line break position of previous line.
1319 2004-12-06 David Hyatt <hyatt@apple.com>
1321 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
1322 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
1323 3126929, handle top/left overflow.
1325 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
1327 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
1328 regions and web pages) has been fixed.
1332 * khtml/rendering/bidi.cpp:
1333 (khtml::RenderBlock::computeHorizontalPositionsForLine):
1334 (khtml::RenderBlock::checkLinesForOverflow):
1335 * khtml/rendering/render_block.cpp:
1336 (khtml:::RenderFlow):
1337 (khtml::RenderBlock::overflowHeight):
1338 (khtml::RenderBlock::overflowWidth):
1339 (khtml::RenderBlock::overflowLeft):
1340 (khtml::RenderBlock::overflowTop):
1341 (khtml::RenderBlock::overflowRect):
1342 (khtml::RenderBlock::layoutBlock):
1343 (khtml::RenderBlock::layoutBlockChildren):
1344 (khtml::RenderBlock::paint):
1345 (khtml::RenderBlock::floatRect):
1346 (khtml::RenderBlock::lowestPosition):
1347 (khtml::RenderBlock::rightmostPosition):
1348 (khtml::RenderBlock::leftmostPosition):
1349 (khtml::RenderBlock::nodeAtPoint):
1350 * khtml/rendering/render_block.h:
1351 * khtml/rendering/render_box.h:
1352 (khtml::RenderBox::borderBox):
1353 (khtml::RenderBox::borderTopExtra):
1354 (khtml::RenderBox::borderBottomExtra):
1355 * khtml/rendering/render_layer.cpp:
1356 (RenderLayer::paintScrollbars):
1357 (mustExamineRenderer):
1358 (RenderLayer::intersectsDamageRect):
1359 (RenderLayer::containsPoint):
1360 * khtml/rendering/render_line.cpp:
1361 (khtml::InlineFlowBox::placeBoxesHorizontally):
1362 (khtml::InlineFlowBox::verticallyAlignBoxes):
1363 * khtml/rendering/render_line.h:
1364 (khtml::InlineBox::leftOverflow):
1365 (khtml::InlineBox::rightOverflow):
1366 (khtml::InlineFlowBox::setVerticalOverflowPositions):
1367 (khtml::RootInlineBox::RootInlineBox):
1368 (khtml::RootInlineBox::leftOverflow):
1369 (khtml::RootInlineBox::rightOverflow):
1370 (khtml::RootInlineBox::setVerticalOverflowPositions):
1371 (khtml::RootInlineBox::setHorizontalOverflowPositions):
1372 * khtml/rendering/render_object.h:
1373 (khtml::RenderObject::borderBox):
1374 (khtml::RenderObject::overflowLeft):
1375 (khtml::RenderObject::overflowTop):
1376 (khtml::RenderObject::overflowRect):
1377 (khtml::RenderObject::floatRect):
1378 * khtml/rendering/render_table.cpp:
1379 (RenderTable::layout):
1380 (RenderTable::paint):
1381 (RenderTable::paintBoxDecorations):
1382 (RenderTable::calcMinMaxWidth):
1383 * khtml/rendering/render_table.h:
1384 (khtml::RenderTableCell::borderTopExtra):
1385 (khtml::RenderTableCell::borderBottomExtra):
1390 2004-12-06 Maciej Stachowiak <mjs@apple.com>
1394 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
1396 I changed all unprotected places that can navigate a different
1397 window or frame from script to check for a javascript: URL, and if
1398 found, to check for safety using cross-site-script rules.
1400 I considered a few other possible exploits and made no change:
1402 - document.location is already protected because the document
1403 object itself is protected
1405 - frame.src, frame.location, iframe.src and targetted links are
1406 all safe because setting the URL of a frame to a javascript: URL
1407 executes the script in the context of the parent
1409 * khtml/ecma/kjs_window.cpp:
1410 (WindowFunc::tryCall):
1412 (LocationFunc::tryCall):
1414 2004-12-06 Ken Kocienda <kocienda@apple.com>
1420 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
1422 * khtml/editing/htmlediting.cpp:
1423 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
1424 check for one of the special cases being checked for in this function. The specific case
1425 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
1426 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
1427 case where a selection ended in a <br> after a block and would not delete any part of the
1428 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
1431 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
1432 new use of the function exposed this bug:
1434 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
1436 * khtml/xml/dom_position.cpp:
1437 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
1438 not have this fatal flaw. It is a much better design as well.
1440 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
1441 have what I consider to be a better result. Going with it.
1443 2004-12-06 Chris Blumenberg <cblu@apple.com>
1445 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
1450 (-[DOMElement _font]): new SPI for AppKit
1453 2004-12-06 Darin Adler <darin@apple.com>
1457 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
1459 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
1460 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
1462 2004-12-06 John Sullivan <sullivan@apple.com>
1464 Darin found what appears to be the real leak that we were falsely blaming
1465 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
1466 sure nothing barfed.
1468 * khtml/css/cssparser.cpp:
1469 (CSSParser::parseValue):
1470 call clearProperties() instead of just setting numParsedProperties to 0
1471 (CSSParser::parseDeclaration):
1473 (CSSParser::createStyleDeclaration):
1476 2004-12-06 Ken Kocienda <kocienda@apple.com>
1482 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
1483 * layout-tests/editing/inserting/insert-div-001.html: Added.
1484 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
1485 * layout-tests/editing/inserting/insert-div-002.html: Added.
1486 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
1487 * layout-tests/editing/inserting/insert-div-003.html: Added.
1488 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
1489 * layout-tests/editing/inserting/insert-div-004.html: Added.
1490 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
1491 * layout-tests/editing/inserting/insert-div-005.html: Added.
1492 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
1493 * layout-tests/editing/inserting/insert-div-006.html: Added.
1494 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
1495 * layout-tests/editing/inserting/insert-div-007.html: Added.
1496 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
1497 * layout-tests/editing/inserting/insert-div-008.html: Added.
1498 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
1499 * layout-tests/editing/inserting/insert-div-009.html: Added.
1501 2004-12-06 Ken Kocienda <kocienda@apple.com>
1503 Reviewed by Harrison
1507 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
1509 * khtml/editing/htmlediting.cpp:
1510 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
1511 being added to this function. This ensures that the added block has a height.
1512 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1514 2004-12-06 Ken Kocienda <kocienda@apple.com>
1518 * khtml/dom/dom_string.cpp:
1519 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
1520 * khtml/dom/dom_string.h: Ditto.
1521 * khtml/editing/htmlediting.cpp:
1522 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
1523 RebalanceWhitespaceCommand instance.
1524 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
1525 (khtml::InsertLineBreakCommand::doApply): Ditto.
1526 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1527 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1528 (khtml::InsertTextCommand::input): Ditto.
1529 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
1530 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
1531 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
1532 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
1533 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
1534 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
1535 * khtml/editing/htmlediting.h: Ditto.
1536 (khtml::RebalanceWhitespaceCommand::): Ditto.
1538 2004-12-05 Darin Adler <darin@apple.com>
1540 - fixed small problem in my check-in from yesterday
1543 (positionForEvent): Get location from event without raising exception if it's the wrong type.
1544 (clickCountForEvent): Same, for clickCount.
1545 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
1546 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
1547 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
1549 2004-12-04 Darin Adler <darin@apple.com>
1553 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
1555 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
1556 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
1557 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
1559 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
1561 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
1562 * khtml/rendering/render_form.cpp:
1563 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
1564 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
1565 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
1567 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
1568 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
1569 Added a fixState helper method so the constructors can save code.
1571 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
1572 and added a third constructor that uses the "current event" from AppKit (used above).
1573 (QMouseEvent::fixState): Compute state and click count based on event type.
1575 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
1577 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
1578 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
1579 underlying cause in CSS.
1581 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
1583 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
1584 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
1586 2004-12-03 Chris Blumenberg <cblu@apple.com>
1589 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
1590 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
1591 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
1592 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
1594 Reviewed by darin, rjw, kocienda.
1596 * khtml/misc/loader.cpp:
1597 (CachedObject::~CachedObject):
1598 (CachedCSSStyleSheet::checkNotify):
1599 (Loader::servePendingRequests):
1600 (Loader::slotFinished):
1601 (Loader::slotReceivedResponse):
1602 (Cache::requestImage):
1603 (Cache::requestScript):
1604 * khtml/misc/loader.h:
1605 (khtml::CachedObject::CachedObject):
1606 (khtml::CachedObject::response):
1607 (khtml::CachedObject::allData):
1608 * kwq/KWQKJobClasses.h:
1609 * kwq/KWQKJobClasses.mm:
1610 (KIO::TransferJobPrivate::TransferJobPrivate):
1611 (KIO::TransferJobPrivate::~TransferJobPrivate):
1612 (KIO::TransferJob::TransferJob):
1613 (KIO::TransferJob::assembleResponseHeaders):
1614 (KIO::TransferJob::retrieveCharset):
1615 (KIO::TransferJob::emitResult):
1616 (KIO::TransferJob::emitReceivedResponse):
1619 (KWQHeaderStringFromDictionary):
1620 (KWQCheckCacheObjectStatus):
1621 (KWQIsResponseURLEqualToURL):
1623 (KWQResponseMIMEType):
1624 (KWQCacheObjectExpiresTime):
1625 (khtml::CachedObject::setResponse):
1626 (khtml::CachedObject::setAllData):
1630 * kwq/KWQResourceLoader.mm:
1631 (-[KWQResourceLoader finishJobAndHandle:]):
1632 (-[KWQResourceLoader cancel]):
1633 (-[KWQResourceLoader reportError]):
1634 (-[KWQResourceLoader finishWithData:]):
1642 * kwq/WebCoreBridge.h:
1643 * kwq/WebCoreResourceLoader.h:
1645 2004-12-04 Darin Adler <darin@apple.com>
1649 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
1651 * khtml/rendering/render_form.cpp:
1652 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
1653 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
1654 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
1655 (RenderSlider::slotSliderValueChanged): Ditto.
1657 2004-12-03 John Sullivan <sullivan@apple.com>
1661 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
1662 khtml::BackgroundLayer::cullEmptyLayers
1664 * khtml/rendering/render_style.cpp:
1665 (BackgroundLayer::cullEmptyLayers):
1666 added missing nil check
1670 2004-12-03 Ken Kocienda <kocienda@apple.com>
1674 Roll out some recent changes by Chris that caused a performance regression.
1675 Fix is in hand, but it is a little risky this close to a submission. So,
1676 we have decided to roll back the change with the regression and roll in
1677 the new code after we submit.
1679 * khtml/css/cssproperties.c:
1682 * khtml/css/cssvalues.c:
1685 * khtml/misc/htmlattrs.c:
1688 * khtml/misc/htmltags.c:
1691 * khtml/misc/loader.cpp:
1692 (CachedObject::~CachedObject):
1693 (CachedObject::setResponse):
1694 (CachedCSSStyleSheet::checkNotify):
1695 (Loader::servePendingRequests):
1696 (Loader::slotFinished):
1697 (Loader::slotReceivedResponse):
1698 (Cache::requestImage):
1699 (Cache::requestScript):
1700 * khtml/misc/loader.h:
1701 (khtml::CachedObject::CachedObject):
1702 (khtml::CachedObject::response):
1703 * kwq/KWQKJobClasses.h:
1704 * kwq/KWQKJobClasses.mm:
1705 (KIO::TransferJobPrivate::TransferJobPrivate):
1706 (KIO::TransferJobPrivate::~TransferJobPrivate):
1707 (KIO::TransferJob::TransferJob):
1708 (KIO::TransferJob::assembleResponseHeaders):
1709 (KIO::TransferJob::retrieveCharset):
1710 (KIO::TransferJob::emitResult):
1711 (KIO::TransferJob::emitReceivedResponse):
1714 (KWQHeaderStringFromDictionary):
1715 (KWQCheckCacheObjectStatus):
1716 (KWQRetainResponse):
1717 (KWQReleaseResponse):
1718 (KWQIsResponseURLEqualToURL):
1720 (KWQResponseMIMEType):
1721 (KWQResponseTextEncodingName):
1722 (KWQResponseHeaderString):
1723 (KWQCacheObjectExpiresTime):
1724 (KWQLoader::KWQLoader):
1728 * kwq/KWQResourceLoader.mm:
1729 (-[KWQResourceLoader finishJobAndHandle]):
1730 (-[KWQResourceLoader cancel]):
1731 (-[KWQResourceLoader reportError]):
1732 (-[KWQResourceLoader finish]):
1740 * kwq/WebCoreBridge.h:
1741 * kwq/WebCoreResourceLoader.h:
1743 2004-12-03 John Sullivan <sullivan@apple.com>
1747 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
1749 * kwq/KWQKHTMLPart.mm:
1750 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
1751 when checking whether we moved the focus to another view, make sure we didn't "move" it to
1752 our documentView, because that's no move at all.
1754 2004-12-03 Darin Adler <darin@apple.com>
1758 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
1760 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
1761 Added missing initialization for base class and node pointer.
1763 - fixed a few places that could leave dangling node pointers
1765 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
1766 Clear out the node pointer when the node is destroyed.
1767 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
1769 2004-12-03 Chris Blumenberg <cblu@apple.com>
1771 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.
1772 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
1776 * khtml/misc/loader.cpp:
1777 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
1778 (Loader::slotFinished): take data param
1779 * khtml/misc/loader.h:
1780 * kwq/KWQKJobClasses.h:
1781 * kwq/KWQKJobClasses.mm:
1782 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
1783 (KIO::TransferJob::emitResult): take data param and pass it
1784 * kwq/KWQResourceLoader.mm:
1785 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
1786 (-[KWQResourceLoader cancel]): pass nil for data
1787 (-[KWQResourceLoader reportError]): ditto
1788 (-[KWQResourceLoader finishWithData:]): pass data
1790 (KWQSlot::KWQSlot): pass data param to slotFinished
1791 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
1793 2004-12-03 Ken Kocienda <kocienda@apple.com>
1797 Did some clean up in the Position class as a result of trying to write some new layout
1798 tests and discovering a bug along the way.
1800 I removed these three functions from the Position class:
1802 1. bool isFirstRenderedPositionOnLine() const;
1803 2. bool isLastRenderedPositionOnLine() const;
1804 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
1805 4. bool inFirstEditableInRootEditableElement() const;
1807 The first two have replacements in the VisiblePosition class, and some code has been
1808 moved to use these new variants. The third function was a helper used only by these
1809 first two function, and can be removed as well. The fourth function was not used by anyone.
1811 * khtml/editing/htmlediting.cpp:
1812 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
1813 * khtml/editing/visible_position.cpp:
1814 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
1815 Incorrect results were being returned when asking about positions at the starts of blocks.
1816 * khtml/xml/dom_position.cpp:
1817 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
1818 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
1819 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
1820 * khtml/xml/dom_position.h: Update header for deletions.
1822 2004-12-03 Ken Kocienda <kocienda@apple.com>
1826 Terminology change in execCommand command identifiers. Specifically, the name of
1827 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
1828 terminology used by AppKit. It is also more accurate, since the insertion of a
1829 "br" element is what the command does. The inspiration for this change is so the
1830 -insertNewline AppKit method can be mapped to insert a new "div" element in
1831 a document and avoid ambiguity with what the javascript editing command does.
1833 * khtml/editing/jsediting.cpp
1834 * layout-tests/editing/deleting/delete-tab-004.html
1835 * layout-tests/editing/editing.js
1836 * layout-tests/editing/inserting/insert-3654864-fix.html
1837 * layout-tests/editing/inserting/insert-3659587-fix.html
1838 * layout-tests/editing/inserting/insert-3775316-fix.html
1839 * layout-tests/editing/inserting/insert-3800346-fix.html
1840 * layout-tests/editing/inserting/insert-br-001.html
1841 * layout-tests/editing/inserting/insert-br-002.html
1842 * layout-tests/editing/inserting/insert-br-003.html
1843 * layout-tests/editing/inserting/insert-br-004.html
1844 * layout-tests/editing/inserting/insert-br-005.html
1845 * layout-tests/editing/inserting/insert-br-006.html
1846 * layout-tests/editing/inserting/insert-br-007.html
1847 * layout-tests/editing/inserting/insert-br-008.html
1848 * layout-tests/editing/inserting/insert-tab-004.html
1849 * layout-tests/editing/inserting/insert-text-with-newlines.html
1850 * layout-tests/editing/pasteboard/paste-text-010.html
1852 2004-12-02 Ken Kocienda <kocienda@apple.com>
1858 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
1860 * khtml/editing/htmlediting.cpp:
1861 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
1862 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
1863 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
1864 in a block and the document is in quirks mode, add an additional br to make the one in the
1865 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
1866 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
1867 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
1869 2004-12-02 Richard Williamson <rjw@apple.com>
1871 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
1873 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
1874 the b/f cache won't incorrectly trash the previous state when restoring.
1878 * kwq/WebCoreBridge.h:
1879 * kwq/WebCoreBridge.mm:
1880 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
1881 (-[WebCoreBridge canCachePage]):
1882 (-[WebCoreBridge clear]):
1884 2004-12-02 Ken Kocienda <kocienda@apple.com>
1890 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
1892 * khtml/xml/dom2_rangeimpl.cpp:
1893 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
1894 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
1895 of this bug where there is content after the body tag). Did a little code clean up as well.
1896 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
1898 2004-12-02 Ken Kocienda <kocienda@apple.com>
1904 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
1906 * khtml/khtml_part.cpp:
1907 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
1908 to figure out which end of the selection to extend.
1910 2004-12-02 David Harrison <harrison@apple.com>
1912 Reviewed by Ken Kocienda.
1914 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
1915 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
1917 * khtml/editing/visible_text.cpp:
1918 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1919 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
1920 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
1921 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
1922 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
1923 Distinguish BR from whitespace.
1924 * khtml/editing/visible_text.h:
1925 Distinguish BR from whitespace.
1926 * khtml/editing/visible_units.cpp:
1927 (khtml::previousWordBoundary):
1928 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.
1930 2004-12-02 Ken Kocienda <kocienda@apple.com>
1936 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
1938 * khtml/xml/dom_position.cpp:
1939 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
1940 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
1941 exception trying to use a Position returned from this function to set the boundary point of a Range (which
1942 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
1943 contract to return a range-compliant position, hence the need for this fix.
1945 2004-12-01 Ken Kocienda <kocienda@apple.com>
1951 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
1952 regard to other editing commands. The class had a name change ages ago, and it was never
1954 * khtml/editing/htmlediting.h: Ditto.
1956 2004-12-01 Ken Kocienda <kocienda@apple.com>
1960 Some improvements for paste, including some new code to annotate
1961 whitespace when writing to the pasteboard to ensure that the meaning
1962 of the markup on the pasteboard is unambiguous.
1964 There is also new code for reading this annotated markup from the pasteboard,
1965 removing the nodes that were added only to prevent ambiguity.
1967 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
1968 The header should have been added earlier, but I did not do so.
1969 * khtml/editing/html_interchange.cpp: Added.
1970 (convertHTMLTextToInterchangeFormat):
1971 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
1972 * khtml/editing/htmlediting.cpp:
1973 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
1974 Also fixed a bug in the code that counts blocks in a fragment.
1975 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
1976 (khtml::ReplacementFragment::insertNodeBefore): New helper.
1977 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
1978 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
1979 * khtml/editing/htmlediting.h: Add some new declarations.
1980 * khtml/xml/dom2_rangeimpl.cpp:
1981 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
1982 * khtml/xml/dom_nodeimpl.cpp:
1983 (NodeImpl::stringValueForRange): New helper.
1984 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
1985 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
1986 should be added. Called by the paste code.
1987 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
1989 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
1990 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
1991 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
1993 2004-11-30 Chris Blumenberg <cblu@apple.com>
1995 * ChangeLog: removed conflict marker
1997 2004-11-30 Chris Blumenberg <cblu@apple.com>
2000 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
2001 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
2005 * khtml/misc/loader.cpp:
2006 (CachedObject::~CachedObject): release m_allData
2007 (CachedObject::setAllData): new
2008 (Loader::servePendingRequests): connect slotAllData
2009 (Loader::slotAllData): new
2010 (Cache::requestImage): tweak
2011 * khtml/misc/loader.h:
2012 (khtml::CachedObject::CachedObject): set allData to 0
2013 (khtml::CachedObject::allData): new
2014 * kwq/KWQKJobClasses.h:
2015 * kwq/KWQKJobClasses.mm:
2016 (KIO::TransferJob::TransferJob): set m_allData
2017 (KIO::TransferJob::emitAllData): new
2019 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
2020 * kwq/KWQResourceLoader.mm:
2021 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
2023 (KWQSlot::KWQSlot): support for slotAllData
2025 * kwq/WebCoreBridge.h:
2026 * kwq/WebCoreResourceLoader.h:
2028 2004-11-30 Maciej Stachowiak <mjs@apple.com>
2032 2004-11-30 Maciej Stachowiak <mjs@apple.com>
2036 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
2038 * khtml/khtml_part.cpp:
2039 (KHTMLPart::begin): call setParsing on document here after opening
2040 - from now on we'll only set parsing to true for a document open
2041 caused by page loading, not a programmatic one.
2042 * khtml/xml/dom_docimpl.cpp:
2043 (DocumentImpl::open): don't setParsing to true here any more.
2045 2004-11-30 Maciej Stachowiak <mjs@apple.com>
2049 - fix recent regression from collection perf fixes.
2051 * khtml/html/html_miscimpl.cpp:
2052 (HTMLFormCollectionImpl::updateNameCache): Look up the name
2053 attribute in the name cache, not the id cache (d'oh!)
2055 2004-11-30 Darin Adler <darin@apple.com>
2059 - rolled in a KDE fix for a problem that may underlie a number of crashes
2061 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
2062 the KDE guys to fix a subtle problem. Code said "n = n =".
2064 - rolled in a KDE fix for a containingBlock crash
2066 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
2067 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
2070 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
2073 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
2074 (-[KWQButton detachQButton]): Added.
2075 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
2076 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
2077 (-[KWQButton widget]): Added.
2078 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
2079 (-[KWQButton resignFirstResponder]): Ditto.
2080 (-[KWQButton canBecomeKeyView]): Ditto.
2081 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
2082 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
2084 * kwq/KWQComboBox.mm:
2085 (QComboBox::~QComboBox): Call detachQComboBox.
2086 (-[KWQPopUpButtonCell detachQComboBox]): Added.
2087 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
2088 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
2089 (-[KWQPopUpButton action:]): Ditto.
2090 (-[KWQPopUpButton widget]): Tweaked.
2091 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
2092 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
2093 (-[KWQPopUpButton resignFirstResponder]): Ditto.
2094 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
2096 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
2098 * kwq/KWQListBox.mm:
2099 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
2101 * kwq/KWQScrollBar.h: Removed m_scroller field.
2102 * kwq/KWQScrollBar.mm:
2103 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
2104 (-[KWQScrollBar detachQScrollBar]): Added.
2105 (-[KWQScrollBar widget]): Added.
2106 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
2107 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
2108 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
2109 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
2110 (QScrollBar::setKnobProportion): Ditto.
2111 (QScrollBar::scrollbarHit): Ditto.
2113 * kwq/KWQScrollView.mm:
2114 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
2115 hack where we don't remove right away when doing mouse tracking.
2116 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
2117 the hack where we don't add right away when doing mouse tracking.
2119 * kwq/KWQSlider.h: Added destructor.
2121 (-[KWQSlider initWithQSlider:]): Tweaked a little.
2122 (-[KWQSlider detachQSlider]): Added.
2123 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
2124 (-[KWQSlider widget]): Added.
2125 (QSlider::~QSlider): Added. Calls detachQSlider.
2127 * kwq/KWQTextArea.h: Added detachQTextEdit method.
2128 * kwq/KWQTextArea.mm:
2129 (-[KWQTextArea detachQTextEdit]): Added.
2130 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
2131 (-[KWQTextArea becomeFirstResponder]): Ditto.
2132 (-[KWQTextArea nextKeyView]): Ditto.
2133 (-[KWQTextArea previousKeyView]): Ditto.
2134 (-[KWQTextArea drawRect:]): Ditto.
2135 (-[KWQTextAreaTextView insertTab:]): Ditto.
2136 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
2137 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
2138 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
2139 (-[KWQTextAreaTextView mouseDown:]): Ditto.
2140 (-[KWQTextAreaTextView keyDown:]): Ditto.
2141 (-[KWQTextAreaTextView keyUp:]): Ditto.
2143 * kwq/KWQTextEdit.h: Added ~QTextEdit.
2144 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
2146 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
2147 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
2149 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
2150 Added beforeMouseDown and afterMouseDown for use in widget implementations.
2151 Removed unused hasMouseTracking function.
2153 (QWidget::QWidget): Initialize two new fields.
2154 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
2155 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
2156 (QWidget::addToSuperview): Added.
2157 (QWidget::removeFromSuperview): Added.
2158 (QWidget::beforeMouseDown): Added.
2159 (QWidget::afterMouseDown): Added.
2161 * khtml/rendering/render_layer.cpp:
2162 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
2163 (RenderLayer::setHasVerticalScrollbar): Ditto.
2165 2004-11-30 Ken Kocienda <kocienda@apple.com>
2171 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
2173 * khtml/khtml_part.cpp:
2174 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
2175 with no blink if it is.
2177 2004-11-30 Ken Kocienda <kocienda@apple.com>
2183 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
2185 * khtml/khtml_part.cpp:
2186 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
2187 or <input type=image> was checked for focus since these elements are keyboard-focusable,
2188 but not mouse focusable. Also, this function did not work hard enough to set the focused
2189 node, and was content to clear it if the first element checked failed the test, rather
2190 than looking more at parents. This would have the effect of clearing, then resetting the
2191 focus on a DIV containing a button or image with content on either side of it in the
2192 process of arrowing over such content.
2194 2004-11-30 Ken Kocienda <kocienda@apple.com>
2198 * khtml/editing/htmlediting.cpp:
2199 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
2200 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
2201 * khtml/khtml_part.cpp:
2202 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
2203 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
2204 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
2205 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
2206 isCharacterSmartReplaceExempt virtual.
2208 2004-11-30 Ken Kocienda <kocienda@apple.com>
2212 * khtml/editing/htmlediting.cpp:
2213 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
2214 Seemed simple enough to land without review.
2216 2004-11-29 Ken Kocienda <kocienda@apple.com>
2220 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
2221 are handled correctly now, including selections that span multiple blocks, and cases
2222 where content on the pasteboard ends in newlines (or what appear to be newlines to a
2223 user, really block ends or BRs). I also made one small, but important change in the
2224 copy code to annotate the markup written to the pasteboard to support these selections
2227 New header that defines a couple of constants used in copying and pasting.
2229 * ForwardingHeaders/editing/html_interchange.h: Added.
2230 * khtml/editing/html_interchange.h: Added.
2232 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
2233 as a new helper class, ReplacementFragment, which encapsulates information and functions
2234 pertaining to a document fragment that is being inserted into a document.
2236 * khtml/editing/htmlediting.cpp:
2237 (khtml::ReplacementFragment::ReplacementFragment):
2238 (khtml::ReplacementFragment::~ReplacementFragment):
2239 (khtml::ReplacementFragment::firstChild): Simple accessor.
2240 (khtml::ReplacementFragment::lastChild): Ditto.
2241 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
2242 the starting node to use for merging into the block containing the start of the selection.
2243 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
2244 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
2245 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
2246 special annotation comment added in by the copy code.
2247 (khtml::ReplacementFragment::removeNode): Simple helper.
2248 (khtml::isComment): Simple helper.
2249 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
2250 I would like to do better than this some day, but this check will hold us until I can do better.
2251 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
2252 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
2253 (khtml::ReplaceSelectionCommand::doApply):
2254 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
2255 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
2256 (khtml::ReplacementFragment::root):
2257 (khtml::ReplacementFragment::type):
2258 (khtml::ReplacementFragment::isEmpty):
2259 (khtml::ReplacementFragment::isSingleTextNode):
2260 (khtml::ReplacementFragment::isTreeFragment):
2261 (khtml::ReplacementFragment::hasMoreThanOneBlock):
2262 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
2264 This smaller set of changes markup generation to add the newline annotation described in the
2265 comment at the start of this entry.
2267 * khtml/xml/dom2_rangeimpl.cpp:
2268 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
2269 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
2270 comment annotations are added to the markup generated.
2271 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
2272 * kwq/WebCoreBridge.mm:
2273 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
2274 DOM::RangeImpl::toHTML uses annotations when generating.
2278 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
2279 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
2280 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
2281 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
2282 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
2283 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
2284 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
2285 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
2286 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
2287 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
2288 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
2289 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
2290 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
2291 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
2292 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
2293 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
2294 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
2295 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
2297 2004-11-29 Ken Kocienda <kocienda@apple.com>
2299 Reviewed by Harrison
2301 Made two small changes that make it possible for comments to have DOM nodes made for them
2302 when pasting. This relies on some earlier work I did some days ago.
2304 * khtml/xml/dom_nodeimpl.cpp:
2305 (NodeImpl::startMarkup): Get the string from the comment.
2306 * kwq/WebCoreBridge.mm:
2307 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
2308 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
2309 be included in the DOM.
2311 2004-11-29 Ken Kocienda <kocienda@apple.com>
2313 Reviewed by Harrison
2315 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
2316 my improved paste code.
2318 * khtml/editing/visible_position.cpp:
2319 (khtml::blockRelationship)
2320 (khtml::visiblePositionsInDifferentBlocks)
2321 (khtml::isFirstVisiblePositionInBlock)
2322 (khtml::isFirstVisiblePositionInNode)
2323 (khtml::isLastVisiblePositionInBlock)
2324 * khtml/editing/visible_position.h
2326 2004-11-29 Ken Kocienda <kocienda@apple.com>
2328 Reviewed by Harrison
2330 * khtml/xml/dom_position.cpp:
2331 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
2332 specified from obeying that directive. The old code would stop at an outer block boundary in
2333 the case where that block had a block as its first child. The correct behavior is to drill into
2334 that inner block (and continue on drilling down, if possible), to find the correct position.
2336 2004-11-29 Ken Kocienda <kocienda@apple.com>
2338 Reviewed by Harrison
2340 Small improvements to the node-display debugging helpers.
2342 * khtml/xml/dom_nodeimpl.cpp:
2343 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
2344 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
2346 2004-11-29 Ken Kocienda <kocienda@apple.com>
2348 Reviewed by Harrison
2350 * khtml/editing/htmlediting.cpp:
2351 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
2352 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
2353 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
2354 place after the delete.
2356 2004-11-29 Ken Kocienda <kocienda@apple.com>
2358 Reviewed by Harrison
2360 Add a new helper function to insert a paragraph separator. Will be used in my
2361 upcoming paste improvments.
2363 * khtml/editing/htmlediting.cpp: Added function
2364 (khtml::CompositeEditCommand::insertParagraphSeparator)
2365 * khtml/editing/htmlediting.h: Ditto.
2367 2004-11-23 David Harrison <harrison@apple.com>
2369 Added various comments.
2371 * khtml/editing/htmlediting.cpp:
2372 (khtml::StyleChange::init):
2373 (khtml::ApplyStyleCommand::doApply):
2374 (khtml::ApplyStyleCommand::applyBlockStyle):
2375 (khtml::ApplyStyleCommand::applyInlineStyle):
2377 2004-11-23 David Hyatt <hyatt@apple.com>
2379 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
2380 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
2382 * khtml/rendering/render_block.cpp:
2383 (khtml::RenderBlock::nodeAtPoint):
2385 2004-11-22 David Hyatt <hyatt@apple.com>
2387 Make sure you can use document.createElement to make a <canvas> element.
2389 * khtml/xml/dom_docimpl.cpp:
2390 (DocumentImpl::createHTMLElement):
2392 2004-11-22 Maciej Stachowiak <mjs@apple.com>
2396 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
2397 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
2398 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
2399 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
2401 * khtml/ecma/kjs_html.cpp:
2402 (KJS::HTMLDocument::tryGet):
2403 * khtml/html/html_formimpl.cpp:
2404 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
2405 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2406 * khtml/html/html_formimpl.h:
2407 * khtml/html/html_miscimpl.cpp:
2408 (HTMLCollectionImpl::HTMLCollectionImpl):
2409 (HTMLCollectionImpl::~HTMLCollectionImpl):
2410 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
2411 (HTMLCollectionImpl::CollectionInfo::reset):
2412 (HTMLCollectionImpl::resetCollectionInfo):
2413 (HTMLCollectionImpl::checkForNameMatch):
2415 (HTMLCollectionImpl::updateNameCache):
2416 (HTMLCollectionImpl::namedItems):
2417 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
2418 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
2419 (HTMLFormCollectionImpl::item):
2420 (HTMLFormCollectionImpl::updateNameCache):
2421 * khtml/html/html_miscimpl.h:
2423 2004-11-22 David Hyatt <hyatt@apple.com>
2425 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
2430 * khtml/misc/loader.cpp:
2431 (CachedObject::finish):
2434 * khtml/misc/loader.h:
2435 (khtml::Cache::maxCacheableObjectSize):
2437 2004-11-22 David Hyatt <hyatt@apple.com>
2439 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
2440 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
2441 that lets us short circuit earlier when painting and hit testing.
2445 * khtml/khtml_part.cpp:
2446 (KHTMLPart::isPointInsideSelection):
2447 * khtml/rendering/render_block.cpp:
2448 (khtml::RenderBlock::paint):
2449 (khtml::RenderBlock::paintChildren):
2450 (khtml::RenderBlock::paintObject):
2451 (khtml::RenderBlock::paintFloats):
2452 (khtml::RenderBlock::nodeAtPoint):
2453 * khtml/rendering/render_block.h:
2454 * khtml/rendering/render_box.cpp:
2455 (RenderBox::nodeAtPoint):
2456 * khtml/rendering/render_box.h:
2457 * khtml/rendering/render_br.h:
2458 * khtml/rendering/render_canvas.cpp:
2459 (RenderCanvas::paint):
2460 * khtml/rendering/render_flow.cpp:
2461 (RenderFlow::paintLines):
2462 (RenderFlow::hitTestLines):
2463 (RenderFlow::caretRect):
2464 (RenderFlow::addFocusRingRects):
2465 (RenderFlow::paintFocusRing):
2466 (RenderFlow::paintOutlines):
2467 (RenderFlow::paintOutlineForLine):
2468 * khtml/rendering/render_flow.h:
2469 * khtml/rendering/render_frames.cpp:
2470 (RenderFrameSet::nodeAtPoint):
2471 * khtml/rendering/render_frames.h:
2472 * khtml/rendering/render_image.cpp:
2473 (RenderImage::nodeAtPoint):
2474 * khtml/rendering/render_image.h:
2475 * khtml/rendering/render_inline.cpp:
2476 (RenderInline::paint):
2477 (RenderInline::nodeAtPoint):
2478 * khtml/rendering/render_inline.h:
2479 * khtml/rendering/render_layer.cpp:
2480 (RenderLayer::paintLayer):
2481 (RenderLayer::hitTest):
2482 (RenderLayer::hitTestLayer):
2483 * khtml/rendering/render_layer.h:
2484 * khtml/rendering/render_line.cpp:
2485 (khtml::InlineBox::paint):
2486 (khtml::InlineBox::nodeAtPoint):
2487 (khtml::InlineFlowBox::flowObject):
2488 (khtml::InlineFlowBox::nodeAtPoint):
2489 (khtml::InlineFlowBox::paint):
2490 (khtml::InlineFlowBox::paintBackgrounds):
2491 (khtml::InlineFlowBox::paintBackground):
2492 (khtml::InlineFlowBox::paintBackgroundAndBorder):
2493 (khtml::InlineFlowBox::paintDecorations):
2494 (khtml::EllipsisBox::paint):
2495 (khtml::EllipsisBox::nodeAtPoint):
2496 (khtml::RootInlineBox::paintEllipsisBox):
2497 (khtml::RootInlineBox::paint):
2498 (khtml::RootInlineBox::nodeAtPoint):
2499 * khtml/rendering/render_line.h:
2500 (khtml::InlineRunBox::paintBackgroundAndBorder):
2501 * khtml/rendering/render_object.cpp:
2502 (RenderObject::hitTest):
2503 (RenderObject::setInnerNode):
2504 (RenderObject::nodeAtPoint):
2505 * khtml/rendering/render_object.h:
2506 (khtml::RenderObject::PaintInfo::PaintInfo):
2507 (khtml::RenderObject::PaintInfo::~PaintInfo):
2508 (khtml::RenderObject::paintingRootForChildren):
2509 (khtml::RenderObject::shouldPaintWithinRoot):
2510 * khtml/rendering/render_table.cpp:
2511 (RenderTable::layout):
2512 (RenderTable::paint):
2513 * khtml/rendering/render_text.cpp:
2514 (simpleDifferenceBetweenColors):
2515 (correctedTextColor):
2516 (InlineTextBox::nodeAtPoint):
2517 (InlineTextBox::paint):
2518 (InlineTextBox::selectionStartEnd):
2519 (InlineTextBox::paintSelection):
2520 (InlineTextBox::paintMarkedTextBackground):
2521 (InlineTextBox::paintDecoration):
2522 (RenderText::posOfChar):
2523 * khtml/rendering/render_text.h:
2524 (khtml::RenderText::paint):
2525 (khtml::RenderText::layout):
2526 (khtml::RenderText::nodeAtPoint):
2527 * khtml/xml/dom2_eventsimpl.cpp:
2528 (MouseEventImpl::computeLayerPos):
2529 * khtml/xml/dom_docimpl.cpp:
2530 (DocumentImpl::prepareMouseEvent):
2531 * kwq/KWQAccObject.mm:
2532 (-[KWQAccObject accessibilityHitTest:]):
2533 * kwq/KWQKHTMLPart.mm:
2534 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
2535 (KWQKHTMLPart::eventMayStartDrag):
2536 (KWQKHTMLPart::khtmlMouseMoveEvent):
2537 * kwq/WebCoreBridge.mm:
2538 (-[WebCoreBridge elementAtPoint:]):
2539 (-[WebCoreBridge _positionForPoint:]):
2541 2004-11-22 Maciej Stachowiak <mjs@apple.com>
2545 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
2546 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
2548 This avoids the O(N^2) penalty for named item traversal for form collections.
2550 It also combines the item traversal logic for all non-form
2551 collection operations into a single traverseNextItem
2552 function. This avoids having 5 copies of the big switch statement
2555 Also fixed a bug that prevented the last form element from being removed properly.
2557 * khtml/html/html_formimpl.cpp:
2558 (DOM::removeFromVector):
2559 * khtml/dom/html_misc.cpp:
2560 (HTMLCollection::namedItems):
2561 * khtml/dom/html_misc.h:
2562 * khtml/ecma/kjs_html.cpp:
2563 (KJS::HTMLCollection::getNamedItems):
2564 * khtml/html/html_miscimpl.cpp:
2565 (HTMLCollectionImpl::traverseNextItem):
2566 (HTMLCollectionImpl::calcLength):
2567 (HTMLCollectionImpl::length):
2568 (HTMLCollectionImpl::item):
2569 (HTMLCollectionImpl::nextItem):
2570 (HTMLCollectionImpl::checkForNameMatch):
2571 (HTMLCollectionImpl::namedItem):
2572 (HTMLCollectionImpl::namedItems):
2573 (HTMLCollectionImpl::nextNamedItem):
2574 (HTMLFormCollectionImpl::calcLength):
2575 (HTMLFormCollectionImpl::namedItem):
2576 (HTMLFormCollectionImpl::nextNamedItem):
2577 (HTMLFormCollectionImpl::namedItems):
2578 * khtml/html/html_miscimpl.h:
2580 2004-11-22 Ken Kocienda <kocienda@apple.com>
2582 Reviewed by Harrison
2584 Change around the way we block the Javascript "Paste" command identifier from
2585 being available. Formerly, this was done with an ifdef we never compiled in.
2586 Now, this is done with a couple of cheap runtime checks. The advantage is that
2587 we can now compile this command into development builds, and still yet switch
2588 on the command in deployment builds through the use of WebCore SPI so we can
2589 write and run layout tests with all of our builds.
2591 * khtml/editing/jsediting.cpp:
2592 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
2593 command being queried is the paste command.
2594 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
2595 * khtml/editing/jsediting.h: Ditto.
2596 * khtml/khtml_part.cpp:
2597 (KHTMLPart::pasteFromPasteboard): Added.
2598 (KHTMLPart::canPaste): Added.
2599 * kwq/KWQKHTMLPart.mm:
2600 (KHTMLPart::canPaste): Added.
2601 * kwq/KWQRenderTreeDebug.cpp:
2602 (externalRepresentation): Turn on paste command.
2603 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
2605 2004-11-21 Maciej Stachowiak <mjs@apple.com>
2607 Reviewed by Richard.
2609 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
2611 * khtml/html/html_miscimpl.cpp:
2612 (HTMLCollectionImpl::calcLength):
2613 (HTMLCollectionImpl::getItem):
2614 (HTMLCollectionImpl::item):
2615 (HTMLCollectionImpl::nextItem):
2616 (HTMLCollectionImpl::getNamedItem):
2617 (HTMLCollectionImpl::namedItem):
2618 (HTMLCollectionImpl::nextNamedItemInternal):
2619 (HTMLFormCollectionImpl::nextNamedItemInternal):
2621 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2625 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
2626 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
2627 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
2629 Many optimizations to HTMLFormCollection. Iterating it should not
2630 be N^2 any more, though finding items by name could still be.
2632 * khtml/html/html_formimpl.cpp:
2633 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2634 (DOM::HTMLFormElementImpl::length):
2635 (DOM::HTMLFormElementImpl::submitClick):
2636 (DOM::HTMLFormElementImpl::formData):
2637 (DOM::HTMLFormElementImpl::submit):
2638 (DOM::HTMLFormElementImpl::reset):
2639 (DOM::HTMLFormElementImpl::radioClicked):
2640 (DOM::appendToVector):
2641 (DOM::removeFromVector):
2642 (DOM::HTMLFormElementImpl::registerFormElement):
2643 (DOM::HTMLFormElementImpl::removeFormElement):
2644 (DOM::HTMLFormElementImpl::makeFormElementDormant):
2645 (DOM::HTMLFormElementImpl::registerImgElement):
2646 (DOM::HTMLFormElementImpl::removeImgElement):
2647 * khtml/html/html_formimpl.h:
2648 * khtml/html/html_miscimpl.cpp:
2649 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
2650 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
2651 (HTMLFormCollectionImpl::resetCollectionInfo):
2652 (HTMLFormCollectionImpl::calcLength):
2653 (HTMLFormCollectionImpl::item):
2654 (HTMLFormCollectionImpl::getNamedItem):
2655 (HTMLFormCollectionImpl::getNamedFormItem):
2656 (HTMLFormCollectionImpl::firstItem):
2657 (HTMLFormCollectionImpl::nextItem):
2658 * khtml/html/html_miscimpl.h:
2659 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
2660 * khtml/xml/dom_elementimpl.cpp:
2661 (ElementImpl::setAttribute):
2662 (ElementImpl::setAttributeMap):
2663 * kwq/KWQPtrVector.h:
2664 (QPtrVector::findRef):
2665 * kwq/KWQVectorImpl.h:
2666 * kwq/KWQVectorImpl.mm:
2667 (KWQVectorImpl::findRef):
2668 * kwq/WebCoreBridge.mm:
2669 (-[WebCoreBridge elementWithName:inForm:]):
2670 (-[WebCoreBridge controlsInForm:]):
2672 2004-11-19 David Harrison <harrison@apple.com>
2674 Reviewed by Ken and Darin.
2676 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
2678 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
2679 for the existing style, but in this case (hitting cmd-B with caret at top of
2680 file) there is nothing upstream. Changed this to use the VisiblePosition
2681 deepEquivalent instead.
2683 * khtml/khtml_part.cpp:
2684 (KHTMLPart::computeAndSetTypingStyle):
2688 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2692 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
2694 * khtml/xml/dom_docimpl.cpp:
2695 (DocumentImpl::close): Don't fire the onload handler if there is a
2696 redirect pending. This is a very long-standing bug that was masked
2697 by our previously incorrect redirect logic. It used to be that an
2698 older redirect would always win. Recently we changed things so
2699 that a newer redirect would win, but a script that causes a
2700 redirect would stop parsing once complete (so if there are two
2701 redirects in the same script, the latter wins). However, we should
2702 have also prevented onload in this case. Testing with other
2703 browsers shows that onload handlers do not run at all when there
2704 is a pending redirect.
2706 2004-11-19 Ken Kocienda <kocienda@apple.com>
2708 Reviewed by Harrison
2710 Fix some object lifetime issues in these two commands. This fixes some crashes
2711 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
2713 * khtml/editing/htmlediting.cpp:
2714 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
2715 in the ancestor list. They are not ref'ed when put on list. D'uh.
2716 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
2717 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
2718 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
2720 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
2722 2004-11-19 Ken Kocienda <kocienda@apple.com>
2724 Reviewed by Harrison
2728 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
2730 * khtml/khtml_part.cpp:
2731 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
2732 declaration given the current selection, and then sets the minimum necessary style as the typing
2734 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
2735 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
2737 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
2738 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
2739 * kwq/WebCoreBridge.mm:
2740 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
2741 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
2743 2004-11-18 David Harrison <harrison@apple.com>
2747 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
2748 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
2751 (-[DOMCSSStyleDeclaration setProperty:::]):
2753 2004-11-18 Chris Blumenberg <cblu@apple.com>
2755 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
2759 * kwq/KWQKHTMLPart.mm:
2760 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
2762 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2766 - fix recursive item traversal, use traverseNextNode() instead of
2767 the buggy hand-rolled traversal.
2769 * khtml/xml/dom_nodeimpl.cpp:
2770 (NodeListImpl::recursiveItem):
2772 2004-11-17 Darin Adler <darin@apple.com>
2776 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
2778 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
2779 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
2781 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
2782 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
2783 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
2784 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
2785 an entire category of leaks we have been fixing one by one recently
2786 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
2787 stale RenderObject pointer, although I never saw it do that in practice
2788 - implemented the length and item methods for computed styles
2789 - implemented querying additional properties in computed styles (29 more)
2791 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
2792 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
2793 take a mutable style.
2794 * khtml/khtml_part.cpp:
2795 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
2796 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
2797 a computed style; also change some types to mutable style.
2798 (updateState): Update iteration of CSSProperty objects in a style declaration to use
2799 the new valuesIterator interface.
2800 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
2801 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
2802 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
2803 including accomodating the exception code that setCssText has now.
2804 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
2805 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
2806 the style attributes really was a change, although it's not an important optimization it's
2807 good to do it right.
2809 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
2810 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
2811 calling it were already removing the old property explicitly, so the code in here to remove
2812 the property again was redundant.
2814 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
2815 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
2816 * khtml/css/css_computedstyle.cpp:
2817 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
2818 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
2819 Before we had no guarantee the object would outlast us.
2820 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
2821 exception to NO_MODIFICATION_ALLOWED_ERR.
2822 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
2823 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
2824 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
2825 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
2826 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
2827 page-break-inside, position, unicode-bidi, widows, z-index.
2828 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
2829 exception to NO_MODIFICATION_ALLOWED_ERR.
2830 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
2831 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
2832 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
2833 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
2834 CSSMutableStyleDeclarationImpl.
2835 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
2836 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
2838 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
2839 now a separate class rather than a typedef.
2840 * khtml/css/cssparser.h: Ditto.
2842 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
2843 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
2844 Removed a bunch of redundant stuff from other classes in this file too.
2845 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
2846 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
2847 (DOM::CSSProperty::operator=): Added.
2848 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
2850 * khtml/css/css_valueimpl.cpp:
2851 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
2852 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
2853 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
2854 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
2855 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
2856 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
2857 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
2858 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
2859 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
2860 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
2861 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
2862 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
2863 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
2864 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
2865 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
2866 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
2867 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
2868 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
2869 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
2870 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
2871 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
2872 no styles in the list. Update to use QValueList.
2873 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
2874 parameter and set it.
2875 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
2876 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
2877 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
2878 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
2879 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
2880 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
2882 * khtml/css/cssparser.cpp:
2883 (CSSParser::parseValue): Changed to use addParsedProperties.
2884 (CSSParser::parseDeclaration): Ditto.
2885 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
2887 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
2888 * khtml/css/cssproperties.c: Regenerated.
2889 * khtml/css/cssproperties.h: Regenerated.
2891 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
2892 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
2894 * khtml/dom/css_value.cpp:
2895 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
2896 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
2897 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
2898 first doing getPropertyCSSValue and then doing cssText.
2899 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
2900 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
2901 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
2902 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
2903 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
2904 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
2905 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
2907 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
2908 * khtml/dom/dom_node.cpp: Ditto.
2910 * khtml/editing/htmlediting.h: Change some types to mutable style.
2911 * khtml/editing/htmlediting.cpp:
2912 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
2913 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
2914 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
2915 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
2916 (khtml::EditCommand::setTypingStyle): Ditto.
2917 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
2918 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
2919 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
2920 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
2921 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
2922 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
2923 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
2924 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2925 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
2926 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
2927 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
2928 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
2929 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
2931 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
2932 * khtml/html/html_baseimpl.h: Change type to mutable style.
2933 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
2935 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
2936 class as a base class, and change types to mutable style as needed.
2937 * khtml/html/html_elementimpl.cpp:
2938 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
2939 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
2940 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
2941 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
2942 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
2943 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
2945 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
2948 * khtml/html/html_tableimpl.h: Change types to mutable style.
2949 * khtml/html/html_tableimpl.cpp:
2950 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2951 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
2952 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2954 * khtml/html/htmlparser.cpp:
2955 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
2956 than using an explicit delete to make the node go away, and is required for compatibility with the
2957 changes to the NodeImpl functions.
2958 (KHTMLParser::insertNode): Ditto.
2959 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
2960 the NodeImpl functions.
2962 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
2963 now that there's no need to make the property list explictly.
2966 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
2967 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
2968 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
2970 * khtml/xml/dom_nodeimpl.cpp:
2971 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
2972 function succeeded or not for ownership purposes.
2973 (NodeImpl::replaceChild): Ditto.
2974 (NodeImpl::appendChild): Ditto.
2975 (NodeBaseImpl::insertBefore): Ditto.
2976 (NodeBaseImpl::replaceChild): Ditto.
2977 (NodeBaseImpl::appendChild): Ditto.
2978 (NodeBaseImpl::addChild): Ditto.
2980 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
2981 * WebCore-combined.exp: Regenerated.
2983 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2985 still even more build fixing
2987 * khtml/html/html_miscimpl.cpp:
2988 (HTMLCollectionImpl::resetCollectionInfo):
2990 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2994 * khtml/html/html_miscimpl.cpp:
2995 (HTMLCollectionImpl::resetCollectionInfo):
2997 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2999 Fixed build problem.
3001 * khtml/html/html_miscimpl.h:
3002 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
3004 2004-11-18 Maciej Stachowiak <mjs@apple.com>
3008 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
3010 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
3011 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
3013 This is also a start on fixing 5 other bugs, but those need additional work to make
3014 HTMLFormCollection fast.
3016 * khtml/html/html_documentimpl.h:
3017 (DOM::HTMLDocumentImpl::collectionInfo):
3018 * khtml/html/html_formimpl.cpp:
3019 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
3020 (DOM::HTMLFormElementImpl::isURLAttribute):
3021 (DOM::HTMLFormElementImpl::registerImgElement):
3022 (DOM::HTMLFormElementImpl::removeImgElement):
3023 * khtml/html/html_formimpl.h:
3024 * khtml/html/html_imageimpl.cpp:
3025 (HTMLImageElementImpl::HTMLImageElementImpl):
3026 (HTMLImageElementImpl::~HTMLImageElementImpl):
3027 * khtml/html/html_imageimpl.h:
3028 * khtml/html/html_miscimpl.cpp:
3029 (HTMLCollectionImpl::HTMLCollectionImpl):
3030 (HTMLCollectionImpl::~HTMLCollectionImpl):
3031 (HTMLCollectionImpl::updateCollectionInfo):
3032 (HTMLCollectionImpl::length):
3033 (HTMLCollectionImpl::item):
3034 (HTMLCollectionImpl::firstItem):
3035 (HTMLCollectionImpl::nextItem):
3036 (HTMLCollectionImpl::namedItem):
3037 (HTMLCollectionImpl::nextNamedItemInternal):
3038 (HTMLFormCollectionImpl::getNamedFormItem):
3039 * khtml/html/html_miscimpl.h:
3040 (DOM::HTMLCollectionImpl::):
3041 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
3042 * khtml/html/htmlparser.cpp:
3043 (KHTMLParser::getElement):
3044 * khtml/xml/dom_docimpl.cpp:
3045 (DocumentImpl::DocumentImpl):
3046 * khtml/xml/dom_docimpl.h:
3047 (DOM::DocumentImpl::incDOMTreeVersion):
3048 (DOM::DocumentImpl::domTreeVersion):
3049 * khtml/xml/dom_nodeimpl.cpp:
3053 2004-11-18 Kevin Decker <kdecker@apple.com>
3057 fixed: <rdar://problem/3841842> getPropertyID expensive
3060 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
3062 2004-11-17 David Hyatt <hyatt@apple.com>
3064 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
3065 and subsequently backed out).
3067 Reviewed by kocienda
3069 * khtml/html/html_baseimpl.cpp:
3070 (HTMLBodyElementImpl::insertedIntoDocument):
3071 * khtml/html/htmltokenizer.cpp:
3072 (khtml::HTMLTokenizer::reset):
3073 (khtml::HTMLTokenizer::scriptHandler):
3074 (khtml::HTMLTokenizer::scriptExecution):
3075 (khtml::HTMLTokenizer::write):
3076 (khtml::HTMLTokenizer::continueProcessing):
3077 (khtml::HTMLTokenizer::timerEvent):
3078 (khtml::HTMLTokenizer::notifyFinished):
3079 * khtml/html/htmltokenizer.h:
3080 * khtml/khtmlview.cpp:
3081 (KHTMLViewPrivate::KHTMLViewPrivate):
3082 (KHTMLViewPrivate::reset):
3084 (KHTMLView::layout):
3085 (KHTMLView::timerEvent):
3086 (KHTMLView::scheduleRelayout):
3087 (KHTMLView::layoutPending):
3088 (KHTMLView::haveDelayedLayoutScheduled):
3089 (KHTMLView::unscheduleRelayout):
3090 * khtml/khtmlview.h:
3091 * khtml/xml/dom_docimpl.cpp:
3092 (DocumentImpl::DocumentImpl):
3093 (DocumentImpl::close):
3094 (DocumentImpl::setParsing):
3095 (DocumentImpl::shouldScheduleLayout):
3096 (DocumentImpl::minimumLayoutDelay):
3097 (DocumentImpl::write):
3098 (DocumentImpl::finishParsing):
3099 (DocumentImpl::stylesheetLoaded):
3100 (DocumentImpl::updateStyleSelector):
3101 * khtml/xml/dom_docimpl.h:
3102 (DOM::DocumentImpl::parsing):
3103 * kwq/KWQDateTime.mm:
3104 (KWQUIEventTime::uiEventPending):
3106 2004-11-17 David Harrison <harrison@apple.com>
3108 Reviewed by Ken Kocienda.
3110 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
3111 Treat null case as meaning no post-move merge is needed.
3113 * khtml/editing/htmlediting.cpp:
3114 (khtml::DeleteSelectionCommand::initializePositionData):
3116 2004-11-17 David Harrison <harrison@apple.com>
3118 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
3119 * khtml/xml/dom_nodeimpl.cpp:
3120 (NodeImpl::displayNode):
3121 (NodeImpl::displayTree):
3122 (NodeBaseImpl::dispatchChildRemovalEvents):
3123 * khtml/xml/dom_nodeimpl.h:
3125 2004-11-16 John Sullivan <sullivan@apple.com>
3127 Reviewed by Richard.
3129 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
3131 * khtml/khtml_part.cpp:
3133 delete the list we created when we're done with it
3135 2004-11-16 Ken Kocienda <kocienda@apple.com>
3139 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
3140 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
3141 QPtrList when the list goes out of scope.
3143 * khtml/editing/htmlediting.cpp:
3144 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
3145 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
3146 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
3147 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
3148 No longer set lists to autodelete.
3149 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
3150 Call new derefNodesInList helper.
3151 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
3152 of one before, but now it does.
3154 2004-11-15 David Harrison <harrison@apple.com>
3156 Reviewed by Chris and Darin.
3158 <rdar://problem/3880304> Non-linear performance hit for style changes
3160 * khtml/xml/dom_nodeimpl.cpp:
3161 (NodeImpl::traverseNextNode):
3162 (NodeImpl::traverseNextSibling):
3163 (NodeImpl::traversePreviousNodePostOrder):
3164 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
3165 Add asserts that stayWithin is an ancestor of the returned node.
3167 2004-11-15 Darin Adler <darin@apple.com>
3171 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
3173 * khtml/css/css_computedstyle.cpp:
3174 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
3175 since there's no guarantee it's already ref'd.
3176 * khtml/css/css_valueimpl.cpp:
3177 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
3178 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
3179 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
3180 (CSSStyleDeclarationImpl::merge): Ditto.
3181 (CSSStyleDeclarationImpl::diff): Ditto.
3182 * khtml/editing/htmlediting.cpp:
3183 (khtml::StyleChange::currentlyHasStyle): Ditto.
3184 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
3185 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
3186 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
3188 2004-11-15 Darin Adler <darin@apple.com>
3192 Use separate mutable style and computed style types as appropriate.
3193 For now this should have no effect, but it prepares us for refactoring later.
3194 Also remove some unnecessary "DOM::" prefixes and in one case factor out
3197 * khtml/khtml_part.cpp:
3198 (KHTMLPart::typingStyle):
3199 (KHTMLPart::setTypingStyle):
3201 (KHTMLPart::selectionHasStyle):
3202 (KHTMLPart::selectionStartHasStyle):
3203 (KHTMLPart::selectionComputedStyle):
3204 * khtml/khtml_part.h:
3205 * khtml/khtmlpart_p.h:
3207 * khtml/css/css_base.h:
3208 * khtml/css/css_ruleimpl.cpp:
3209 (CSSStyleRuleImpl::setDeclaration):
3210 * khtml/css/css_ruleimpl.h:
3211 (DOM::CSSFontFaceRuleImpl::style):
3212 (DOM::CSSPageRuleImpl::style):
3213 (DOM::CSSStyleRuleImpl::style):
3214 (DOM::CSSStyleRuleImpl::declaration):
3215 * khtml/css/css_valueimpl.h:
3216 (DOM::CSSPrimitiveValueImpl::):
3217 * khtml/css/cssparser.cpp:
3218 (CSSParser::parseValue):
3219 (CSSParser::parseColor):
3220 (CSSParser::parseDeclaration):
3221 (CSSParser::createStyleDeclaration):
3222 * khtml/css/cssparser.h:
3223 * khtml/css/cssstyleselector.cpp:
3224 (khtml::CSSStyleSelector::addMatchedDeclaration):
3225 (khtml::CSSStyleSelector::matchRulesForList):
3226 (khtml::CSSStyleSelector::styleForElement):
3227 (khtml::CSSStyleSelector::applyDeclarations):
3228 * khtml/css/cssstyleselector.h:
3229 * khtml/css/parser.cpp:
3230 * khtml/css/parser.y:
3231 * khtml/dom/css_rule.h:
3232 * khtml/dom/css_stylesheet.h:
3233 * khtml/dom/css_value.h:
3234 * khtml/dom/dom2_views.cpp:
3235 * khtml/xml/dom2_viewsimpl.cpp:
3236 (DOM::AbstractViewImpl::getComputedStyle):
3237 * khtml/xml/dom_docimpl.cpp:
3238 (DocumentImpl::importNode):
3239 (DocumentImpl::setStyleSheet):
3240 * khtml/xml/dom_docimpl.h:
3241 * khtml/xml/dom_xmlimpl.cpp:
3242 (DOM::ProcessingInstructionImpl::setStyleSheet):
3243 * khtml/xml/dom_xmlimpl.h:
3245 * khtml/dom/css_value.cpp:
3246 (DOM::throwException): Added.
3247 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
3248 The real thing is coming with the next change to refactor.
3249 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
3250 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
3252 2004-11-15 Darin Adler <darin@apple.com>
3256 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
3258 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
3259 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
3260 node's attributes changed without sending a misleading childrenChanged call,
3261 but the childrenChanged call can happen at the exact right moment.
3262 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
3263 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
3264 the boolean true is passed in.
3266 * khtml/xml/dom_elementimpl.cpp:
3267 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
3268 (NamedAttrMapImpl::removeAttribute): Ditto.
3270 2004-11-15 John Sullivan <sullivan@apple.com>
3274 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
3275 seen often in Mail and Blot
3277 * khtml/css/css_valueimpl.cpp:
3278 (CSSStyleDeclarationImpl::copyPropertiesInSet):
3279 delete temporary list after we're done using it
3281 2004-11-15 Richard Williamson <rjw@apple.com>
3283 Fixed leak (3879883) that John found. Early return leaked
3288 * khtml/css/css_computedstyle.cpp:
3289 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3291 2004-11-15 Ken Kocienda <kocienda@apple.com>
3297 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
3299 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
3300 EditCommandPtr to its parent, but this caused a a reference cycle in composite
3301 commands as the children held a ref to their parent. Now, the parent variable
3302 is a non-retained reference to an EditCommand *. It would be nice to have a
3303 weak reference to the parent or even override deref in composite commands (but I
3304 can't since deref() is not virtual). However, this should be OK since any
3305 dangling parent pointer is a sign of a bigger object lifetime problem that
3306 would need to be addressed anyway.
3308 * khtml/css/css_valueimpl.cpp:
3309 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
3310 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
3311 just assigning the list variable passed in to the local list variable, or the list will be
3313 * khtml/editing/htmlediting.cpp:
3314 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
3315 (khtml::EditCommand::setEndingSelection): Ditto.
3316 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
3317 Unrelated to the change, but saves some ref's and deref's.
3318 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
3319 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
3320 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
3321 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
3323 2004-11-15 Maciej Stachowiak <mjs@apple.com>