1 2004-12-21 Maciej Stachowiak <mjs@apple.com>
5 <rdar://problem/3888931> frame naming allows malicious site to bring up a window when you click on a link in another
7 Added opener bridge method to help WebKit implement security check
8 for named frame visibility.
11 * kwq/WebCoreBridge.h:
12 * kwq/WebCoreBridge.mm:
13 (-[WebCoreBridge opener]):
15 2005-01-03 Ken Kocienda <kocienda@apple.com>
21 <rdar://problem/3933926> Tiger8A341: Mail crashes while forwarding embedded HTML message in -[WebCoreBridge ensureSelectionVisible]
23 * kwq/WebCoreBridge.mm:
24 (-[WebCoreBridge ensureSelectionVisible]): Put in some null checks to prevent crash experienced in bug.
26 2005-01-03 David Hyatt <hyatt@apple.com>
28 Reviewed by NOBODY (OOPS!).
30 * khtml/rendering/render_block.cpp:
31 (khtml::RenderBlock::layoutPositionedObjects):
33 2005-01-03 Ken Kocienda <kocienda@apple.com>
39 <rdar://problem/3928250> REGRESSION (Mail): Typing style lost after hitting return key
41 * khtml/editing/htmlediting.cpp:
42 (khtml::InsertLineBreakCommand::preservesTypingStyle): Now implemented, returning yes for this command.
43 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Initialize new typing style member variable.
44 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Deref new typing style member variable.
45 (khtml::InsertParagraphSeparatorCommand::preservesTypingStyle): Now implemented, returning yes for this command.
46 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion): New function to set the typing style
47 (khtml::InsertParagraphSeparatorCommand::calculateAndSetTypingStyleAfterInsertion): Function called after the <p>
48 insertion is done. This function diffs the style created in setFullTypingStyleBeforeInsertion() with the style
49 of the new <p> and only sets those styles needed to preserve the style in effect before the insertion.
50 (khtml::InsertParagraphSeparatorCommand::doApply): Call new functions.
51 (khtml::TypingCommand::preservesTypingStyle): Now yes for inserting line breaks and paragraphs.
52 * khtml/editing/htmlediting.h: Declare new functions.
54 2004-12-25 Kevin Decker <kdecker@apple.com>
58 Fixed: <rdar://problem/3505072> hang in KHTMLParser::parseToken (consulting.soroos.net)
60 * khtml/html/dtd.cpp: <label> needed a much higher priority such that it will close block elements. Malformed HTML (ugh) is the only reason why we need to do this.
62 2004-12-23 Darin Adler <darin@apple.com>
66 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
68 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
69 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
71 * khtml/editing/htmlediting.cpp:
72 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
73 per-document tags and is just better all around for things like the document.
74 (khtml::debugNode): Ditto.
75 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
76 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
77 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
78 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
80 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
81 non-HTML elements to be nested as desired.
83 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
84 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
86 * khtml/html/htmlparser.cpp:
87 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
88 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
89 to eliminate code that used ID_CLOSE_TAG for an array size.
90 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
91 that manages isindex to use deref instead of delete.
92 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
93 mistake of using ID_CLOSE_TAG for the array size too.
94 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
95 there and it would prevent custom tags from working. Added range check before using the forbidden
96 tag array with the token ID since custom tags will use index values past the end of the array.
97 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
98 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
99 createElement call is still here. Last time I left out a few form element types from this switch;
101 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
102 document if getTagID fails; this creates a unique per-document ID.
104 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
105 * khtml/misc/htmlhashes.cpp:
106 (khtml::getTagID): Changed return type to unsigned short.
107 (khtml::getAttrID): Ditto.
109 * khtml/misc/htmltags.c: Regenerated.
110 * khtml/misc/htmltags.h: Regenerated.
112 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
113 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
114 Also rewrote getTagName to work with the new scheme.
116 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
117 * khtml/xml/dom_docimpl.cpp:
118 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
119 Also updated for a few tags that the parser handled but this did not.
121 * kwq/KWQRenderTreeDebug.cpp:
122 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
123 the tag ID directly, which only works for standard nodes.
124 (operator<<): Update to call getTagName.
125 (nodePositionRelativeToRoot): Ditto.
126 (writeSelection): Ditto.
130 2004-12-22 Darin Adler <darin@apple.com>
132 - rolled out my custom tag name change -- it broke amazon.com
134 * khtml/css/cssstyleselector.cpp:
135 * khtml/editing/htmlediting.cpp:
136 * khtml/editing/selection.cpp:
137 * khtml/editing/visible_position.cpp:
138 * khtml/html/dtd.cpp:
139 * khtml/html/htmlparser.cpp:
140 * khtml/html/htmlparser.h:
141 * khtml/html/htmltokenizer.cpp:
142 * khtml/misc/htmlhashes.cpp:
143 * khtml/misc/htmlhashes.h:
144 * khtml/misc/htmltags.c:
145 * khtml/misc/htmltags.h:
146 * khtml/misc/maketags:
147 * khtml/xml/dom_docimpl.cpp:
148 * khtml/xml/dom_docimpl.h:
149 * khtml/xml/dom_nodeimpl.cpp:
150 * khtml/xml/dom_position.cpp:
151 * kwq/KWQRenderTreeDebug.cpp:
153 2004-12-22 David Harrison <harrison@apple.com>
155 Reviewed by Darin Adler.
157 * khtml/editing/selection.cpp:
158 (khtml::Selection::validate):
159 The selecting/deselecting bad behavior is because the Selection code that expands by words
160 had an inaccurate test for being at the end of the document (where double-clicking needs
161 to select the last word). Fixed that check.
163 2004-12-22 Adele Amchan <adele@apple.com>
167 Fix for <rdar://problem/3911650> tabs at safeway.com stop working after a while
169 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scrollToAnchor): removed call to cancelRedirection
170 so that we match Firefox and WinIE behavior.
172 2004-12-22 Darin Adler <darin@apple.com>
176 - fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
178 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
179 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
181 * khtml/editing/htmlediting.cpp:
182 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
183 per-document tags and is just better all around for things like the document.
184 (khtml::debugNode): Ditto.
185 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
186 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
187 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
188 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
190 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
191 non-HTML elements to be nested as desired.
193 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
194 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
196 * khtml/html/htmlparser.cpp:
197 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
198 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
199 to eliminate code that used ID_CLOSE_TAG for an array size.
200 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
201 that manages isindex to use deref instead of delete.
202 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
203 mistake of using ID_CLOSE_TAG for the array size too.
204 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
205 there and it would prevent custom tags from working. Added range check before using the forbidden
206 tag array with the token ID since custom tags will use index values past the end of the array.
207 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
208 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
209 createElement call is still here.
210 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
211 document if getTagID fails; this creates a unique per-document ID.
213 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
214 * khtml/misc/htmlhashes.cpp:
215 (khtml::getTagID): Changed return type to unsigned short.
216 (khtml::getAttrID): Ditto.
218 * khtml/misc/htmltags.c: Regenerated.
219 * khtml/misc/htmltags.h: Regenerated.
221 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
222 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
223 Also rewrote getTagName to work with the new scheme.
225 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
226 * khtml/xml/dom_docimpl.cpp:
227 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
228 Also updated for a few tags that the parser handled but this did not.
230 * kwq/KWQRenderTreeDebug.cpp:
231 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
232 the tag ID directly, which only works for standard nodes.
233 (operator<<): Update to call getTagName.
234 (nodePositionRelativeToRoot): Ditto.
235 (writeSelection): Ditto.
237 2004-12-21 David Harrison <harrison@apple.com>
239 Reviewed by Ken Kocienda.
241 <rdar://problem/3924934> REGRESSION: double click at end of line selects start of next line
243 Problem was the TextIterator was not handling exitNode() from a P block properly.
245 * khtml/editing/visible_text.cpp:
246 (khtml::TextIterator::TextIterator):
247 Add new param that specifies whether the iterator is for content or for searching.
248 Search iterators do not prevent newlines at the beginning.
249 (khtml::TextIterator::advance):
251 (khtml::TextIterator::handleTextNode):
253 (khtml::TextIterator::exitNode):
254 Emit newline for P (and other) blocks with position following the block, instead of the m_lastTextNode.
255 (khtml::TextIterator::emitCharacter):
257 (khtml::TextIterator::range):
259 (khtml::CharacterIterator::CharacterIterator):
260 Specify search type TextIterator.
261 (khtml::CharacterIterator::advance):
262 * khtml/editing/visible_text.h:
264 Add new TextIterator::TextIterator param that specifies whether the iterator is for content or for searching.
265 * khtml/editing/visible_units.cpp:
266 (khtml::nextWordBoundary):
267 Specify search type TextIterator.
269 2004-12-21 David Harrison <harrison@apple.com>
271 Reviewed by Ken Kocienda.
273 <rdar://problem/3924695> REGRESSION (Mail): double-clicking past end of line shows no selection, should select to EOL
275 Problem was that RenderText::setSelectionState did not handle the SelectionStart case where start and end are the end of the line.
276 Fixed by pretending the start == end-1 in that situation, as long as end > 0.
278 * khtml/rendering/render_text.cpp:
279 (RenderText::setSelectionState)
281 2004-12-21 Maciej Stachowiak <mjs@apple.com>
285 <rdar://problem/3929187> WebKit needs to restrict access to certain window operations by domain
287 * khtml/ecma/kjs_window.cpp:
288 (Window::get): Change most window functions to be restricted by
291 2004-12-21 Ken Kocienda <kocienda@apple.com>
297 <rdar://problem/3928305> selecting an entire line and typing over causes new inserted text at top of document
299 * khtml/editing/htmlediting.cpp:
300 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent): New function to detect case
301 formerly undetected and unhandled. This is the crux of the bug fix.
302 (khtml::DeleteSelectionCommand::doApply): Call insertPlaceholderForAncestorBlockContent() during
303 execution of command.
304 * khtml/editing/htmlediting.h: Declare new function.
305 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt: Added.
306 * layout-tests/editing/deleting/delete-3928305-fix.html: Added.
308 2004-12-21 Ken Kocienda <kocienda@apple.com>
312 * khtml/editing/htmlediting.cpp:
313 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Note to self: Must compile code before
314 checking in (aka must return false from function returning bool).
316 2004-12-21 Ken Kocienda <kocienda@apple.com>
322 <rdar://problem/3927752> Crash in khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded(DOM::NodeImpl*)
324 * khtml/editing/htmlediting.cpp:
325 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Added some null checks.
326 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Ditto.
328 2004-12-21 Ken Kocienda <kocienda@apple.com>
332 * khtml/editing/htmlediting.cpp:
333 (khtml::ReplacementFragment::mergeStartNode): Refine concept of how this node is found based on
334 further experiements.
335 (khtml::ReplaceSelectionCommand::doApply): Add a special case for determining merges that need to
336 be done if the insertion point is in an empty block.
337 * layout-tests/editing/pasteboard/paste-text-012-expected.txt: Added.
338 * layout-tests/editing/pasteboard/paste-text-012.html: Added.
339 * layout-tests/editing/pasteboard/paste-text-013-expected.txt: Added.
340 * layout-tests/editing/pasteboard/paste-text-013.html: Added.
341 * layout-tests/editing/pasteboard/paste-text-014-expected.txt: Added.
342 * layout-tests/editing/pasteboard/paste-text-014.html: Added.
344 2004-12-21 Darin Adler <darin@apple.com>
348 - fixed <rdar://problem/3899133> text search in a Safari window takes a very long time on Tiger updates page (and some other pages)
350 * khtml/editing/visible_text.h: Add an "offset base node" parameter to emitCharacter, and also
351 add a field to track it. Must make a few things mutable so we can update them in the range accessor.
352 * khtml/editing/visible_text.cpp:
353 (khtml::TextIterator::advance): Pass in base node and offsets rather than computing actual offsets
354 using the node's index. We only compute the node index if actually asked for the range.
355 (khtml::TextIterator::handleTextNode): Pass 0 for base node and set base node to 0 when setting
357 (khtml::TextIterator::handleTextBox): Ditto.
358 (khtml::TextIterator::handleReplacedElement): Pass base node and set base node instead of calling
360 (khtml::TextIterator::handleNonTextNode): Pass 0 for offset.
361 (khtml::TextIterator::exitNode): More of the same.
362 (khtml::TextIterator::emitCharacter): Ditto.
363 (khtml::TextIterator::range): If an offset base node is stored, then get its node index, and then
364 add that in to the offsets. Doing the work here guarantees it's done only once when doing a text search.
368 * khtml/khtml_part.cpp: Removed SPEED_DEBUG define. Not sure why it was on.
372 2004-12-20 Ken Kocienda <kocienda@apple.com>
376 * khtml/editing/htmlediting.cpp:
377 (khtml::DeleteSelectionCommand::moveNodesAfterNode): My one-liner for this bug introduced layout test
378 regressions: <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
379 Rolling out until I can develop a real fix.
381 2004-12-20 David Harrison <harrison@apple.com>
383 Reviewed by Dave Hyatt.
385 Initial checkin of AXTextMarkerRef support.
387 * khtml/xml/dom_docimpl.cpp:
388 (DocumentImpl::updateSelection):
389 (DocumentImpl::setFocusNode):
390 * kwq/KWQAccObject.h:
391 * kwq/KWQAccObject.mm:
392 (-[KWQAccObject detach]):
393 (-[KWQAccObject anchorElement]):
394 (-[KWQAccObject addChildrenToArray:]):
395 (-[KWQAccObject accessibilityAttributeNames]):
396 (-[KWQAccObject accessibilityActionDescription:]):
397 (-[KWQAccObject accessibilityPerformAction:]):
398 (-[KWQAccObject textMarkerRangeFromMarkers:andEndMarker:]):
399 (-[KWQAccObject textMarkerForVisiblePosition:]):
400 (-[KWQAccObject visiblePositionForTextMarker:]):
401 (-[KWQAccObject AXTextMarkerRangeCopyStartMarkerWrapper:]):
402 (-[KWQAccObject AXTextMarkerRangeCopyEndMarkerWrapper:]):
403 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
404 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
405 (-[KWQAccObject accessibilityAttributeValue:]):
406 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
407 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
408 (-[KWQAccObject getSelectedTextMarkerRange]):
409 (-[KWQAccObject doAXLineForTextMarker:]):
410 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
411 (-[KWQAccObject doAXStringForTextMarkerRange:]):
412 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
413 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
414 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
415 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
416 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
417 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
418 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
419 (-[KWQAccObject accessibilityFocusedUIElement]):
420 (-[KWQAccObject clearChildren]):
421 (-[KWQAccObject accObjectID]):
422 (-[KWQAccObject setAccObjectID:]):
423 (-[KWQAccObject removeAccObjectID]):
424 * kwq/KWQAccObjectCache.h:
425 * kwq/KWQAccObjectCache.mm:
426 (KWQAccObjectCache::KWQAccObjectCache):
427 (KWQAccObjectCache::~KWQAccObjectCache):
428 (KWQAccObjectCache::getAccObjectID):
429 (KWQAccObjectCache::removeAccObjectID):
430 (KWQAccObjectCache::textMarkerForVisiblePosition):
431 (KWQAccObjectCache::visiblePositionForTextMarker):
433 2004-12-19 Darin Adler <darin@apple.com>
435 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added nil check.
437 2004-12-19 Darin Adler <darin@apple.com>
441 - a garbage collection fix
443 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added a more-extensive comment and fixed the BUILDING_ON_PANTHER
444 #ifndef to use #if (in practice, either is OK).
445 * kwq/KWQKURL.mm: (KURL::getNSURL): Use KWQCFAutorelease instead of autorelease.
447 2004-12-17 David Hyatt <hyatt@apple.com>
449 Fix for 3923255, specified percentage heights of divs with overflow auto inside tables not honored.
453 * khtml/rendering/render_box.cpp:
454 (RenderBox::calcPercentageHeight):
455 * khtml/rendering/render_table.cpp:
456 (RenderTableSection::layoutRows):
458 2004-12-17 David Harrison <harrison@apple.com>
460 Reviewed by Ken Kocienda.
462 <rdar://problem/3924930> REGRESSION: triple click does not select to end of line
464 * khtml/editing/visible_units.cpp:
465 (khtml::endOfParagraph):
466 When includeLineBreak is true, allow traversal to next node after enclosingBlockFlowElement.
468 2004-12-17 Ken Kocienda <kocienda@apple.com>
472 * khtml/editing/htmlediting.cpp:
473 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Missed deleting some now-obsolete expcetion
474 codes when I added the createBreakElement() function.
476 2004-12-17 Richard Williamson <rjw@apple.com>
478 Set the floor of max cacheable object size to 40K. This restores
479 the long standing floor. Lower floor deleteriously impacts the PLT.
482 * khtml/khtml_part.cpp:
483 (KHTMLPart::checkCompleted):
484 * khtml/misc/loader.cpp:
487 2004-12-17 Ken Kocienda <kocienda@apple.com>
493 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
495 * khtml/editing/htmlediting.cpp:
496 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Stop merging nodes when a <br> is hit.
497 Formerly checked only for block boundary.
499 2004-12-17 David Harrison <harrison@apple.com>
503 Add KWQCFAutorelease for autoreleasing CF objects.
504 * kwq/KWQFoundationExtras.h:
508 2004-12-17 David Harrison <harrison@apple.com>
512 Fix GC compatibility in getNSString.
515 (QString::getNSString):
516 Use NSString allocator instead of CFString, so that autorelease works under GC.
518 2004-12-17 Ken Kocienda <kocienda@apple.com>
524 <rdar://problem/3890973> REGRESSION (Mail): Deleting reorders remaining text
526 * khtml/editing/htmlediting.cpp:
527 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Added check to ensure that moving content will not
528 move it after the <body> element.
530 2004-12-17 Ken Kocienda <kocienda@apple.com>
534 Added new layout tests covering cases from recent bug fixes.
536 * layout-tests/editing/inserting/insert-div-018-expected.txt: Added.
537 * layout-tests/editing/inserting/insert-div-018.html: Added.
538 * layout-tests/editing/inserting/insert-div-019-expected.txt: Added.
539 * layout-tests/editing/inserting/insert-div-019.html: Added.
540 * layout-tests/editing/inserting/insert-div-020-expected.txt: Added.
541 * layout-tests/editing/inserting/insert-div-020.html: Added.
542 * layout-tests/editing/inserting/insert-div-021-expected.txt: Added.
543 * layout-tests/editing/inserting/insert-div-021.html: Added.
545 2004-12-17 Ken Kocienda <kocienda@apple.com>
549 Changes in layout resulting from giving <p> elements no margin rather than 0.1em margin.
551 * layout-tests/editing/inserting/insert-div-013-expected.txt
552 * layout-tests/editing/inserting/insert-div-014-expected.txt
554 2004-12-17 Ken Kocienda <kocienda@apple.com>
560 <rdar://problem/3925317> Increase quote in email and with cursor below the quote the new line appears above the quote
562 * khtml/editing/htmlediting.cpp:
563 (khtml::InsertParagraphSeparatorCommand::doApply):
564 * khtml/editing/visible_position.cpp: Refine rules for whether to use the starting node or the starting
565 block as the reference node for the insertion of the new block.
566 (khtml::isLastVisiblePositionInBlock): Tweak rules again. Descendants of following blocks should answer true.
567 I worked this all out on the whiteboard this time. This should be the last tweak.
569 2004-12-17 Kevin Decker <kdecker@apple.com>
573 Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs
575 * khtml/xml/xml_tokenizer.cpp:
576 (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.
578 2004-12-16 Ken Kocienda <kocienda@apple.com>
584 <rdar://problem/3924888> REGRESSION (Mail): Hitting return key at end of line does not insert visible newline
586 * khtml/editing/htmlediting.cpp:
587 (khtml::InsertParagraphSeparatorCommand::doApply): Tweaked code I added just before to fix 3924486, so that
588 it checks the downstream node for the starting position.
590 2004-12-16 Ken Kocienda <kocienda@apple.com>
594 Added new createBreakElement() function that makes creating a <br> element a one-liner.
595 Converted all the code that used to call the DocumentImpl, and dealt with the exceptionCode,
596 over to this new helper.
598 * khtml/editing/htmlediting.cpp:
599 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Now uses new helper function.
600 (khtml::InsertLineBreakCommand::doApply): Ditto.
601 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
602 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
603 (khtml::ReplaceSelectionCommand::doApply): Ditto.
604 (khtml::createBreakElement): New helper.
605 * khtml/editing/htmlediting.h: Ditto.
607 2004-12-16 David Hyatt <hyatt@apple.com>
609 Fix a bug where vertical-align values that depended on their parent's value went crazy if the parent was
610 vertical-align top or bottom. The bug is 3771007, bankofamerica's ebills page.
614 * khtml/rendering/render_object.cpp:
615 (RenderObject::getVerticalPosition):
617 2004-12-16 Ken Kocienda <kocienda@apple.com>
623 <rdar://problem/3924486> REGRESSION (Mail): Hitting return key does not insert visible newline
624 <rdar://problem/3924579> REGRESSION (Mail): After deleting, hitting return key does not insert visible newline
626 * khtml/editing/htmlediting.cpp:
627 (khtml::InsertParagraphSeparatorCommand::doApply): For the first bug, detect when inserting a <p> will
628 make a visible <br> collapse. For the second bug, move the code that inserts the new <p> after
629 a check which may move the node used as the reference node for the insertion. Also change this code to
630 insert the <p> after the last sibling of the starting position, to move it past the nodes we're going
631 to want to shift into the new <p>.
633 2004-12-16 Darin Adler <darin@apple.com>
637 - use <p> elements rather than <br> when pasting plain text; also use margin of 0 rather than 0.1 em
638 after talking this over with Dave and Ken
640 * khtml/editing/htmlediting.h: Added createDefaultParagraphElement and createBlockPlaceholderElement.
641 * khtml/editing/htmlediting.cpp:
642 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Use new createBlockPlaceholderElement
643 helper so this can share code with the plain-text conversion code.
644 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): Use new createDefaultParagraphElement
645 helper so this can share code with the plain-text conversion code.
646 (khtml::createDefaultParagraphElement): Added.
647 (khtml::createBlockPlaceholderElement): Added.
649 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Use paragraphs rather than
650 <br> elements for pasting plain text.
652 - regenerated these files with the newer gperf
654 * khtml/css/cssproperties.c: Regenerated.
655 * khtml/css/cssvalues.c: Regenerated.
656 * khtml/misc/htmlattrs.c: Regenerated.
657 * khtml/misc/htmltags.c: Regenerated.
659 2004-12-16 Ken Kocienda <kocienda@apple.com>
665 <rdar://problem/3924291> REGRESSION (Mail): Crash deleting content following a <p> element
667 * khtml/xml/dom_nodeimpl.cpp:
668 (NodeImpl::enclosingInlineElement): Fixed problem in this function where recursive search for
669 parent that is not an inline would skip past previous siblings of nodes which were blocks. Now
670 it stops looking in this situation. This problem eventually caused the delete code to try to
671 merge a node under a descendent.
673 2004-12-16 Adele Amchan <adele@apple.com>
675 Change by Richard, reviewed by me.
677 Fix for: <rdar://problem/3923983> background image decoding prevents page with 0Kb image from finishing to load
679 * khtml/misc/loader.cpp: (CachedImage::data): Added call to notifyFinished so the 0Kb image case finishes loading.
681 2004-12-16 Adele Amchan <adele@apple.com>
685 Fix for: <rdar://problem/3534824> VIP: some navigation links on safeway.com don't work due to a JavaScript quirk
687 Added a call to ObjectImp::get before Window::get just returns Undefined.
688 This was preventing us from getting the toString function from a Window object.
690 * khtml/ecma/kjs_window.cpp: (Window::get):
692 2004-12-16 Ken Kocienda <kocienda@apple.com>
698 <rdar://problem/3918351> REGRESSION (Mail, 173-175+): Return before first char of line leaves insertion point in wrong place
700 * khtml/editing/htmlediting.cpp:
701 (khtml::InsertParagraphSeparatorCommand::doApply): Basically, did a rewrite of this function
702 to do a better job than it was doing before. Added several test cases to prove I am on a
704 * khtml/editing/visible_position.cpp:
705 (khtml::isFirstVisiblePositionInBlock): Tweaked the rules a bit to fix an issue very similar to the
706 leaving-the-bar-node case problem I just fixed in a recent checkin (relevant markup: <p>foo</p>bar).
707 This function was returning true for the first position in "bar". Wrong. Also tightened up other
708 rule: Should not report true when relationship between blocks cannot be determined.
709 (khtml::isLastVisiblePositionInBlock): Tightened up rule as above: Should not report true
710 when relationship between blocks cannot be determined.
711 * layout-tests/editing/inserting/insert-div-010-expected.txt: Added.
712 * layout-tests/editing/inserting/insert-div-010.html: Added.
713 * layout-tests/editing/inserting/insert-div-011-expected.txt: Added.
714 * layout-tests/editing/inserting/insert-div-011.html: Added.
715 * layout-tests/editing/inserting/insert-div-012-expected.txt: Added.
716 * layout-tests/editing/inserting/insert-div-012.html: Added.
717 * layout-tests/editing/inserting/insert-div-013-expected.txt: Added.
718 * layout-tests/editing/inserting/insert-div-013.html: Added.
719 * layout-tests/editing/inserting/insert-div-014-expected.txt: Added.
720 * layout-tests/editing/inserting/insert-div-014.html: Added.
721 * layout-tests/editing/inserting/insert-div-015-expected.txt: Added.
722 * layout-tests/editing/inserting/insert-div-015.html: Added.
723 * layout-tests/editing/inserting/insert-div-016-expected.txt: Added.
724 * layout-tests/editing/inserting/insert-div-016.html: Added.
725 * layout-tests/editing/inserting/insert-div-017-expected.txt: Added.
726 * layout-tests/editing/inserting/insert-div-017.html: Added.
728 2004-12-16 Ken Kocienda <kocienda@apple.com>
732 Added a layout test based on my last checkin.
734 * layout-tests/editing/selection/move-by-word-001-expected.txt: Added.
735 * layout-tests/editing/selection/move-by-word-001.html: Added.
737 2004-12-16 Ken Kocienda <kocienda@apple.com>
743 <rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps
745 * khtml/editing/visible_text.cpp:
746 (khtml::SimplifiedBackwardsTextIterator::advance): Add new check for leaving a text node and iterating
747 backwards into a different block that is an descendent of the block containing the text node (as in leaving
748 the "bar" node in this example: <p>foo</p>bar).
749 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Call new emitNewlineForBROrText helper.
750 (khtml::SimplifiedBackwardsTextIterator::emitNewlineForBROrText): Factor out code from handleNonTextNode, since
751 it is called from there, and now also from advance().
753 2004-12-15 Darin Adler <darin@apple.com>
757 - fixed problem where plain-text would put a blank line between each <p> even when they have no margins
759 * khtml/editing/visible_text.cpp: (khtml::TextIterator::exitNode): Add more checks and only set the
760 "add one more newline" flag if the margin is sufficient. A more complete fix would ignore the node
761 type altogether and use the render tree instead.
763 2004-12-14 John Sullivan <sullivan@apple.com>
767 - rest of WebCore fix for <rdar://problem/3790011> undoable operations all say "Undo"
768 in the menu, no specific action names
770 * khtml/editing/edit_actions.h: new header, contains EditAction enum
771 (renamed from HTMLEditAction, formerly in htmlediting.h)
773 * ForwardingHeaders/editing/edit_actions.h: new forwarding header
775 * khtml/editing/htmlediting.h:
776 removed HTMLEditAction enum in favor of including edit_actions.h; added khtml::
777 namespace to EditAction usages; added m_editingAction ivar to ApplyStyleCommand
779 * khtml/editing/htmlediting.cpp:
780 (khtml::EditCommandPtr::editingAction):
781 update for enum name change
782 (khtml::EditCommand::editingAction):
784 (khtml::ApplyStyleCommand::ApplyStyleCommand):
785 added editingAction parameter to this constructor
786 (khtml::ApplyStyleCommand::editingAction):
788 (khtml::DeleteSelectionCommand::editingAction):
789 update for enum name change
790 (khtml::MoveSelectionCommand::editingAction):
792 (khtml::TypingCommand::editingAction):
794 (khtml::ReplaceSelectionCommand::editingAction):
797 * khtml/khtml_part.h:
798 added EditAction parameter to applyStyle and computeAndSetTypingStyle
799 * khtml/khtml_part.cpp:
800 (KHTMLPart::computeAndSetTypingStyle):
801 added EditAction parameter
802 (KHTMLPart::applyStyle):
805 * kwq/KWQKHTMLPart.mm:
806 (KWQKHTMLPart::registerCommandForUndoOrRedo):
807 do the cast from EditAction to WebUndoAction a different way to match other code
809 * kwq/WebCoreBridge.h:
810 * kwq/WebCoreBridge.mm:
811 (-[WebCoreBridge setTypingStyle:withUndoAction:]):
812 added WebUndoAction parameter, passed into ApplyStyleCommand constructor
813 (-[WebCoreBridge applyStyle:withUndoAction:]):
816 * WebCore.pbproj/project.pbxproj:
817 updated for new files
819 2004-12-14 David Hyatt <hyatt@apple.com>
821 Fix for 3562458, rowspan and colspan converted to ints so that large values will work for them. Remove
822 the ridiculous 1024 limit on the span values.
824 * khtml/html/html_tableimpl.cpp:
825 (HTMLTableCellElementImpl::parseHTMLAttribute):
826 * khtml/rendering/render_table.cpp:
827 (RenderTableCell::collapsedBottomBorder):
828 * khtml/rendering/render_table.h:
829 (khtml::RenderTableCell::colSpan):
830 (khtml::RenderTableCell::setColSpan):
831 (khtml::RenderTableCell::rowSpan):
832 (khtml::RenderTableCell::setRowSpan):
833 (khtml::RenderTableCol::span):
834 (khtml::RenderTableCol::setSpan):
836 2004-12-14 David Hyatt <hyatt@apple.com>
838 Make sure <col> and <colgroup> can have spans updated dynamically as well.
842 * khtml/html/html_tableimpl.cpp:
843 (HTMLTableColElementImpl::parseHTMLAttribute):
844 * khtml/rendering/render_table.cpp:
845 (RenderTableCell::updateFromElement):
846 (RenderTableCol::updateFromElement):
848 2004-12-14 David Hyatt <hyatt@apple.com>
850 Fix for 3833123, setting a cell's colspan does not update rendering like it should.
854 * khtml/html/html_tableimpl.cpp:
855 (HTMLTableCellElementImpl::parseHTMLAttribute):
856 * khtml/rendering/render_table.cpp:
857 (RenderTableCell::RenderTableCell):
858 (RenderTableCell::updateFromElement):
860 2004-12-14 Chris Blumenberg <cblu@apple.com>
862 Fixed: <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
866 * khtml/editing/markup.cpp:
867 (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it
869 2004-12-14 David Hyatt <hyatt@apple.com>
871 Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position.
872 This is actually a regression from my positioned object DHTML optimization.
876 * khtml/rendering/render_object.cpp:
877 (RenderObject::setStyle):
879 2004-12-14 David Hyatt <hyatt@apple.com>
881 Make sure the class attribute works when newlines are present in the attribute.
885 * khtml/html/html_elementimpl.cpp:
886 (HTMLNamedAttrMapImpl::parseClassAttribute):
888 2004-12-14 David Hyatt <hyatt@apple.com>
890 Fix for 3724938, float element is duplicated and paints twice. The logic for when to paint floats was
891 actually fairly screwed up. This patch simplifies the logic and makes addOverhangingFloats easier to
892 read by splitting it into two separate functions.
896 * khtml/rendering/render_block.cpp:
897 (khtml::RenderBlock::layoutBlockChildren):
898 (khtml::RenderBlock::clearFloats):
899 (khtml::RenderBlock::addOverhangingFloats):
900 (khtml::RenderBlock::addIntrudingFloats):
901 * khtml/rendering/render_block.h:
903 2004-12-14 John Sullivan <sullivan@apple.com>
907 - added Undo action names for Cut, Paste, and Drag
909 * khtml/editing/htmlediting.h:
910 * khtml/editing/htmlediting.cpp:
911 (khtml::DeleteSelectionCommand::editingAction):
912 overridden to return HTMLEditActionCut
913 (khtml::MoveSelectionCommand::editingAction):
914 overridden to return HTMLEditActionDrag
915 (khtml::ReplaceSelectionCommand::editingAction):
916 overridden to return HTMLEditActionPaste
918 2004-12-14 John Sullivan <sullivan@apple.com>
922 - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu,
923 no specific action names
925 The remaining step is to make each EditCommand subclass override editingAction() to return an
926 appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
927 is not completely straightforward, so this next step isn't trivial.)
929 * khtml/editing/htmlediting.h:
930 new enum for HTMLEditAction
932 * khtml/editing/htmlediting.cpp:
933 (khtml::EditCommandPtr::editingAction):
934 new method, calls through to EditCommand
935 (khtml::EditCommand::editingAction):
936 new method for subclasses to override, returns HTMLEditActionUnspecified at this level
937 (khtml::TypingCommand::editingAction):
938 proof of concept override, returns HTMLEditActionTyping
940 * kwq/KWQKHTMLPart.h:
941 declare new private bottleneck method registerCommandForUndoOrRedo
942 * kwq/KWQKHTMLPart.mm:
943 (KWQKHTMLPart::registerCommandForUndoOrRedo):
944 new bottleneck method to reduce code duplication; now calls over the bridge
945 to get the localized string to use for the Undo action name
946 (KWQKHTMLPart::registerCommandForUndo):
947 now calls new bottleneck method
948 (KWQKHTMLPart::registerCommandForRedo):
949 now calls new bottleneck method
951 * kwq/WebCoreBridge.h:
952 new enum for WebUndoAction, maps directly to HTMLEditAction.
953 Declaration of nameForUndoAction:
955 2004-12-14 Darin Adler <darin@apple.com>
959 - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)
961 * khtml/rendering/render_frames.cpp:
962 (RenderPart::~RenderPart): Check widget for nil.
963 (RenderPart::setWidget): Ditto.
964 (RenderFrame::slotViewCleared): Ditto.
965 (RenderPartObject::slotViewCleared): Ditto.
967 2004-12-13 Darin Adler <darin@apple.com>
971 - moved markup-related functions into new sources files in the editing directory
972 - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster
974 * ForwardingHeaders/editing/markup.h: Added.
975 * khtml/editing/markup.h: Added.
976 * khtml/editing/markup.cpp: Added.
978 * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.
980 * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
981 * khtml/html/html_elementimpl.cpp:
982 (HTMLElementImpl::innerHTML): Changed to call createMarkup.
983 (HTMLElementImpl::outerHTML): Ditto.
985 * khtml/ecma/kjs_window.cpp:
986 (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
987 (Window::retrieveActive): Ditto.
989 * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
990 * khtml/xml/dom_docimpl.h: Ditto.
992 * khtml/khtml_part.cpp:
993 (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
994 (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.
996 * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
997 still works even with the additional replace overloads added to QString.
998 * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.
1000 * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
1001 base pointer, because it used dynamic_cast in its implementation. Made the other version public.
1002 * khtml/rendering/render_object.cpp: Ditto.
1003 * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.
1005 * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
1006 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
1007 the support code into markup.cpp.
1009 * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
1010 * khtml/xml/dom_nodeimpl.cpp: Ditto.
1012 * khtml/xml/dom_position.cpp:
1013 (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
1014 so these return null positions rather than raising exceptions.
1015 (DOM::endPosition): Ditto.
1017 * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
1018 * kwq/KWQFrame.h: Ditto.
1019 * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
1020 * kwq/KWQKPartsPart.h: Ditto.
1021 * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
1022 * kwq/KWQScrollView.h: Ditto.
1023 * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
1024 * kwq/KWQKHTMLPart.h: Ditto.
1025 * kwq/KWQKHTMLPart.mm:
1026 (KHTMLView::isKHTMLView): Ditto.
1027 (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
1028 replace overloads added to QString.
1029 (KWQKHTMLPart::setStatusBarText): Ditto.
1030 (KWQKHTMLPart::runJavaScriptAlert): Ditto.
1031 (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
1032 (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
1033 (KWQKHTMLPart::attributedString): Ditto.
1034 (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
1035 (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).
1037 * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
1039 (QObject::inherits): Changed to not use dynamic cast.
1040 (QObject::isKHTMLPart): Added. Returns false.
1041 (QObject::isKHTMLView): Ditto.
1042 (QObject::isKPartsReadOnlyPart): Ditto.
1043 (QObject::isQFrame): Ditto.
1044 (QObject::isQScrollView): Ditto.
1046 * kwq/KWQRenderTreeDebug.cpp:
1047 (write): Changed to use inherits rather than dynamic_cast.
1048 (writeSelection): Ditto.
1050 * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
1051 than going straight on to the "no parameters at all" version.
1054 * kwq/KWQString.mm: (QString::replace): Added overloads.
1055 * kwq/WebCoreBridge.mm:
1056 (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
1057 (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
1058 (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
1059 the additional replace overloads added to QString.
1060 (-[WebCoreBridge stringForRange:]): Ditto.
1061 (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
1062 (-[WebCoreBridge elementAtPoint:]): QChar conversion.
1063 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
1064 (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.
1066 2004-12-13 Ken Kocienda <kocienda@apple.com>
1072 <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
1074 * khtml/editing/htmlediting.cpp:
1075 (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
1076 leading and trailing whitespace positions was reversed! I must have introduced this error recently
1077 when changing around this code.
1079 2004-12-13 David Hyatt <hyatt@apple.com>
1081 Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing
1082 and painting was using the wrong rect when setting up the x/y of the rect.
1086 * khtml/rendering/render_block.cpp:
1087 (khtml::RenderBlock::paint):
1088 (khtml::RenderBlock::nodeAtPoint):
1089 * khtml/rendering/render_object.h:
1090 (khtml::RenderObject::floatRect):
1092 2004-12-13 Ken Kocienda <kocienda@apple.com>
1098 <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles
1100 Code to figuire out the end node to merge was missing the font tag in the second paragraph
1101 written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.
1103 * khtml/editing/htmlediting.cpp:
1104 (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
1105 looking for the node that is the last inline in the last block of the fragment. The old algorithm was
1106 insufficiently powerful.
1107 (khtml::ReplacementFragment::enclosingBlock): New helper function.
1108 * khtml/editing/htmlediting.h: Add declaration for new helper function.
1109 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
1110 * layout-tests/editing/pasteboard/paste-text-011.html: Added.
1112 2004-12-13 Ken Kocienda <kocienda@apple.com>
1116 WebCore side of fix for this bug:
1118 <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace
1120 Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
1121 bug. This change involves our half of the needed changes.
1123 Note that a lot of this change has to do with changing code to use a <br> element instead of
1124 a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
1125 other places, code to handle comments in markup can be removed since we do not use comments for
1126 such annotations after this change.
1128 * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
1129 (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
1130 (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
1131 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
1132 convertedSpaceSpanClassString to match other uses of the idiom used here.
1133 (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
1134 * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
1135 (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
1136 * khtml/html/html_elementimpl.cpp:
1137 (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
1138 annotate fragments with comments any longer.
1139 * khtml/html/html_elementimpl.h: Ditto.
1140 * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
1141 (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
1142 (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
1143 spurious semi-colon.
1144 * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
1145 * kwq/WebCoreBridge.mm:
1146 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
1147 in DOM when calling createContextualFragment().
1149 2004-12-10 John Sullivan <sullivan@apple.com>
1151 fixed deployment build bustage that John Louch ran into
1153 * kwq/KWQTextEdit.mm:
1154 (QTextEdit::setScrollBarModes):
1155 move bool declaration inside exception-handling block to avoid obscure
1158 2004-12-10 Maciej Stachowiak <mjs@apple.com>
1160 Reviewed by Richard.
1162 <rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
1165 (QWidget::setFocus): Handle the case where setting focus removed
1166 us from the superview - this can happen due to style changes on
1169 2004-12-10 Ken Kocienda <kocienda@apple.com>
1175 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
1177 There are a number of interesting things we could do to fix this bug, including SPI and involving
1178 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
1179 will fix the bug in the general case until such time as we can come up with more specific
1182 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
1185 * khtml/editing/htmlediting.cpp:
1186 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
1187 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
1188 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
1189 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
1191 2004-12-10 Darin Adler <darin@apple.com>
1195 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
1197 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
1198 * khtml/rendering/render_form.cpp:
1199 (RenderSubmitButton::rawText): Convert to QChar explicitly.
1200 (RenderLineEdit::updateFromElement): Ditto.
1201 (RenderLineEdit::slotTextChanged): Ditto.
1202 (RenderSelect::updateFromElement): Ditto.
1203 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
1204 that requires a derived class. Now we don't use this class at all for WebCore, but they still
1206 (TextAreaWidget::event): Moved out the ifdefs.
1207 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
1208 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
1209 now done in setStyle.
1210 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
1211 that's needed and WebCore no longer has TextAreaWidget.
1212 (RenderTextArea::calcMinMaxWidth): Ditto.
1213 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
1215 (RenderTextArea::updateFromElement): Use type QTextEdit.
1216 (RenderTextArea::text): Ditto.
1217 (RenderTextArea::select): Ditto.
1219 * kwq/KWQTextArea.mm:
1220 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
1221 since it's now handled by QTextEdit.
1222 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
1224 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
1225 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
1226 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
1228 2004-12-10 Ken Kocienda <kocienda@apple.com>
1234 <rdar://problem/3915047> HItting return in empty document inserts <p> but
1235 insertion point does not move
1237 * khtml/editing/htmlediting.cpp:
1238 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
1239 code to insert the <p> element for the return is not detecting the fact
1240 that the document is empty. Inserting a <p> into an empty body will not
1241 "add a new line" as the user expects. With this change, we'll add a second
1242 <p> when the root editable element has no rendered kids.
1244 2004-12-10 Maciej Stachowiak <mjs@apple.com>
1248 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
1250 * khtml/html/html_miscimpl.cpp:
1251 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
1252 the initial one step, otherwise we might inadvertantly step
1253 outside the collection base, thereby causing assertion failures or
1254 other badness later.
1256 2004-12-10 Ken Kocienda <kocienda@apple.com>
1260 * khtml/editing/htmlediting.cpp:
1261 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
1262 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
1263 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
1264 should do nothing if the starting point for the selection is itself the starting block.
1265 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
1266 function, though the names and concepts are slightly different.
1268 2004-12-10 Maciej Stachowiak <mjs@apple.com>
1272 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
1274 * khtml/dom/html_document.cpp:
1275 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
1276 * khtml/dom/html_document.h:
1277 * khtml/ecma/kjs_html.cpp:
1278 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
1279 * khtml/html/html_miscimpl.cpp:
1280 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
1281 the items that can be accessed directly as a document propery, in particular forms, images,
1282 objects, applets and embeds.
1283 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
1284 (HTMLFormCollectionImpl::updateNameCache): Ditto.
1285 * khtml/html/html_miscimpl.h:
1286 (DOM::HTMLCollectionImpl::): Added new type.
1288 2004-12-10 Ken Kocienda <kocienda@apple.com>
1294 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
1296 * khtml/rendering/render_text.cpp:
1297 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
1299 2004-12-10 Ken Kocienda <kocienda@apple.com>
1305 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
1307 * khtml/editing/htmlediting.cpp:
1308 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
1309 that was removed from the document when pasting. This caused the disappearance. Now this
1310 is detected, and the selection is shifted to a node that is in the document.
1312 2004-12-09 Richard Williamson <rjw@apple.com>
1314 Check to disable threaded decoding during
1315 layout tests wasn't invoking function, just checking address of
1316 function, which would always return true.
1318 * kwq/WebCoreImageRendererFactory.m:
1319 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
1321 2004-12-09 David Hyatt <hyatt@apple.com>
1323 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
1326 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
1327 all inlines when repainting.
1331 * khtml/rendering/render_block.cpp:
1332 (khtml::RenderBlock::layoutBlockChildren):
1333 * khtml/rendering/render_flow.cpp:
1334 (RenderFlow::getAbsoluteRepaintRect):
1336 2004-12-09 David Hyatt <hyatt@apple.com>
1338 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
1339 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
1340 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
1341 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
1345 * khtml/rendering/render_block.cpp:
1346 (khtml::RenderBlock::getClearDelta):
1347 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
1348 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
1349 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
1350 * layout-tests/fast/block/margin-collapse/102-expected.txt:
1351 * layout-tests/fast/block/margin-collapse/102.html:
1353 2004-12-09 Richard Williamson <rjw@apple.com>
1355 Fixed <rdar://problem/3914078> worldclock crashing gc related
1357 Use ProtectedValue for Context2D instance members.
1361 * khtml/ecma/kjs_html.h:
1363 2004-12-09 John Sullivan <sullivan@apple.com>
1367 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
1369 * kwq/KWQAccObject.mm:
1370 (-[KWQAccObject title]): moved image alt tag code out of here
1371 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
1372 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
1373 that ordinary elements return; this means that ordinary elements that aren't images will return
1374 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
1376 (-[KWQAccObject accessibilityAttributeValue:]):
1377 call accessibilityDescription when asked for AXDescription
1379 2004-12-09 Ken Kocienda <kocienda@apple.com>
1381 Reviewed by Harrison
1385 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
1387 * khtml/editing/htmlediting.cpp:
1388 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
1389 been deleted. If this is the case, set the destination to the node the delete command provides in
1390 its ending selection.
1394 2004-12-09 Ken Kocienda <kocienda@apple.com>
1400 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
1402 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
1403 callback may not be delivered before the program asks for the dimensions of an image in order to
1404 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
1405 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
1407 * kwq/KWQRenderTreeDebug.cpp:
1408 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
1409 (externalRepresentation): Sets debuggingRenderTree flag to true;
1410 * kwq/KWQRenderTreeDebug.h:
1411 * kwq/WebCoreImageRendererFactory.m:
1412 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
1413 do threaded decoding in any case if the flag is set.
1415 2004-12-09 Chris Blumenberg <cblu@apple.com>
1417 Fix for busting XMLHTTPRequest.
1419 Reviewed by kocienda.
1421 * khtml/misc/loader.cpp:
1422 (Loader::servePendingRequests): pass true for deliverAllData
1424 (KIO::get): take deliverAllData param
1425 (KIO::http_post): ditto
1426 * kwq/KWQKJobClasses.h:
1427 * kwq/KWQKJobClasses.mm:
1428 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
1429 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
1431 2004-12-09 Ken Kocienda <kocienda@apple.com>
1435 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
1437 * khtml/xml/dom_nodeimpl.cpp:
1438 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
1440 2004-12-07 Richard Williamson <rjw@apple.com>
1442 Support threaded image decoding on machines w/ > 2 CPUs.
1444 Reviewed by Maciej and Chris.
1446 * khtml/misc/loader.cpp:
1447 (CachedImageCallback::notifyUpdate):
1448 (CachedImageCallback::notifyFinished):
1449 (CachedImageCallback::notifyDecodingError):
1450 (CachedImageCallback::handleError):
1451 (CachedImageCallback::clear):
1452 (CachedImage::CachedImage):
1453 (CachedImage::clear):
1454 (CachedImage::data):
1455 (CachedImage::checkNotify):
1456 (Loader::servePendingRequests):
1457 (Loader::slotFinished):
1458 (Loader::numRequests):
1459 (Loader::cancelRequests):
1460 (Loader::removeBackgroundDecodingRequest):
1461 * khtml/misc/loader.h:
1462 (khtml::CachedImageCallback::CachedImageCallback):
1463 (khtml::CachedImageCallback::ref):
1464 (khtml::CachedImageCallback::deref):
1465 (khtml::CachedImage::decoderCallback):
1466 * khtml/rendering/render_object.cpp:
1467 (RenderObject::setPixmap):
1470 (-[WebImageCallback initWithCallback:khtml::]):
1471 (-[WebImageCallback _commonTermination]):
1472 (-[WebImageCallback dealloc]):
1473 (-[WebImageCallback finalize]):
1474 (-[WebImageCallback notify]):
1475 (-[WebImageCallback setImageSourceStatus:]):
1476 (-[WebImageCallback status]):
1477 (QPixmap::shouldUseThreadedDecoding):
1478 (QPixmap::receivedData):
1479 * kwq/WebCoreImageRenderer.h:
1480 * kwq/WebCoreImageRendererFactory.h:
1481 * kwq/WebCoreImageRendererFactory.m:
1482 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
1483 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
1485 2004-12-07 Ken Kocienda <kocienda@apple.com>
1489 * khtml/editing/htmlediting.cpp:
1490 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
1491 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
1492 after new block has been inserted, otherwise a crash can result. Shuffle down call
1493 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
1496 2004-12-07 Ken Kocienda <kocienda@apple.com>
1502 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
1504 * khtml/editing/htmlediting.cpp:
1505 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
1506 for determining the location for inserting content. Do not allow an insert before or after if the
1507 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
1508 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
1509 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
1511 2004-12-07 Darin Adler <darin@apple.com>
1515 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
1517 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
1519 2004-12-07 Ken Kocienda <kocienda@apple.com>
1523 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
1524 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
1526 * khtml/editing/html_interchange.h: Name change, as described above.
1527 * khtml/editing/htmlediting.cpp:
1528 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
1529 * khtml/xml/dom2_rangeimpl.cpp:
1530 (DOM::RangeImpl::toHTML): Ditto.
1532 2004-12-07 Ken Kocienda <kocienda@apple.com>
1536 Added a couple more layout tests.
1538 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
1539 * layout-tests/editing/deleting/delete-line-013.html: Added.
1540 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
1541 * layout-tests/editing/deleting/delete-line-014.html: Added.
1543 2004-12-06 Maciej Stachowiak <mjs@apple.com>
1547 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
1549 * kwq/KWQListBox.mm:
1550 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
1551 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
1552 (-[KWQListBoxScrollView widget]): See above.
1553 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
1554 afterMouseDown, to avoid triggering an assertion failure.
1556 2004-12-06 David Hyatt <hyatt@apple.com>
1558 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
1559 made by me, kocienda and harrison to just remove it.
1563 * khtml/rendering/bidi.cpp:
1564 (khtml::RenderBlock::layoutInlineChildren):
1565 * khtml/rendering/render_block.cpp:
1566 (khtml:::RenderFlow):
1567 * khtml/rendering/render_block.h:
1568 * khtml/rendering/render_flow.cpp:
1569 (RenderFlow::dirtyLinesFromChangedChild):
1571 2004-12-06 David Hyatt <hyatt@apple.com>
1573 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
1574 not a damage rect that can be changed when intersected with the clip regions of the web page.
1578 * khtml/rendering/render_canvas.h:
1579 (khtml::RenderCanvas::printRect):
1580 (khtml::RenderCanvas::setPrintRect):
1581 * khtml/rendering/render_flow.cpp:
1582 (RenderFlow::paintLines):
1583 * khtml/rendering/render_list.cpp:
1584 (RenderListMarker::paint):
1585 * kwq/KWQKHTMLPart.mm:
1586 (KWQKHTMLPart::adjustPageHeight):
1588 2004-12-06 David Harrison <harrison@apple.com>
1590 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
1592 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
1595 * khtml/rendering/render_flow.cpp:
1596 (RenderFlow::dirtyLinesFromChangedChild):
1597 Dirty the line above because new child can inval the cached line break position of previous line.
1599 2004-12-06 David Hyatt <hyatt@apple.com>
1601 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
1602 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
1603 3126929, handle top/left overflow.
1605 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
1607 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
1608 regions and web pages) has been fixed.
1612 * khtml/rendering/bidi.cpp:
1613 (khtml::RenderBlock::computeHorizontalPositionsForLine):
1614 (khtml::RenderBlock::checkLinesForOverflow):
1615 * khtml/rendering/render_block.cpp:
1616 (khtml:::RenderFlow):
1617 (khtml::RenderBlock::overflowHeight):
1618 (khtml::RenderBlock::overflowWidth):
1619 (khtml::RenderBlock::overflowLeft):
1620 (khtml::RenderBlock::overflowTop):
1621 (khtml::RenderBlock::overflowRect):
1622 (khtml::RenderBlock::layoutBlock):
1623 (khtml::RenderBlock::layoutBlockChildren):
1624 (khtml::RenderBlock::paint):
1625 (khtml::RenderBlock::floatRect):
1626 (khtml::RenderBlock::lowestPosition):
1627 (khtml::RenderBlock::rightmostPosition):
1628 (khtml::RenderBlock::leftmostPosition):
1629 (khtml::RenderBlock::nodeAtPoint):
1630 * khtml/rendering/render_block.h:
1631 * khtml/rendering/render_box.h:
1632 (khtml::RenderBox::borderBox):
1633 (khtml::RenderBox::borderTopExtra):
1634 (khtml::RenderBox::borderBottomExtra):
1635 * khtml/rendering/render_layer.cpp:
1636 (RenderLayer::paintScrollbars):
1637 (mustExamineRenderer):
1638 (RenderLayer::intersectsDamageRect):
1639 (RenderLayer::containsPoint):
1640 * khtml/rendering/render_line.cpp:
1641 (khtml::InlineFlowBox::placeBoxesHorizontally):
1642 (khtml::InlineFlowBox::verticallyAlignBoxes):
1643 * khtml/rendering/render_line.h:
1644 (khtml::InlineBox::leftOverflow):
1645 (khtml::InlineBox::rightOverflow):
1646 (khtml::InlineFlowBox::setVerticalOverflowPositions):
1647 (khtml::RootInlineBox::RootInlineBox):
1648 (khtml::RootInlineBox::leftOverflow):
1649 (khtml::RootInlineBox::rightOverflow):
1650 (khtml::RootInlineBox::setVerticalOverflowPositions):
1651 (khtml::RootInlineBox::setHorizontalOverflowPositions):
1652 * khtml/rendering/render_object.h:
1653 (khtml::RenderObject::borderBox):
1654 (khtml::RenderObject::overflowLeft):
1655 (khtml::RenderObject::overflowTop):
1656 (khtml::RenderObject::overflowRect):
1657 (khtml::RenderObject::floatRect):
1658 * khtml/rendering/render_table.cpp:
1659 (RenderTable::layout):
1660 (RenderTable::paint):
1661 (RenderTable::paintBoxDecorations):
1662 (RenderTable::calcMinMaxWidth):
1663 * khtml/rendering/render_table.h:
1664 (khtml::RenderTableCell::borderTopExtra):
1665 (khtml::RenderTableCell::borderBottomExtra):
1670 2004-12-06 Maciej Stachowiak <mjs@apple.com>
1674 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
1676 I changed all unprotected places that can navigate a different
1677 window or frame from script to check for a javascript: URL, and if
1678 found, to check for safety using cross-site-script rules.
1680 I considered a few other possible exploits and made no change:
1682 - document.location is already protected because the document
1683 object itself is protected
1685 - frame.src, frame.location, iframe.src and targetted links are
1686 all safe because setting the URL of a frame to a javascript: URL
1687 executes the script in the context of the parent
1689 * khtml/ecma/kjs_window.cpp:
1690 (WindowFunc::tryCall):
1692 (LocationFunc::tryCall):
1694 2004-12-06 Ken Kocienda <kocienda@apple.com>
1700 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
1702 * khtml/editing/htmlediting.cpp:
1703 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
1704 check for one of the special cases being checked for in this function. The specific case
1705 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
1706 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
1707 case where a selection ended in a <br> after a block and would not delete any part of the
1708 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
1711 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
1712 new use of the function exposed this bug:
1714 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
1716 * khtml/xml/dom_position.cpp:
1717 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
1718 not have this fatal flaw. It is a much better design as well.
1720 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
1721 have what I consider to be a better result. Going with it.
1723 2004-12-06 Chris Blumenberg <cblu@apple.com>
1725 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
1730 (-[DOMElement _font]): new SPI for AppKit
1733 2004-12-06 Darin Adler <darin@apple.com>
1737 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
1739 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
1740 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
1742 2004-12-06 John Sullivan <sullivan@apple.com>
1744 Darin found what appears to be the real leak that we were falsely blaming
1745 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
1746 sure nothing barfed.
1748 * khtml/css/cssparser.cpp:
1749 (CSSParser::parseValue):
1750 call clearProperties() instead of just setting numParsedProperties to 0
1751 (CSSParser::parseDeclaration):
1753 (CSSParser::createStyleDeclaration):
1756 2004-12-06 Ken Kocienda <kocienda@apple.com>
1762 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
1763 * layout-tests/editing/inserting/insert-div-001.html: Added.
1764 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
1765 * layout-tests/editing/inserting/insert-div-002.html: Added.
1766 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
1767 * layout-tests/editing/inserting/insert-div-003.html: Added.
1768 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
1769 * layout-tests/editing/inserting/insert-div-004.html: Added.
1770 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
1771 * layout-tests/editing/inserting/insert-div-005.html: Added.
1772 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
1773 * layout-tests/editing/inserting/insert-div-006.html: Added.
1774 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
1775 * layout-tests/editing/inserting/insert-div-007.html: Added.
1776 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
1777 * layout-tests/editing/inserting/insert-div-008.html: Added.
1778 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
1779 * layout-tests/editing/inserting/insert-div-009.html: Added.
1781 2004-12-06 Ken Kocienda <kocienda@apple.com>
1783 Reviewed by Harrison
1787 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
1789 * khtml/editing/htmlediting.cpp:
1790 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
1791 being added to this function. This ensures that the added block has a height.
1792 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1794 2004-12-06 Ken Kocienda <kocienda@apple.com>
1798 * khtml/dom/dom_string.cpp:
1799 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
1800 * khtml/dom/dom_string.h: Ditto.
1801 * khtml/editing/htmlediting.cpp:
1802 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
1803 RebalanceWhitespaceCommand instance.
1804 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
1805 (khtml::InsertLineBreakCommand::doApply): Ditto.
1806 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1807 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1808 (khtml::InsertTextCommand::input): Ditto.
1809 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
1810 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
1811 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
1812 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
1813 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
1814 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
1815 * khtml/editing/htmlediting.h: Ditto.
1816 (khtml::RebalanceWhitespaceCommand::): Ditto.
1818 2004-12-05 Darin Adler <darin@apple.com>
1820 - fixed small problem in my check-in from yesterday
1823 (positionForEvent): Get location from event without raising exception if it's the wrong type.
1824 (clickCountForEvent): Same, for clickCount.
1825 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
1826 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
1827 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
1829 2004-12-04 Darin Adler <darin@apple.com>
1833 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
1835 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
1836 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
1837 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
1839 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
1841 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
1842 * khtml/rendering/render_form.cpp:
1843 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
1844 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
1845 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
1847 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
1848 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
1849 Added a fixState helper method so the constructors can save code.
1851 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
1852 and added a third constructor that uses the "current event" from AppKit (used above).
1853 (QMouseEvent::fixState): Compute state and click count based on event type.
1855 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
1857 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
1858 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
1859 underlying cause in CSS.
1861 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
1863 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
1864 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
1866 2004-12-03 Chris Blumenberg <cblu@apple.com>
1869 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
1870 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
1871 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
1872 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
1874 Reviewed by darin, rjw, kocienda.
1876 * khtml/misc/loader.cpp:
1877 (CachedObject::~CachedObject):
1878 (CachedCSSStyleSheet::checkNotify):
1879 (Loader::servePendingRequests):
1880 (Loader::slotFinished):
1881 (Loader::slotReceivedResponse):
1882 (Cache::requestImage):
1883 (Cache::requestScript):
1884 * khtml/misc/loader.h:
1885 (khtml::CachedObject::CachedObject):
1886 (khtml::CachedObject::response):
1887 (khtml::CachedObject::allData):
1888 * kwq/KWQKJobClasses.h:
1889 * kwq/KWQKJobClasses.mm:
1890 (KIO::TransferJobPrivate::TransferJobPrivate):
1891 (KIO::TransferJobPrivate::~TransferJobPrivate):
1892 (KIO::TransferJob::TransferJob):
1893 (KIO::TransferJob::assembleResponseHeaders):
1894 (KIO::TransferJob::retrieveCharset):
1895 (KIO::TransferJob::emitResult):
1896 (KIO::TransferJob::emitReceivedResponse):
1899 (KWQHeaderStringFromDictionary):
1900 (KWQCheckCacheObjectStatus):
1901 (KWQIsResponseURLEqualToURL):
1903 (KWQResponseMIMEType):
1904 (KWQCacheObjectExpiresTime):
1905 (khtml::CachedObject::setResponse):
1906 (khtml::CachedObject::setAllData):
1910 * kwq/KWQResourceLoader.mm:
1911 (-[KWQResourceLoader finishJobAndHandle:]):
1912 (-[KWQResourceLoader cancel]):
1913 (-[KWQResourceLoader reportError]):
1914 (-[KWQResourceLoader finishWithData:]):
1922 * kwq/WebCoreBridge.h:
1923 * kwq/WebCoreResourceLoader.h:
1925 2004-12-04 Darin Adler <darin@apple.com>
1929 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
1931 * khtml/rendering/render_form.cpp:
1932 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
1933 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
1934 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
1935 (RenderSlider::slotSliderValueChanged): Ditto.
1937 2004-12-03 John Sullivan <sullivan@apple.com>
1941 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
1942 khtml::BackgroundLayer::cullEmptyLayers
1944 * khtml/rendering/render_style.cpp:
1945 (BackgroundLayer::cullEmptyLayers):
1946 added missing nil check
1950 2004-12-03 Ken Kocienda <kocienda@apple.com>
1954 Roll out some recent changes by Chris that caused a performance regression.
1955 Fix is in hand, but it is a little risky this close to a submission. So,
1956 we have decided to roll back the change with the regression and roll in
1957 the new code after we submit.
1959 * khtml/css/cssproperties.c:
1962 * khtml/css/cssvalues.c:
1965 * khtml/misc/htmlattrs.c:
1968 * khtml/misc/htmltags.c:
1971 * khtml/misc/loader.cpp:
1972 (CachedObject::~CachedObject):
1973 (CachedObject::setResponse):
1974 (CachedCSSStyleSheet::checkNotify):
1975 (Loader::servePendingRequests):
1976 (Loader::slotFinished):
1977 (Loader::slotReceivedResponse):
1978 (Cache::requestImage):
1979 (Cache::requestScript):
1980 * khtml/misc/loader.h:
1981 (khtml::CachedObject::CachedObject):
1982 (khtml::CachedObject::response):
1983 * kwq/KWQKJobClasses.h:
1984 * kwq/KWQKJobClasses.mm:
1985 (KIO::TransferJobPrivate::TransferJobPrivate):
1986 (KIO::TransferJobPrivate::~TransferJobPrivate):
1987 (KIO::TransferJob::TransferJob):
1988 (KIO::TransferJob::assembleResponseHeaders):
1989 (KIO::TransferJob::retrieveCharset):
1990 (KIO::TransferJob::emitResult):
1991 (KIO::TransferJob::emitReceivedResponse):
1994 (KWQHeaderStringFromDictionary):
1995 (KWQCheckCacheObjectStatus):
1996 (KWQRetainResponse):
1997 (KWQReleaseResponse):
1998 (KWQIsResponseURLEqualToURL):
2000 (KWQResponseMIMEType):
2001 (KWQResponseTextEncodingName):
2002 (KWQResponseHeaderString):
2003 (KWQCacheObjectExpiresTime):
2004 (KWQLoader::KWQLoader):
2008 * kwq/KWQResourceLoader.mm:
2009 (-[KWQResourceLoader finishJobAndHandle]):
2010 (-[KWQResourceLoader cancel]):
2011 (-[KWQResourceLoader reportError]):
2012 (-[KWQResourceLoader finish]):
2020 * kwq/WebCoreBridge.h:
2021 * kwq/WebCoreResourceLoader.h:
2023 2004-12-03 John Sullivan <sullivan@apple.com>
2027 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
2029 * kwq/KWQKHTMLPart.mm:
2030 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
2031 when checking whether we moved the focus to another view, make sure we didn't "move" it to
2032 our documentView, because that's no move at all.
2034 2004-12-03 Darin Adler <darin@apple.com>
2038 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
2040 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
2041 Added missing initialization for base class and node pointer.
2043 - fixed a few places that could leave dangling node pointers
2045 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
2046 Clear out the node pointer when the node is destroyed.
2047 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
2049 2004-12-03 Chris Blumenberg <cblu@apple.com>
2051 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.
2052 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
2056 * khtml/misc/loader.cpp:
2057 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
2058 (Loader::slotFinished): take data param
2059 * khtml/misc/loader.h:
2060 * kwq/KWQKJobClasses.h:
2061 * kwq/KWQKJobClasses.mm:
2062 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
2063 (KIO::TransferJob::emitResult): take data param and pass it
2064 * kwq/KWQResourceLoader.mm:
2065 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
2066 (-[KWQResourceLoader cancel]): pass nil for data
2067 (-[KWQResourceLoader reportError]): ditto
2068 (-[KWQResourceLoader finishWithData:]): pass data
2070 (KWQSlot::KWQSlot): pass data param to slotFinished
2071 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
2073 2004-12-03 Ken Kocienda <kocienda@apple.com>
2077 Did some clean up in the Position class as a result of trying to write some new layout
2078 tests and discovering a bug along the way.
2080 I removed these three functions from the Position class:
2082 1. bool isFirstRenderedPositionOnLine() const;
2083 2. bool isLastRenderedPositionOnLine() const;
2084 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
2085 4. bool inFirstEditableInRootEditableElement() const;
2087 The first two have replacements in the VisiblePosition class, and some code has been
2088 moved to use these new variants. The third function was a helper used only by these
2089 first two function, and can be removed as well. The fourth function was not used by anyone.
2091 * khtml/editing/htmlediting.cpp:
2092 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
2093 * khtml/editing/visible_position.cpp:
2094 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
2095 Incorrect results were being returned when asking about positions at the starts of blocks.
2096 * khtml/xml/dom_position.cpp:
2097 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
2098 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
2099 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
2100 * khtml/xml/dom_position.h: Update header for deletions.
2102 2004-12-03 Ken Kocienda <kocienda@apple.com>
2106 Terminology change in execCommand command identifiers. Specifically, the name of
2107 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
2108 terminology used by AppKit. It is also more accurate, since the insertion of a
2109 "br" element is what the command does. The inspiration for this change is so the
2110 -insertNewline AppKit method can be mapped to insert a new "div" element in
2111 a document and avoid ambiguity with what the javascript editing command does.
2113 * khtml/editing/jsediting.cpp
2114 * layout-tests/editing/deleting/delete-tab-004.html
2115 * layout-tests/editing/editing.js
2116 * layout-tests/editing/inserting/insert-3654864-fix.html
2117 * layout-tests/editing/inserting/insert-3659587-fix.html
2118 * layout-tests/editing/inserting/insert-3775316-fix.html
2119 * layout-tests/editing/inserting/insert-3800346-fix.html
2120 * layout-tests/editing/inserting/insert-br-001.html
2121 * layout-tests/editing/inserting/insert-br-002.html
2122 * layout-tests/editing/inserting/insert-br-003.html
2123 * layout-tests/editing/inserting/insert-br-004.html
2124 * layout-tests/editing/inserting/insert-br-005.html
2125 * layout-tests/editing/inserting/insert-br-006.html
2126 * layout-tests/editing/inserting/insert-br-007.html
2127 * layout-tests/editing/inserting/insert-br-008.html
2128 * layout-tests/editing/inserting/insert-tab-004.html
2129 * layout-tests/editing/inserting/insert-text-with-newlines.html
2130 * layout-tests/editing/pasteboard/paste-text-010.html
2132 2004-12-02 Ken Kocienda <kocienda@apple.com>
2138 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
2140 * khtml/editing/htmlediting.cpp:
2141 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
2142 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
2143 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
2144 in a block and the document is in quirks mode, add an additional br to make the one in the
2145 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
2146 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
2147 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
2149 2004-12-02 Richard Williamson <rjw@apple.com>
2151 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
2153 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
2154 the b/f cache won't incorrectly trash the previous state when restoring.
2158 * kwq/WebCoreBridge.h:
2159 * kwq/WebCoreBridge.mm:
2160 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
2161 (-[WebCoreBridge canCachePage]):
2162 (-[WebCoreBridge clear]):
2164 2004-12-02 Ken Kocienda <kocienda@apple.com>
2170 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
2172 * khtml/xml/dom2_rangeimpl.cpp:
2173 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
2174 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
2175 of this bug where there is content after the body tag). Did a little code clean up as well.
2176 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
2178 2004-12-02 Ken Kocienda <kocienda@apple.com>
2184 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
2186 * khtml/khtml_part.cpp:
2187 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
2188 to figure out which end of the selection to extend.
2190 2004-12-02 David Harrison <harrison@apple.com>
2192 Reviewed by Ken Kocienda.
2194 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
2195 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
2197 * khtml/editing/visible_text.cpp:
2198 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
2199 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
2200 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
2201 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
2202 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
2203 Distinguish BR from whitespace.
2204 * khtml/editing/visible_text.h:
2205 Distinguish BR from whitespace.
2206 * khtml/editing/visible_units.cpp:
2207 (khtml::previousWordBoundary):
2208 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.
2210 2004-12-02 Ken Kocienda <kocienda@apple.com>
2216 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
2218 * khtml/xml/dom_position.cpp:
2219 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
2220 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
2221 exception trying to use a Position returned from this function to set the boundary point of a Range (which
2222 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
2223 contract to return a range-compliant position, hence the need for this fix.
2225 2004-12-01 Ken Kocienda <kocienda@apple.com>
2231 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
2232 regard to other editing commands. The class had a name change ages ago, and it was never
2234 * khtml/editing/htmlediting.h: Ditto.
2236 2004-12-01 Ken Kocienda <kocienda@apple.com>
2240 Some improvements for paste, including some new code to annotate
2241 whitespace when writing to the pasteboard to ensure that the meaning
2242 of the markup on the pasteboard is unambiguous.
2244 There is also new code for reading this annotated markup from the pasteboard,
2245 removing the nodes that were added only to prevent ambiguity.
2247 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
2248 The header should have been added earlier, but I did not do so.
2249 * khtml/editing/html_interchange.cpp: Added.
2250 (convertHTMLTextToInterchangeFormat):
2251 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
2252 * khtml/editing/htmlediting.cpp:
2253 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
2254 Also fixed a bug in the code that counts blocks in a fragment.
2255 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
2256 (khtml::ReplacementFragment::insertNodeBefore): New helper.
2257 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
2258 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
2259 * khtml/editing/htmlediting.h: Add some new declarations.
2260 * khtml/xml/dom2_rangeimpl.cpp:
2261 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
2262 * khtml/xml/dom_nodeimpl.cpp:
2263 (NodeImpl::stringValueForRange): New helper.
2264 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
2265 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
2266 should be added. Called by the paste code.
2267 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
2269 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
2270 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
2271 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
2273 2004-11-30 Chris Blumenberg <cblu@apple.com>
2275 * ChangeLog: removed conflict marker
2277 2004-11-30 Chris Blumenberg <cblu@apple.com>
2280 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
2281 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
2285 * khtml/misc/loader.cpp:
2286 (CachedObject::~CachedObject): release m_allData
2287 (CachedObject::setAllData): new
2288 (Loader::servePendingRequests): connect slotAllData
2289 (Loader::slotAllData): new
2290 (Cache::requestImage): tweak
2291 * khtml/misc/loader.h:
2292 (khtml::CachedObject::CachedObject): set allData to 0
2293 (khtml::CachedObject::allData): new
2294 * kwq/KWQKJobClasses.h:
2295 * kwq/KWQKJobClasses.mm:
2296 (KIO::TransferJob::TransferJob): set m_allData
2297 (KIO::TransferJob::emitAllData): new
2299 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
2300 * kwq/KWQResourceLoader.mm:
2301 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
2303 (KWQSlot::KWQSlot): support for slotAllData
2305 * kwq/WebCoreBridge.h:
2306 * kwq/WebCoreResourceLoader.h:
2308 2004-11-30 Maciej Stachowiak <mjs@apple.com>
2312 2004-11-30 Maciej Stachowiak <mjs@apple.com>
2316 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
2318 * khtml/khtml_part.cpp:
2319 (KHTMLPart::begin): call setParsing on document here after opening
2320 - from now on we'll only set parsing to true for a document open
2321 caused by page loading, not a programmatic one.
2322 * khtml/xml/dom_docimpl.cpp:
2323 (DocumentImpl::open): don't setParsing to true here any more.
2325 2004-11-30 Maciej Stachowiak <mjs@apple.com>
2329 - fix recent regression from collection perf fixes.
2331 * khtml/html/html_miscimpl.cpp:
2332 (HTMLFormCollectionImpl::updateNameCache): Look up the name
2333 attribute in the name cache, not the id cache (d'oh!)
2335 2004-11-30 Darin Adler <darin@apple.com>
2339 - rolled in a KDE fix for a problem that may underlie a number of crashes
2341 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
2342 the KDE guys to fix a subtle problem. Code said "n = n =".
2344 - rolled in a KDE fix for a containingBlock crash
2346 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
2347 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
2350 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
2353 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
2354 (-[KWQButton detachQButton]): Added.
2355 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
2356 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
2357 (-[KWQButton widget]): Added.
2358 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
2359 (-[KWQButton resignFirstResponder]): Ditto.
2360 (-[KWQButton canBecomeKeyView]): Ditto.
2361 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
2362 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
2364 * kwq/KWQComboBox.mm:
2365 (QComboBox::~QComboBox): Call detachQComboBox.
2366 (-[KWQPopUpButtonCell detachQComboBox]): Added.
2367 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
2368 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
2369 (-[KWQPopUpButton action:]): Ditto.
2370 (-[KWQPopUpButton widget]): Tweaked.
2371 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
2372 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
2373 (-[KWQPopUpButton resignFirstResponder]): Ditto.
2374 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
2376 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
2378 * kwq/KWQListBox.mm:
2379 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
2381 * kwq/KWQScrollBar.h: Removed m_scroller field.
2382 * kwq/KWQScrollBar.mm:
2383 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
2384 (-[KWQScrollBar detachQScrollBar]): Added.
2385 (-[KWQScrollBar widget]): Added.
2386 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
2387 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
2388 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
2389 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
2390 (QScrollBar::setKnobProportion): Ditto.
2391 (QScrollBar::scrollbarHit): Ditto.
2393 * kwq/KWQScrollView.mm:
2394 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
2395 hack where we don't remove right away when doing mouse tracking.
2396 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
2397 the hack where we don't add right away when doing mouse tracking.
2399 * kwq/KWQSlider.h: Added destructor.
2401 (-[KWQSlider initWithQSlider:]): Tweaked a little.
2402 (-[KWQSlider detachQSlider]): Added.
2403 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
2404 (-[KWQSlider widget]): Added.
2405 (QSlider::~QSlider): Added. Calls detachQSlider.
2407 * kwq/KWQTextArea.h: Added detachQTextEdit method.
2408 * kwq/KWQTextArea.mm:
2409 (-[KWQTextArea detachQTextEdit]): Added.
2410 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
2411 (-[KWQTextArea becomeFirstResponder]): Ditto.
2412 (-[KWQTextArea nextKeyView]): Ditto.
2413 (-[KWQTextArea previousKeyView]): Ditto.
2414 (-[KWQTextArea drawRect:]): Ditto.
2415 (-[KWQTextAreaTextView insertTab:]): Ditto.
2416 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
2417 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
2418 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
2419 (-[KWQTextAreaTextView mouseDown:]): Ditto.
2420 (-[KWQTextAreaTextView keyDown:]): Ditto.
2421 (-[KWQTextAreaTextView keyUp:]): Ditto.
2423 * kwq/KWQTextEdit.h: Added ~QTextEdit.
2424 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
2426 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
2427 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
2429 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
2430 Added beforeMouseDown and afterMouseDown for use in widget implementations.
2431 Removed unused hasMouseTracking function.
2433 (QWidget::QWidget): Initialize two new fields.
2434 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
2435 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
2436 (QWidget::addToSuperview): Added.
2437 (QWidget::removeFromSuperview): Added.
2438 (QWidget::beforeMouseDown): Added.
2439 (QWidget::afterMouseDown): Added.
2441 * khtml/rendering/render_layer.cpp:
2442 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
2443 (RenderLayer::setHasVerticalScrollbar): Ditto.
2445 2004-11-30 Ken Kocienda <kocienda@apple.com>
2451 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
2453 * khtml/khtml_part.cpp:
2454 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
2455 with no blink if it is.
2457 2004-11-30 Ken Kocienda <kocienda@apple.com>
2463 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
2465 * khtml/khtml_part.cpp:
2466 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
2467 or <input type=image> was checked for focus since these elements are keyboard-focusable,
2468 but not mouse focusable. Also, this function did not work hard enough to set the focused
2469 node, and was content to clear it if the first element checked failed the test, rather
2470 than looking more at parents. This would have the effect of clearing, then resetting the
2471 focus on a DIV containing a button or image with content on either side of it in the
2472 process of arrowing over such content.
2474 2004-11-30 Ken Kocienda <kocienda@apple.com>
2478 * khtml/editing/htmlediting.cpp:
2479 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
2480 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
2481 * khtml/khtml_part.cpp:
2482 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
2483 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
2484 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
2485 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
2486 isCharacterSmartReplaceExempt virtual.
2488 2004-11-30 Ken Kocienda <kocienda@apple.com>
2492 * khtml/editing/htmlediting.cpp:
2493 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
2494 Seemed simple enough to land without review.
2496 2004-11-29 Ken Kocienda <kocienda@apple.com>
2500 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
2501 are handled correctly now, including selections that span multiple blocks, and cases
2502 where content on the pasteboard ends in newlines (or what appear to be newlines to a
2503 user, really block ends or BRs). I also made one small, but important change in the
2504 copy code to annotate the markup written to the pasteboard to support these selections
2507 New header that defines a couple of constants used in copying and pasting.
2509 * ForwardingHeaders/editing/html_interchange.h: Added.
2510 * khtml/editing/html_interchange.h: Added.
2512 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
2513 as a new helper class, ReplacementFragment, which encapsulates information and functions
2514 pertaining to a document fragment that is being inserted into a document.
2516 * khtml/editing/htmlediting.cpp:
2517 (khtml::ReplacementFragment::ReplacementFragment):
2518 (khtml::ReplacementFragment::~ReplacementFragment):
2519 (khtml::ReplacementFragment::firstChild): Simple accessor.
2520 (khtml::ReplacementFragment::lastChild): Ditto.
2521 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
2522 the starting node to use for merging into the block containing the start of the selection.
2523 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
2524 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
2525 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
2526 special annotation comment added in by the copy code.
2527 (khtml::ReplacementFragment::removeNode): Simple helper.
2528 (khtml::isComment): Simple helper.
2529 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
2530 I would like to do better than this some day, but this check will hold us until I can do better.
2531 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
2532 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
2533 (khtml::ReplaceSelectionCommand::doApply):
2534 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
2535 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
2536 (khtml::ReplacementFragment::root):
2537 (khtml::ReplacementFragment::type):
2538 (khtml::ReplacementFragment::isEmpty):
2539 (khtml::ReplacementFragment::isSingleTextNode):
2540 (khtml::ReplacementFragment::isTreeFragment):
2541 (khtml::ReplacementFragment::hasMoreThanOneBlock):
2542 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
2544 This smaller set of changes markup generation to add the newline annotation described in the
2545 comment at the start of this entry.
2547 * khtml/xml/dom2_rangeimpl.cpp:
2548 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
2549 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
2550 comment annotations are added to the markup generated.
2551 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
2552 * kwq/WebCoreBridge.mm:
2553 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
2554 DOM::RangeImpl::toHTML uses annotations when generating.
2558 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
2559 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
2560 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
2561 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
2562 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
2563 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
2564 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
2565 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
2566 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
2567 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
2568 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
2569 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
2570 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
2571 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
2572 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
2573 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
2574 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
2575 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
2577 2004-11-29 Ken Kocienda <kocienda@apple.com>
2579 Reviewed by Harrison
2581 Made two small changes that make it possible for comments to have DOM nodes made for them
2582 when pasting. This relies on some earlier work I did some days ago.
2584 * khtml/xml/dom_nodeimpl.cpp:
2585 (NodeImpl::startMarkup): Get the string from the comment.
2586 * kwq/WebCoreBridge.mm:
2587 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
2588 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
2589 be included in the DOM.
2591 2004-11-29 Ken Kocienda <kocienda@apple.com>
2593 Reviewed by Harrison
2595 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
2596 my improved paste code.
2598 * khtml/editing/visible_position.cpp:
2599 (khtml::blockRelationship)
2600 (khtml::visiblePositionsInDifferentBlocks)
2601 (khtml::isFirstVisiblePositionInBlock)
2602 (khtml::isFirstVisiblePositionInNode)
2603 (khtml::isLastVisiblePositionInBlock)
2604 * khtml/editing/visible_position.h
2606 2004-11-29 Ken Kocienda <kocienda@apple.com>
2608 Reviewed by Harrison
2610 * khtml/xml/dom_position.cpp:
2611 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
2612 specified from obeying that directive. The old code would stop at an outer block boundary in
2613 the case where that block had a block as its first child. The correct behavior is to drill into
2614 that inner block (and continue on drilling down, if possible), to find the correct position.
2616 2004-11-29 Ken Kocienda <kocienda@apple.com>
2618 Reviewed by Harrison
2620 Small improvements to the node-display debugging helpers.
2622 * khtml/xml/dom_nodeimpl.cpp:
2623 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
2624 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
2626 2004-11-29 Ken Kocienda <kocienda@apple.com>
2628 Reviewed by Harrison
2630 * khtml/editing/htmlediting.cpp:
2631 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
2632 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
2633 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
2634 place after the delete.
2636 2004-11-29 Ken Kocienda <kocienda@apple.com>
2638 Reviewed by Harrison
2640 Add a new helper function to insert a paragraph separator. Will be used in my
2641 upcoming paste improvments.
2643 * khtml/editing/htmlediting.cpp: Added function
2644 (khtml::CompositeEditCommand::insertParagraphSeparator)
2645 * khtml/editing/htmlediting.h: Ditto.
2647 2004-11-23 David Harrison <harrison@apple.com>
2649 Added various comments.
2651 * khtml/editing/htmlediting.cpp:
2652 (khtml::StyleChange::init):
2653 (khtml::ApplyStyleCommand::doApply):
2654 (khtml::ApplyStyleCommand::applyBlockStyle):
2655 (khtml::ApplyStyleCommand::applyInlineStyle):
2657 2004-11-23 David Hyatt <hyatt@apple.com>
2659 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
2660 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
2662 * khtml/rendering/render_block.cpp:
2663 (khtml::RenderBlock::nodeAtPoint):
2665 2004-11-22 David Hyatt <hyatt@apple.com>
2667 Make sure you can use document.createElement to make a <canvas> element.
2669 * khtml/xml/dom_docimpl.cpp:
2670 (DocumentImpl::createHTMLElement):
2672 2004-11-22 Maciej Stachowiak <mjs@apple.com>
2676 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
2677 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
2678 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
2679 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
2681 * khtml/ecma/kjs_html.cpp:
2682 (KJS::HTMLDocument::tryGet):
2683 * khtml/html/html_formimpl.cpp:
2684 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
2685 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2686 * khtml/html/html_formimpl.h:
2687 * khtml/html/html_miscimpl.cpp:
2688 (HTMLCollectionImpl::HTMLCollectionImpl):
2689 (HTMLCollectionImpl::~HTMLCollectionImpl):
2690 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
2691 (HTMLCollectionImpl::CollectionInfo::reset):
2692 (HTMLCollectionImpl::resetCollectionInfo):
2693 (HTMLCollectionImpl::checkForNameMatch):
2695 (HTMLCollectionImpl::updateNameCache):
2696 (HTMLCollectionImpl::namedItems):
2697 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
2698 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
2699 (HTMLFormCollectionImpl::item):
2700 (HTMLFormCollectionImpl::updateNameCache):
2701 * khtml/html/html_miscimpl.h:
2703 2004-11-22 David Hyatt <hyatt@apple.com>
2705 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
2710 * khtml/misc/loader.cpp:
2711 (CachedObject::finish):
2714 * khtml/misc/loader.h:
2715 (khtml::Cache::maxCacheableObjectSize):
2717 2004-11-22 David Hyatt <hyatt@apple.com>
2719 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
2720 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
2721 that lets us short circuit earlier when painting and hit testing.
2725 * khtml/khtml_part.cpp:
2726 (KHTMLPart::isPointInsideSelection):
2727 * khtml/rendering/render_block.cpp:
2728 (khtml::RenderBlock::paint):
2729 (khtml::RenderBlock::paintChildren):
2730 (khtml::RenderBlock::paintObject):
2731 (khtml::RenderBlock::paintFloats):
2732 (khtml::RenderBlock::nodeAtPoint):
2733 * khtml/rendering/render_block.h:
2734 * khtml/rendering/render_box.cpp:
2735 (RenderBox::nodeAtPoint):
2736 * khtml/rendering/render_box.h:
2737 * khtml/rendering/render_br.h:
2738 * khtml/rendering/render_canvas.cpp:
2739 (RenderCanvas::paint):
2740 * khtml/rendering/render_flow.cpp:
2741 (RenderFlow::paintLines):
2742 (RenderFlow::hitTestLines):
2743 (RenderFlow::caretRect):
2744 (RenderFlow::addFocusRingRects):
2745 (RenderFlow::paintFocusRing):
2746 (RenderFlow::paintOutlines):
2747 (RenderFlow::paintOutlineForLine):
2748 * khtml/rendering/render_flow.h:
2749 * khtml/rendering/render_frames.cpp:
2750 (RenderFrameSet::nodeAtPoint):
2751 * khtml/rendering/render_frames.h:
2752 * khtml/rendering/render_image.cpp:
2753 (RenderImage::nodeAtPoint):
2754 * khtml/rendering/render_image.h:
2755 * khtml/rendering/render_inline.cpp:
2756 (RenderInline::paint):
2757 (RenderInline::nodeAtPoint):
2758 * khtml/rendering/render_inline.h:
2759 * khtml/rendering/render_layer.cpp:
2760 (RenderLayer::paintLayer):
2761 (RenderLayer::hitTest):
2762 (RenderLayer::hitTestLayer):
2763 * khtml/rendering/render_layer.h:
2764 * khtml/rendering/render_line.cpp:
2765 (khtml::InlineBox::paint):
2766 (khtml::InlineBox::nodeAtPoint):
2767 (khtml::InlineFlowBox::flowObject):
2768 (khtml::InlineFlowBox::nodeAtPoint):
2769 (khtml::InlineFlowBox::paint):
2770 (khtml::InlineFlowBox::paintBackgrounds):
2771 (khtml::InlineFlowBox::paintBackground):
2772 (khtml::InlineFlowBox::paintBackgroundAndBorder):
2773 (khtml::InlineFlowBox::paintDecorations):
2774 (khtml::EllipsisBox::paint):
2775 (khtml::EllipsisBox::nodeAtPoint):
2776 (khtml::RootInlineBox::paintEllipsisBox):
2777 (khtml::RootInlineBox::paint):
2778 (khtml::RootInlineBox::nodeAtPoint):
2779 * khtml/rendering/render_line.h:
2780 (khtml::InlineRunBox::paintBackgroundAndBorder):
2781 * khtml/rendering/render_object.cpp:
2782 (RenderObject::hitTest):
2783 (RenderObject::setInnerNode):
2784 (RenderObject::nodeAtPoint):
2785 * khtml/rendering/render_object.h:
2786 (khtml::RenderObject::PaintInfo::PaintInfo):
2787 (khtml::RenderObject::PaintInfo::~PaintInfo):
2788 (khtml::RenderObject::paintingRootForChildren):
2789 (khtml::RenderObject::shouldPaintWithinRoot):
2790 * khtml/rendering/render_table.cpp:
2791 (RenderTable::layout):
2792 (RenderTable::paint):
2793 * khtml/rendering/render_text.cpp:
2794 (simpleDifferenceBetweenColors):
2795 (correctedTextColor):
2796 (InlineTextBox::nodeAtPoint):
2797 (InlineTextBox::paint):
2798 (InlineTextBox::selectionStartEnd):
2799 (InlineTextBox::paintSelection):
2800 (InlineTextBox::paintMarkedTextBackground):
2801 (InlineTextBox::paintDecoration):
2802 (RenderText::posOfChar):
2803 * khtml/rendering/render_text.h:
2804 (khtml::RenderText::paint):
2805 (khtml::RenderText::layout):
2806 (khtml::RenderText::nodeAtPoint):
2807 * khtml/xml/dom2_eventsimpl.cpp:
2808 (MouseEventImpl::computeLayerPos):
2809 * khtml/xml/dom_docimpl.cpp:
2810 (DocumentImpl::prepareMouseEvent):
2811 * kwq/KWQAccObject.mm:
2812 (-[KWQAccObject accessibilityHitTest:]):
2813 * kwq/KWQKHTMLPart.mm:
2814 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
2815 (KWQKHTMLPart::eventMayStartDrag):
2816 (KWQKHTMLPart::khtmlMouseMoveEvent):
2817 * kwq/WebCoreBridge.mm:
2818 (-[WebCoreBridge elementAtPoint:]):
2819 (-[WebCoreBridge _positionForPoint:]):
2821 2004-11-22 Maciej Stachowiak <mjs@apple.com>
2825 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
2826 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
2828 This avoids the O(N^2) penalty for named item traversal for form collections.
2830 It also combines the item traversal logic for all non-form
2831 collection operations into a single traverseNextItem
2832 function. This avoids having 5 copies of the big switch statement
2835 Also fixed a bug that prevented the last form element from being removed properly.
2837 * khtml/html/html_formimpl.cpp:
2838 (DOM::removeFromVector):
2839 * khtml/dom/html_misc.cpp:
2840 (HTMLCollection::namedItems):
2841 * khtml/dom/html_misc.h:
2842 * khtml/ecma/kjs_html.cpp:
2843 (KJS::HTMLCollection::getNamedItems):
2844 * khtml/html/html_miscimpl.cpp:
2845 (HTMLCollectionImpl::traverseNextItem):
2846 (HTMLCollectionImpl::calcLength):
2847 (HTMLCollectionImpl::length):
2848 (HTMLCollectionImpl::item):
2849 (HTMLCollectionImpl::nextItem):
2850 (HTMLCollectionImpl::checkForNameMatch):
2851 (HTMLCollectionImpl::namedItem):
2852 (HTMLCollectionImpl::namedItems):
2853 (HTMLCollectionImpl::nextNamedItem):
2854 (HTMLFormCollectionImpl::calcLength):
2855 (HTMLFormCollectionImpl::namedItem):
2856 (HTMLFormCollectionImpl::nextNamedItem):
2857 (HTMLFormCollectionImpl::namedItems):
2858 * khtml/html/html_miscimpl.h:
2860 2004-11-22 Ken Kocienda <kocienda@apple.com>
2862 Reviewed by Harrison
2864 Change around the way we block the Javascript "Paste" command identifier from
2865 being available. Formerly, this was done with an ifdef we never compiled in.
2866 Now, this is done with a couple of cheap runtime checks. The advantage is that
2867 we can now compile this command into development builds, and still yet switch
2868 on the command in deployment builds through the use of WebCore SPI so we can
2869 write and run layout tests with all of our builds.
2871 * khtml/editing/jsediting.cpp:
2872 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
2873 command being queried is the paste command.
2874 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
2875 * khtml/editing/jsediting.h: Ditto.
2876 * khtml/khtml_part.cpp:
2877 (KHTMLPart::pasteFromPasteboard): Added.
2878 (KHTMLPart::canPaste): Added.
2879 * kwq/KWQKHTMLPart.mm:
2880 (KHTMLPart::canPaste): Added.
2881 * kwq/KWQRenderTreeDebug.cpp:
2882 (externalRepresentation): Turn on paste command.
2883 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
2885 2004-11-21 Maciej Stachowiak <mjs@apple.com>
2887 Reviewed by Richard.
2889 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
2891 * khtml/html/html_miscimpl.cpp:
2892 (HTMLCollectionImpl::calcLength):
2893 (HTMLCollectionImpl::getItem):
2894 (HTMLCollectionImpl::item):
2895 (HTMLCollectionImpl::nextItem):
2896 (HTMLCollectionImpl::getNamedItem):
2897 (HTMLCollectionImpl::namedItem):
2898 (HTMLCollectionImpl::nextNamedItemInternal):
2899 (HTMLFormCollectionImpl::nextNamedItemInternal):
2901 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2905 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
2906 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
2907 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
2909 Many optimizations to HTMLFormCollection. Iterating it should not
2910 be N^2 any more, though finding items by name could still be.
2912 * khtml/html/html_formimpl.cpp:
2913 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
2914 (DOM::HTMLFormElementImpl::length):
2915 (DOM::HTMLFormElementImpl::submitClick):
2916 (DOM::HTMLFormElementImpl::formData):
2917 (DOM::HTMLFormElementImpl::submit):
2918 (DOM::HTMLFormElementImpl::reset):
2919 (DOM::HTMLFormElementImpl::radioClicked):
2920 (DOM::appendToVector):
2921 (DOM::removeFromVector):
2922 (DOM::HTMLFormElementImpl::registerFormElement):
2923 (DOM::HTMLFormElementImpl::removeFormElement):
2924 (DOM::HTMLFormElementImpl::makeFormElementDormant):
2925 (DOM::HTMLFormElementImpl::registerImgElement):
2926 (DOM::HTMLFormElementImpl::removeImgElement):
2927 * khtml/html/html_formimpl.h:
2928 * khtml/html/html_miscimpl.cpp:
2929 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
2930 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
2931 (HTMLFormCollectionImpl::resetCollectionInfo):
2932 (HTMLFormCollectionImpl::calcLength):
2933 (HTMLFormCollectionImpl::item):
2934 (HTMLFormCollectionImpl::getNamedItem):
2935 (HTMLFormCollectionImpl::getNamedFormItem):
2936 (HTMLFormCollectionImpl::firstItem):
2937 (HTMLFormCollectionImpl::nextItem):
2938 * khtml/html/html_miscimpl.h:
2939 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
2940 * khtml/xml/dom_elementimpl.cpp:
2941 (ElementImpl::setAttribute):
2942 (ElementImpl::setAttributeMap):
2943 * kwq/KWQPtrVector.h:
2944 (QPtrVector::findRef):
2945 * kwq/KWQVectorImpl.h:
2946 * kwq/KWQVectorImpl.mm:
2947 (KWQVectorImpl::findRef):
2948 * kwq/WebCoreBridge.mm:
2949 (-[WebCoreBridge elementWithName:inForm:]):
2950 (-[WebCoreBridge controlsInForm:]):
2952 2004-11-19 David Harrison <harrison@apple.com>
2954 Reviewed by Ken and Darin.
2956 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
2958 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
2959 for the existing style, but in this case (hitting cmd-B with caret at top of
2960 file) there is nothing upstream. Changed this to use the VisiblePosition
2961 deepEquivalent instead.
2963 * khtml/khtml_part.cpp:
2964 (KHTMLPart::computeAndSetTypingStyle):
2968 2004-11-19 Maciej Stachowiak <mjs@apple.com>
2972 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
2974 * khtml/xml/dom_docimpl.cpp:
2975 (DocumentImpl::close): Don't fire the onload handler if there is a
2976 redirect pending. This is a very long-standing bug that was masked
2977 by our previously incorrect redirect logic. It used to be that an
2978 older redirect would always win. Recently we changed things so
2979 that a newer redirect would win, but a script that causes a
2980 redirect would stop parsing once complete (so if there are two
2981 redirects in the same script, the latter wins). However, we should
2982 have also prevented onload in this case. Testing with other
2983 browsers shows that onload handlers do not run at all when there
2984 is a pending redirect.
2986 2004-11-19 Ken Kocienda <kocienda@apple.com>
2988 Reviewed by Harrison
2990 Fix some object lifetime issues in these two commands. This fixes some crashes
2991 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
2993 * khtml/editing/htmlediting.cpp:
2994 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
2995 in the ancestor list. They are not ref'ed when put on list. D'uh.
2996 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
2997 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
2998 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
3000 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
3002 2004-11-19 Ken Kocienda <kocienda@apple.com>
3004 Reviewed by Harrison
3008 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
3010 * khtml/khtml_part.cpp:
3011 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
3012 declaration given the current selection, and then sets the minimum necessary style as the typing
3014 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
3015 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
3017 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
3018 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
3019 * kwq/WebCoreBridge.mm:
3020 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
3021 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
3023 2004-11-18 David Harrison <harrison@apple.com>
3027 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
3028 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
3031 (-[DOMCSSStyleDeclaration setProperty:::]):
3033 2004-11-18 Chris Blumenberg <cblu@apple.com>
3035 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
3039 * kwq/KWQKHTMLPart.mm:
3040 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
3042 2004-11-18 Maciej Stachowiak <mjs@apple.com>
3046 - fix recursive item traversal, use traverseNextNode() instead of
3047 the buggy hand-rolled traversal.
3049 * khtml/xml/dom_nodeimpl.cpp:
3050 (NodeListImpl::recursiveItem):
3052 2004-11-17 Darin Adler <darin@apple.com>
3056 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
3058 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
3059 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
3061 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
3062 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
3063 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
3064 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
3065 an entire category of leaks we have been fixing one by one recently
3066 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
3067 stale RenderObject pointer, although I never saw it do that in practice
3068 - implemented the length and item methods for computed styles
3069 - implemented querying additional properties in computed styles (29 more)
3071 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
3072 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
3073 take a mutable style.
3074 * khtml/khtml_part.cpp:
3075 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
3076 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
3077 a computed style; also change some types to mutable style.
3078 (updateState): Update iteration of CSSProperty objects in a style declaration to use
3079 the new valuesIterator interface.
3080 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
3081 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
3082 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
3083 including accomodating the exception code that setCssText has now.
3084 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
3085 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
3086 the style attributes really was a change, although it's not an important optimization it's
3087 good to do it right.
3089 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
3090 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
3091 calling it were already removing the old property explicitly, so the code in here to remove
3092 the property again was redundant.
3094 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
3095 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
3096 * khtml/css/css_computedstyle.cpp:
3097 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
3098 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
3099 Before we had no guarantee the object would outlast us.
3100 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
3101 exception to NO_MODIFICATION_ALLOWED_ERR.
3102 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
3103 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
3104 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
3105 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
3106 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
3107 page-break-inside, position, unicode-bidi, widows, z-index.
3108 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
3109 exception to NO_MODIFICATION_ALLOWED_ERR.
3110 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
3111 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
3112 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
3113 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
3114 CSSMutableStyleDeclarationImpl.
3115 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
3116 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
3118 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
3119 now a separate class rather than a typedef.
3120 * khtml/css/cssparser.h: Ditto.
3122 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
3123 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
3124 Removed a bunch of redundant stuff from other classes in this file too.
3125 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
3126 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
3127 (DOM::CSSProperty::operator=): Added.
3128 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
3130 * khtml/css/css_valueimpl.cpp:
3131 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
3132 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
3133 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
3134 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
3135 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
3136 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
3137 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
3138 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
3139 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
3140 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
3141 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
3142 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
3143 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
3144 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
3145 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
3146 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
3147 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
3148 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
3149 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
3150 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
3151 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
3152 no styles in the list. Update to use QValueList.
3153 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
3154 parameter and set it.
3155 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
3156 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
3157 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
3158 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
3159 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
3160 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
3162 * khtml/css/cssparser.cpp:
3163 (CSSParser::parseValue): Changed to use addParsedProperties.
3164 (CSSParser::parseDeclaration): Ditto.
3165 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
3167 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
3168 * khtml/css/cssproperties.c: Regenerated.
3169 * khtml/css/cssproperties.h: Regenerated.
3171 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
3172 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
3174 * khtml/dom/css_value.cpp:
3175 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
3176 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
3177 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
3178 first doing getPropertyCSSValue and then doing cssText.
3179 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
3180 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
3181 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
3182 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
3183 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
3184 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
3185 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
3187 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
3188 * khtml/dom/dom_node.cpp: Ditto.
3190 * khtml/editing/htmlediting.h: Change some types to mutable style.
3191 * khtml/editing/htmlediting.cpp:
3192 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
3193 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
3194 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
3195 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
3196 (khtml::EditCommand::setTypingStyle): Ditto.
3197 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
3198 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
3199 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
3200 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
3201 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
3202 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
3203 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
3204 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
3205 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
3206 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
3207 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
3208 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
3209 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
3211 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
3212 * khtml/html/html_baseimpl.h: Change type to mutable style.
3213 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
3215 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
3216 class as a base class, and change types to mutable style as needed.
3217 * khtml/html/html_elementimpl.cpp:
3218 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
3219 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
3220 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
3221 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
3222 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
3223 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
3225 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
3228 * khtml/html/html_tableimpl.h: Change types to mutable style.
3229 * khtml/html/html_tableimpl.cpp:
3230 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
3231 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
3232 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
3234 * khtml/html/htmlparser.cpp:
3235 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
3236 than using an explicit delete to make the node go away, and is required for compatibility with the
3237 changes to the NodeImpl functions.
3238 (KHTMLParser::insertNode): Ditto.
3239 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
3240 the NodeImpl functions.
3242 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
3243 now that there's no need to make the property list explictly.
3246 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
3247 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
3248 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
3250 * khtml/xml/dom_nodeimpl.cpp:
3251 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
3252 function succeeded or not for ownership purposes.
3253 (NodeImpl::replaceChild): Ditto.
3254 (NodeImpl::appendChild): Ditto.
3255 (NodeBaseImpl::insertBefore): Ditto.
3256 (NodeBaseImpl::replaceChild): Ditto.
3257 (NodeBaseImpl::appendChild): Ditto.
3258 (NodeBaseImpl::addChild): Ditto.
3260 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
3261 * WebCore-combined.exp: Regenerated.
3263 2004-11-18 Maciej Stachowiak <mjs@apple.com>
3265 still even more build fixing
3267 * khtml/html/html_miscimpl.cpp:
3268 (HTMLCollectionImpl::resetCollectionInfo):
3270 2004-11-18 Maciej Stachowiak <mjs@apple.com>
3274 * khtml/html/html_miscimpl.cpp:
3275 (HTMLCollectionImpl::resetCollectionInfo):
3277 2004-11-18 Maciej Stachowiak <mjs@apple.com>
3279 Fixed build problem.
3281 * khtml/html/html_miscimpl.h:
3282 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
3284 2004-11-18 Maciej Stachowiak <mjs@apple.com>
3288 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
3290 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
3291 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
3293 This is also a start on fixing 5 other bugs, but those need additional work to make
3294 HTMLFormCollection fast.
3296 * khtml/html/html_documentimpl.h:
3297 (DOM::HTMLDocumentImpl::collectionInfo):
3298 * khtml/html/html_formimpl.cpp:
3299 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
3300 (DOM::HTMLFormElementImpl::isURLAttribute):
3301 (DOM::HTMLFormElementImpl::registerImgElement):
3302 (DOM::HTMLFormElementImpl::removeImgElement):
3303 * khtml/html/html_formimpl.h:
3304 * khtml/html/html_imageimpl.cpp:
3305 (HTMLImageElementImpl::HTMLImageElementImpl):
3306 (HTMLImageElementImpl::~HTMLImageElementImpl):
3307 * khtml/html/html_imageimpl.h:
3308 * khtml/html/html_miscimpl.cpp:
3309 (HTMLCollectionImpl::HTMLCollectionImpl):
3310 (HTMLCollectionImpl::~HTMLCollectionImpl):
3311 (HTMLCollectionImpl::updateCollectionInfo):
3312 (HTMLCollectionImpl::length):
3313 (HTMLCollectionImpl::item):
3314 (HTMLCollectionImpl::firstItem):
3315 (HTMLCollectionImpl::nextItem):
3316 (HTMLCollectionImpl::namedItem):
3317 (HTMLCollectionImpl::nextNamedItemInternal):
3318 (HTMLFormCollectionImpl::getNamedFormItem):
3319 * khtml/html/html_miscimpl.h:
3320 (DOM::HTMLCollectionImpl::):
3321 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
3322 * khtml/html/htmlparser.cpp:
3323 (KHTMLParser::getElement):
3324 * khtml/xml/dom_docimpl.cpp:
3325 (DocumentImpl::DocumentImpl):
3326 * khtml/xml/dom_docimpl.h:
3327 (DOM::DocumentImpl::incDOMTreeVersion):
3328 (DOM::DocumentImpl::domTreeVersion):
3329 * khtml/xml/dom_nodeimpl.cpp:
3333 2004-11-18 Kevin Decker <kdecker@apple.com>
3337 fixed: <rdar://problem/3841842> getPropertyID expensive
3340 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
3342 2004-11-17 David Hyatt <hyatt@apple.com>
3344 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
3345 and subsequently backed out).
3347 Reviewed by kocienda
3349 * khtml/html/html_baseimpl.cpp:
3350 (HTMLBodyElementImpl::insertedIntoDocument):
3351 * khtml/html/htmltokenizer.cpp:
3352 (khtml::HTMLTokenizer::reset):
3353 (khtml::HTMLTokenizer::scriptHandler):
3354 (khtml::HTMLTokenizer::scriptExecution):
3355 (khtml::HTMLTokenizer::write):
3356 (khtml::HTMLTokenizer::continueProcessing):
3357 (khtml::HTMLTokenizer::timerEvent):
3358 (khtml::HTMLTokenizer::notifyFinished):
3359 * khtml/html/htmltokenizer.h:
3360 * khtml/khtmlview.cpp:
3361 (KHTMLViewPrivate::KHTMLViewPrivate):
3362 (KHTMLViewPrivate::reset):
3364 (KHTMLView::layout):
3365 (KHTMLView::timerEvent):
3366 (KHTMLView::scheduleRelayout):
3367 (KHTMLView::layoutPending):
3368 (KHTMLView::haveDelayedLayoutScheduled):
3369 (KHTMLView::unscheduleRelayout):
3370 * khtml/khtmlview.h:
3371 * khtml/xml/dom_docimpl.cpp:
3372 (DocumentImpl::DocumentImpl):
3373 (DocumentImpl::close):
3374 (DocumentImpl::setParsing):
3375 (DocumentImpl::shouldScheduleLayout):
3376 (DocumentImpl::minimumLayoutDelay):
3377 (DocumentImpl::write):
3378 (DocumentImpl::finishParsing):
3379 (DocumentImpl::stylesheetLoaded):
3380 (DocumentImpl::updateStyleSelector):
3381 * khtml/xml/dom_docimpl.h:
3382 (DOM::DocumentImpl::parsing):
3383 * kwq/KWQDateTime.mm:
3384 (KWQUIEventTime::uiEventPending):
3386 2004-11-17 David Harrison <harrison@apple.com>
3388 Reviewed by Ken Kocienda.
3390 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
3391 Treat null case as meaning no post-move merge is needed.
3393 * khtml/editing/htmlediting.cpp:
3394 (khtml::DeleteSelectionCommand::initializePositionData):
3396 2004-11-17 David Harrison <harrison@apple.com>
3398 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
3399 * khtml/xml/dom_nodeimpl.cpp:
3400 (NodeImpl::displayNode):
3401 (NodeImpl::displayTree):
3402 (NodeBaseImpl::dispatchChildRemovalEvents):
3403 * khtml/xml/dom_nodeimpl.h:
3405 2004-11-16 John Sullivan <sullivan@apple.com>
3407 Reviewed by Richard.
3409 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
3411 * khtml/khtml_part.cpp:
3413 delete the list we created when we're done with it
3415 2004-11-16 Ken Kocienda <kocienda@apple.com>
3419 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
3420 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
3421 QPtrList when the list goes out of scope.
3423 * khtml/editing/htmlediting.cpp:
3424 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
3425 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
3426 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
3427 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
3428 No longer set lists to autodelete.
3429 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
3430 Call new derefNodesInList helper.
3431 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
3432 of one before, but now it does.
3434 2004-11-15 David Harrison <harrison@apple.com>
3436 Reviewed by Chris and Darin.
3438 <rdar://problem/3880304> Non-linear performance hit for style changes
3440 * khtml/xml/dom_nodeimpl.cpp:
3441 (NodeImpl::traverseNextNode):
3442 (NodeImpl::traverseNextSibling):
3443 (NodeImpl::traversePreviousNodePostOrder):
3444 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
3445 Add asserts that stayWithin is an ancestor of the returned node.
3447 2004-11-15 Darin Adler <darin@apple.com>
3451 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
3453 * khtml/css/css_computedstyle.cpp:
3454 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
3455 since there's no guarantee it's already ref'd.
3456 * khtml/css/css_valueimpl.cpp:
3457 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
3458 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
3459 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
3460 (CSSStyleDeclarationImpl::merge): Ditto.
3461 (CSSStyleDeclarationImpl::diff): Ditto.
3462 * khtml/editing/htmlediting.cpp:
3463 (khtml::StyleChange::currentlyHasStyle): Ditto.
3464 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
3465 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
3466 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
3468 2004-11-15 Darin Adler <darin@apple.com>
3472 Use separate mutable style and computed style types as appropriate.
3473 For now this should have no effect, but it prepares us for refactoring later.
3474 Also remove some unnecessary "DOM::" prefixes and in one case factor out
3477 * khtml/khtml_part.cpp:
3478 (KHTMLPart::typingStyle):
3479 (KHTMLPart::setTypingStyle):
3481 (KHTMLPart::selectionHasStyle):
3482 (KHTMLPart::selectionStartHasStyle):
3483 (KHTMLPart::selectionComputedStyle):
3484 * khtml/khtml_part.h:
3485 * khtml/khtmlpart_p.h:
3487 * khtml/css/css_base.h:
3488 * khtml/css/css_ruleimpl.cpp:
3489 (CSSStyleRuleImpl::setDeclaration):
3490 * khtml/css/css_ruleimpl.h:
3491 (DOM::CSSFontFaceRuleImpl::style):
3492 (DOM::CSSPageRuleImpl::style):
3493 (DOM::CSSStyleRuleImpl::style):
3494 (DOM::CSSStyleRuleImpl::declaration):
3495 * khtml/css/css_valueimpl.h:
3496 (DOM::CSSPrimitiveValueImpl::):
3497 * khtml/css/cssparser.cpp:
3498 (CSSParser::parseValue):
3499 (CSSParser::parseColor):
3500 (CSSParser::parseDeclaration):
3501 (CSSParser::createStyleDeclaration):
3502 * khtml/css/cssparser.h:
3503 * khtml/css/cssstyleselector.cpp:
3504 (khtml::CSSStyleSelector::addMatchedDeclaration):
3505 (khtml::CSSStyleSelector::matchRulesForList):
3506 (khtml::CSSStyleSelector::styleForElement):
3507 (khtml::CSSStyleSelector::applyDeclarations):
3508 * khtml/css/cssstyleselector.h:
3509 * khtml/css/parser.cpp:
3510 * khtml/css/parser.y:
3511 * khtml/dom/css_rule.h:
3512 * khtml/dom/css_stylesheet.h:
3513 * khtml/dom/css_value.h:
3514 * khtml/dom/dom2_views.cpp:
3515 * khtml/xml/dom2_viewsimpl.cpp:
3516 (DOM::AbstractViewImpl::getComputedStyle):
3517 * khtml/xml/dom_docimpl.cpp:
3518 (DocumentImpl::importNode):
3519 (DocumentImpl::setStyleSheet):
3520 * khtml/xml/dom_docimpl.h:
3521 * khtml/xml/dom_xmlimpl.cpp:
3522 (DOM::ProcessingInstructionImpl::setStyleSheet):
3523 * khtml/xml/dom_xmlimpl.h:
3525 * khtml/dom/css_value.cpp:
3526 (DOM::throwException): Added.
3527 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
3528 The real thing is coming with the next change to refactor.
3529 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
3530 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
3532 2004-11-15 Darin Adler <darin@apple.com>
3536 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
3538 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
3539 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
3540 node's attributes changed without sending a misleading childrenChanged call,
3541 but the childrenChanged call can happen at the exact right moment.
3542 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
3543 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
3544 the boolean true is passed in.
3546 * khtml/xml/dom_elementimpl.cpp:
3547 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
3548 (NamedAttrMapImpl::removeAttribute): Ditto.
3550 2004-11-15 John Sullivan <sullivan@apple.com>
3554 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
3555 seen often in Mail and Blot
3557 * khtml/css/css_valueimpl.cpp:
3558 (CSSStyleDeclarationImpl::copyPropertiesInSet):
3559 delete temporary list after we're done using it
3561 2004-11-15 Richard Williamson <rjw@apple.com>
3563 Fixed leak (3879883) that John found. Early return leaked
3568 * khtml/css/css_computedstyle.cpp:
3569 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3571 2004-11-15 Ken Kocienda <kocienda@apple.com>
3577 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
3579 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
3580 EditCommandPtr to its parent, but this caused a a reference cycle in composite
3581 commands as the children held a ref to their parent. Now, the parent variable
3582 is a non-retained reference to an EditCommand *. It would be nice to have a
3583 weak reference to the parent or even override deref in composite commands (but I
3584 can't since deref() is not virtual). However, this should be OK since any
3585 dangling parent pointer is a sign of a bigger object lifetime problem that
3586 would need to be addressed anyway.
3588 * khtml/css/css_valueimpl.cpp:
3589 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
3590 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
3591 just assigning the list variable passed in to the local list variable, or the list will be
3593 * khtml/editing/htmlediting.cpp:
3594 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
3595 (khtml::EditCommand::setEndingSelection): Ditto.
3596 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
3597 Unrelated to the change, but saves some ref's and deref's.
3598 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
3599 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
3600 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
3601 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
3603 2004-11-15 Maciej Stachowiak <mjs@apple.com>
3607 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
3609 * khtml/xml/dom_nodeimpl.cpp:
3610 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
3612 (NodeListImpl::recursiveLength): Adjusted for rename.
3613 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
3614 If the same offset is looked up again, just return it, otherwise, if looking up
3615 a later offset, start at the last item and proceed from there.
3616 (NodeListImpl::itemById): Apply the special document optimization to all
3617 nodes that are either a document or in a document - just walk up to make
3618 sure the node found by ID has the root node as an ancestor.
3619 (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
3620 * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
3622 2004-11-15 John Sullivan <sullivan@apple.com>
3626 - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
3628 * kwq/KWQKHTMLPart.mm:
3629 (KWQKHTMLPart::documentFragmentWithText):
3630 release mutable copy of string after we're done using it
3632 2004-11-14 Kevin Decker <kdecker@apple.com>
3636 fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
3638 * khtml/html/html_elementimpl.cpp:
3639 (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
3640 (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
3642 2004-11-13 Maciej Stachowiak <mjs@apple.com>
3646 <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
3648 * khtml/dom/dom_node.cpp:
3649 (NodeList::itemById): New method, just forward to impl.
3650 * khtml/dom/dom_node.h: Prototype it.
3651 * khtml/ecma/kjs_dom.cpp:
3652 (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
3653 let the NodeList do it. The NodeList might be able to do it more efficiently.
3654 * khtml/xml/dom_nodeimpl.cpp:
3655 (NodeListImpl::itemById): Optimize for the case where the NodeList
3656 covers the whole document. In this case, just use getElementById,
3657 then check that the element satisfies the list criteria.
3658 (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
3659 (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
3660 * khtml/xml/dom_nodeimpl.h:
3662 2004-11-12 Maciej Stachowiak <mjs@apple.com>
3666 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
3667 sometimes using a huge bogus length value.
3669 * khtml/xml/dom_nodeimpl.cpp:
3670 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
3672 2004-11-12 Darin Adler <darin@apple.com>
3676 - fixed an infinite loop in that last check-in
3678 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
3679 Added a ++i to the loop so it won't get stuck on the first element in the list.
3681 2004-11-12 Maciej Stachowiak <mjs@apple.com>
3685 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
3687 I fixed this by changing NodeLists to cache their length, but
3688 invalidate it whenever there is a change in the DOM subtree at
3689 which they are rooted. This makes NodeListImpl::recursiveLength()
3690 drop completely off the profile, since we were repeatedly getting
3691 a length for the same NodeList over and over.
3693 * khtml/xml/dom_nodeimpl.cpp:
3694 (NodeImpl::NodeImpl):
3695 (NodeImpl::~NodeImpl):
3696 (NodeImpl::registerNodeList):
3697 (NodeImpl::unregisterNodeList):
3698 (NodeImpl::notifyLocalNodeListsSubtreeModified):
3699 (NodeImpl::notifyNodeListsSubtreeModified):
3700 (NodeImpl::dispatchSubtreeModifiedEvent):
3701 (NodeListImpl::NodeListImpl):
3702 (NodeListImpl::~NodeListImpl):
3703 (NodeListImpl::recursiveLength):
3704 (NodeListImpl::recursiveItem):
3705 (NodeListImpl::rootNodeSubtreeModified):
3706 (ChildNodeListImpl::ChildNodeListImpl):
3707 (ChildNodeListImpl::length):
3708 (ChildNodeListImpl::item):
3709 (TagNodeListImpl::TagNodeListImpl):
3710 (TagNodeListImpl::length):
3711 (TagNodeListImpl::item):
3712 (NameNodeListImpl::NameNodeListImpl):
3713 (NameNodeListImpl::length):
3714 (NameNodeListImpl::item):
3715 * khtml/xml/dom_nodeimpl.h:
3717 2004-11-12 Darin Adler <darin@apple.com>
3721 - various small cleanups
3723 * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
3724 * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
3726 * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
3727 * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
3728 * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
3729 * khtml/html/htmltokenizer.cpp:
3730 (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
3731 (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
3733 * khtml/khtml_part.h: Removed docImpl function.
3734 * khtml/khtml_part.cpp: Ditto.
3736 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
3737 the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
3739 * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
3740 * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
3741 part of the change last time, which is why the build broke).
3742 (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
3743 (KWQKHTMLPart::setPolicyBaseURL): Ditto.
3744 (KWQKHTMLPart::keyEvent): Ditto.
3745 (KWQKHTMLPart::dispatchCPPEvent): Ditto.
3746 (KWQKHTMLPart::bodyBackgroundColor): Ditto.
3748 2004-11-12 Chris Blumenberg <cblu@apple.com>
3750 <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
3754 * kwq/KWQKHTMLPart.mm:
3755 (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
3759 2004-11-12 Darin Adler <darin@apple.com>
3763 - fixed a couple places that would not work for XML documents
3765 * khtml/ecma/kjs_window.cpp:
3766 (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
3767 is present on the base class.
3768 (WindowFunc::tryCall): More of the same.
3770 2004-11-12 Darin Adler <darin@apple.com>
3772 - land versions of these files generated by the newer gperf
3774 People building on Panther will continue to see these files modified.
3775 A workaround would be to install the newer gperf on our Tiger build machines.
3777 * khtml/css/cssproperties.c: Regenerated.
3778 * khtml/css/cssvalues.c: Regenerated.
3779 * khtml/html/doctypes.cpp: Regenerated.
3780 * khtml/html/kentities.c: Regenerated.
3781 * khtml/misc/htmlattrs.c: Regenerated.
3782 * khtml/misc/htmltags.c: Regenerated.
3783 * kwq/KWQColorData.c: Regenerated.
3785 2004-11-11 Richard Williamson <rjw@apple.com>
3787 Fix build horkage from previous checkin.
3789 * kwq/KWQKHTMLPart.h:
3791 2004-11-11 Darin Adler <darin@apple.com>
3795 - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
3797 * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
3799 * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
3800 * kwq/KWQKHTMLPart.mm:
3801 (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
3802 method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
3803 we started with the NSTextField as first responder, and then took focus away and gave it back, which
3804 makes dragging text work again.
3805 (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
3807 2004-11-11 David Hyatt <hyatt@apple.com>
3809 Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
3813 * khtml/html/htmltokenizer.cpp:
3814 (khtml::HTMLTokenizer::continueProcessing):
3816 2004-11-11 Ken Kocienda <kocienda@apple.com>
3820 * khtml/editing/htmlediting.cpp:
3821 (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
3822 of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
3823 with the prevailing style for the VisiblePosition class.
3824 * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files.
3825 * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
3826 (khtml::visiblePositionsInDifferentBlocks): New helper method.
3827 (khtml::isLastVisiblePositionInBlock): Ditto.
3828 (khtml::isLastVisiblePositionInNode): Ditto.
3829 * khtml/editing/visible_position.h: Add declarations for new functions.
3831 2004-11-11 Ken Kocienda <kocienda@apple.com>
3835 * khtml/editing/htmlediting.cpp:
3836 (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
3837 (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
3838 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
3839 (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
3840 (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
3841 * khtml/xml/dom2_rangeimpl.cpp:
3842 (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
3843 * khtml/xml/dom2_rangeimpl.h: Ditto.
3845 2004-11-11 Ken Kocienda <kocienda@apple.com>
3847 Reviewed by Harrison
3849 Some improvements to deleting when complete lines are selected.
3851 * khtml/editing/htmlediting.cpp:
3852 (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
3853 the end of a selection is fully selected. Turn off block merging in this case.
3854 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
3855 whether a BR immediately followed a block. The old code could erroneously skip nodes.
3856 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
3857 start block is selected. This new code will now delete this block in one call, rather
3858 than iterating over each child.
3859 * khtml/editing/visible_position.cpp:
3860 (khtml::visiblePositionsOnDifferentLines): New helper call