3 2004-12-20 Ken Kocienda <kocienda@apple.com>
7 * khtml/editing/htmlediting.cpp:
8 (khtml::DeleteSelectionCommand::moveNodesAfterNode): My one-liner for this bug introduced layout test
9 regressions: <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
10 Rolling out until I can develop a real fix.
12 2004-12-20 David Harrison <harrison@apple.com>
14 Reviewed by Dave Hyatt.
16 Initial checkin of AXTextMarkerRef support.
18 * khtml/xml/dom_docimpl.cpp:
19 (DocumentImpl::updateSelection):
20 (DocumentImpl::setFocusNode):
22 * kwq/KWQAccObject.mm:
23 (-[KWQAccObject detach]):
24 (-[KWQAccObject anchorElement]):
25 (-[KWQAccObject addChildrenToArray:]):
26 (-[KWQAccObject accessibilityAttributeNames]):
27 (-[KWQAccObject accessibilityActionDescription:]):
28 (-[KWQAccObject accessibilityPerformAction:]):
29 (-[KWQAccObject textMarkerRangeFromMarkers:andEndMarker:]):
30 (-[KWQAccObject textMarkerForVisiblePosition:]):
31 (-[KWQAccObject visiblePositionForTextMarker:]):
32 (-[KWQAccObject AXTextMarkerRangeCopyStartMarkerWrapper:]):
33 (-[KWQAccObject AXTextMarkerRangeCopyEndMarkerWrapper:]):
34 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
35 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
36 (-[KWQAccObject accessibilityAttributeValue:]):
37 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
38 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
39 (-[KWQAccObject getSelectedTextMarkerRange]):
40 (-[KWQAccObject doAXLineForTextMarker:]):
41 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
42 (-[KWQAccObject doAXStringForTextMarkerRange:]):
43 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
44 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
45 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
46 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
47 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
48 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
49 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
50 (-[KWQAccObject accessibilityFocusedUIElement]):
51 (-[KWQAccObject clearChildren]):
52 (-[KWQAccObject accObjectID]):
53 (-[KWQAccObject setAccObjectID:]):
54 (-[KWQAccObject removeAccObjectID]):
55 * kwq/KWQAccObjectCache.h:
56 * kwq/KWQAccObjectCache.mm:
57 (KWQAccObjectCache::KWQAccObjectCache):
58 (KWQAccObjectCache::~KWQAccObjectCache):
59 (KWQAccObjectCache::getAccObjectID):
60 (KWQAccObjectCache::removeAccObjectID):
61 (KWQAccObjectCache::textMarkerForVisiblePosition):
62 (KWQAccObjectCache::visiblePositionForTextMarker):
64 2004-12-19 Darin Adler <darin@apple.com>
66 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added nil check.
68 2004-12-19 Darin Adler <darin@apple.com>
72 - a garbage collection fix
74 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added a more-extensive comment and fixed the BUILDING_ON_PANTHER
75 #ifndef to use #if (in practice, either is OK).
76 * kwq/KWQKURL.mm: (KURL::getNSURL): Use KWQCFAutorelease instead of autorelease.
78 2004-12-17 David Hyatt <hyatt@apple.com>
80 Fix for 3923255, specified percentage heights of divs with overflow auto inside tables not honored.
84 * khtml/rendering/render_box.cpp:
85 (RenderBox::calcPercentageHeight):
86 * khtml/rendering/render_table.cpp:
87 (RenderTableSection::layoutRows):
89 2004-12-17 David Harrison <harrison@apple.com>
91 Reviewed by Ken Kocienda.
93 <rdar://problem/3924930> REGRESSION: triple click does not select to end of line
95 * khtml/editing/visible_units.cpp:
96 (khtml::endOfParagraph):
97 When includeLineBreak is true, allow traversal to next node after enclosingBlockFlowElement.
99 2004-12-17 Ken Kocienda <kocienda@apple.com>
103 * khtml/editing/htmlediting.cpp:
104 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Missed deleting some now-obsolete expcetion
105 codes when I added the createBreakElement() function.
107 2004-12-17 Richard Williamson <rjw@apple.com>
109 Set the floor of max cacheable object size to 40K. This restores
110 the long standing floor. Lower floor deleteriously impacts the PLT.
113 * khtml/khtml_part.cpp:
114 (KHTMLPart::checkCompleted):
115 * khtml/misc/loader.cpp:
118 2004-12-17 Ken Kocienda <kocienda@apple.com>
124 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
126 * khtml/editing/htmlediting.cpp:
127 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Stop merging nodes when a <br> is hit.
128 Formerly checked only for block boundary.
130 2004-12-17 David Harrison <harrison@apple.com>
134 Add KWQCFAutorelease for autoreleasing CF objects.
135 * kwq/KWQFoundationExtras.h:
139 2004-12-17 David Harrison <harrison@apple.com>
143 Fix GC compatibility in getNSString.
146 (QString::getNSString):
147 Use NSString allocator instead of CFString, so that autorelease works under GC.
149 2004-12-17 Ken Kocienda <kocienda@apple.com>
155 <rdar://problem/3890973> REGRESSION (Mail): Deleting reorders remaining text
157 * khtml/editing/htmlediting.cpp:
158 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Added check to ensure that moving content will not
159 move it after the <body> element.
161 2004-12-17 Ken Kocienda <kocienda@apple.com>
165 Added new layout tests covering cases from recent bug fixes.
167 * layout-tests/editing/inserting/insert-div-018-expected.txt: Added.
168 * layout-tests/editing/inserting/insert-div-018.html: Added.
169 * layout-tests/editing/inserting/insert-div-019-expected.txt: Added.
170 * layout-tests/editing/inserting/insert-div-019.html: Added.
171 * layout-tests/editing/inserting/insert-div-020-expected.txt: Added.
172 * layout-tests/editing/inserting/insert-div-020.html: Added.
173 * layout-tests/editing/inserting/insert-div-021-expected.txt: Added.
174 * layout-tests/editing/inserting/insert-div-021.html: Added.
176 2004-12-17 Ken Kocienda <kocienda@apple.com>
180 Changes in layout resulting from giving <p> elements no margin rather than 0.1em margin.
182 * layout-tests/editing/inserting/insert-div-013-expected.txt
183 * layout-tests/editing/inserting/insert-div-014-expected.txt
185 2004-12-17 Ken Kocienda <kocienda@apple.com>
191 <rdar://problem/3925317> Increase quote in email and with cursor below the quote the new line appears above the quote
193 * khtml/editing/htmlediting.cpp:
194 (khtml::InsertParagraphSeparatorCommand::doApply):
195 * khtml/editing/visible_position.cpp: Refine rules for whether to use the starting node or the starting
196 block as the reference node for the insertion of the new block.
197 (khtml::isLastVisiblePositionInBlock): Tweak rules again. Descendants of following blocks should answer true.
198 I worked this all out on the whiteboard this time. This should be the last tweak.
200 2004-12-17 Kevin Decker <kdecker@apple.com>
204 Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs
206 * khtml/xml/xml_tokenizer.cpp:
207 (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.
209 2004-12-16 Ken Kocienda <kocienda@apple.com>
215 <rdar://problem/3924888> REGRESSION (Mail): Hitting return key at end of line does not insert visible newline
217 * khtml/editing/htmlediting.cpp:
218 (khtml::InsertParagraphSeparatorCommand::doApply): Tweaked code I added just before to fix 3924486, so that
219 it checks the downstream node for the starting position.
221 2004-12-16 Ken Kocienda <kocienda@apple.com>
225 Added new createBreakElement() function that makes creating a <br> element a one-liner.
226 Converted all the code that used to call the DocumentImpl, and dealt with the exceptionCode,
227 over to this new helper.
229 * khtml/editing/htmlediting.cpp:
230 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Now uses new helper function.
231 (khtml::InsertLineBreakCommand::doApply): Ditto.
232 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
233 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
234 (khtml::ReplaceSelectionCommand::doApply): Ditto.
235 (khtml::createBreakElement): New helper.
236 * khtml/editing/htmlediting.h: Ditto.
238 2004-12-16 David Hyatt <hyatt@apple.com>
240 Fix a bug where vertical-align values that depended on their parent's value went crazy if the parent was
241 vertical-align top or bottom. The bug is 3771007, bankofamerica's ebills page.
245 * khtml/rendering/render_object.cpp:
246 (RenderObject::getVerticalPosition):
248 2004-12-16 Ken Kocienda <kocienda@apple.com>
254 <rdar://problem/3924486> REGRESSION (Mail): Hitting return key does not insert visible newline
255 <rdar://problem/3924579> REGRESSION (Mail): After deleting, hitting return key does not insert visible newline
257 * khtml/editing/htmlediting.cpp:
258 (khtml::InsertParagraphSeparatorCommand::doApply): For the first bug, detect when inserting a <p> will
259 make a visible <br> collapse. For the second bug, move the code that inserts the new <p> after
260 a check which may move the node used as the reference node for the insertion. Also change this code to
261 insert the <p> after the last sibling of the starting position, to move it past the nodes we're going
262 to want to shift into the new <p>.
264 2004-12-16 Darin Adler <darin@apple.com>
268 - use <p> elements rather than <br> when pasting plain text; also use margin of 0 rather than 0.1 em
269 after talking this over with Dave and Ken
271 * khtml/editing/htmlediting.h: Added createDefaultParagraphElement and createBlockPlaceholderElement.
272 * khtml/editing/htmlediting.cpp:
273 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Use new createBlockPlaceholderElement
274 helper so this can share code with the plain-text conversion code.
275 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): Use new createDefaultParagraphElement
276 helper so this can share code with the plain-text conversion code.
277 (khtml::createDefaultParagraphElement): Added.
278 (khtml::createBlockPlaceholderElement): Added.
280 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Use paragraphs rather than
281 <br> elements for pasting plain text.
283 - regenerated these files with the newer gperf
285 * khtml/css/cssproperties.c: Regenerated.
286 * khtml/css/cssvalues.c: Regenerated.
287 * khtml/misc/htmlattrs.c: Regenerated.
288 * khtml/misc/htmltags.c: Regenerated.
290 2004-12-16 Ken Kocienda <kocienda@apple.com>
296 <rdar://problem/3924291> REGRESSION (Mail): Crash deleting content following a <p> element
298 * khtml/xml/dom_nodeimpl.cpp:
299 (NodeImpl::enclosingInlineElement): Fixed problem in this function where recursive search for
300 parent that is not an inline would skip past previous siblings of nodes which were blocks. Now
301 it stops looking in this situation. This problem eventually caused the delete code to try to
302 merge a node under a descendent.
304 2004-12-16 Adele Amchan <adele@apple.com>
306 Change by Richard, reviewed by me.
308 Fix for: <rdar://problem/3923983> background image decoding prevents page with 0Kb image from finishing to load
310 * khtml/misc/loader.cpp: (CachedImage::data): Added call to notifyFinished so the 0Kb image case finishes loading.
312 2004-12-16 Adele Amchan <adele@apple.com>
316 Fix for: <rdar://problem/3534824> VIP: some navigation links on safeway.com don't work due to a JavaScript quirk
318 Added a call to ObjectImp::get before Window::get just returns Undefined.
319 This was preventing us from getting the toString function from a Window object.
321 * khtml/ecma/kjs_window.cpp: (Window::get):
323 2004-12-16 Ken Kocienda <kocienda@apple.com>
329 <rdar://problem/3918351> REGRESSION (Mail, 173-175+): Return before first char of line leaves insertion point in wrong place
331 * khtml/editing/htmlediting.cpp:
332 (khtml::InsertParagraphSeparatorCommand::doApply): Basically, did a rewrite of this function
333 to do a better job than it was doing before. Added several test cases to prove I am on a
335 * khtml/editing/visible_position.cpp:
336 (khtml::isFirstVisiblePositionInBlock): Tweaked the rules a bit to fix an issue very similar to the
337 leaving-the-bar-node case problem I just fixed in a recent checkin (relevant markup: <p>foo</p>bar).
338 This function was returning true for the first position in "bar". Wrong. Also tightened up other
339 rule: Should not report true when relationship between blocks cannot be determined.
340 (khtml::isLastVisiblePositionInBlock): Tightened up rule as above: Should not report true
341 when relationship between blocks cannot be determined.
342 * layout-tests/editing/inserting/insert-div-010-expected.txt: Added.
343 * layout-tests/editing/inserting/insert-div-010.html: Added.
344 * layout-tests/editing/inserting/insert-div-011-expected.txt: Added.
345 * layout-tests/editing/inserting/insert-div-011.html: Added.
346 * layout-tests/editing/inserting/insert-div-012-expected.txt: Added.
347 * layout-tests/editing/inserting/insert-div-012.html: Added.
348 * layout-tests/editing/inserting/insert-div-013-expected.txt: Added.
349 * layout-tests/editing/inserting/insert-div-013.html: Added.
350 * layout-tests/editing/inserting/insert-div-014-expected.txt: Added.
351 * layout-tests/editing/inserting/insert-div-014.html: Added.
352 * layout-tests/editing/inserting/insert-div-015-expected.txt: Added.
353 * layout-tests/editing/inserting/insert-div-015.html: Added.
354 * layout-tests/editing/inserting/insert-div-016-expected.txt: Added.
355 * layout-tests/editing/inserting/insert-div-016.html: Added.
356 * layout-tests/editing/inserting/insert-div-017-expected.txt: Added.
357 * layout-tests/editing/inserting/insert-div-017.html: Added.
359 2004-12-16 Ken Kocienda <kocienda@apple.com>
363 Added a layout test based on my last checkin.
365 * layout-tests/editing/selection/move-by-word-001-expected.txt: Added.
366 * layout-tests/editing/selection/move-by-word-001.html: Added.
368 2004-12-16 Ken Kocienda <kocienda@apple.com>
374 <rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps
376 * khtml/editing/visible_text.cpp:
377 (khtml::SimplifiedBackwardsTextIterator::advance): Add new check for leaving a text node and iterating
378 backwards into a different block that is an descendent of the block containing the text node (as in leaving
379 the "bar" node in this example: <p>foo</p>bar).
380 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Call new emitNewlineForBROrText helper.
381 (khtml::SimplifiedBackwardsTextIterator::emitNewlineForBROrText): Factor out code from handleNonTextNode, since
382 it is called from there, and now also from advance().
384 2004-12-15 Darin Adler <darin@apple.com>
388 - fixed problem where plain-text would put a blank line between each <p> even when they have no margins
390 * khtml/editing/visible_text.cpp: (khtml::TextIterator::exitNode): Add more checks and only set the
391 "add one more newline" flag if the margin is sufficient. A more complete fix would ignore the node
392 type altogether and use the render tree instead.
394 2004-12-14 John Sullivan <sullivan@apple.com>
398 - rest of WebCore fix for <rdar://problem/3790011> undoable operations all say "Undo"
399 in the menu, no specific action names
401 * khtml/editing/edit_actions.h: new header, contains EditAction enum
402 (renamed from HTMLEditAction, formerly in htmlediting.h)
404 * ForwardingHeaders/editing/edit_actions.h: new forwarding header
406 * khtml/editing/htmlediting.h:
407 removed HTMLEditAction enum in favor of including edit_actions.h; added khtml::
408 namespace to EditAction usages; added m_editingAction ivar to ApplyStyleCommand
410 * khtml/editing/htmlediting.cpp:
411 (khtml::EditCommandPtr::editingAction):
412 update for enum name change
413 (khtml::EditCommand::editingAction):
415 (khtml::ApplyStyleCommand::ApplyStyleCommand):
416 added editingAction parameter to this constructor
417 (khtml::ApplyStyleCommand::editingAction):
419 (khtml::DeleteSelectionCommand::editingAction):
420 update for enum name change
421 (khtml::MoveSelectionCommand::editingAction):
423 (khtml::TypingCommand::editingAction):
425 (khtml::ReplaceSelectionCommand::editingAction):
428 * khtml/khtml_part.h:
429 added EditAction parameter to applyStyle and computeAndSetTypingStyle
430 * khtml/khtml_part.cpp:
431 (KHTMLPart::computeAndSetTypingStyle):
432 added EditAction parameter
433 (KHTMLPart::applyStyle):
436 * kwq/KWQKHTMLPart.mm:
437 (KWQKHTMLPart::registerCommandForUndoOrRedo):
438 do the cast from EditAction to WebUndoAction a different way to match other code
440 * kwq/WebCoreBridge.h:
441 * kwq/WebCoreBridge.mm:
442 (-[WebCoreBridge setTypingStyle:withUndoAction:]):
443 added WebUndoAction parameter, passed into ApplyStyleCommand constructor
444 (-[WebCoreBridge applyStyle:withUndoAction:]):
447 * WebCore.pbproj/project.pbxproj:
448 updated for new files
450 2004-12-14 David Hyatt <hyatt@apple.com>
452 Fix for 3562458, rowspan and colspan converted to ints so that large values will work for them. Remove
453 the ridiculous 1024 limit on the span values.
455 * khtml/html/html_tableimpl.cpp:
456 (HTMLTableCellElementImpl::parseHTMLAttribute):
457 * khtml/rendering/render_table.cpp:
458 (RenderTableCell::collapsedBottomBorder):
459 * khtml/rendering/render_table.h:
460 (khtml::RenderTableCell::colSpan):
461 (khtml::RenderTableCell::setColSpan):
462 (khtml::RenderTableCell::rowSpan):
463 (khtml::RenderTableCell::setRowSpan):
464 (khtml::RenderTableCol::span):
465 (khtml::RenderTableCol::setSpan):
467 2004-12-14 David Hyatt <hyatt@apple.com>
469 Make sure <col> and <colgroup> can have spans updated dynamically as well.
473 * khtml/html/html_tableimpl.cpp:
474 (HTMLTableColElementImpl::parseHTMLAttribute):
475 * khtml/rendering/render_table.cpp:
476 (RenderTableCell::updateFromElement):
477 (RenderTableCol::updateFromElement):
479 2004-12-14 David Hyatt <hyatt@apple.com>
481 Fix for 3833123, setting a cell's colspan does not update rendering like it should.
485 * khtml/html/html_tableimpl.cpp:
486 (HTMLTableCellElementImpl::parseHTMLAttribute):
487 * khtml/rendering/render_table.cpp:
488 (RenderTableCell::RenderTableCell):
489 (RenderTableCell::updateFromElement):
491 2004-12-14 Chris Blumenberg <cblu@apple.com>
493 Fixed: <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
497 * khtml/editing/markup.cpp:
498 (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it
500 2004-12-14 David Hyatt <hyatt@apple.com>
502 Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position.
503 This is actually a regression from my positioned object DHTML optimization.
507 * khtml/rendering/render_object.cpp:
508 (RenderObject::setStyle):
510 2004-12-14 David Hyatt <hyatt@apple.com>
512 Make sure the class attribute works when newlines are present in the attribute.
516 * khtml/html/html_elementimpl.cpp:
517 (HTMLNamedAttrMapImpl::parseClassAttribute):
519 2004-12-14 David Hyatt <hyatt@apple.com>
521 Fix for 3724938, float element is duplicated and paints twice. The logic for when to paint floats was
522 actually fairly screwed up. This patch simplifies the logic and makes addOverhangingFloats easier to
523 read by splitting it into two separate functions.
527 * khtml/rendering/render_block.cpp:
528 (khtml::RenderBlock::layoutBlockChildren):
529 (khtml::RenderBlock::clearFloats):
530 (khtml::RenderBlock::addOverhangingFloats):
531 (khtml::RenderBlock::addIntrudingFloats):
532 * khtml/rendering/render_block.h:
534 2004-12-14 John Sullivan <sullivan@apple.com>
538 - added Undo action names for Cut, Paste, and Drag
540 * khtml/editing/htmlediting.h:
541 * khtml/editing/htmlediting.cpp:
542 (khtml::DeleteSelectionCommand::editingAction):
543 overridden to return HTMLEditActionCut
544 (khtml::MoveSelectionCommand::editingAction):
545 overridden to return HTMLEditActionDrag
546 (khtml::ReplaceSelectionCommand::editingAction):
547 overridden to return HTMLEditActionPaste
549 2004-12-14 John Sullivan <sullivan@apple.com>
553 - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu,
554 no specific action names
556 The remaining step is to make each EditCommand subclass override editingAction() to return an
557 appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
558 is not completely straightforward, so this next step isn't trivial.)
560 * khtml/editing/htmlediting.h:
561 new enum for HTMLEditAction
563 * khtml/editing/htmlediting.cpp:
564 (khtml::EditCommandPtr::editingAction):
565 new method, calls through to EditCommand
566 (khtml::EditCommand::editingAction):
567 new method for subclasses to override, returns HTMLEditActionUnspecified at this level
568 (khtml::TypingCommand::editingAction):
569 proof of concept override, returns HTMLEditActionTyping
571 * kwq/KWQKHTMLPart.h:
572 declare new private bottleneck method registerCommandForUndoOrRedo
573 * kwq/KWQKHTMLPart.mm:
574 (KWQKHTMLPart::registerCommandForUndoOrRedo):
575 new bottleneck method to reduce code duplication; now calls over the bridge
576 to get the localized string to use for the Undo action name
577 (KWQKHTMLPart::registerCommandForUndo):
578 now calls new bottleneck method
579 (KWQKHTMLPart::registerCommandForRedo):
580 now calls new bottleneck method
582 * kwq/WebCoreBridge.h:
583 new enum for WebUndoAction, maps directly to HTMLEditAction.
584 Declaration of nameForUndoAction:
586 2004-12-14 Darin Adler <darin@apple.com>
590 - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)
592 * khtml/rendering/render_frames.cpp:
593 (RenderPart::~RenderPart): Check widget for nil.
594 (RenderPart::setWidget): Ditto.
595 (RenderFrame::slotViewCleared): Ditto.
596 (RenderPartObject::slotViewCleared): Ditto.
598 2004-12-13 Darin Adler <darin@apple.com>
602 - moved markup-related functions into new sources files in the editing directory
603 - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster
605 * ForwardingHeaders/editing/markup.h: Added.
606 * khtml/editing/markup.h: Added.
607 * khtml/editing/markup.cpp: Added.
609 * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.
611 * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
612 * khtml/html/html_elementimpl.cpp:
613 (HTMLElementImpl::innerHTML): Changed to call createMarkup.
614 (HTMLElementImpl::outerHTML): Ditto.
616 * khtml/ecma/kjs_window.cpp:
617 (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
618 (Window::retrieveActive): Ditto.
620 * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
621 * khtml/xml/dom_docimpl.h: Ditto.
623 * khtml/khtml_part.cpp:
624 (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
625 (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.
627 * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
628 still works even with the additional replace overloads added to QString.
629 * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.
631 * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
632 base pointer, because it used dynamic_cast in its implementation. Made the other version public.
633 * khtml/rendering/render_object.cpp: Ditto.
634 * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.
636 * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
637 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
638 the support code into markup.cpp.
640 * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
641 * khtml/xml/dom_nodeimpl.cpp: Ditto.
643 * khtml/xml/dom_position.cpp:
644 (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
645 so these return null positions rather than raising exceptions.
646 (DOM::endPosition): Ditto.
648 * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
649 * kwq/KWQFrame.h: Ditto.
650 * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
651 * kwq/KWQKPartsPart.h: Ditto.
652 * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
653 * kwq/KWQScrollView.h: Ditto.
654 * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
655 * kwq/KWQKHTMLPart.h: Ditto.
656 * kwq/KWQKHTMLPart.mm:
657 (KHTMLView::isKHTMLView): Ditto.
658 (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
659 replace overloads added to QString.
660 (KWQKHTMLPart::setStatusBarText): Ditto.
661 (KWQKHTMLPart::runJavaScriptAlert): Ditto.
662 (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
663 (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
664 (KWQKHTMLPart::attributedString): Ditto.
665 (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
666 (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).
668 * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
670 (QObject::inherits): Changed to not use dynamic cast.
671 (QObject::isKHTMLPart): Added. Returns false.
672 (QObject::isKHTMLView): Ditto.
673 (QObject::isKPartsReadOnlyPart): Ditto.
674 (QObject::isQFrame): Ditto.
675 (QObject::isQScrollView): Ditto.
677 * kwq/KWQRenderTreeDebug.cpp:
678 (write): Changed to use inherits rather than dynamic_cast.
679 (writeSelection): Ditto.
681 * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
682 than going straight on to the "no parameters at all" version.
685 * kwq/KWQString.mm: (QString::replace): Added overloads.
686 * kwq/WebCoreBridge.mm:
687 (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
688 (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
689 (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
690 the additional replace overloads added to QString.
691 (-[WebCoreBridge stringForRange:]): Ditto.
692 (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
693 (-[WebCoreBridge elementAtPoint:]): QChar conversion.
694 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
695 (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.
697 2004-12-13 Ken Kocienda <kocienda@apple.com>
703 <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
705 * khtml/editing/htmlediting.cpp:
706 (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
707 leading and trailing whitespace positions was reversed! I must have introduced this error recently
708 when changing around this code.
710 2004-12-13 David Hyatt <hyatt@apple.com>
712 Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing
713 and painting was using the wrong rect when setting up the x/y of the rect.
717 * khtml/rendering/render_block.cpp:
718 (khtml::RenderBlock::paint):
719 (khtml::RenderBlock::nodeAtPoint):
720 * khtml/rendering/render_object.h:
721 (khtml::RenderObject::floatRect):
723 2004-12-13 Ken Kocienda <kocienda@apple.com>
729 <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles
731 Code to figuire out the end node to merge was missing the font tag in the second paragraph
732 written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.
734 * khtml/editing/htmlediting.cpp:
735 (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
736 looking for the node that is the last inline in the last block of the fragment. The old algorithm was
737 insufficiently powerful.
738 (khtml::ReplacementFragment::enclosingBlock): New helper function.
739 * khtml/editing/htmlediting.h: Add declaration for new helper function.
740 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
741 * layout-tests/editing/pasteboard/paste-text-011.html: Added.
743 2004-12-13 Ken Kocienda <kocienda@apple.com>
747 WebCore side of fix for this bug:
749 <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace
751 Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
752 bug. This change involves our half of the needed changes.
754 Note that a lot of this change has to do with changing code to use a <br> element instead of
755 a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
756 other places, code to handle comments in markup can be removed since we do not use comments for
757 such annotations after this change.
759 * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
760 (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
761 (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
762 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
763 convertedSpaceSpanClassString to match other uses of the idiom used here.
764 (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
765 * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
766 (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
767 * khtml/html/html_elementimpl.cpp:
768 (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
769 annotate fragments with comments any longer.
770 * khtml/html/html_elementimpl.h: Ditto.
771 * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
772 (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
773 (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
775 * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
776 * kwq/WebCoreBridge.mm:
777 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
778 in DOM when calling createContextualFragment().
780 2004-12-10 John Sullivan <sullivan@apple.com>
782 fixed deployment build bustage that John Louch ran into
784 * kwq/KWQTextEdit.mm:
785 (QTextEdit::setScrollBarModes):
786 move bool declaration inside exception-handling block to avoid obscure
789 2004-12-10 Maciej Stachowiak <mjs@apple.com>
793 <rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
796 (QWidget::setFocus): Handle the case where setting focus removed
797 us from the superview - this can happen due to style changes on
800 2004-12-10 Ken Kocienda <kocienda@apple.com>
806 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
808 There are a number of interesting things we could do to fix this bug, including SPI and involving
809 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
810 will fix the bug in the general case until such time as we can come up with more specific
813 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
816 * khtml/editing/htmlediting.cpp:
817 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
818 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
819 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
820 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
822 2004-12-10 Darin Adler <darin@apple.com>
826 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
828 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
829 * khtml/rendering/render_form.cpp:
830 (RenderSubmitButton::rawText): Convert to QChar explicitly.
831 (RenderLineEdit::updateFromElement): Ditto.
832 (RenderLineEdit::slotTextChanged): Ditto.
833 (RenderSelect::updateFromElement): Ditto.
834 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
835 that requires a derived class. Now we don't use this class at all for WebCore, but they still
837 (TextAreaWidget::event): Moved out the ifdefs.
838 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
839 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
840 now done in setStyle.
841 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
842 that's needed and WebCore no longer has TextAreaWidget.
843 (RenderTextArea::calcMinMaxWidth): Ditto.
844 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
846 (RenderTextArea::updateFromElement): Use type QTextEdit.
847 (RenderTextArea::text): Ditto.
848 (RenderTextArea::select): Ditto.
850 * kwq/KWQTextArea.mm:
851 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
852 since it's now handled by QTextEdit.
853 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
855 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
856 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
857 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
859 2004-12-10 Ken Kocienda <kocienda@apple.com>
865 <rdar://problem/3915047> HItting return in empty document inserts <p> but
866 insertion point does not move
868 * khtml/editing/htmlediting.cpp:
869 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
870 code to insert the <p> element for the return is not detecting the fact
871 that the document is empty. Inserting a <p> into an empty body will not
872 "add a new line" as the user expects. With this change, we'll add a second
873 <p> when the root editable element has no rendered kids.
875 2004-12-10 Maciej Stachowiak <mjs@apple.com>
879 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
881 * khtml/html/html_miscimpl.cpp:
882 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
883 the initial one step, otherwise we might inadvertantly step
884 outside the collection base, thereby causing assertion failures or
887 2004-12-10 Ken Kocienda <kocienda@apple.com>
891 * khtml/editing/htmlediting.cpp:
892 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
893 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
894 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
895 should do nothing if the starting point for the selection is itself the starting block.
896 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
897 function, though the names and concepts are slightly different.
899 2004-12-10 Maciej Stachowiak <mjs@apple.com>
903 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
905 * khtml/dom/html_document.cpp:
906 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
907 * khtml/dom/html_document.h:
908 * khtml/ecma/kjs_html.cpp:
909 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
910 * khtml/html/html_miscimpl.cpp:
911 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
912 the items that can be accessed directly as a document propery, in particular forms, images,
913 objects, applets and embeds.
914 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
915 (HTMLFormCollectionImpl::updateNameCache): Ditto.
916 * khtml/html/html_miscimpl.h:
917 (DOM::HTMLCollectionImpl::): Added new type.
919 2004-12-10 Ken Kocienda <kocienda@apple.com>
925 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
927 * khtml/rendering/render_text.cpp:
928 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
930 2004-12-10 Ken Kocienda <kocienda@apple.com>
936 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
938 * khtml/editing/htmlediting.cpp:
939 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
940 that was removed from the document when pasting. This caused the disappearance. Now this
941 is detected, and the selection is shifted to a node that is in the document.
943 2004-12-09 Richard Williamson <rjw@apple.com>
945 Check to disable threaded decoding during
946 layout tests wasn't invoking function, just checking address of
947 function, which would always return true.
949 * kwq/WebCoreImageRendererFactory.m:
950 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
952 2004-12-09 David Hyatt <hyatt@apple.com>
954 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
957 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
958 all inlines when repainting.
962 * khtml/rendering/render_block.cpp:
963 (khtml::RenderBlock::layoutBlockChildren):
964 * khtml/rendering/render_flow.cpp:
965 (RenderFlow::getAbsoluteRepaintRect):
967 2004-12-09 David Hyatt <hyatt@apple.com>
969 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
970 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
971 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
972 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
976 * khtml/rendering/render_block.cpp:
977 (khtml::RenderBlock::getClearDelta):
978 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
979 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
980 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
981 * layout-tests/fast/block/margin-collapse/102-expected.txt:
982 * layout-tests/fast/block/margin-collapse/102.html:
984 2004-12-09 Richard Williamson <rjw@apple.com>
986 Fixed <rdar://problem/3914078> worldclock crashing gc related
988 Use ProtectedValue for Context2D instance members.
992 * khtml/ecma/kjs_html.h:
994 2004-12-09 John Sullivan <sullivan@apple.com>
998 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
1000 * kwq/KWQAccObject.mm:
1001 (-[KWQAccObject title]): moved image alt tag code out of here
1002 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
1003 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
1004 that ordinary elements return; this means that ordinary elements that aren't images will return
1005 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
1007 (-[KWQAccObject accessibilityAttributeValue:]):
1008 call accessibilityDescription when asked for AXDescription
1010 2004-12-09 Ken Kocienda <kocienda@apple.com>
1012 Reviewed by Harrison
1016 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
1018 * khtml/editing/htmlediting.cpp:
1019 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
1020 been deleted. If this is the case, set the destination to the node the delete command provides in
1021 its ending selection.
1025 2004-12-09 Ken Kocienda <kocienda@apple.com>
1031 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
1033 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
1034 callback may not be delivered before the program asks for the dimensions of an image in order to
1035 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
1036 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
1038 * kwq/KWQRenderTreeDebug.cpp:
1039 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
1040 (externalRepresentation): Sets debuggingRenderTree flag to true;
1041 * kwq/KWQRenderTreeDebug.h:
1042 * kwq/WebCoreImageRendererFactory.m:
1043 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
1044 do threaded decoding in any case if the flag is set.
1046 2004-12-09 Chris Blumenberg <cblu@apple.com>
1048 Fix for busting XMLHTTPRequest.
1050 Reviewed by kocienda.
1052 * khtml/misc/loader.cpp:
1053 (Loader::servePendingRequests): pass true for deliverAllData
1055 (KIO::get): take deliverAllData param
1056 (KIO::http_post): ditto
1057 * kwq/KWQKJobClasses.h:
1058 * kwq/KWQKJobClasses.mm:
1059 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
1060 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
1062 2004-12-09 Ken Kocienda <kocienda@apple.com>
1066 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
1068 * khtml/xml/dom_nodeimpl.cpp:
1069 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
1071 2004-12-07 Richard Williamson <rjw@apple.com>
1073 Support threaded image decoding on machines w/ > 2 CPUs.
1075 Reviewed by Maciej and Chris.
1077 * khtml/misc/loader.cpp:
1078 (CachedImageCallback::notifyUpdate):
1079 (CachedImageCallback::notifyFinished):
1080 (CachedImageCallback::notifyDecodingError):
1081 (CachedImageCallback::handleError):
1082 (CachedImageCallback::clear):
1083 (CachedImage::CachedImage):
1084 (CachedImage::clear):
1085 (CachedImage::data):
1086 (CachedImage::checkNotify):
1087 (Loader::servePendingRequests):
1088 (Loader::slotFinished):
1089 (Loader::numRequests):
1090 (Loader::cancelRequests):
1091 (Loader::removeBackgroundDecodingRequest):
1092 * khtml/misc/loader.h:
1093 (khtml::CachedImageCallback::CachedImageCallback):
1094 (khtml::CachedImageCallback::ref):
1095 (khtml::CachedImageCallback::deref):
1096 (khtml::CachedImage::decoderCallback):
1097 * khtml/rendering/render_object.cpp:
1098 (RenderObject::setPixmap):
1101 (-[WebImageCallback initWithCallback:khtml::]):
1102 (-[WebImageCallback _commonTermination]):
1103 (-[WebImageCallback dealloc]):
1104 (-[WebImageCallback finalize]):
1105 (-[WebImageCallback notify]):
1106 (-[WebImageCallback setImageSourceStatus:]):
1107 (-[WebImageCallback status]):
1108 (QPixmap::shouldUseThreadedDecoding):
1109 (QPixmap::receivedData):
1110 * kwq/WebCoreImageRenderer.h:
1111 * kwq/WebCoreImageRendererFactory.h:
1112 * kwq/WebCoreImageRendererFactory.m:
1113 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
1114 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
1116 2004-12-07 Ken Kocienda <kocienda@apple.com>
1120 * khtml/editing/htmlediting.cpp:
1121 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
1122 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
1123 after new block has been inserted, otherwise a crash can result. Shuffle down call
1124 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
1127 2004-12-07 Ken Kocienda <kocienda@apple.com>
1133 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
1135 * khtml/editing/htmlediting.cpp:
1136 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
1137 for determining the location for inserting content. Do not allow an insert before or after if the
1138 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
1139 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
1140 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
1142 2004-12-07 Darin Adler <darin@apple.com>
1146 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
1148 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
1150 2004-12-07 Ken Kocienda <kocienda@apple.com>
1154 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
1155 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
1157 * khtml/editing/html_interchange.h: Name change, as described above.
1158 * khtml/editing/htmlediting.cpp:
1159 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
1160 * khtml/xml/dom2_rangeimpl.cpp:
1161 (DOM::RangeImpl::toHTML): Ditto.
1163 2004-12-07 Ken Kocienda <kocienda@apple.com>
1167 Added a couple more layout tests.
1169 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
1170 * layout-tests/editing/deleting/delete-line-013.html: Added.
1171 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
1172 * layout-tests/editing/deleting/delete-line-014.html: Added.
1174 2004-12-06 Maciej Stachowiak <mjs@apple.com>
1178 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
1180 * kwq/KWQListBox.mm:
1181 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
1182 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
1183 (-[KWQListBoxScrollView widget]): See above.
1184 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
1185 afterMouseDown, to avoid triggering an assertion failure.
1187 2004-12-06 David Hyatt <hyatt@apple.com>
1189 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
1190 made by me, kocienda and harrison to just remove it.
1194 * khtml/rendering/bidi.cpp:
1195 (khtml::RenderBlock::layoutInlineChildren):
1196 * khtml/rendering/render_block.cpp:
1197 (khtml:::RenderFlow):
1198 * khtml/rendering/render_block.h:
1199 * khtml/rendering/render_flow.cpp:
1200 (RenderFlow::dirtyLinesFromChangedChild):
1202 2004-12-06 David Hyatt <hyatt@apple.com>
1204 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
1205 not a damage rect that can be changed when intersected with the clip regions of the web page.
1209 * khtml/rendering/render_canvas.h:
1210 (khtml::RenderCanvas::printRect):
1211 (khtml::RenderCanvas::setPrintRect):
1212 * khtml/rendering/render_flow.cpp:
1213 (RenderFlow::paintLines):
1214 * khtml/rendering/render_list.cpp:
1215 (RenderListMarker::paint):
1216 * kwq/KWQKHTMLPart.mm:
1217 (KWQKHTMLPart::adjustPageHeight):
1219 2004-12-06 David Harrison <harrison@apple.com>
1221 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
1223 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
1226 * khtml/rendering/render_flow.cpp:
1227 (RenderFlow::dirtyLinesFromChangedChild):
1228 Dirty the line above because new child can inval the cached line break position of previous line.
1230 2004-12-06 David Hyatt <hyatt@apple.com>
1232 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
1233 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
1234 3126929, handle top/left overflow.
1236 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
1238 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
1239 regions and web pages) has been fixed.
1243 * khtml/rendering/bidi.cpp:
1244 (khtml::RenderBlock::computeHorizontalPositionsForLine):
1245 (khtml::RenderBlock::checkLinesForOverflow):
1246 * khtml/rendering/render_block.cpp:
1247 (khtml:::RenderFlow):
1248 (khtml::RenderBlock::overflowHeight):
1249 (khtml::RenderBlock::overflowWidth):
1250 (khtml::RenderBlock::overflowLeft):
1251 (khtml::RenderBlock::overflowTop):
1252 (khtml::RenderBlock::overflowRect):
1253 (khtml::RenderBlock::layoutBlock):
1254 (khtml::RenderBlock::layoutBlockChildren):
1255 (khtml::RenderBlock::paint):
1256 (khtml::RenderBlock::floatRect):
1257 (khtml::RenderBlock::lowestPosition):
1258 (khtml::RenderBlock::rightmostPosition):
1259 (khtml::RenderBlock::leftmostPosition):
1260 (khtml::RenderBlock::nodeAtPoint):
1261 * khtml/rendering/render_block.h:
1262 * khtml/rendering/render_box.h:
1263 (khtml::RenderBox::borderBox):
1264 (khtml::RenderBox::borderTopExtra):
1265 (khtml::RenderBox::borderBottomExtra):
1266 * khtml/rendering/render_layer.cpp:
1267 (RenderLayer::paintScrollbars):
1268 (mustExamineRenderer):
1269 (RenderLayer::intersectsDamageRect):
1270 (RenderLayer::containsPoint):
1271 * khtml/rendering/render_line.cpp:
1272 (khtml::InlineFlowBox::placeBoxesHorizontally):
1273 (khtml::InlineFlowBox::verticallyAlignBoxes):
1274 * khtml/rendering/render_line.h:
1275 (khtml::InlineBox::leftOverflow):
1276 (khtml::InlineBox::rightOverflow):
1277 (khtml::InlineFlowBox::setVerticalOverflowPositions):
1278 (khtml::RootInlineBox::RootInlineBox):
1279 (khtml::RootInlineBox::leftOverflow):
1280 (khtml::RootInlineBox::rightOverflow):
1281 (khtml::RootInlineBox::setVerticalOverflowPositions):
1282 (khtml::RootInlineBox::setHorizontalOverflowPositions):
1283 * khtml/rendering/render_object.h:
1284 (khtml::RenderObject::borderBox):
1285 (khtml::RenderObject::overflowLeft):
1286 (khtml::RenderObject::overflowTop):
1287 (khtml::RenderObject::overflowRect):
1288 (khtml::RenderObject::floatRect):
1289 * khtml/rendering/render_table.cpp:
1290 (RenderTable::layout):
1291 (RenderTable::paint):
1292 (RenderTable::paintBoxDecorations):
1293 (RenderTable::calcMinMaxWidth):
1294 * khtml/rendering/render_table.h:
1295 (khtml::RenderTableCell::borderTopExtra):
1296 (khtml::RenderTableCell::borderBottomExtra):
1301 2004-12-06 Maciej Stachowiak <mjs@apple.com>
1305 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
1307 I changed all unprotected places that can navigate a different
1308 window or frame from script to check for a javascript: URL, and if
1309 found, to check for safety using cross-site-script rules.
1311 I considered a few other possible exploits and made no change:
1313 - document.location is already protected because the document
1314 object itself is protected
1316 - frame.src, frame.location, iframe.src and targetted links are
1317 all safe because setting the URL of a frame to a javascript: URL
1318 executes the script in the context of the parent
1320 * khtml/ecma/kjs_window.cpp:
1321 (WindowFunc::tryCall):
1323 (LocationFunc::tryCall):
1325 2004-12-06 Ken Kocienda <kocienda@apple.com>
1331 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
1333 * khtml/editing/htmlediting.cpp:
1334 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
1335 check for one of the special cases being checked for in this function. The specific case
1336 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
1337 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
1338 case where a selection ended in a <br> after a block and would not delete any part of the
1339 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
1342 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
1343 new use of the function exposed this bug:
1345 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
1347 * khtml/xml/dom_position.cpp:
1348 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
1349 not have this fatal flaw. It is a much better design as well.
1351 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
1352 have what I consider to be a better result. Going with it.
1354 2004-12-06 Chris Blumenberg <cblu@apple.com>
1356 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
1361 (-[DOMElement _font]): new SPI for AppKit
1364 2004-12-06 Darin Adler <darin@apple.com>
1368 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
1370 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
1371 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
1373 2004-12-06 John Sullivan <sullivan@apple.com>
1375 Darin found what appears to be the real leak that we were falsely blaming
1376 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
1377 sure nothing barfed.
1379 * khtml/css/cssparser.cpp:
1380 (CSSParser::parseValue):
1381 call clearProperties() instead of just setting numParsedProperties to 0
1382 (CSSParser::parseDeclaration):
1384 (CSSParser::createStyleDeclaration):
1387 2004-12-06 Ken Kocienda <kocienda@apple.com>
1393 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
1394 * layout-tests/editing/inserting/insert-div-001.html: Added.
1395 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
1396 * layout-tests/editing/inserting/insert-div-002.html: Added.
1397 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
1398 * layout-tests/editing/inserting/insert-div-003.html: Added.
1399 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
1400 * layout-tests/editing/inserting/insert-div-004.html: Added.
1401 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
1402 * layout-tests/editing/inserting/insert-div-005.html: Added.
1403 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
1404 * layout-tests/editing/inserting/insert-div-006.html: Added.
1405 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
1406 * layout-tests/editing/inserting/insert-div-007.html: Added.
1407 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
1408 * layout-tests/editing/inserting/insert-div-008.html: Added.
1409 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
1410 * layout-tests/editing/inserting/insert-div-009.html: Added.
1412 2004-12-06 Ken Kocienda <kocienda@apple.com>
1414 Reviewed by Harrison
1418 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
1420 * khtml/editing/htmlediting.cpp:
1421 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
1422 being added to this function. This ensures that the added block has a height.
1423 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1425 2004-12-06 Ken Kocienda <kocienda@apple.com>
1429 * khtml/dom/dom_string.cpp:
1430 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
1431 * khtml/dom/dom_string.h: Ditto.
1432 * khtml/editing/htmlediting.cpp:
1433 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
1434 RebalanceWhitespaceCommand instance.
1435 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
1436 (khtml::InsertLineBreakCommand::doApply): Ditto.
1437 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1438 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1439 (khtml::InsertTextCommand::input): Ditto.
1440 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
1441 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
1442 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
1443 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
1444 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
1445 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
1446 * khtml/editing/htmlediting.h: Ditto.
1447 (khtml::RebalanceWhitespaceCommand::): Ditto.
1449 2004-12-05 Darin Adler <darin@apple.com>
1451 - fixed small problem in my check-in from yesterday
1454 (positionForEvent): Get location from event without raising exception if it's the wrong type.
1455 (clickCountForEvent): Same, for clickCount.
1456 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
1457 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
1458 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
1460 2004-12-04 Darin Adler <darin@apple.com>
1464 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
1466 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
1467 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
1468 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
1470 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
1472 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
1473 * khtml/rendering/render_form.cpp:
1474 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
1475 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
1476 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
1478 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
1479 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
1480 Added a fixState helper method so the constructors can save code.
1482 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
1483 and added a third constructor that uses the "current event" from AppKit (used above).
1484 (QMouseEvent::fixState): Compute state and click count based on event type.
1486 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
1488 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
1489 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
1490 underlying cause in CSS.
1492 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
1494 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
1495 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
1497 2004-12-03 Chris Blumenberg <cblu@apple.com>
1500 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
1501 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
1502 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
1503 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
1505 Reviewed by darin, rjw, kocienda.
1507 * khtml/misc/loader.cpp:
1508 (CachedObject::~CachedObject):
1509 (CachedCSSStyleSheet::checkNotify):
1510 (Loader::servePendingRequests):
1511 (Loader::slotFinished):
1512 (Loader::slotReceivedResponse):
1513 (Cache::requestImage):
1514 (Cache::requestScript):
1515 * khtml/misc/loader.h:
1516 (khtml::CachedObject::CachedObject):
1517 (khtml::CachedObject::response):
1518 (khtml::CachedObject::allData):
1519 * kwq/KWQKJobClasses.h:
1520 * kwq/KWQKJobClasses.mm:
1521 (KIO::TransferJobPrivate::TransferJobPrivate):
1522 (KIO::TransferJobPrivate::~TransferJobPrivate):
1523 (KIO::TransferJob::TransferJob):
1524 (KIO::TransferJob::assembleResponseHeaders):
1525 (KIO::TransferJob::retrieveCharset):
1526 (KIO::TransferJob::emitResult):
1527 (KIO::TransferJob::emitReceivedResponse):
1530 (KWQHeaderStringFromDictionary):
1531 (KWQCheckCacheObjectStatus):
1532 (KWQIsResponseURLEqualToURL):
1534 (KWQResponseMIMEType):
1535 (KWQCacheObjectExpiresTime):
1536 (khtml::CachedObject::setResponse):
1537 (khtml::CachedObject::setAllData):
1541 * kwq/KWQResourceLoader.mm:
1542 (-[KWQResourceLoader finishJobAndHandle:]):
1543 (-[KWQResourceLoader cancel]):
1544 (-[KWQResourceLoader reportError]):
1545 (-[KWQResourceLoader finishWithData:]):
1553 * kwq/WebCoreBridge.h:
1554 * kwq/WebCoreResourceLoader.h:
1556 2004-12-04 Darin Adler <darin@apple.com>
1560 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
1562 * khtml/rendering/render_form.cpp:
1563 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
1564 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
1565 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
1566 (RenderSlider::slotSliderValueChanged): Ditto.
1568 2004-12-03 John Sullivan <sullivan@apple.com>
1572 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
1573 khtml::BackgroundLayer::cullEmptyLayers
1575 * khtml/rendering/render_style.cpp:
1576 (BackgroundLayer::cullEmptyLayers):
1577 added missing nil check
1581 2004-12-03 Ken Kocienda <kocienda@apple.com>
1585 Roll out some recent changes by Chris that caused a performance regression.
1586 Fix is in hand, but it is a little risky this close to a submission. So,
1587 we have decided to roll back the change with the regression and roll in
1588 the new code after we submit.
1590 * khtml/css/cssproperties.c:
1593 * khtml/css/cssvalues.c:
1596 * khtml/misc/htmlattrs.c:
1599 * khtml/misc/htmltags.c:
1602 * khtml/misc/loader.cpp:
1603 (CachedObject::~CachedObject):
1604 (CachedObject::setResponse):
1605 (CachedCSSStyleSheet::checkNotify):
1606 (Loader::servePendingRequests):
1607 (Loader::slotFinished):
1608 (Loader::slotReceivedResponse):
1609 (Cache::requestImage):
1610 (Cache::requestScript):
1611 * khtml/misc/loader.h:
1612 (khtml::CachedObject::CachedObject):
1613 (khtml::CachedObject::response):
1614 * kwq/KWQKJobClasses.h:
1615 * kwq/KWQKJobClasses.mm:
1616 (KIO::TransferJobPrivate::TransferJobPrivate):
1617 (KIO::TransferJobPrivate::~TransferJobPrivate):
1618 (KIO::TransferJob::TransferJob):
1619 (KIO::TransferJob::assembleResponseHeaders):
1620 (KIO::TransferJob::retrieveCharset):
1621 (KIO::TransferJob::emitResult):
1622 (KIO::TransferJob::emitReceivedResponse):
1625 (KWQHeaderStringFromDictionary):
1626 (KWQCheckCacheObjectStatus):
1627 (KWQRetainResponse):
1628 (KWQReleaseResponse):
1629 (KWQIsResponseURLEqualToURL):
1631 (KWQResponseMIMEType):
1632 (KWQResponseTextEncodingName):
1633 (KWQResponseHeaderString):
1634 (KWQCacheObjectExpiresTime):
1635 (KWQLoader::KWQLoader):
1639 * kwq/KWQResourceLoader.mm:
1640 (-[KWQResourceLoader finishJobAndHandle]):
1641 (-[KWQResourceLoader cancel]):
1642 (-[KWQResourceLoader reportError]):
1643 (-[KWQResourceLoader finish]):
1651 * kwq/WebCoreBridge.h:
1652 * kwq/WebCoreResourceLoader.h:
1654 2004-12-03 John Sullivan <sullivan@apple.com>
1658 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
1660 * kwq/KWQKHTMLPart.mm:
1661 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
1662 when checking whether we moved the focus to another view, make sure we didn't "move" it to
1663 our documentView, because that's no move at all.
1665 2004-12-03 Darin Adler <darin@apple.com>
1669 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
1671 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
1672 Added missing initialization for base class and node pointer.
1674 - fixed a few places that could leave dangling node pointers
1676 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
1677 Clear out the node pointer when the node is destroyed.
1678 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
1680 2004-12-03 Chris Blumenberg <cblu@apple.com>
1682 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.
1683 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
1687 * khtml/misc/loader.cpp:
1688 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
1689 (Loader::slotFinished): take data param
1690 * khtml/misc/loader.h:
1691 * kwq/KWQKJobClasses.h:
1692 * kwq/KWQKJobClasses.mm:
1693 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
1694 (KIO::TransferJob::emitResult): take data param and pass it
1695 * kwq/KWQResourceLoader.mm:
1696 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
1697 (-[KWQResourceLoader cancel]): pass nil for data
1698 (-[KWQResourceLoader reportError]): ditto
1699 (-[KWQResourceLoader finishWithData:]): pass data
1701 (KWQSlot::KWQSlot): pass data param to slotFinished
1702 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
1704 2004-12-03 Ken Kocienda <kocienda@apple.com>
1708 Did some clean up in the Position class as a result of trying to write some new layout
1709 tests and discovering a bug along the way.
1711 I removed these three functions from the Position class:
1713 1. bool isFirstRenderedPositionOnLine() const;
1714 2. bool isLastRenderedPositionOnLine() const;
1715 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
1716 4. bool inFirstEditableInRootEditableElement() const;
1718 The first two have replacements in the VisiblePosition class, and some code has been
1719 moved to use these new variants. The third function was a helper used only by these
1720 first two function, and can be removed as well. The fourth function was not used by anyone.
1722 * khtml/editing/htmlediting.cpp:
1723 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
1724 * khtml/editing/visible_position.cpp:
1725 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
1726 Incorrect results were being returned when asking about positions at the starts of blocks.
1727 * khtml/xml/dom_position.cpp:
1728 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
1729 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
1730 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
1731 * khtml/xml/dom_position.h: Update header for deletions.
1733 2004-12-03 Ken Kocienda <kocienda@apple.com>
1737 Terminology change in execCommand command identifiers. Specifically, the name of
1738 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
1739 terminology used by AppKit. It is also more accurate, since the insertion of a
1740 "br" element is what the command does. The inspiration for this change is so the
1741 -insertNewline AppKit method can be mapped to insert a new "div" element in
1742 a document and avoid ambiguity with what the javascript editing command does.
1744 * khtml/editing/jsediting.cpp
1745 * layout-tests/editing/deleting/delete-tab-004.html
1746 * layout-tests/editing/editing.js
1747 * layout-tests/editing/inserting/insert-3654864-fix.html
1748 * layout-tests/editing/inserting/insert-3659587-fix.html
1749 * layout-tests/editing/inserting/insert-3775316-fix.html
1750 * layout-tests/editing/inserting/insert-3800346-fix.html
1751 * layout-tests/editing/inserting/insert-br-001.html
1752 * layout-tests/editing/inserting/insert-br-002.html
1753 * layout-tests/editing/inserting/insert-br-003.html
1754 * layout-tests/editing/inserting/insert-br-004.html
1755 * layout-tests/editing/inserting/insert-br-005.html
1756 * layout-tests/editing/inserting/insert-br-006.html
1757 * layout-tests/editing/inserting/insert-br-007.html
1758 * layout-tests/editing/inserting/insert-br-008.html
1759 * layout-tests/editing/inserting/insert-tab-004.html
1760 * layout-tests/editing/inserting/insert-text-with-newlines.html
1761 * layout-tests/editing/pasteboard/paste-text-010.html
1763 2004-12-02 Ken Kocienda <kocienda@apple.com>
1769 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
1771 * khtml/editing/htmlediting.cpp:
1772 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
1773 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
1774 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
1775 in a block and the document is in quirks mode, add an additional br to make the one in the
1776 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
1777 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
1778 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
1780 2004-12-02 Richard Williamson <rjw@apple.com>
1782 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
1784 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
1785 the b/f cache won't incorrectly trash the previous state when restoring.
1789 * kwq/WebCoreBridge.h:
1790 * kwq/WebCoreBridge.mm:
1791 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
1792 (-[WebCoreBridge canCachePage]):
1793 (-[WebCoreBridge clear]):
1795 2004-12-02 Ken Kocienda <kocienda@apple.com>
1801 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
1803 * khtml/xml/dom2_rangeimpl.cpp:
1804 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
1805 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
1806 of this bug where there is content after the body tag). Did a little code clean up as well.
1807 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
1809 2004-12-02 Ken Kocienda <kocienda@apple.com>
1815 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
1817 * khtml/khtml_part.cpp:
1818 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
1819 to figure out which end of the selection to extend.
1821 2004-12-02 David Harrison <harrison@apple.com>
1823 Reviewed by Ken Kocienda.
1825 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
1826 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
1828 * khtml/editing/visible_text.cpp:
1829 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1830 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
1831 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
1832 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
1833 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
1834 Distinguish BR from whitespace.
1835 * khtml/editing/visible_text.h:
1836 Distinguish BR from whitespace.
1837 * khtml/editing/visible_units.cpp:
1838 (khtml::previousWordBoundary):
1839 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.
1841 2004-12-02 Ken Kocienda <kocienda@apple.com>
1847 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
1849 * khtml/xml/dom_position.cpp:
1850 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
1851 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
1852 exception trying to use a Position returned from this function to set the boundary point of a Range (which
1853 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
1854 contract to return a range-compliant position, hence the need for this fix.
1856 2004-12-01 Ken Kocienda <kocienda@apple.com>
1862 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
1863 regard to other editing commands. The class had a name change ages ago, and it was never
1865 * khtml/editing/htmlediting.h: Ditto.
1867 2004-12-01 Ken Kocienda <kocienda@apple.com>
1871 Some improvements for paste, including some new code to annotate
1872 whitespace when writing to the pasteboard to ensure that the meaning
1873 of the markup on the pasteboard is unambiguous.
1875 There is also new code for reading this annotated markup from the pasteboard,
1876 removing the nodes that were added only to prevent ambiguity.
1878 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
1879 The header should have been added earlier, but I did not do so.
1880 * khtml/editing/html_interchange.cpp: Added.
1881 (convertHTMLTextToInterchangeFormat):
1882 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
1883 * khtml/editing/htmlediting.cpp:
1884 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
1885 Also fixed a bug in the code that counts blocks in a fragment.
1886 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
1887 (khtml::ReplacementFragment::insertNodeBefore): New helper.
1888 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
1889 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
1890 * khtml/editing/htmlediting.h: Add some new declarations.
1891 * khtml/xml/dom2_rangeimpl.cpp:
1892 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
1893 * khtml/xml/dom_nodeimpl.cpp:
1894 (NodeImpl::stringValueForRange): New helper.
1895 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
1896 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
1897 should be added. Called by the paste code.
1898 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
1900 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
1901 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
1902 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
1904 2004-11-30 Chris Blumenberg <cblu@apple.com>
1906 * ChangeLog: removed conflict marker
1908 2004-11-30 Chris Blumenberg <cblu@apple.com>
1911 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
1912 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
1916 * khtml/misc/loader.cpp:
1917 (CachedObject::~CachedObject): release m_allData
1918 (CachedObject::setAllData): new
1919 (Loader::servePendingRequests): connect slotAllData
1920 (Loader::slotAllData): new
1921 (Cache::requestImage): tweak
1922 * khtml/misc/loader.h:
1923 (khtml::CachedObject::CachedObject): set allData to 0
1924 (khtml::CachedObject::allData): new
1925 * kwq/KWQKJobClasses.h:
1926 * kwq/KWQKJobClasses.mm:
1927 (KIO::TransferJob::TransferJob): set m_allData
1928 (KIO::TransferJob::emitAllData): new
1930 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
1931 * kwq/KWQResourceLoader.mm:
1932 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
1934 (KWQSlot::KWQSlot): support for slotAllData
1936 * kwq/WebCoreBridge.h:
1937 * kwq/WebCoreResourceLoader.h:
1939 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1943 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1947 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
1949 * khtml/khtml_part.cpp:
1950 (KHTMLPart::begin): call setParsing on document here after opening
1951 - from now on we'll only set parsing to true for a document open
1952 caused by page loading, not a programmatic one.
1953 * khtml/xml/dom_docimpl.cpp:
1954 (DocumentImpl::open): don't setParsing to true here any more.
1956 2004-11-30 Maciej Stachowiak <mjs@apple.com>
1960 - fix recent regression from collection perf fixes.
1962 * khtml/html/html_miscimpl.cpp:
1963 (HTMLFormCollectionImpl::updateNameCache): Look up the name
1964 attribute in the name cache, not the id cache (d'oh!)
1966 2004-11-30 Darin Adler <darin@apple.com>
1970 - rolled in a KDE fix for a problem that may underlie a number of crashes
1972 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
1973 the KDE guys to fix a subtle problem. Code said "n = n =".
1975 - rolled in a KDE fix for a containingBlock crash
1977 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
1978 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
1981 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
1984 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
1985 (-[KWQButton detachQButton]): Added.
1986 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
1987 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
1988 (-[KWQButton widget]): Added.
1989 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
1990 (-[KWQButton resignFirstResponder]): Ditto.
1991 (-[KWQButton canBecomeKeyView]): Ditto.
1992 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
1993 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
1995 * kwq/KWQComboBox.mm:
1996 (QComboBox::~QComboBox): Call detachQComboBox.
1997 (-[KWQPopUpButtonCell detachQComboBox]): Added.
1998 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
1999 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
2000 (-[KWQPopUpButton action:]): Ditto.
2001 (-[KWQPopUpButton widget]): Tweaked.
2002 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
2003 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
2004 (-[KWQPopUpButton resignFirstResponder]): Ditto.
2005 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
2007 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
2009 * kwq/KWQListBox.mm:
2010 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
2012 * kwq/KWQScrollBar.h: Removed m_scroller field.
2013 * kwq/KWQScrollBar.mm:
2014 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
2015 (-[KWQScrollBar detachQScrollBar]): Added.
2016 (-[KWQScrollBar widget]): Added.
2017 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
2018 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
2019 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
2020 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
2021 (QScrollBar::setKnobProportion): Ditto.
2022 (QScrollBar::scrollbarHit): Ditto.
2024 * kwq/KWQScrollView.mm:
2025 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
2026 hack where we don't remove right away when doing mouse tracking.
2027 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
2028 the hack where we don't add right away when doing mouse tracking.
2030 * kwq/KWQSlider.h: Added destructor.
2032 (-[KWQSlider initWithQSlider:]): Tweaked a little.
2033 (-[KWQSlider detachQSlider]): Added.
2034 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
2035 (-[KWQSlider widget]): Added.
2036 (QSlider::~QSlider): Added. Calls detachQSlider.
2038 * kwq/KWQTextArea.h: Added detachQTextEdit method.
2039 * kwq/KWQTextArea.mm:
2040 (-[KWQTextArea detachQTextEdit]): Added.
2041 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
2042 (-[KWQTextArea becomeFirstResponder]): Ditto.
2043 (-[KWQTextArea nextKeyView]): Ditto.
2044 (-[KWQTextArea previousKeyView]): Ditto.
2045 (-[KWQTextArea drawRect:]): Ditto.
2046 (-[KWQTextAreaTextView insertTab:]): Ditto.
2047 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
2048 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
2049 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
2050 (-[KWQTextAreaTextView mouseDown:]): Ditto.
2051 (-[KWQTextAreaTextView keyDown:]): Ditto.
2052 (-[KWQTextAreaTextView keyUp:]): Ditto.
2054 * kwq/KWQTextEdit.h: Added ~QTextEdit.
2055 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
2057 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
2058 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
2060 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
2061 Added beforeMouseDown and afterMouseDown for use in widget implementations.
2062 Removed unused hasMouseTracking function.
2064 (QWidget::QWidget): Initialize two new fields.
2065 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
2066 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
2067 (QWidget::addToSuperview): Added.
2068 (QWidget::removeFromSuperview): Added.
2069 (QWidget::beforeMouseDown): Added.
2070 (QWidget::afterMouseDown): Added.
2072 * khtml/rendering/render_layer.cpp:
2073 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
2074 (RenderLayer::setHasVerticalScrollbar): Ditto.
2076 2004-11-30 Ken Kocienda <kocienda@apple.com>
2082 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
2084 * khtml/khtml_part.cpp:
2085 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
2086 with no blink if it is.
2088 2004-11-30 Ken Kocienda <kocienda@apple.com>
2094 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
2096 * khtml/khtml_part.cpp:
2097 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
2098 or <input type=image> was checked for focus since these elements are keyboard-focusable,
2099 but not mouse focusable. Also, this function did not work hard enough to set the focused
2100 node, and was content to clear it if the first element checked failed the test, rather
2101 than looking more at parents. This would have the effect of clearing, then resetting the
2102 focus on a DIV containing a button or image with content on either side of it in the
2103 process of arrowing over such content.
2105 2004-11-30 Ken Kocienda <kocienda@apple.com>
2109 * khtml/editing/htmlediting.cpp:
2110 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
2111 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
2112 * khtml/khtml_part.cpp:
2113 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
2114 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
2115 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
2116 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
2117 isCharacterSmartReplaceExempt virtual.
2119 2004-11-30 Ken Kocienda <kocienda@apple.com>
2123 * khtml/editing/htmlediting.cpp:
2124 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
2125 Seemed simple enough to land without review.
2127 2004-11-29 Ken Kocienda <kocienda@apple.com>
2131 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
2132 are handled correctly now, including selections that span multiple blocks, and cases
2133 where content on the pasteboard ends in newlines (or what appear to be newlines to a
2134 user, really block ends or BRs). I also made one small, but important change in the
2135 copy code to annotate the markup written to the pasteboard to support these selections
2138 New header that defines a couple of constants used in copying and pasting.
2140 * ForwardingHeaders/editing/html_interchange.h: Added.
2141 * khtml/editing/html_interchange.h: Added.
2143 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
2144 as a new helper class, ReplacementFragment, which encapsulates information and functions
2145 pertaining to a document fragment that is being inserted into a document.
2147 * khtml/editing/htmlediting.cpp:
2148 (khtml::ReplacementFragment::ReplacementFragment):
2149 (khtml::ReplacementFragment::~ReplacementFragment):
2150 (khtml::ReplacementFragment::firstChild): Simple accessor.
2151 (khtml::ReplacementFragment::lastChild): Ditto.
2152 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
2153 the starting node to use for merging into the block containing the start of the selection.
2154 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
2155 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
2156 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
2157 special annotation comment added in by the copy code.
2158 (khtml::ReplacementFragment::removeNode): Simple helper.
2159 (khtml::isComment): Simple helper.
2160 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
2161 I would like to do better than this some day, but this check will hold us until I can do better.
2162 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
2163 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
2164 (khtml::ReplaceSelectionCommand::doApply):
2165 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
2166 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
2167 (khtml::ReplacementFragment::root):
2168 (khtml::ReplacementFragment::type):
2169 (khtml::ReplacementFragment::isEmpty):
2170 (khtml::ReplacementFragment::isSingleTextNode):
2171 (khtml::ReplacementFragment::isTreeFragment):
2172 (khtml::ReplacementFragment::hasMoreThanOneBlock):
2173 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
2175 This smaller set of changes markup generation to add the newline annotation described in the
2176 comment at the start of this entry.
2178 * khtml/xml/dom2_rangeimpl.cpp:
2179 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
2180 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
2181 comment annotations are added to the markup generated.
2182 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
2183 * kwq/WebCoreBridge.mm:
2184 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
2185 DOM::RangeImpl::toHTML uses annotations when generating.
2189 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
2190 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
2191 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
2192 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
2193 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
2194 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
2195 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
2196 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
2197 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
2198 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
2199 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
2200 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
2201 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
2202 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
2203 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
2204 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
2205 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
2206 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
2208 2004-11-29 Ken Kocienda <kocienda@apple.com>
2210 Reviewed by Harrison
2212 Made two small changes that make it possible for comments to have DOM nodes made for them
2213 when pasting. This relies on some earlier work I did some days ago.
2215 * khtml/xml/dom_nodeimpl.cpp:
2216 (NodeImpl::startMarkup): Get the string from the comment.
2217 * kwq/WebCoreBridge.mm:
2218 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
2219 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
2220 be included in the DOM.
2222 2004-11-29 Ken Kocienda <kocienda@apple.com>
2224 Reviewed by Harrison
2226 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
2227 my improved paste code.
2229 * khtml/editing/visible_position.cpp:
2230 (khtml::blockRelationship)
2231 (khtml::visiblePositionsInDifferentBlocks)
2232 (khtml::isFirstVisiblePositionInBlock)
2233 (khtml::isFirstVisiblePositionInNode)
2234 (khtml::isLastVisiblePositionInBlock)
2235 * khtml/editing/visible_position.h
2237 2004-11-29 Ken Kocienda <kocienda@apple.com>
2239 Reviewed by Harrison
2241 * khtml/xml/dom_position.cpp:
2242 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
2243 specified from obeying that directive. The old code would stop at an outer block boundary in
2244 the case where that block had a block as its first child. The correct behavior is to drill into
2245 that inner block (and continue on drilling down, if possible), to find the correct position.
2247 2004-11-29 Ken Kocienda <kocienda@apple.com>
2249 Reviewed by Harrison
2251 Small improvements to the node-display debugging helpers.
2253 * khtml/xml/dom_nodeimpl.cpp:
2254 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
2255 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
2257 2004-11-29 Ken Kocienda <kocienda@apple.com>
2259 Reviewed by Harrison
2261 * khtml/editing/htmlediting.cpp:
2262 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
2263 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
2264 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
2265 place after the delete.
2267 2004-11-29 Ken Kocienda <kocienda@apple.com>
2269 Reviewed by Harrison
2271 Add a new helper function to insert a paragraph separator. Will be used in my
2272 upcoming paste improvments.
2274 * khtml/editing/htmlediting.cpp: Added function
2275 (khtml::CompositeEditCommand::insertParagraphSeparator)
2276 * khtml/editing/htmlediting.h: Ditto.
2278 2004-11-23 David Harrison <harrison@apple.com>
2280 Added various comments.
2282 * khtml/editing/htmlediting.cpp:
2283 (khtml::StyleChange::init):
2284 (khtml::ApplyStyleCommand::doApply):
2285 (khtml::ApplyStyleCommand::applyBlockStyle):
2286 (khtml::ApplyStyleCommand::applyInlineStyle):
2288 2004-11-23 David Hyatt <hyatt@apple.com>
2290 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
2291 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
2293 * khtml/rendering/render_block.cpp:
2294 (khtml::RenderBlock::nodeAtPoint):
2296 2004-11-22 David Hyatt <hyatt@apple.com>
2298 Make sure you can use document.createElement to make a <canvas> element.
2300 * khtml/xml/dom_docimpl.cpp:
2301 (DocumentImpl::createHTMLElement):
2303 2004-11-22 Maciej Stachowiak <mjs@apple.com>
2307 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
2308 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
2309 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
2310 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
2312 * khtml/ecma/kjs_html.cpp:
2313 (KJS::HTMLDocument::tryGet):
2314 * khtml/html/html_formimpl.cpp:
2315 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
2316 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2317 * khtml/html/html_formimpl.h:
2318 * khtml/html/html_miscimpl.cpp:
2319 (HTMLCollectionImpl::HTMLCollectionImpl):
2320 (HTMLCollectionImpl::~HTMLCollectionImpl):
2321 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
2322 (HTMLCollectionImpl::CollectionInfo::reset):
2323 (HTMLCollectionImpl::resetCollectionInfo):
2324 (HTMLCollectionImpl::checkForNameMatch):
2326 (HTMLCollectionImpl::updateNameCache):
2327 (HTMLCollectionImpl::namedItems):
2328 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
2329 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
2330 (HTMLFormCollectionImpl::item):
2331 (HTMLFormCollectionImpl::updateNameCache):
2332 * khtml/html/html_miscimpl.h:
2334 2004-11-22 David Hyatt <hyatt@apple.com>
2336 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
2341 * khtml/misc/loader.cpp:
2342 (CachedObject::finish):
2345 * khtml/misc/loader.h:
2346 (khtml::Cache::maxCacheableObjectSize):
2348 2004-11-22 David Hyatt <hyatt@apple.com>
2350 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
2351 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
2352 that lets us short circuit earlier when painting and hit testing.
2356 * khtml/khtml_part.cpp:
2357 (KHTMLPart::isPointInsideSelection):
2358 * khtml/rendering/render_block.cpp:
2359 (khtml::RenderBlock::paint):
2360 (khtml::RenderBlock::paintChildren):
2361 (khtml::RenderBlock::paintObject):
2362 (khtml::RenderBlock::paintFloats):
2363 (khtml::RenderBlock::nodeAtPoint):
2364 * khtml/rendering/render_block.h:
2365 * khtml/rendering/render_box.cpp:
2366 (RenderBox::nodeAtPoint):
2367 * khtml/rendering/render_box.h:
2368 * khtml/rendering/render_br.h:
2369 * khtml/rendering/render_canvas.cpp:
2370 (RenderCanvas::paint):
2371 * khtml/rendering/render_flow.cpp:
2372 (RenderFlow::paintLines):
2373 (RenderFlow::hitTestLines):
2374 (RenderFlow::caretRect):
2375 (RenderFlow::addFocusRingRects):
2376 (RenderFlow::paintFocusRing):
2377 (RenderFlow::paintOutlines):
2378 (RenderFlow::paintOutlineForLine):
2379 * khtml/rendering/render_flow.h:
2380 * khtml/rendering/render_frames.cpp:
2381 (RenderFrameSet::nodeAtPoint):
2382 * khtml/rendering/render_frames.h:
2383 * khtml/rendering/render_image.cpp:
2384 (RenderImage::nodeAtPoint):
2385 * khtml/rendering/render_image.h:
2386 * khtml/rendering/render_inline.cpp:
2387 (RenderInline::paint):
2388 (RenderInline::nodeAtPoint):
2389 * khtml/rendering/render_inline.h:
2390 * khtml/rendering/render_layer.cpp:
2391 (RenderLayer::paintLayer):
2392 (RenderLayer::hitTest):
2393 (RenderLayer::hitTestLayer):
2394 * khtml/rendering/render_layer.h:
2395 * khtml/rendering/render_line.cpp:
2396 (khtml::InlineBox::paint):
2397 (khtml::InlineBox::nodeAtPoint):
2398 (khtml::InlineFlowBox::flowObject):
2399 (khtml::InlineFlowBox::nodeAtPoint):
2400 (khtml::InlineFlowBox::paint):
2401 (khtml::InlineFlowBox::paintBackgrounds):
2402 (khtml::InlineFlowBox::paintBackground):
2403 (khtml::InlineFlowBox::paintBackgroundAndBorder):
2404 (khtml::InlineFlowBox::paintDecorations):
2405 (khtml::EllipsisBox::paint):
2406 (khtml::EllipsisBox::nodeAtPoint):
2407 (khtml::RootInlineBox::paintEllipsisBox):
2408 (khtml::RootInlineBox::paint):
2409 (khtml::RootInlineBox::nodeAtPoint):
2410 * khtml/rendering/render_line.h:
2411 (khtml::InlineRunBox::paintBackgroundAndBorder):
2412 * khtml/rendering/render_object.cpp:
2413 (RenderObject::hitTest):
2414 (RenderObject::setInnerNode):
2415 (RenderObject::nodeAtPoint):
2416 * khtml/rendering/render_object.h:
2417 (khtml::RenderObject::PaintInfo::PaintInfo):
2418 (khtml::RenderObject::PaintInfo::~PaintInfo):
2419 (khtml::RenderObject::paintingRootForChildren):
2420 (khtml::RenderObject::shouldPaintWithinRoot):
2421 * khtml/rendering/render_table.cpp:
2422 (RenderTable::layout):
2423 (RenderTable::paint):
2424 * khtml/rendering/render_text.cpp:
2425 (simpleDifferenceBetweenColors):
2426 (correctedTextColor):
2427 (InlineTextBox::nodeAtPoint):
2428 (InlineTextBox::paint):
2429 (InlineTextBox::selectionStartEnd):
2430 (InlineTextBox::paintSelection):
2431 (InlineTextBox::paintMarkedTextBackground):
2432 (InlineTextBox::paintDecoration):
2433 (RenderText::posOfChar):
2434 * khtml/rendering/render_text.h:
2435 (khtml::RenderText::paint):
2436 (khtml::RenderText::layout):
2437 (khtml::RenderText::nodeAtPoint):
2438 * khtml/xml/dom2_eventsimpl.cpp:
2439 (MouseEventImpl::computeLayerPos):
2440 * khtml/xml/dom_docimpl.cpp:
2441 (DocumentImpl::prepareMouseEvent):
2442 * kwq/KWQAccObject.mm:
2443 (-[KWQAccObject accessibilityHitTest:]):
2444 * kwq/KWQKHTMLPart.mm:
2445 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
2446 (KWQKHTMLPart::eventMayStartDrag):
2447 (KWQKHTMLPart::khtmlMouseMoveEvent):
2448 * kwq/WebCoreBridge.mm:
2449 (-[WebCoreBridge elementAtPoint:]):
2450 (-[WebCoreBridge _positionForPoint:]):
2452 2004-11-22 Maciej Stachowiak <mjs@apple.com>
2456 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
2457 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
2459 This avoids the O(N^2) penalty for named item traversal for form collections.
2461 It also combines the item traversal logic for all non-form
2462 collection operations into a single traverseNextItem
2463 function. This avoids having 5 copies of the big switch statement
2466 Also fixed a bug that prevented the last form element from being removed properly.
2468 * khtml/html/html_formimpl.cpp:
2469 (DOM::removeFromVector):
2470 * khtml/dom/html_misc.cpp:
2471 (HTMLCollection::namedItems):
2472 * khtml/dom/html_misc.h:
2473 * khtml/ecma/kjs_html.cpp:
2474 (KJS::HTMLCollection::getNamedItems):
2475 * khtml/html/html_miscimpl.cpp:
2476 (HTMLCollectionImpl::traverseNextItem):
2477 (HTMLCollectionImpl::calcLength):
2478 (HTMLCollectionImpl::length):
2479 (HTMLCollectionImpl::item):
2480 (HTMLCollectionImpl::nextItem):
2481 (HTMLCollectionImpl::checkForNameMatch):
2482 (HTMLCollectionImpl::namedItem):
2483 (HTMLCollectionImpl::namedItems):
2484 (HTMLCollectionImpl::nextNamedItem):
2485 (HTMLFormCollectionImpl::calcLength):
2486 (HTMLFormCollectionImpl::namedItem):
2487 (HTMLFormCollectionImpl::nextNamedItem):
2488 (HTMLFormCollectionImpl::namedItems):
2489 * khtml/html/html_miscimpl.h:
2491 2004-11-22 Ken Kocienda <kocienda@apple.com>
2493 Reviewed by Harrison
2495 Change around the way we block the Javascript "Paste" command identifier from
2496 being available. Formerly, this was done with an ifdef we never compiled in.
2497 Now, this is done with a couple of cheap runtime checks. The advantage is that
2498 we can now compile this command into development builds, and still yet switch
2499 on the command in deployment builds through the use of WebCore SPI so we can
2500 write and run layout tests with all of our builds.
2502 * khtml/editing/jsediting.cpp:
2503 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
2504 command being queried is the paste command.
2505 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
2506 * khtml/editing/jsediting.h: Ditto.
2507 * khtml/khtml_part.cpp:
2508 (KHTMLPart::pasteFromPasteboard): Added.
2509 (KHTMLPart::canPaste): Added.
2510 * kwq/KWQKHTMLPart.mm:
2511 (KHTMLPart::canPaste): Added.
2512 * kwq/KWQRenderTreeDebug.cpp:
2513 (externalRepresentation): Turn on paste command.
2514 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
2516 2004-11-21 Maciej Stachowiak <mjs@apple.com>
2518 Reviewed by Richard.
2520 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
2522 * khtml/html/html_miscimpl.cpp:
2523 (HTMLCollectionImpl::calcLength):
2524 (HTMLCollectionImpl::getItem):
2525 (HTMLCollectionImpl::item):
2526 (HTMLCollectionImpl::nextItem):
2527 (HTMLCollectionImpl::getNamedItem):
2528 (HTMLCollectionImpl::namedItem):
2529 (HTMLCollectionImpl::nextNamedItemInternal):
2530 (HTMLFormCollectionImpl::nextNamedItemInternal):
2532 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2536 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
2537 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
2538 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
2540 Many optimizations to HTMLFormCollection. Iterating it should not
2541 be N^2 any more, though finding items by name could still be.
2543 * khtml/html/html_formimpl.cpp:
2544 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2545 (DOM::HTMLFormElementImpl::length):
2546 (DOM::HTMLFormElementImpl::submitClick):
2547 (DOM::HTMLFormElementImpl::formData):
2548 (DOM::HTMLFormElementImpl::submit):
2549 (DOM::HTMLFormElementImpl::reset):
2550 (DOM::HTMLFormElementImpl::radioClicked):
2551 (DOM::appendToVector):
2552 (DOM::removeFromVector):
2553 (DOM::HTMLFormElementImpl::registerFormElement):
2554 (DOM::HTMLFormElementImpl::removeFormElement):
2555 (DOM::HTMLFormElementImpl::makeFormElementDormant):
2556 (DOM::HTMLFormElementImpl::registerImgElement):
2557 (DOM::HTMLFormElementImpl::removeImgElement):
2558 * khtml/html/html_formimpl.h:
2559 * khtml/html/html_miscimpl.cpp:
2560 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
2561 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
2562 (HTMLFormCollectionImpl::resetCollectionInfo):
2563 (HTMLFormCollectionImpl::calcLength):
2564 (HTMLFormCollectionImpl::item):
2565 (HTMLFormCollectionImpl::getNamedItem):
2566 (HTMLFormCollectionImpl::getNamedFormItem):
2567 (HTMLFormCollectionImpl::firstItem):
2568 (HTMLFormCollectionImpl::nextItem):
2569 * khtml/html/html_miscimpl.h:
2570 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
2571 * khtml/xml/dom_elementimpl.cpp:
2572 (ElementImpl::setAttribute):
2573 (ElementImpl::setAttributeMap):
2574 * kwq/KWQPtrVector.h:
2575 (QPtrVector::findRef):
2576 * kwq/KWQVectorImpl.h:
2577 * kwq/KWQVectorImpl.mm:
2578 (KWQVectorImpl::findRef):
2579 * kwq/WebCoreBridge.mm:
2580 (-[WebCoreBridge elementWithName:inForm:]):
2581 (-[WebCoreBridge controlsInForm:]):
2583 2004-11-19 David Harrison <harrison@apple.com>
2585 Reviewed by Ken and Darin.
2587 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
2589 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
2590 for the existing style, but in this case (hitting cmd-B with caret at top of
2591 file) there is nothing upstream. Changed this to use the VisiblePosition
2592 deepEquivalent instead.
2594 * khtml/khtml_part.cpp:
2595 (KHTMLPart::computeAndSetTypingStyle):
2599 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2603 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
2605 * khtml/xml/dom_docimpl.cpp:
2606 (DocumentImpl::close): Don't fire the onload handler if there is a
2607 redirect pending. This is a very long-standing bug that was masked
2608 by our previously incorrect redirect logic. It used to be that an
2609 older redirect would always win. Recently we changed things so
2610 that a newer redirect would win, but a script that causes a
2611 redirect would stop parsing once complete (so if there are two
2612 redirects in the same script, the latter wins). However, we should
2613 have also prevented onload in this case. Testing with other
2614 browsers shows that onload handlers do not run at all when there
2615 is a pending redirect.
2617 2004-11-19 Ken Kocienda <kocienda@apple.com>
2619 Reviewed by Harrison
2621 Fix some object lifetime issues in these two commands. This fixes some crashes
2622 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
2624 * khtml/editing/htmlediting.cpp:
2625 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
2626 in the ancestor list. They are not ref'ed when put on list. D'uh.
2627 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
2628 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
2629 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
2631 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
2633 2004-11-19 Ken Kocienda <kocienda@apple.com>
2635 Reviewed by Harrison
2639 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
2641 * khtml/khtml_part.cpp:
2642 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
2643 declaration given the current selection, and then sets the minimum necessary style as the typing
2645 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
2646 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
2648 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
2649 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
2650 * kwq/WebCoreBridge.mm:
2651 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
2652 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
2654 2004-11-18 David Harrison <harrison@apple.com>
2658 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
2659 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
2662 (-[DOMCSSStyleDeclaration setProperty:::]):
2664 2004-11-18 Chris Blumenberg <cblu@apple.com>
2666 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
2670 * kwq/KWQKHTMLPart.mm:
2671 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
2673 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2677 - fix recursive item traversal, use traverseNextNode() instead of
2678 the buggy hand-rolled traversal.
2680 * khtml/xml/dom_nodeimpl.cpp:
2681 (NodeListImpl::recursiveItem):
2683 2004-11-17 Darin Adler <darin@apple.com>
2687 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
2689 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
2690 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
2692 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
2693 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
2694 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
2695 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
2696 an entire category of leaks we have been fixing one by one recently
2697 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
2698 stale RenderObject pointer, although I never saw it do that in practice
2699 - implemented the length and item methods for computed styles
2700 - implemented querying additional properties in computed styles (29 more)
2702 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
2703 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
2704 take a mutable style.
2705 * khtml/khtml_part.cpp:
2706 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
2707 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
2708 a computed style; also change some types to mutable style.
2709 (updateState): Update iteration of CSSProperty objects in a style declaration to use
2710 the new valuesIterator interface.
2711 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
2712 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
2713 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
2714 including accomodating the exception code that setCssText has now.
2715 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
2716 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
2717 the style attributes really was a change, although it's not an important optimization it's
2718 good to do it right.
2720 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
2721 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
2722 calling it were already removing the old property explicitly, so the code in here to remove
2723 the property again was redundant.
2725 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
2726 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
2727 * khtml/css/css_computedstyle.cpp:
2728 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
2729 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
2730 Before we had no guarantee the object would outlast us.
2731 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
2732 exception to NO_MODIFICATION_ALLOWED_ERR.
2733 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
2734 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
2735 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
2736 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
2737 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
2738 page-break-inside, position, unicode-bidi, widows, z-index.
2739 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
2740 exception to NO_MODIFICATION_ALLOWED_ERR.
2741 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
2742 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
2743 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
2744 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
2745 CSSMutableStyleDeclarationImpl.
2746 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
2747 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
2749 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
2750 now a separate class rather than a typedef.
2751 * khtml/css/cssparser.h: Ditto.
2753 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
2754 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
2755 Removed a bunch of redundant stuff from other classes in this file too.
2756 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
2757 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
2758 (DOM::CSSProperty::operator=): Added.
2759 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
2761 * khtml/css/css_valueimpl.cpp:
2762 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
2763 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
2764 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
2765 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
2766 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
2767 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
2768 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
2769 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
2770 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
2771 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
2772 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
2773 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
2774 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
2775 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
2776 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
2777 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
2778 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
2779 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
2780 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
2781 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
2782 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
2783 no styles in the list. Update to use QValueList.
2784 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
2785 parameter and set it.
2786 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
2787 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
2788 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
2789 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
2790 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
2791 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
2793 * khtml/css/cssparser.cpp:
2794 (CSSParser::parseValue): Changed to use addParsedProperties.
2795 (CSSParser::parseDeclaration): Ditto.
2796 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
2798 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
2799 * khtml/css/cssproperties.c: Regenerated.
2800 * khtml/css/cssproperties.h: Regenerated.
2802 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
2803 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
2805 * khtml/dom/css_value.cpp:
2806 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
2807 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
2808 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
2809 first doing getPropertyCSSValue and then doing cssText.
2810 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
2811 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
2812 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
2813 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
2814 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
2815 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
2816 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
2818 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
2819 * khtml/dom/dom_node.cpp: Ditto.
2821 * khtml/editing/htmlediting.h: Change some types to mutable style.
2822 * khtml/editing/htmlediting.cpp:
2823 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
2824 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
2825 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
2826 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
2827 (khtml::EditCommand::setTypingStyle): Ditto.
2828 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
2829 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
2830 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
2831 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
2832 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
2833 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
2834 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
2835 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2836 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
2837 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
2838 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
2839 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
2840 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
2842 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
2843 * khtml/html/html_baseimpl.h: Change type to mutable style.
2844 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
2846 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
2847 class as a base class, and change types to mutable style as needed.
2848 * khtml/html/html_elementimpl.cpp:
2849 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
2850 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
2851 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
2852 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
2853 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
2854 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
2856 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
2859 * khtml/html/html_tableimpl.h: Change types to mutable style.
2860 * khtml/html/html_tableimpl.cpp:
2861 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2862 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
2863 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
2865 * khtml/html/htmlparser.cpp:
2866 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
2867 than using an explicit delete to make the node go away, and is required for compatibility with the
2868 changes to the NodeImpl functions.
2869 (KHTMLParser::insertNode): Ditto.
2870 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
2871 the NodeImpl functions.
2873 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
2874 now that there's no need to make the property list explictly.
2877 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
2878 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
2879 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
2881 * khtml/xml/dom_nodeimpl.cpp:
2882 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
2883 function succeeded or not for ownership purposes.
2884 (NodeImpl::replaceChild): Ditto.
2885 (NodeImpl::appendChild): Ditto.
2886 (NodeBaseImpl::insertBefore): Ditto.
2887 (NodeBaseImpl::replaceChild): Ditto.
2888 (NodeBaseImpl::appendChild): Ditto.
2889 (NodeBaseImpl::addChild): Ditto.
2891 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
2892 * WebCore-combined.exp: Regenerated.
2894 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2896 still even more build fixing
2898 * khtml/html/html_miscimpl.cpp:
2899 (HTMLCollectionImpl::resetCollectionInfo):
2901 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2905 * khtml/html/html_miscimpl.cpp:
2906 (HTMLCollectionImpl::resetCollectionInfo):
2908 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2910 Fixed build problem.
2912 * khtml/html/html_miscimpl.h:
2913 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
2915 2004-11-18 Maciej Stachowiak <mjs@apple.com>
2919 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
2921 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
2922 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
2924 This is also a start on fixing 5 other bugs, but those need additional work to make
2925 HTMLFormCollection fast.
2927 * khtml/html/html_documentimpl.h:
2928 (DOM::HTMLDocumentImpl::collectionInfo):
2929 * khtml/html/html_formimpl.cpp:
2930 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2931 (DOM::HTMLFormElementImpl::isURLAttribute):
2932 (DOM::HTMLFormElementImpl::registerImgElement):
2933 (DOM::HTMLFormElementImpl::removeImgElement):
2934 * khtml/html/html_formimpl.h:
2935 * khtml/html/html_imageimpl.cpp:
2936 (HTMLImageElementImpl::HTMLImageElementImpl):
2937 (HTMLImageElementImpl::~HTMLImageElementImpl):
2938 * khtml/html/html_imageimpl.h:
2939 * khtml/html/html_miscimpl.cpp:
2940 (HTMLCollectionImpl::HTMLCollectionImpl):
2941 (HTMLCollectionImpl::~HTMLCollectionImpl):
2942 (HTMLCollectionImpl::updateCollectionInfo):
2943 (HTMLCollectionImpl::length):
2944 (HTMLCollectionImpl::item):
2945 (HTMLCollectionImpl::firstItem):
2946 (HTMLCollectionImpl::nextItem):
2947 (HTMLCollectionImpl::namedItem):
2948 (HTMLCollectionImpl::nextNamedItemInternal):
2949 (HTMLFormCollectionImpl::getNamedFormItem):
2950 * khtml/html/html_miscimpl.h:
2951 (DOM::HTMLCollectionImpl::):
2952 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
2953 * khtml/html/htmlparser.cpp:
2954 (KHTMLParser::getElement):
2955 * khtml/xml/dom_docimpl.cpp:
2956 (DocumentImpl::DocumentImpl):
2957 * khtml/xml/dom_docimpl.h:
2958 (DOM::DocumentImpl::incDOMTreeVersion):
2959 (DOM::DocumentImpl::domTreeVersion):
2960 * khtml/xml/dom_nodeimpl.cpp:
2964 2004-11-18 Kevin Decker <kdecker@apple.com>
2968 fixed: <rdar://problem/3841842> getPropertyID expensive
2971 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
2973 2004-11-17 David Hyatt <hyatt@apple.com>
2975 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
2976 and subsequently backed out).
2978 Reviewed by kocienda
2980 * khtml/html/html_baseimpl.cpp:
2981 (HTMLBodyElementImpl::insertedIntoDocument):
2982 * khtml/html/htmltokenizer.cpp:
2983 (khtml::HTMLTokenizer::reset):
2984 (khtml::HTMLTokenizer::scriptHandler):
2985 (khtml::HTMLTokenizer::scriptExecution):
2986 (khtml::HTMLTokenizer::write):
2987 (khtml::HTMLTokenizer::continueProcessing):
2988 (khtml::HTMLTokenizer::timerEvent):
2989 (khtml::HTMLTokenizer::notifyFinished):
2990 * khtml/html/htmltokenizer.h:
2991 * khtml/khtmlview.cpp:
2992 (KHTMLViewPrivate::KHTMLViewPrivate):
2993 (KHTMLViewPrivate::reset):
2995 (KHTMLView::layout):
2996 (KHTMLView::timerEvent):
2997 (KHTMLView::scheduleRelayout):
2998 (KHTMLView::layoutPending):
2999 (KHTMLView::haveDelayedLayoutScheduled):
3000 (KHTMLView::unscheduleRelayout):
3001 * khtml/khtmlview.h:
3002 * khtml/xml/dom_docimpl.cpp:
3003 (DocumentImpl::DocumentImpl):
3004 (DocumentImpl::close):
3005 (DocumentImpl::setParsing):
3006 (DocumentImpl::shouldScheduleLayout):
3007 (DocumentImpl::minimumLayoutDelay):
3008 (DocumentImpl::write):
3009 (DocumentImpl::finishParsing):
3010 (DocumentImpl::stylesheetLoaded):
3011 (DocumentImpl::updateStyleSelector):
3012 * khtml/xml/dom_docimpl.h:
3013 (DOM::DocumentImpl::parsing):
3014 * kwq/KWQDateTime.mm:
3015 (KWQUIEventTime::uiEventPending):
3017 2004-11-17 David Harrison <harrison@apple.com>
3019 Reviewed by Ken Kocienda.
3021 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
3022 Treat null case as meaning no post-move merge is needed.
3024 * khtml/editing/htmlediting.cpp:
3025 (khtml::DeleteSelectionCommand::initializePositionData):
3027 2004-11-17 David Harrison <harrison@apple.com>
3029 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
3030 * khtml/xml/dom_nodeimpl.cpp:
3031 (NodeImpl::displayNode):
3032 (NodeImpl::displayTree):
3033 (NodeBaseImpl::dispatchChildRemovalEvents):
3034 * khtml/xml/dom_nodeimpl.h:
3036 2004-11-16 John Sullivan <sullivan@apple.com>
3038 Reviewed by Richard.
3040 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
3042 * khtml/khtml_part.cpp:
3044 delete the list we created when we're done with it
3046 2004-11-16 Ken Kocienda <kocienda@apple.com>
3050 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
3051 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
3052 QPtrList when the list goes out of scope.
3054 * khtml/editing/htmlediting.cpp:
3055 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
3056 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
3057 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
3058 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
3059 No longer set lists to autodelete.
3060 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
3061 Call new derefNodesInList helper.
3062 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
3063 of one before, but now it does.
3065 2004-11-15 David Harrison <harrison@apple.com>
3067 Reviewed by Chris and Darin.
3069 <rdar://problem/3880304> Non-linear performance hit for style changes
3071 * khtml/xml/dom_nodeimpl.cpp:
3072 (NodeImpl::traverseNextNode):
3073 (NodeImpl::traverseNextSibling):
3074 (NodeImpl::traversePreviousNodePostOrder):
3075 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
3076 Add asserts that stayWithin is an ancestor of the returned node.
3078 2004-11-15 Darin Adler <darin@apple.com>
3082 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
3084 * khtml/css/css_computedstyle.cpp:
3085 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
3086 since there's no guarantee it's already ref'd.
3087 * khtml/css/css_valueimpl.cpp:
3088 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
3089 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
3090 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
3091 (CSSStyleDeclarationImpl::merge): Ditto.
3092 (CSSStyleDeclarationImpl::diff): Ditto.
3093 * khtml/editing/htmlediting.cpp:
3094 (khtml::StyleChange::currentlyHasStyle): Ditto.
3095 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
3096 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
3097 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
3099 2004-11-15 Darin Adler <darin@apple.com>
3103 Use separate mutable style and computed style types as appropriate.
3104 For now this should have no effect, but it prepares us for refactoring later.
3105 Also remove some unnecessary "DOM::" prefixes and in one case factor out
3108 * khtml/khtml_part.cpp:
3109 (KHTMLPart::typingStyle):
3110 (KHTMLPart::setTypingStyle):
3112 (KHTMLPart::selectionHasStyle):
3113 (KHTMLPart::selectionStartHasStyle):
3114 (KHTMLPart::selectionComputedStyle):
3115 * khtml/khtml_part.h:
3116 * khtml/khtmlpart_p.h:
3118 * khtml/css/css_base.h:
3119 * khtml/css/css_ruleimpl.cpp:
3120 (CSSStyleRuleImpl::setDeclaration):
3121 * khtml/css/css_ruleimpl.h:
3122 (DOM::CSSFontFaceRuleImpl::style):
3123 (DOM::CSSPageRuleImpl::style):
3124 (DOM::CSSStyleRuleImpl::style):
3125 (DOM::CSSStyleRuleImpl::declaration):
3126 * khtml/css/css_valueimpl.h:
3127 (DOM::CSSPrimitiveValueImpl::):
3128 * khtml/css/cssparser.cpp:
3129 (CSSParser::parseValue):
3130 (CSSParser::parseColor):
3131 (CSSParser::parseDeclaration):
3132 (CSSParser::createStyleDeclaration):
3133 * khtml/css/cssparser.h:
3134 * khtml/css/cssstyleselector.cpp:
3135 (khtml::CSSStyleSelector::addMatchedDeclaration):
3136 (khtml::CSSStyleSelector::matchRulesForList):
3137 (khtml::CSSStyleSelector::styleForElement):
3138 (khtml::CSSStyleSelector::applyDeclarations):
3139 * khtml/css/cssstyleselector.h:
3140 * khtml/css/parser.cpp:
3141 * khtml/css/parser.y:
3142 * khtml/dom/css_rule.h:
3143 * khtml/dom/css_stylesheet.h:
3144 * khtml/dom/css_value.h:
3145 * khtml/dom/dom2_views.cpp:
3146 * khtml/xml/dom2_viewsimpl.cpp:
3147 (DOM::AbstractViewImpl::getComputedStyle):
3148 * khtml/xml/dom_docimpl.cpp:
3149 (DocumentImpl::importNode):
3150 (DocumentImpl::setStyleSheet):
3151 * khtml/xml/dom_docimpl.h:
3152 * khtml/xml/dom_xmlimpl.cpp:
3153 (DOM::ProcessingInstructionImpl::setStyleSheet):
3154 * khtml/xml/dom_xmlimpl.h:
3156 * khtml/dom/css_value.cpp:
3157 (DOM::throwException): Added.
3158 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
3159 The real thing is coming with the next change to refactor.
3160 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
3161 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
3163 2004-11-15 Darin Adler <darin@apple.com>
3167 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
3169 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
3170 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
3171 node's attributes changed without sending a misleading childrenChanged call,
3172 but the childrenChanged call can happen at the exact right moment.
3173 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
3174 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
3175 the boolean true is passed in.
3177 * khtml/xml/dom_elementimpl.cpp:
3178 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
3179 (NamedAttrMapImpl::removeAttribute): Ditto.
3181 2004-11-15 John Sullivan <sullivan@apple.com>
3185 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
3186 seen often in Mail and Blot
3188 * khtml/css/css_valueimpl.cpp:
3189 (CSSStyleDeclarationImpl::copyPropertiesInSet):
3190 delete temporary list after we're done using it
3192 2004-11-15 Richard Williamson <rjw@apple.com>
3194 Fixed leak (3879883) that John found. Early return leaked
3199 * khtml/css/css_computedstyle.cpp:
3200 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3202 2004-11-15 Ken Kocienda <kocienda@apple.com>
3208 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
3210 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
3211 EditCommandPtr to its parent, but this caused a a reference cycle in composite
3212 commands as the children held a ref to their parent. Now, the parent variable
3213 is a non-retained reference to an EditCommand *. It would be nice to have a
3214 weak reference to the parent or even override deref in composite commands (but I
3215 can't since deref() is not virtual). However, this should be OK since any
3216 dangling parent pointer is a sign of a bigger object lifetime problem that
3217 would need to be addressed anyway.
3219 * khtml/css/css_valueimpl.cpp:
3220 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
3221 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
3222 just assigning the list variable passed in to the local list variable, or the list will be
3224 * khtml/editing/htmlediting.cpp:
3225 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
3226 (khtml::EditCommand::setEndingSelection): Ditto.
3227 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
3228 Unrelated to the change, but saves some ref's and deref's.
3229 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
3230 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
3231 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
3232 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
3234 2004-11-15 Maciej Stachowiak <mjs@apple.com>
3238 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
3240 * khtml/xml/dom_nodeimpl.cpp:
3241 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
3243 (NodeListImpl::recursiveLength): Adjusted for rename.
3244 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
3245 If the same offset is looked up again, just return it, otherwise, if looking up
3246 a later offset, start at the last item and proceed from there.
3247 (NodeListImpl::itemById): Apply the special document optimization to all
3248 nodes that are either a document or in a document - just walk up to make
3249 sure the node found by ID has the root node as an ancestor.
3250 (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
3251 * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
3253 2004-11-15 John Sullivan <sullivan@apple.com>
3257 - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
3259 * kwq/KWQKHTMLPart.mm:
3260 (KWQKHTMLPart::documentFragmentWithText):
3261 release mutable copy of string after we're done using it
3263 2004-11-14 Kevin Decker <kdecker@apple.com>
3267 fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
3269 * khtml/html/html_elementimpl.cpp:
3270 (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
3271 (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
3273 2004-11-13 Maciej Stachowiak <mjs@apple.com>
3277 <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
3279 * khtml/dom/dom_node.cpp:
3280 (NodeList::itemById): New method, just forward to impl.
3281 * khtml/dom/dom_node.h: Prototype it.
3282 * khtml/ecma/kjs_dom.cpp:
3283 (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
3284 let the NodeList do it. The NodeList might be able to do it more efficiently.
3285 * khtml/xml/dom_nodeimpl.cpp:
3286 (NodeListImpl::itemById): Optimize for the case where the NodeList
3287 covers the whole document. In this case, just use getElementById,
3288 then check that the element satisfies the list criteria.
3289 (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
3290 (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
3291 * khtml/xml/dom_nodeimpl.h:
3293 2004-11-12 Maciej Stachowiak <mjs@apple.com>
3297 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
3298 sometimes using a huge bogus length value.
3300 * khtml/xml/dom_nodeimpl.cpp:
3301 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
3303 2004-11-12 Darin Adler <darin@apple.com>
3307 - fixed an infinite loop in that last check-in
3309 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
3310 Added a ++i to the loop so it won't get stuck on the first element in the list.
3312 2004-11-12 Maciej Stachowiak <mjs@apple.com>
3316 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
3318 I fixed this by changing NodeLists to cache their length, but
3319 invalidate it whenever there is a change in the DOM subtree at
3320 which they are rooted. This makes NodeListImpl::recursiveLength()
3321 drop completely off the profile, since we were repeatedly getting
3322 a length for the same NodeList over and over.
3324 * khtml/xml/dom_nodeimpl.cpp: