1 2005-03-27 Darin Adler <darin@apple.com>
3 Reviewed by me, fix by Kida-san.
5 - fixed <rdar://problem/4067474> 8A424: Safari immediately quit by Cmd+Ctrll+'D'
7 * kwq/WebCoreBridge.mm: (-[WebCoreBridge convertToNSRange:DOM::]):
12 2005-03-24 Richard Williamson <rjw@apple.com>
14 Fixed <rdar://problem/4052683> After adding/removing stocks from Stocks Widget, stock areas went blank
16 The request was being collected before firing it's load handler.
17 We now gc protect the request while it's loading.
21 * khtml/ecma/xmlhttprequest.cpp:
22 (KJS::XMLHttpRequest::send):
23 (KJS::XMLHttpRequest::abort):
24 (KJS::XMLHttpRequest::slotFinished):
25 (KJS::XMLHttpRequestProtoFunc::tryCall):
29 2005-03-23 Darin Adler <darin@apple.com>
31 Further fix for 4053515.
33 Covered cases where text position doesn't lie inside a
38 * khtml/editing/visible_text.cpp:
39 (khtml::TextIterator::setRangeFromLocationAndLength):
41 2005-03-23 Richard Williamson <rjw@apple.com>
43 Fixed <rdar://problem/4053515> REGRESSION (Mail): Kotoeri input method reconversion does not work in WebViews
45 We now use actual document NSRanges to represent both marked text
46 ranges and selection ranges.
50 * khtml/editing/visible_text.cpp:
51 (khtml::TextIterator::rangeLength):
52 (khtml::TextIterator::setRangeFromLocationAndLength):
53 * khtml/editing/visible_text.h:
54 * kwq/WebCoreBridge.h:
55 * kwq/WebCoreBridge.mm:
56 (-[WebCoreBridge convertToNSRange:DOM::]):
57 (-[WebCoreBridge DOM::convertToDOMRange:]):
58 (-[WebCoreBridge selectNSRange:]):
59 (-[WebCoreBridge markedTextDOMRange]):
60 (-[WebCoreBridge markedTextNSRange]):
62 2005-03-22 Kevin Decker <kdecker@apple.com>
66 Fixed <rdar://problem/4062336> REGRESSION (406-407): HTML submenus not working at hrweb.apple.com after going back
68 Rolled out the fix for <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
70 We clearly need a better solution to 4041374. We can't indiscriminately remove event listeners in closeURL() after-all. Since event listeners are registered in a <script> tag, which is evaluated and executed at page load time, this becomes a problem since we don't reevaluate a page's <script> that is in the back/forward cache. Thus once you leave the page, the listeners are gone for good. This is the problem.
72 * khtml/khtml_part.cpp:
73 (KHTMLPart::closeURL):
74 * khtml/xml/dom_docimpl.cpp:
75 (DocumentImpl::detach):
79 2005-03-22 Vicki Murley <vicki@apple.com>
81 - roll the fix for <rdar://problem/4060266> back in, since its
84 * khtml/editing/visible_text.cpp:
85 (khtml::TextIterator::handleTextBox):
87 2005-03-22 Vicki Murley <vicki@apple.com>
89 - roll out the fix for <rdar://problem/4060266> since it was denied by CCC
91 * khtml/editing/visible_text.cpp:
92 (khtml::TextIterator::handleTextBox):
94 2005-03-22 David Harrison <harrison@apple.com>
98 <rdar://problem/4060266> Double-clicking in Dictionary.app doesn't work for some words (coming just after style change)
100 * khtml/editing/visible_text.cpp:
101 (khtml::TextIterator::handleTextBox):
102 Complete the check of whether to emit space for collapsed space.
104 2005-03-22 David Harrison <harrison@apple.com>
108 <rdar://problem/4061443> REGRESSION (8A420-8A421): Pasting in the Stickies widget is broken again
110 * khtml/editing/htmlediting.cpp:
111 (khtml::positionBeforeContainingSpecialElement):
112 (khtml::positionAfterContainingSpecialElement):
113 Return unchanged Position rather than a null or non-editable one.
117 2005-03-20 Ken Kocienda <kocienda@apple.com>
121 I made an error in this test earlier. It was not testing what I intended. Fixed.
123 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt
124 * layout-tests/editing/unsupported-content/list-delete-001.html
128 * layout-tests/editing/unsupported-content/table-delete-001-expected.txt: Added.
129 * layout-tests/editing/unsupported-content/table-delete-001.html: Added.
130 * layout-tests/editing/unsupported-content/table-delete-002-expected.txt: Added.
131 * layout-tests/editing/unsupported-content/table-delete-002.html: Added.
132 * layout-tests/editing/unsupported-content/table-delete-003-expected.txt: Added.
133 * layout-tests/editing/unsupported-content/table-delete-003.html: Added.
134 * layout-tests/editing/unsupported-content/table-type-after-expected.txt: Added.
135 * layout-tests/editing/unsupported-content/table-type-after.html: Added.
136 * layout-tests/editing/unsupported-content/table-type-before-expected.txt: Added.
137 * layout-tests/editing/unsupported-content/table-type-before.html: Added.
139 2005-03-20 Darin Adler <darin@apple.com>
143 - fixed <rdar://problem/3923903> REGRESSION (164-165): Repro Safari crash in khtml::RenderLayer::scrollToOffset
145 * khtml/rendering/render_layer.cpp: (RenderLayer::scrollToOffset): Check canvas for nil.
147 2005-03-20 David Harrison <harrison@apple.com>
151 <rdar://problem/4055127> Dictionary pop-up panel misplaced at beginning of text blocks (breaks double-clicking in Dictionary.app)
153 SimplifiedBackwardsTextIterator::advance() needed to not limit to textnodes
154 when checking whether moving back across block boundaries
156 VisibleUnits previousBoundary() needed to INIT_DOWN when creating result VisiblePosition
158 All editing tests pass.
160 * khtml/editing/visible_text.cpp:
161 (khtml::SimplifiedBackwardsTextIterator::advance):
162 * khtml/editing/visible_units.cpp:
163 (khtml::previousBoundary):
165 2005-03-20 Darin Adler <darin@apple.com>
167 Reviewed by Harrison.
169 - fixed <rdar://problem/4059914> when you select all of a frame's content, need to select the frame in the parent document so it can be easily deleted
171 * khtml/khtml_part.h: Added selectFrameElementInParentIfFullySelected.
172 * khtml/khtml_part.cpp:
174 (KHTMLPart::setFocusNodeIfNeeded): Changed to not set focus to a frame; was not what this function was
175 intended to do, and caused trouble when trying to select a frame element.
176 (KHTMLPart::khtmlMouseReleaseEvent): Call selectFrameElementInParentIfFullySelected.
177 (KHTMLPart::selectAll): Call selectFrameElementInParentIfFullySelected.
178 (KHTMLPart::selectFrameElementInParentIfFullySelected): Added. Selects the frame element in the parent
179 if a frame is entirely selected, which makes it easier to delete or replace the frame and is consistent
180 with the changes Maciej made recently for other elements.
182 * kwq/WebCoreBridge.mm:
183 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Call selectFrameElementInParentIfFullySelected.
184 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Call selectFrameElementInParentIfFullySelected.
186 2005-03-20 Darin Adler <darin@apple.com>
188 Reviewed by me, code change by Ken.
190 - fixed <rdar://problem/4059852> Deleting from first element of list makes content jump to wrong place
192 * khtml/editing/htmlediting.cpp:
193 (khtml::isListStructureNode): Added.
194 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Check for list nodes as well as table nodes.
196 2005-03-20 Ken Kocienda <kocienda@apple.com>
200 Added tests to cover new "unsupported content" editing code.
202 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt: Added.
203 * layout-tests/editing/unsupported-content/list-delete-001.html: Added.
204 * layout-tests/editing/unsupported-content/list-delete-002-expected.txt: Added.
205 * layout-tests/editing/unsupported-content/list-delete-002.html: Added.
206 * layout-tests/editing/unsupported-content/list-delete-003-expected.txt: Added.
207 * layout-tests/editing/unsupported-content/list-delete-003.html: Added.
208 * layout-tests/editing/unsupported-content/list-type-after-expected.txt: Added.
209 * layout-tests/editing/unsupported-content/list-type-after.html: Added.
210 * layout-tests/editing/unsupported-content/list-type-before-expected.txt: Added.
211 * layout-tests/editing/unsupported-content/list-type-before.html: Added.
213 2005-03-20 Ken Kocienda <kocienda@apple.com>
219 <rdar://problem/4059578> Entire list deleted, and caret disappears, when delete key hit at end of list
221 The problem is that a new case in the delete code did not consider when the
222 downstream end node of the selection might be an ancestor of the upstream start
223 node. That is the case in this bug. The downstream end is the body element, and
224 this line of code would delete all the children of the downstream end:
225 removeChildrenInRangePreservingPosition(m_downstreamEnd.node(), 0,
226 m_downstreamEnd.offset(), m_upstreamStart);
228 The fix is to check for this "is ancestor" case, and do some tree logic to find
229 the right offset of the downstream end node for the call to
230 removeChildrenInRangePreservingPosition().
232 * khtml/editing/htmlediting.cpp:
233 (khtml::DeleteSelectionCommand::handleGeneralDelete): Fixed as described.
235 2005-03-19 Ken Kocienda <kocienda@apple.com>
241 <rdar://problem/4059384> Cannot place insertion point correctly in editable text that avoids floating elements
243 Note: I strongly suspect this bug blocks a complete solution to this other Tiger/P2:
244 <rdar://problem/4055748> AX: Dictionary pop-up panel shows at wrong place on specific parts of particular pages
246 * khtml/rendering/render_text.cpp:
247 (RenderText::caretRect): Change the y-coordinate used to calculate the available width for a line. Height is wrong.
248 Top of the box containing the text where the click is done is correct. Also, add in the x-offset for the start
249 of the text box when calculating the available width. If this text box is avoiding a float at the y-coordinate
250 for the relevant box, failure to add in the amount of float-avoidance will make the text at the coordinates
251 greater than end-of-line minus float-avoidance ineligible for caret placement.
253 2005-03-19 Darin Adler <darin@apple.com>
257 - fixed <rdar://problem/4057594> REGRESSION (125-406): Unrepro crash in HTMLTokenizer::allDataProcessed after hitting Back button
259 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::allDataProcessed):
260 To get the part safely after calling end, save a guarded pointer to the view.
261 The old way could end trying to call a virtual function a part that was destroyed.
263 2005-03-19 Maciej Stachowiak <mjs@apple.com>
267 <rdar://problem/4053506> Pasting Tables and Cells in Mail does not allow editing before or after
268 <rdar://problem/4005954> REGRESSION (Mail): After copy/paste of content containing list element cannot go back to entering text at left side of page
270 * khtml/editing/htmlediting.cpp:
271 (khtml::maxDeepOffset):
272 (khtml::CompositeEditCommand::removeFullySelectedNodePreservingPosition):
273 (khtml::CompositeEditCommand::removeChildrenInRangePreservingPosition):
274 (khtml::CompositeEditCommand::removeNodePreservingPosition):
275 (khtml::CompositeEditCommand::insertBlockPlaceholder):
276 (khtml::CompositeEditCommand::appendBlockPlaceholder):
277 (khtml::CompositeEditCommand::forceBlockPlaceholder):
278 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
279 (khtml::isSpecialElement):
280 (khtml::isFirstVisiblePositionInSpecialElementInFragment):
281 (khtml::positionBeforePossibleContainingSpecialElement):
282 (khtml::positionAfterPossibleContainingSpecialElement):
283 (khtml::ApplyStyleCommand::applyInlineStyle):
284 (khtml::DeleteSelectionCommand::initializePositionData):
285 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
286 (khtml::DeleteSelectionCommand::handleGeneralDelete):
287 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
288 (khtml::DeleteSelectionCommand::doApply):
289 (khtml::InsertParagraphSeparatorCommand::doApply):
290 (khtml::ReplacementFragment::ReplacementFragment):
291 (khtml::ReplaceSelectionCommand::doApply):
292 * khtml/editing/htmlediting.h:
293 * khtml/editing/visible_position.cpp:
294 (khtml::isRenderedBR):
295 (khtml::VisiblePosition::initDownstream):
296 (khtml::isLastVisiblePositionInBlock):
297 * khtml/rendering/render_line.cpp:
298 (khtml::RootInlineBox::closestLeafChildForXPos):
299 * khtml/xml/dom_nodeimpl.cpp:
300 (NodeImpl::isBlockFlowOrTable):
301 (NodeImpl::isEditableBlock):
302 (NodeImpl::enclosingBlockFlowOrTableElement):
303 * khtml/xml/dom_nodeimpl.h:
304 * khtml/xml/dom_position.cpp:
305 (DOM::Position::upstream):
306 (DOM::Position::downstream):
307 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
308 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
309 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
310 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
311 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt:
313 2005-03-19 John Sullivan <sullivan@apple.com>
317 - fixed <rdar://problem/4058740> Crash (nil-deref) editing Mail reply
318 message in KWQKHTMLPart::fontForSelection (MailViewer-723)
320 * kwq/KWQKHTMLPart.mm:
321 (KWQKHTMLPart::fontForSelection):
322 Add nil check to loop. It shouldn't be necessary, but this crash trace seems to be
323 running into it. We're not completely certain, but the check is harmless at worst.
327 2005-03-18 David Harrison <harrison@apple.com>
331 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
335 * kwq/KWQAccObject.mm:
336 (-[KWQAccObject rendererForView:]):
337 New to cover both the WebCore and WebKit NSViews.
339 (-[KWQAccObject _accessibilityParentForSubview:]):
342 * kwq/WebCoreFrameView.h:
343 Add WebCoreBridgeHolder protocol to get access to WebKit NSViews.
345 2005-03-18 David Harrison <harrison@apple.com>
347 Reviewed by Darin, Ken.
349 <rdar://problem/3735625> AX: add AXPress action if an element has an onclick handler
351 * khtml/dom/html_form.cpp:
352 (HTMLInputElement::click):
353 * khtml/html/html_elementimpl.cpp:
354 (HTMLElementImpl::click):
355 (HTMLElementImpl::accessKeyAction):
356 * khtml/html/html_elementimpl.h:
357 * khtml/html/html_formimpl.cpp:
358 (DOM::HTMLFormElementImpl::submitClick):
359 (DOM::HTMLButtonElementImpl::click):
360 (DOM::HTMLButtonElementImpl::accessKeyAction):
361 (DOM::HTMLInputElementImpl::click):
362 (DOM::HTMLInputElementImpl::accessKeyAction):
363 (DOM::HTMLInputElementImpl::defaultEventHandler):
364 (DOM::HTMLLabelElementImpl::accessKeyAction):
365 (DOM::HTMLSelectElementImpl::accessKeyAction):
366 (DOM::HTMLTextAreaElementImpl::accessKeyAction):
367 * khtml/html/html_formimpl.h:
368 * khtml/html/html_inlineimpl.cpp:
369 (HTMLAnchorElementImpl::defaultEventHandler):
370 (HTMLAnchorElementImpl::accessKeyAction):
371 * khtml/html/html_inlineimpl.h:
372 * khtml/rendering/render_form.cpp:
373 (RenderFileButton::click):
374 * khtml/rendering/render_form.h:
375 * khtml/xml/dom_docimpl.cpp:
376 (DocumentImpl::defaultEventHandler):
377 * khtml/xml/dom_elementimpl.h:
378 (DOM::ElementImpl::accessKeyAction):
380 (-[DOMHTMLInputElement click]):
384 * kwq/KWQFileButton.h:
385 * kwq/KWQFileButton.mm:
386 (KWQFileButton::click):
388 Add accessKeyAction parameter about whether to limit to HTMLElementImpl subclasses that JavaScript wants, or to apply to others as well.
390 Add click() parameter about whether to send the mousedown and mouseup events in addition to the click event.
392 * kwq/KWQAccObject.mm:
393 (-[KWQAccObject mouseButtonListener]):
394 Locate a mousedown, mouseup, or click handler in the current element and its ancestors.
396 (-[KWQAccObject actionElement]):
397 (-[KWQAccObject accessibilityIsIgnored]):
398 (-[KWQAccObject accessibilityPerformAction:]):
399 Consider mouseButtonListener.
401 2005-03-18 John Sullivan <sullivan@apple.com>
405 - fixed <rdar://problem/4002164> maps that include start and end
406 location don't print right from maps.google.com
408 I thought I checked this in yesterday but a ChangeLog conflict aborted my checkin
411 * khtml/rendering/render_style.cpp:
413 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
415 * khtml/rendering/render_style.h:
416 (khtml::RenderStyle::InheritedFlags::operator==):
417 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
418 (khtml::RenderStyle::setBitDefaults):
420 (khtml::RenderStyle::forceBackgroundsToWhite):
421 ditto, and method name changed too
422 (khtml::RenderStyle::setForceBackgroundsToWhite):
425 * khtml/rendering/render_text.cpp:
426 (InlineTextBox::paint):
427 updated for name change; also, compare text against white instead of current bg color
428 because we no longer actually modify the bg color (previously we would always set
429 the bg color to white, so the result is the same)
431 * khtml/xml/dom_docimpl.cpp:
432 (DocumentImpl::recalcStyle):
433 updated for name change
435 * kwq/WebCoreBridge.mm:
436 (-[WebCoreBridge styleSheetForPrinting]):
438 (-[WebCoreBridge reapplyStylesForDeviceType:]):
439 removed the code that called styleSheetForPrinting; we no longer use a stylesheet
442 * khtml/rendering/render_box.cpp:
443 (RenderBox::paintBackgroundExtended):
444 If forceBackgroundsToWhite flag is set, convert background images and
445 background colors to white background color with no background image.
447 2005-03-18 Ken Kocienda <kocienda@apple.com>
453 <rdar://problem/4056718> Pasting quotes the entire message
455 * khtml/editing/htmlediting.cpp:
456 (khtml::ReplaceSelectionCommand::doApply): After pasting, nodes are moved to the block containing
457 the end of the pasted content in certain cases. This move logic used to stop once it moved all the
458 siblings of the node following the last node of the pasted-in content. This means that block elements
459 could get moved, and if the pasted-in content included a mail blockquote, this could result in
460 one quote level getting added. The fix is to stop the move of nodes once a <br>, block element, or
461 <table> is seen. This only affected one of the many test cases we have for such scenarios, and
462 the change to that result makes sense given the code change.
463 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: This test result changed in a way that
464 adequately tests the behavior change, so I did not add a new test.
466 2005-03-17 Ken Kocienda <kocienda@apple.com>
472 <rdar://problem/4051809> 8A413: Cursor-up in a mail message sometimes gets stuck (with specific reproducible case)
474 * khtml/rendering/render_text.cpp:
475 (RenderText::positionForCoordinates): Consider two lines: line-above and line-below. If the caret position in line-below
476 was at an x coordinate between half way through the x coordinate of the last character on the line-above and the
477 end of that same character, this bug would happen since the positioning code would assume that it could create a
478 VisiblePosition with a DOWNSTREAM affinity. Now, I check to see if the character position on the line-above is the
479 last character on that line, and if it is, I use UPSTREAM as the affinity.
483 2005-03-17 David Harrison <harrison@apple.com>
485 Reviewed by Darin, Ken.
487 * khtml/editing/htmlediting.cpp:
488 (khtml::EditCommandPtr::setEndingSelection):
489 Fixed typo so that it calls setEndingSelection rather than setStartingSelection.
490 Commented out this unused method, tho, since this is late in Tiger. Proved unused by successful build after temporarily removing method declaration or implemenation.
492 2005-03-16 Kevin Decker <kdecker@apple.com>
496 Fixed <rdar://problem/4046665> REGRESSION (403-405): mypage.apple.com login does not work (hits assertion in Development build)
498 * kwq/WebCoreBridge.mm:
499 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Check always came back false when callers would send a nil NSURL to this method. Now we allow the empty url cases, eg., <frame src="">
501 2005-03-16 Darin Adler <darin@apple.com>
505 - fixed <rdar://problem/4045203> REGRESSION (125-188): Redundant JS imports crash Safari
507 * khtml/html/htmltokenizer.h: Take inWRite bool out of NDEBUG ifdef.
508 * khtml/html/htmltokenizer.cpp:
509 (khtml::HTMLTokenizer::HTMLTokenizer): Take inWrite bool management code out of NDEBUG ifdef.
510 (khtml::HTMLTokenizer::write): Ditto. Don't call end if inWrite is true, since it will be called
511 when you return to the body of the outer write() call.
512 (khtml::HTMLTokenizer::allDataProcessed): Don't call end() if inWrite is true for the same reason.
513 (khtml::HTMLTokenizer::finish): Ditto.
515 * kwq/KWQWidget.mm: (QWidget::getOuterView): Removed bogus assertion that has been vexing us of late.
517 2005-03-16 David Harrison <harrison@apple.com>
519 Reviewed by me (written by Patti Yeh).
521 * kwq/KWQAccObject.mm:
522 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
523 Use LeftWordIfOnBoundary instead of RightWordIfOnBoundary.
525 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
526 Use RightWordIfOnBoundary instead of LeftWordIfOnBoundary.
528 2005-03-16 David Harrison <harrison@apple.com>
532 <rdar://problem/4054590> AX: Dictionary panel does not work when page is scrolled on Safari
534 * kwq/KWQAccObject.mm:
535 (-[KWQAccObject doAXTextMarkerForPosition:]):
536 Add in the view's contentsX and contentsY to the point.
538 2005-03-16 David Harrison <harrison@apple.com>
542 <rdar://problem/4048506> Deleting from beginning of editable div deletes other document elements
546 * khtml/editing/visible_units.h:
547 * khtml/editing/visible_units.cpp:
548 (khtml::startOfEditableContent):
549 (khtml::endOfEditableContent):
550 (khtml::inSameEditableContent):
551 (khtml::isStartOfEditableContent):
552 (khtml::isEndOfEditableContent):
555 * kwq/WebCoreBridge.h:
556 * kwq/WebCoreBridge.mm:
557 (-[WebCoreBridge canDeleteRange:]):
560 2005-03-16 Ken Kocienda <kocienda@apple.com>
566 <rdar://problem/4042935> undo doesn't work properly during inline input
568 * kwq/WebCoreBridge.h: Declare new method below.
569 * kwq/WebCoreBridge.mm:
570 (-[WebCoreBridge replaceMarkedTextWithText:]): New method. Wraps calls to TypingCommand::deleteKeyPressed and
571 TypingCommand::insertText to map the way that international text input works onto the typing undo system.
573 2005-03-16 David Harrison <harrison@apple.com>
577 <rdar://problem/4044336> REGRESSION (8A398-8A409): Option-Delete also deletes space to left of deleted word
579 * khtml/editing/htmlediting.cpp:
580 (khtml::DeleteSelectionCommand::initializePositionData):
581 - skip smart delete if the selection to delete already starts or ends with whitespace
583 * khtml/khtml_part.cpp:
584 (KHTMLPart::handleMousePressEventDoubleClick):
585 - preserve selection on double-click when range is already selected
587 * khtml/xml/dom_position.cpp:
588 (DOM::Position::leadingWhitespacePosition):
589 (DOM::Position::trailingWhitespacePosition):
590 - fix considerNonCollapsibleWhitespace action (logic was reversed)
591 - add non-breaking space to the non-collapsable ones
593 * kwq/WebCoreBridge.mm:
594 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
595 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
596 - these methods do not set the selection, so remove calls to setSelectionGranularity
598 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
599 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]):
600 - set the granularity back to character
601 - the one exception is that we need to keep word granularity
602 to preserve smart delete behavior when extending by word
604 2005-03-15 Maciej Stachowiak <mjs@apple.com>
608 <rdar://problem/4053266> Pressing return a few times right after a link makes the new blank lines part of the link
610 * khtml/editing/htmlediting.cpp:
611 (khtml::InsertLineBreakCommand::doApply): Use
612 positionOutsideContainingSpecialElement in the right two places.
613 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
615 - move all these helper functions higher in the file
617 * khtml/editing/htmlediting.cpp:
618 (khtml::isSpecialElement):
619 (khtml::isFirstVisiblePositionInSpecialElement):
620 (khtml::positionBeforeNode):
621 (khtml::positionBeforeContainingSpecialElement):
622 (khtml::maxRangeOffset):
623 (khtml::isLastVisiblePositionInSpecialElement):
624 (khtml::positionAfterNode):
625 (khtml::positionAfterContainingSpecialElement):
626 (khtml::positionOutsideContainingSpecialElement):
628 2005-03-14 Maciej Stachowiak <mjs@apple.com>
632 <rdar://problem/4049925> Pasting right after a link makes pasted content part of the link (without visible style change)
634 * khtml/editing/htmlediting.cpp:
635 (khtml::positionOutsideContainingSpecialElement): made a helper
636 function that computes a position outside the outermost containing
637 special element if the passed in position is right at the start or
639 (khtml::InsertTextCommand::prepareForTextInsertion): use new helper here
640 (khtml::ReplaceSelectionCommand::doApply): use it here too: this is the fix
641 (khtml::positionBeforeNode): made static
642 (khtml::positionBeforeContainingSpecialElement): made static
643 (khtml::positionAfterNode): made static
644 (khtml::positionAfterContainingSpecialElement): made static
646 2005-03-15 Richard Williamson <rjw@apple.com>
648 Fixed <rdar://problem/4053658> Crash getting direction at maps.google.com
650 Add non nil style() check.
652 Reviewed by Dave Harrison.
654 * khtml/rendering/render_table.cpp:
655 (RenderTableCell::collapsedRightBorder):
657 2005-03-15 Kevin Decker <kdecker@apple.com>
661 Fixed: <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
663 The reason why UNLOAD_EVENT wouldn't dispatch was because the code would delete all event listeners at the detach() phase which is prior to closeURL().
665 This fixes a recent regression from:
667 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
669 * khtml/khtml_part.cpp:
670 (KHTMLPart::closeURL): After dispatching event handlers, go ahead and remove them from the DOM.
671 * khtml/xml/dom_docimpl.cpp:
672 (DocumentImpl::detach): Took out the call to removeAllEventListenersFromAllNodes(). If we remove all event listeners here then when KHTMLPart::closeURL() checks for even listeners, it will never have any because they'll already be gone.
674 2005-03-15 Ken Kocienda <kocienda@apple.com>
680 <rdar://problem/4052642> Each delete keystroke is in its own undo group; not included in undo group with other typing
682 Calling -[WebCore setSelectedDOMRange:range affinity:] had the result of "closing" any active set of typing
683 keystrokes grouped together in a single undo operation. A change on 27 Jan in WebKit to change the way delete
684 keystrokes are handled made this feature regress. Previous to that change, the backwards delete
685 key went through separate code that is no longer in the tree that did not set the selection in the way
688 The solution is to add an extra argument to the set-selection call. The WebCoreBridge now offers this method:
689 -[WebCore setSelectedDOMRange:range affinity:closeTyping:]. Now, callers must indicate whether setting the
690 selection will act to close typing or not.
692 * kwq/WebCoreBridge.h: Changed header accordingly to change method shown below.
693 * kwq/WebCoreBridge.mm:
694 (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Added closeTyping argument to this method.
696 2005-03-15 John Sullivan <sullivan@apple.com>
700 - fixed <rdar://problem/4052246> crash in KWQKHTMLPart::createPart() trying to display local file in frame
702 * kwq/KWQKHTMLPart.mm:
703 (KWQKHTMLPart::createPart):
704 Check part for nil before trying to ref. This was probably a longstanding code flaw revealed by
705 the recent security fix.
707 2005-03-15 Kevin Decker <kdecker@apple.com>
709 Reviewed by Ken and Maciej.
711 New fix for <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
713 The tokenizer has buffers which mean parsing can continue even after loading is supposed to be stopped. If the loading process was aborted, the tokenizer should abort, too.
715 * khtml/html/htmltokenizer.cpp:
716 (khtml::HTMLTokenizer::HTMLTokenizer): Initialize loadStopped to false.
717 (khtml::HTMLTokenizer::write): Go ahead and bail out if loadStopped is true.
718 (khtml::HTMLTokenizer::processToken):
719 * khtml/html/htmltokenizer.h: Added loadStopped flag. Changed the view pointer from a standard pointer to a QGuardedPtr. This fixes the crash. Now the tokenizer's handle to the view will now automatically nil-out and never dangle.
720 * khtml/khtml_part.cpp:
721 (KHTMLPart::closeURL): Notify the tokenizer to stop parsing.
722 * khtml/xml/xml_tokenizer.cpp:
723 (khtml::XMLTokenizer::XMLTokenizer): Initialize loadStopped to false.
724 * khtml/xml/xml_tokenizer.h:
725 (khtml::Tokenizer::stopParsing): Added.
727 2005-03-14 David Harrison <harrison@apple.com>
729 Reviewed by Darin, Maciej.
731 <rdar://problem/4046103> REGRESSION (Mail): clicking after style change sets insertion point incorrectly
733 Also fixes crash by adding nil check.
735 * khtml/editing/htmlediting.cpp:
736 (khtml::MoveSelectionCommand::doApply):
737 Check the node for nil.
739 * khtml/khtml_part.cpp:
740 (KHTMLPart::khtmlMouseReleaseEvent):
741 Use the node from the event rather than from the selection.
743 2005-03-14 Darin Adler <darin@apple.com>
745 Reviewed by Harrison.
747 - fixed <rdar://problem/4049776> Seed: Mail: Disable spellcheck leaves red artifacts
749 * khtml/xml/dom_docimpl.cpp:
750 (DocumentImpl::DocumentImpl): Set markers list to be "auto-delete" so they don't all leak.
751 (DocumentImpl::removeMarker): Remove markers list for a node when the last marker is removed
752 for that node. Otherwise, we can have empty marker lists for each node forever until the
754 (DocumentImpl::removeAllMarkers): Added code to dirty the markers.
755 (DocumentImpl::shiftMarkers): Remove unneeded empty check.
757 * kwq/WebCoreBridge.h: Added unmarkAllMisspellings for WebKit.
758 * kwq/WebCoreBridge.mm: (-[WebCoreBridge unmarkAllMisspellings]): Added. Calls removeAllMarkers.
760 2005-03-14 Richard Williamson <rjw@apple.com>
762 Fixed <rdar://problem/4027928> Tiger_8A394:Acrobat crashes while tried to remove the subscription errors by clicking on "Would you like to remove the subscription" from Tracker details view pane
764 A document may be deleted as a consequence of handling an event,
765 as was the case with Acrobat.app. Ensure that the document is still valid
766 before passing the event on for further handling.
768 * khtml/xml/dom_nodeimpl.cpp:
769 (NodeImpl::dispatchUIEvent):
771 2005-03-14 Ken Kocienda <kocienda@apple.com>
775 Added a couple of comments about setChanged() to this code based on my experiences with 4047028.
777 * khtml/css/css_valueimpl.cpp:
778 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties)
779 (DOM::CSSMutableStyleDeclarationImpl::merge)
781 2005-03-14 Ken Kocienda <kocienda@apple.com>
787 <rdar://problem/4047028> Changing quote levels on stylized text causes it to be sent as colored (Blue). Tiger8A410
789 * khtml/css/css_valueimpl.cpp:
790 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): This function now calls setChanged() at the
791 end of its loop if any properties were removed. This makes the style system update correctly in response
792 to changes made by this function. The code to paste removes style from the pasted content in a
793 preliminary step, and the fact that the style system did not update properly left unwanted color
794 declarations in the document.
796 2005-03-14 Vicki Murley <vicki@apple.com>
798 - roll out this change for now, since it was denied by CCC
800 2005-03-11 David Harrison <harrison@apple.com>
804 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
806 * kwq/KWQKHTMLPart.mm:
807 (KWQKHTMLPart::advanceToNextMisspelling):
808 (KWQKHTMLPart::markMisspellings):
811 2005-03-14 Ken Kocienda <kocienda@apple.com>
817 <rdar://problem/4050403> Mail crashes after pasting and deleting the content of one Excel cell
819 * khtml/editing/htmlediting.cpp:
820 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add some null checks to the code. This fixes the crash, although
821 following the steps described in the bug by John Sullivan on 3/14/05 at 10:49 AM will leave us with a "blank line" in
822 the document that cannot be removed (this is actually an empty table). This is undesirable, however, work Maciej is
823 doing to fix the general-case problem of trying to edit constructs we do not handle well in editing should fix this
824 particular case, making the deletion of this "blank line" possible. Maciej is doing this work as part of this bug:
825 <rdar://problem/4036051> Hard to select (and thus delete) an IFRAME in an editable WebView
827 2005-03-14 Ken Kocienda <kocienda@apple.com>
833 <rdar://problem/4029632> Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
835 The problem is that removeInlineStyle() can remove nodes, and if either the start or end node of the
836 selection at the time of the call to removeInlineStyle() was in a node that got removed, bad things
837 would happen. The fix is described below.
839 * khtml/editing/htmlediting.cpp:
840 (khtml::maxRangeOffset): Moved this static function to a different place in the file so the code below can use it.
841 (khtml::ApplyStyleCommand::applyInlineStyle): Calling removeInlineStyle() now has the side effect of
842 setting the command's ending selection. Now resets start and end using the ending selection after the call to
843 removeInlineStyle() as it is done elsewhere in this function.
844 (khtml::ApplyStyleCommand::removeInlineStyle): Track the removal of the start or end node based on
845 the positions passed in. If either the start or the end node is removed as part of style removal,
846 set an appropriate replacement start or end that is still in the document.
850 2005-03-14 Ken Kocienda <kocienda@apple.com>
854 I need to roll out Kevin's change to fix 3667701. It breaks contextual fragments, and hence breaks
855 paste in editing (among other things).
857 * khtml/html/htmltokenizer.cpp: Roll out recent change.
858 (khtml::HTMLTokenizer::write)
859 * khtml/html/htmltokenizer.h: Ditto.
861 2005-03-13 Darin Adler <darin@apple.com>
863 Reviewed by Ken and Maciej.
865 - fixed <rdar://problem/4049040> REGRESSION (403-405): security check prevents user stylesheet from loading (Dictionary.app doesn't work at all!)
867 * kwq/WebCoreBridge.mm: (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Changed to give "applewebdata:"
868 documents the same privileges to open local files that "file:" documents have.
870 2005-03-13 Kevin Decker <kdecker@apple.com>
874 Fixed: <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
876 The problem here was that the tokenizer would continue to receive chunks of data from the loader already
877 after the view and part had been destroyed. Situations like this could arise when clicking on another link
878 while still loading the current view, or during self test where we rapidly open, load, and close browser
881 * khtml/html/htmltokenizer.cpp:
882 (khtml::HTMLTokenizer::write): Simple nil check against the view.
883 * khtml/html/htmltokenizer.h: Changed the view pointer from a standard pointer to a QGuardedPtr. The tokenizer's
884 handle to the view will now automatically nil-out and never dangle.
886 2005-03-13 Darin Adler <darin@apple.com>
888 Reviewed by John and Ken.
890 - fixed <rdar://problem/4044347> REGRESSION (Mail): Control-K in particular message moves insertion point to previous line
892 Tweaked the deleting code, and added three new deleting layout tests to confirm the new code works.
894 * khtml/editing/htmlediting.cpp:
895 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Removed special case with comment that said it was
896 for the case where a "selection contains only a BR right after a block ended". This code was being triggered in
897 more cases than just that one, and in all the cases I tested, the general delete code works fine.
898 (khtml::DeleteSelectionCommand::handleGeneralDelete): Changed the code that decides whether to delete an entire
899 block to understand the case where the end block is outside the start block, but contains the start block.
900 In that case, we want to delete the entire block. Not deleting the block was causing us to delete just the <br>,
901 and not the enclosing <div> in the case in the bug.
903 * layout-tests/editing/deleting/delete-line-015-expected.txt: Added.
904 * layout-tests/editing/deleting/delete-line-015.html: Added.
905 * layout-tests/editing/deleting/delete-line-016-expected.txt: Added.
906 * layout-tests/editing/deleting/delete-line-016.html: Added.
907 * layout-tests/editing/deleting/delete-line-017-expected.txt: Added.
908 * layout-tests/editing/deleting/delete-line-017.html: Added.
909 * layout-tests/editing/style/smoosh-styles-002-expected.txt: Updated to improved results. With the code change, the deletion
910 now deletes more than it used to. The old results had an empty text node and <h1> element that were both 0-sized, and now
911 we delete both of those.
913 2005-03-13 Darin Adler <darin@apple.com>
915 - fixed <rdar://problem/4049172> REGRESSION (403-405): Gmail: text box in "Invite a friend" section overlaps other sections
917 Rolled out fix for <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
919 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth): Back to previous version of this file.
921 2005-03-12 Maciej Stachowiak <mjs@apple.com>
925 <rdar://problem/4046144> RSS pages leave a hole in local file security policy (need to revert feed: exemption)
927 * kwq/WebCoreBridge.mm:
928 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Revert
929 emergency workaround for Safari RSS, now that a new Syndication
932 2005-03-11 Maciej Stachowiak <mjs@apple.com>
936 <rdar://problem/4026787> text typed after a link (pasted or Mail Link to this Page) is part of the link, underlined and colored blue
938 The concept of this change is every time you type at the very
939 start or very end of a link (even if nested in further inner
940 elements), the typed text goes outside the link instead of inside.
942 * khtml/editing/htmlediting.cpp:
943 (khtml::InsertTextCommand::prepareForTextInsertion): Check whether
944 we are at the first visible position or last visible position of a
945 special element. For now this only includes HTML A elements that
946 are links (i.e. they have an href).
947 (khtml::isSpecialElement): Helper function that identifies special
948 elements (for now only links).
949 (khtml::isFirstVisiblePositionInSpecialElement): Checks if a given DOM
950 position is equivalent to the first visible position in some containing
951 editable special element.
952 (khtml::positionBeforeNode): Returns the DOM position immediately
954 (khtml::positionBeforeContainingSpecialElement): Gives a DOM
955 position immediately before the outermost editable containing
956 special element where the passed-in position is equivalent to the
957 first visible position.
958 (khtml::maxRangeOffset): Helper to get the maximum allowed
959 range/position offset for a node, does the right thing based on
960 whether the node would use a character offset or child offset.
961 (khtml::isLastVisiblePositionInSpecialElement): Similar to above,
962 but for end of node instead of start.
963 (khtml::positionAfterNode): Ditto.
964 (khtml::positionAfterContainingSpecialElement): Ditto.
966 Some layout tests changed - I looked over all the diffs and found
967 that the only changes were "junk nodes" like empty spans and text
968 nodes moving from one spot in the tree to another. These changes
969 are all harmless and do not affect layout or future editing.
971 * layout-tests/editing/inserting/typing-003-expected.txt:
972 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
973 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
974 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
975 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
976 * layout-tests/editing/style/remove-underline-expected.txt:
977 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt:
978 * layout-tests/editing/style/remove-underline-in-bold-expected.txt:
979 * layout-tests/editing/style/typing-style-003-expected.txt:
980 * layout-tests/editing/style/unbold-in-bold-expected.txt:
981 * layout-tests/editing/style/underline-expected.txt:
983 2005-03-11 Adele Amchan <adele@apple.com>
985 backing out fix for <rdar://problem/4021711> REGRESSION (125-188): blank pages when browsing forum at cooperativeresearch.org - cached external script problem
987 This caused the following regressions (that we know of):
988 <rdar://problem/4047445> REGRESSION (Safari-400-403?): Some or all page contents sometimes don't appear (macworld.com)
989 <rdar://problem/4046153> 8a409: Problem loading Citibank page in Safari 2 (403)
990 <rdar://problem/4047801> REGRESSION (402-403): .Mac homepage links don't work
992 * khtml/html/htmltokenizer.cpp:
993 (khtml::HTMLTokenizer::scriptHandler):
995 2005-03-11 David Harrison <harrison@apple.com>
999 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
1001 * kwq/KWQKHTMLPart.mm:
1002 (KWQKHTMLPart::advanceToNextMisspelling):
1003 (KWQKHTMLPart::markMisspellings):
1006 2005-03-11 Ken Kocienda <kocienda@apple.com>
1010 * ForwardingHeaders/editing/visible_units.h: Added.
1012 2005-03-11 Ken Kocienda <kocienda@apple.com>
1018 <rdar://problem/4045521> Hitting return key with full line selected does not add blank line as it should
1020 * khtml/editing/htmlediting.cpp:
1021 (khtml::InsertParagraphSeparatorCommand::doApply): Removed some "special-case" code from this
1022 function that would look for a selection that started and ended in a different block, and would
1023 then bail right after the deletion of the selection without inserting a paragraph separator.
1024 This was just wrong. So, the code change is removal only. When the general-case code runs instead
1025 of the erroneous special-case code, the bug goes away.
1029 * layout-tests/editing/inserting/return-key-with-selection-001-expected.txt: Added.
1030 * layout-tests/editing/inserting/return-key-with-selection-001.html: Added.
1031 * layout-tests/editing/inserting/return-key-with-selection-002-expected.txt: Added.
1032 * layout-tests/editing/inserting/return-key-with-selection-002.html: Added.
1033 * layout-tests/editing/inserting/return-key-with-selection-003-expected.txt: Added.
1034 * layout-tests/editing/inserting/return-key-with-selection-003.html: Added.
1036 2005-03-11 David Harrison <harrison@apple.com>
1040 <rdar://problem/4009446> AX: kAXTextMarkerForPositionParameterizedAttribute not working correctly (required for Dictionary pop-up)
1042 * kwq/KWQAccObject.mm:
1043 (-[KWQAccObject accessibilityAttributeValue:]):
1046 (-[KWQAccObject doAXTextMarkerForPosition:]):
1049 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
1050 Use the selection's document instead of the top document, to accommodate frames, etc.
1052 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
1053 Fixed parameter processing to look for NSValue instead of AXValue.
1055 2005-03-11 Ken Kocienda <kocienda@apple.com>
1057 Reviewed by Harrison
1061 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
1063 This was fixed, then regressed with Harrison's fix for this bug:
1065 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
1067 * khtml/editing/htmlediting.cpp:
1068 (khtml::ReplaceSelectionCommand::doApply): My now addresses both problems in a way that they no longer
1071 2005-03-10 Ken Kocienda <kocienda@apple.com>
1077 <rdar://problem/4045511> Copying and pasting end-of-paragraph selection puts insertion point in wrong place
1078 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
1080 The copy/paste code before this patch had no notion of a "logical newline" at the start of the selection. We have
1081 had a similar notion for "logical newline" at the end of the selection for quite some time. To fix these bugs, we
1082 need to introduce the same idea for selection starts.
1084 * khtml/editing/htmlediting.cpp:
1085 (khtml::ReplacementFragment::ReplacementFragment): Process the "logical newline" at start as we write it out
1086 in markup. Set the bit we added to this object to signify we have such a newline.
1087 (khtml::ReplaceSelectionCommand::doApply): Many, many changes to introduce the new "logical newline" at start concept.
1088 I also tried to simply the code that sets the start position for inserting content to be pasted. I also improved a
1089 weakness in the smart-paste code. Now, we check before and after the paste for whether we need to add a leading or
1090 trailing space. The code previous to this patch only did a "before" check, with the result that we sometimes added
1091 a second space. In other words, the code did not realize that DOM changes done by pasting could cause formerly
1092 unrendered whitespace to become rendered. Also moved line placeholder clean up code to its own function.
1093 (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): New helper that further refines the notion
1094 of when we can remove a line placeholder. The definition is now, "If a line placeholder is at the visible start
1095 and visible end of its line, keep it; otherwise remove it".
1096 * khtml/editing/htmlediting.h: Declare new functions. Rework inlines in ReplacementFragment class to account for
1097 addition of new "logical newline" at start concept.
1098 (khtml::ReplacementFragment::hasInterchangeNewlineAtStart): New accessor.
1099 (khtml::ReplacementFragment::hasInterchangeNewlineAtEnd): Renamed from hasInterchangeNewline(), since before we
1100 only had a bit for the end, hence we did not need to distinguish it from the start.
1101 * khtml/editing/markup.cpp:
1102 (khtml::createMarkup): Added code to detect and write out markup for cases where we have a "logical newline" at start.
1103 * khtml/xml/dom2_rangeimpl.cpp:
1104 (DOM::RangeImpl::startPosition): New helper.
1105 (DOM::RangeImpl::endPosition): Ditto.
1106 * khtml/xml/dom2_rangeimpl.h: Declare new helpers.
1109 * layout-tests/editing/pasteboard/paste-line-endings-001-expected.txt: Added.
1110 * layout-tests/editing/pasteboard/paste-line-endings-001.html: Added.
1111 * layout-tests/editing/pasteboard/paste-line-endings-002-expected.txt: Added.
1112 * layout-tests/editing/pasteboard/paste-line-endings-002.html: Added.
1113 * layout-tests/editing/pasteboard/paste-line-endings-003-expected.txt: Added.
1114 * layout-tests/editing/pasteboard/paste-line-endings-003.html: Added.
1115 * layout-tests/editing/pasteboard/paste-line-endings-004-expected.txt: Added.
1116 * layout-tests/editing/pasteboard/paste-line-endings-004.html: Added.
1117 * layout-tests/editing/pasteboard/paste-line-endings-005-expected.txt: Added.
1118 * layout-tests/editing/pasteboard/paste-line-endings-005.html: Added.
1119 * layout-tests/editing/pasteboard/paste-line-endings-006-expected.txt: Added.
1120 * layout-tests/editing/pasteboard/paste-line-endings-006.html: Added.
1121 * layout-tests/editing/pasteboard/paste-line-endings-007-expected.txt: Added.
1122 * layout-tests/editing/pasteboard/paste-line-endings-007.html: Added.
1123 * layout-tests/editing/pasteboard/paste-line-endings-008-expected.txt: Added.
1124 * layout-tests/editing/pasteboard/paste-line-endings-008.html: Added.
1125 * layout-tests/editing/pasteboard/paste-line-endings-009-expected.txt: Added.
1126 * layout-tests/editing/pasteboard/paste-line-endings-009.html: Added.
1127 * layout-tests/editing/pasteboard/paste-line-endings-010-expected.txt: Added.
1128 * layout-tests/editing/pasteboard/paste-line-endings-010.html: Added.
1132 2005-03-10 Darin Adler <darin@apple.com>
1134 Reviewed by Richard.
1136 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
1138 * khtml/rendering/render_text.cpp: (getCharacterBreakIterator): Set boolean "got iterator" to true.
1140 2005-03-10 Darin Adler <darin@apple.com>
1144 - fixed <rdar://problem/4042867> "Bigger" changes the font size of too much text when the selection is on a style-change boundary
1146 * khtml/editing/htmlediting.cpp: (khtml::ApplyStyleCommand::applyRelativeFontStyleChange):
1147 Advance out of the starting text node if we're at the end of it.
1149 2005-03-10 Darin Adler <darin@apple.com>
1151 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Fixed assertion for nested calls to write.
1153 2005-03-10 David Harrison <harrison@apple.com>
1157 <rdar://problem/4032346> REGRESSION (Mail): changing 1st line of a URL that wraps to two lines doesn't always update 2nd line
1159 * khtml/rendering/bidi.cpp:
1160 (khtml::RenderBlock::matchedEndLine):
1161 Look at first clean line in case line wrap implicitly dirtied it.
1163 2005-03-10 Maciej Stachowiak <mjs@apple.com>
1167 <rdar://problem/4046018> REGRESSION (TOT): RSS pages don't display anything
1169 * kwq/WebCoreBridge.mm:
1170 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Exempt
1171 feed: and feeds: pages from the local file security check.
1173 2005-03-10 Darin Adler <darin@apple.com>
1175 Change written by Steve Peters, reviewed by me.
1177 - fixed <rdar://problem/4045924> improve compareBoundaryPoints to make style changes faster
1179 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints):
1180 Do early outs in a couple of the loops to make things faster.
1182 2005-03-10 Jens Alfke <jens@apple.com>
1186 Fixes <rdar://problem/4040848> "REGR: Sun security-check demo applet does not load". My earlier fix for 3603191 deferred loading the applet until the </applet> tag is reached, so all <param>s will be available. Unfortunately that meant that if the </applet> tag was missing, the applet would never load at all. So instead, the loading needs to happen when the ID_APPLET tag is popped from the parser stack for any reason.
1188 I've restored the old NodeImpl::closeRenderer() method. Except it's now virtual, with a no-op base implementation, and is overridden by HTMLAppletElementImpl, replacing its setAllParamsAvailable method that I added a few weeks ago when fixing 3603191.
1190 This ensures that the applet will get loaded even if there is no explicit </applet> tag.
1192 The changes to htmlparser.cpp back out my earlier change and restore the lines that were deleted on 8/3/04 when the old closeRenderer was removed.
1194 * khtml/html/html_objectimpl.cpp:
1195 (HTMLAppletElementImpl::closeRenderer):
1196 * khtml/html/html_objectimpl.h:
1197 * khtml/html/htmlparser.cpp:
1198 (KHTMLParser::insertNode):
1199 (KHTMLParser::processCloseTag):
1200 (KHTMLParser::popOneBlock):
1201 * khtml/xml/dom_nodeimpl.h:
1202 (DOM::NodeImpl::closeRenderer):
1204 2005-03-10 Ken Kocienda <kocienda@apple.com>
1210 <rdar://problem/4024929> REGRESSION (Mail): Pasting text with multiple reply levels removes one level instead of all
1212 The code to figure out which node to use to merge into an existing line did not drill into the first inline element
1213 as needed to make the feature work as user expect. Instead, it looked at the first node, and if it was a block, it
1214 skipped that node. This worked for some cases (including the important "paste-as-quotation" case) but obviously
1215 doesn't work for content quoted more than once.
1217 Now, mergeStartNode() will look for the first node in pasted content that is not a block. It will now also look
1218 for nodes specially marked by Mail as a node added to make "Paste As Quotation" work. It won't skip those.
1220 NOTE: This change will break Mail's "Paste As Quotation" feature for TOT WebKit users, but this is only a temporary
1221 problem that will exist until we sync up with Mail's pending change to mark nodes as needed in its pasteAsQuotation:
1224 * khtml/editing/html_interchange.h: Add ApplePasteAsQuotation constant used to check for "marked" blockquotes.
1225 * khtml/editing/htmlediting.cpp:
1226 (khtml::ReplacementFragment::mergeStartNode): Look for first node that is either not a block or is marked as
1227 an ApplePasteAsQuotation node.
1228 (khtml::isMailPasteAsQuotationNode): New helper that looks for nodes marked with ApplePasteAsQuotation.
1229 * khtml/editing/htmlediting.h: Updated header for new function.
1231 This test result changed is an acceptable way.
1233 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
1234 * layout-tests/editing/pasteboard/paste-text-013.html
1236 NOTE: This change causes a regression in this layout test:
1238 * layout-tests/editing/pasteboard/paste-text-013.html
1240 This problem will need to be fixed separately, and this bug has been filed to track this problem:
1241 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
1243 2005-03-09 Maciej Stachowiak <mjs@apple.com>
1245 Reviewed by Richard.
1247 <rdar://problem/4040776> Dashboard (Weather widget) is a memory hog
1249 Change things around so the event listeners for XMLHttpRequest
1250 mark their JS listener objects instead of holding a hard
1251 reference, to avoid an unbreakable reference cycle.
1253 * khtml/ecma/kjs_events.cpp:
1254 (JSAbstractEventListener::JSAbstractEventListener):
1255 (JSAbstractEventListener::~JSAbstractEventListener):
1256 (JSAbstractEventListener::handleEvent):
1257 (JSAbstractEventListener::eventListenerType):
1258 (JSUnprotectedEventListener::JSUnprotectedEventListener):
1259 (JSUnprotectedEventListener::~JSUnprotectedEventListener):
1260 (JSUnprotectedEventListener::listenerObj):
1261 (JSUnprotectedEventListener::windowObj):
1262 (JSUnprotectedEventListener::mark):
1263 (JSEventListener::JSEventListener):
1264 (JSEventListener::~JSEventListener):
1265 (JSEventListener::listenerObj):
1266 (JSEventListener::windowObj):
1267 (JSLazyEventListener::JSLazyEventListener):
1268 * khtml/ecma/kjs_events.h:
1269 * khtml/ecma/kjs_html.h:
1270 * khtml/ecma/kjs_window.cpp:
1271 (Window::getJSEventListener):
1272 (Window::getJSUnprotectedEventListener):
1273 * khtml/ecma/kjs_window.h:
1274 * khtml/ecma/xmlhttprequest.cpp:
1275 (KJS::XMLHttpRequest::putValue):
1276 (KJS::XMLHttpRequest::mark):
1277 * khtml/ecma/xmlhttprequest.h:
1278 * khtml/khtml_part.h:
1280 2005-03-06 Maciej Stachowiak <mjs@apple.com>
1284 <rdar://problem/4005575> Arbitrary file disclosure vulnerability due to ability to load local html from remote content
1286 * khtml/ecma/kjs_html.cpp:
1287 (KJS::HTMLDocument::putValue):
1288 * khtml/ecma/kjs_window.cpp:
1290 (WindowFunc::tryCall):
1292 (LocationFunc::tryCall):
1293 * khtml/khtml_part.cpp:
1295 (KHTMLPart::scheduleLocationChange):
1296 (KHTMLPart::slotRedirect):
1297 (KHTMLPart::processObjectRequest):
1298 * khtml/khtml_part.h:
1299 * khtml/khtmlpart_p.h:
1300 * kwq/KWQKHTMLPart.mm:
1301 (KWQKHTMLPart::openURLRequest):
1302 (KWQKHTMLPart::urlSelected):
1303 (KWQKHTMLPart::createPart):
1304 * kwq/KWQKHTMLPartBrowserExtension.mm:
1305 (KHTMLPartBrowserExtension::createNewWindow):
1306 * kwq/WebCoreBridge.h:
1307 * kwq/WebCoreBridge.mm:
1308 (hasCaseInsensitivePrefix):
1309 (-[WebCoreBridge didNotOpenURL:pageCache:]):
1310 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]):
1312 2005-03-09 Richard Williamson <rjw@apple.com>
1314 Fixed <rdar://problem/4032938> Safari: text layout for MS P Gothic font is corrupted
1316 Remove our hacked special case now we have our own cache of
1317 which fonts are fixed pitch.
1322 (QFont::isFixedPitch):
1324 2005-03-09 David Harrison <harrison@apple.com>
1328 <rdar://problem/4037141> REGRESSION (Mail): Pasting deletes preceding blank lines with certain steps
1330 * khtml/editing/htmlediting.cpp:
1331 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
1332 Add check for anonymous text after blocks.
1334 2005-03-08 Ken Kocienda <kocienda@apple.com>
1340 <rdar://problem/4039661> crash in ApplyStyleCommand::applyBlockStyle pasting contents of webpage into Mail or Blot
1341 <rdar://problem/4039672> hang in moveParagraphContentsToNewBlockIfNecessary after pasting contents of webpage into Blot
1343 * khtml/editing/htmlediting.cpp:
1344 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Fix for 4039672. Iteration needs to do
1345 a traverseNextSibling(), not a traverseNextNode(). The latter might iterate into a child that already got moved, and
1346 the code can infinite loop as a result.
1347 (khtml::ApplyStyleCommand::applyBlockStyle): Fix for 4039661. This function iterates over a set of nodes to apply
1348 block styles. Before, the iteration would go from the start to the end of the selection, and apply block styles
1349 as it went. However, the act of applying style could confuse the iteration. Now I iterate and store the relevant
1350 nodes in QPtrList before doing any style manipulation, and then iterate that set of nodes.
1352 2005-03-08 Darin Adler <darin@apple.com>
1354 Change written by Hyatt, reviewed by me.
1356 - fixed <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
1358 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth):
1359 Only use a minWidth of 0 for images with a percentage value. Other replaced elements aren't scalable
1360 so their minWidth should be their calculated width. This has been wrong all along, but it's a relatively
1361 safe change because it only affects replaced elements' min-width.
1363 2005-03-08 David Harrison <harrison@apple.com>
1367 <rdar://problem/4039006> REGRESSION (Mail): Command-left-arrow goes to the start of the wrong line in particular message
1369 * khtml/editing/visible_units.cpp:
1370 (khtml::startOfLine):
1371 Use firstLeafChild() instead of firstChild().
1373 2005-03-08 Richard Williamson <rjw@apple.com>
1375 Fixed by Tom Madden.
1377 Fixed <rdar://problem/4038586> 8A402: Osaka-Mono text overlaps when typing with input method
1379 We weren't clearing the "all ascii" flag when setting text on
1382 Reviewed by Richard Williamson.
1384 * khtml/rendering/render_text.cpp:
1385 (RenderText::setText):
1387 2005-03-08 Darin Adler <darin@apple.com>
1389 Reviewed by Ken and Maciej.
1391 - fixed <rdar://problem/3988809> REGRESSION (Mail): wide space characters are turned into plain old spaces when typed or pasted
1393 Changed the few places where it matters to use a "collapsible whitespace" concept instead of
1394 the general whitespace concept. This means treating only ' ' and '\n' specially instead of
1395 including other space characters, which matches what the space-collapsing logic does in RenderText,
1396 although it really needs to behave differently based on whitespace mode.
1398 * khtml/editing/visible_text.h: (khtml::isCollapsibleWhitespace): Added. This returns true only for
1399 ' ' and '\n' since they are the only characters collapsed once text is in the DOM. But really it
1400 can't do the job ignoring white-space mode, so some day it must go.
1402 * khtml/editing/html_interchange.cpp: (convertHTMLTextToInterchangeFormat): Changed to use
1403 isCollapsibleWhitespace and removed unnecessary calls to latin1().
1405 * khtml/editing/htmlediting.cpp:
1406 (khtml::isNBSP): Removed unnecessary creation/destruction of QChar each time this is called.
1407 (khtml::nextCharacterIsCollapsibleWhitespace): Renamed from isWS and changed to use isCollapsibleWhitespace.
1408 (khtml::DeleteSelectionCommand::fixupWhitespace): Use isCollapsibleWhitespace instead of isWS,
1409 since we only want to do our NBSP tricks for collapsible whitespace.
1410 (khtml::InsertTextCommand::input): Changed use of isTab to instead say == "\t" since that does the
1411 same thing and is arguably just as clear. Changed use of isWS to == " " since the input text can't
1412 include any "\n" characters, and really a plain old space is the only collapsible thing that can
1413 be passed in. Use isCollapsibleWhitespace instead of isWS since we want to do NBSP tricks only for
1414 collapsible whitespace, not all whitespace.
1415 (khtml::InsertTextCommand::insertSpace): Use isCollapsibleWhitespace instead of isWS since we want
1416 to do NBSP tricks only for collapsible whitespace, not all whitespace.
1417 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
1419 * khtml/xml/dom_position.h: Changed treatNBSPAsWhiteSpace parameters to considerNonCollapsibleWhitespace
1420 parameters. The most common callers are only interested in collapsible whitespace, and the smart copy
1421 and paste callers want to include all whitespace, including non-breaking spaces and all the Unicode spaces.
1422 * khtml/xml/dom_position.cpp:
1423 (DOM::Position::leadingWhitespacePosition): Rename the parameter, and use either QChar::isSpace or
1424 isCollapsibleWhitespace depending on the boolean passed in.
1425 (DOM::Position::trailingWhitespacePosition): Ditto.
1427 2005-03-07 John Sullivan <sullivan@apple.com>
1431 - <rdar://problem/4040868> REGRESSION (Mail, 403-403+): Drag and drop deletes text,
1432 many other bad editing problems
1434 * khtml/rendering/render_text.cpp:
1435 (RenderText::caretMaxOffset):
1436 A "-" should have been a "+" in this method that was tweaked an hour ago. Editing
1437 was completely horked.
1439 2005-03-07 Richard Williamson <rjw@apple.com>
1441 Additional nil check from fix for 4040749.
1443 * khtml/rendering/render_box.cpp:
1444 (RenderBox::setStyle):
1446 2005-03-07 Richard Williamson <rjw@apple.com>
1448 Additional nil check from fix for 4040749.
1450 * khtml/rendering/render_layer.cpp:
1451 (RenderLayer::updateLayerPosition):
1453 2005-03-07 David Harrison <harrison@apple.com>
1457 <rdar://problem/4033202> REGRESSION (Mail): Can't arrow up at a particular spot in a particular Mail message
1459 Doublecheck that new position is really on a different line, because the VisiblePosition constructor does not.
1460 Filed <rdar://problem/4040763> for that problem.
1462 * khtml/editing/visible_units.cpp:
1463 (khtml::previousLinePosition):
1465 2005-03-07 Richard Williamson <rjw@apple.com>
1467 Fixed <rdar://problem/4040749> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
1469 When layers are dynamically created/removed as a result of changing opacity they weren't being correctly
1470 sized and positioned. This happens whenever opacity goes from < 1 to 1.
1474 * khtml/rendering/render_box.cpp:
1475 (RenderBox::setStyle):
1476 * khtml/rendering/render_layer.cpp:
1477 (RenderLayer::updateLayerPosition):
1479 2005-03-07 Christy Warren <kali@apple.com>
1483 * khtml/rendering/render_text.cpp:
1484 (RenderText::caretMinOffset): modified to handle BIDI case by checking all text boxes for min offset
1485 (RenderText::caretMaxOffset): modified to handle BIDI case by checking all text boxes for max offset
1487 2005-03-07 David Harrison <harrison@apple.com>
1491 <rdar://problem/4029225> REGRESSION (Mail): Crash if hit return after dragging in attachment - DeleteSelectionCommand::initializePositionData
1493 Work around the fact that the height() of a BR is 0 if there are no text elements on the line, even if there are replaced elements.
1494 Filed <rdar://problem/4040358> RenderBR height() is not accurate.
1496 * khtml/editing/htmlediting.cpp:
1497 (khtml::ReplaceSelectionCommand::doApply):
1498 When height is 0, double check that the placeholder is the first position on the line.
1502 2005-03-07 Ken Kocienda <kocienda@apple.com>
1508 <rdar://problem/4040136> Expose SPI for WebCore's functions to create document fragments from plain text and markup strings
1510 * kwq/DOMHTML.mm: Add two new SPI functions.
1511 (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:])
1512 (-[DOMHTMLDocument _createDocumentFragmentWithText:])
1513 * kwq/DOMPrivate.h: Declare the new SPI here, a privately-exported header, so Mail can make use of it.
1515 2005-03-07 Ken Kocienda <kocienda@apple.com>
1521 <rdar://problem/4039676> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date
1523 * khtml/editing/htmlediting.cpp:
1524 (khtml::ReplaceSelectionCommand::doApply): Code to "eat" a <br> element, that was creating an otherwise empty line, was running
1525 when it should not. If the content being pasted in does not end in a "logical" newline itself, then the <br> already
1526 in the content needs to be preserved. A simple one-line change now sees to this.
1528 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: This test now has an extra, but harmless,
1529 <br> at the end of a paragraph. This makes sense given the code change.
1532 * layout-tests/editing/pasteboard/paste-text-018-expected.txt: Added.
1533 * layout-tests/editing/pasteboard/paste-text-018.html: Added.
1535 2005-03-07 Ken Kocienda <kocienda@apple.com>
1541 <rdar://problem/4035648> REGRESSION (Mail): line feed in source HTML file causes bad copy/paste behavior
1543 The createMarkup() function in markup.cpp iterates over the nodes in a range,
1544 and does some bookkeeping to figure out when to add close tags to the markup.
1545 Some code added at the start of the loop to prevent markup from being written
1546 for unrendered nodes short-circuited the rest of the loop, and so prevented
1547 the close-tag-writing code from running when it should.
1549 This is why the "plain" text wound up inside of the bold tag in the example
1550 above. The addition of the unrendered return character caused an incorrect
1551 delay in the close tag for the bold element from being written out, with the
1552 result being that it wound up including additional content.
1554 The fix is to add checks for node renderers throughout the loop at the points
1555 where markup is written out for each node. This allows the additional close
1556 tag logic to run as needed.
1558 All layout tests pass with this change.
1560 * khtml/editing/markup.cpp:
1561 (khtml::createMarkup)
1565 * layout-tests/editing/pasteboard/paste-4035648-fix-expected.txt: Added.
1566 * layout-tests/editing/pasteboard/paste-4035648-fix.html: Added.
1568 2005-03-06 Christy Warren <kali@appple.com>
1572 * khtml/rendering/render_text.cpp:
1573 (lastRendererOnPrevLine): helper for RenderText::caretRect
1574 (RenderText::caretRect): added code to properly handle bidi ordered text boxes
1576 2005-03-06 Christy Warren <kali@apple.com>
1580 * khtml/editing/visible_position.cpp: Eliminated code that cuts off searching through the text boxes based on an assumption that breaks under bidi
1581 (khtml::VisiblePosition::isCandidate):
1582 * kwq/KWQFontMetrics.mm:
1583 (QFontMetrics::checkSelectionPoint): Made the initialization of the WebCoreStyle honor the reversed flag
1585 2005-03-05 John Sullivan <sullivan@apple.com>
1589 - fixed <rdar://problem/4038417> Mail crashed in StyleChange::checkForLegacyHTMLStyleChange
1590 when composing a reply
1592 * khtml/editing/htmlediting.cpp:
1593 (khtml::StyleChange::checkForLegacyHTMLStyleChange):
1594 Added missing nil check.
1596 2005-03-05 Darin Adler <darin@apple.com>
1600 - fixed <rdar://problem/4038478> Crash in renderer viewing RSS feed at feed://wvs.topleftpixel.com/index.rdf
1602 * khtml/xml/dom_docimpl.cpp: (widgetForNode): Check for nil before going from node to renderer.
1604 2005-03-05 Darin Adler <darin@apple.com>
1606 Reviewed by Richard.
1608 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
1610 * khtml/rendering/render_text.cpp:
1611 (getCharacterBreakIterator): Added. Helper that sets up an iterator for the passed-in text.
1612 Shares a single global iterator (fast, albeit not thread-safe).
1613 (RenderText::previousOffset): Changed to call getCharacterBreakIterator.
1614 (RenderText::nextOffset): Ditto.
1616 2005-03-05 Ken Kocienda <kocienda@apple.com>
1622 <rdar://problem/4038267> REGRESSION (Mail): Crash copying and pasting end of paragraph
1624 Code to handle content that has a "logical" newline at the end of the pasted content, and the code
1625 to adjust the selection at the end of the paste operation made an assumption that at least one
1626 node had been inserted by the paste command. This is not necessarily true in the case where the sole content
1627 in the pasted content is one of these "logical" newlines. Adjust some code around so that we don't deref
1628 null, but still adjust the selection correctly for this case. In each of the two functions below, some
1629 null checks have been added, and some code has been rearranged a little bit to continue on through
1630 the end of completeHTMLReplacement, even if no nodes have been inserted. The patch looks bigger and more
1631 complicated than the conceptual change.
1633 * khtml/editing/htmlediting.cpp:
1634 (khtml::ReplaceSelectionCommand::doApply)
1635 (khtml::ReplaceSelectionCommand::completeHTMLReplacement)
1637 * layout-tests/editing/pasteboard/paste-4038267-fix-expected.txt: Added.
1638 * layout-tests/editing/pasteboard/paste-4038267-fix.html: Added.
1640 2005-03-05 Darin Adler <darin@apple.com>
1644 - fixed <rdar://problem/4025918> images copied from Safari with relative src URLs aren't pasted into Mail messages (KURL resolves base URLs incorrectly)
1646 * kwq/KWQKURL.mm: (KURL::KURL): Add a slash at the start of the path if a relative part is adding
1647 a path onto a URL that has "pre-path" bits like host name, but no path yet. This doesn't come up
1648 for http because in that case we add a trailing "/" as part of canonicalization.
1650 2005-03-04 John Sullivan <sullivan@apple.com>
1654 - fixed <rdar://problem/4033705> REGRESSION (Mail): Copy/Paste from Excel
1655 crashes Mail in KWQKHTMLPart::fontForSelection(bool*) const + 232
1657 * kwq/KWQKHTMLPart.mm:
1658 (KWQKHTMLPart::fontForSelection):
1659 Check for nil startNode, not just nil renderer.
1661 2005-03-04 David Harrison <harrison@apple.com>
1663 Reviewed by Ken, Richard.
1665 <rdar://problem/3996383> REGRESSION (Mail): Deleting all of first line also deletes line ending
1667 Problem was the placeholder check was based on 0 height block, but the block in this
1668 case is the BODY, which has other content even though the paragraph is gone.
1670 * khtml/editing/htmlediting.cpp:
1671 (khtml::CompositeEditCommand::insertBlockPlaceholder):
1672 Now does insert instead of append!
1674 (khtml::CompositeEditCommand::appendBlockPlaceholder):
1675 New. Actually does append.
1677 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
1678 Renamed from insertBlockPlaceholderIfNeeded because it can insert or append. Also accepts "force insert" flag.
1680 (khtml::CompositeEditCommand::removeBlockPlaceholder):
1681 Renamed for succinctness from removeBlockPlaceholderIfNeeded.
1683 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
1684 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
1685 Use renamed methods.
1687 (khtml::DeleteSelectionCommand::doApply):
1688 Use addBlockPlaceholderIfNeeded "force insert" flag if deleting whole paragraphs did not leave an empty one.
1690 (khtml::InsertParagraphSeparatorCommand::doApply):
1691 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1692 (khtml::InsertTextCommand::input):
1693 Use renamed methods.
1695 * khtml/editing/htmlediting.h:
1696 Renamed and new methods per above.
1699 2005-03-04 Chris Blumenberg <cblu@apple.com>
1701 Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after pasting attachment at end of message
1705 * khtml/editing/visible_units.cpp:
1706 (khtml::endOfParagraph): don't consider text nodes that have no rendered characters
1708 2005-03-04 Richard Williamson <rjw@apple.com>
1710 Fixed <rdar://problem/4034764> REGRESSION(125-188)Viewing text/plain page and going back/forward corrupts HTML pages (google.com)
1712 The parse mode wasn't be restored to the document when going
1717 * kwq/KWQKHTMLPart.mm:
1718 (KWQKHTMLPart::openURLFromPageCache):
1719 * kwq/KWQPageState.h:
1720 * kwq/KWQPageState.mm:
1721 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]):
1723 2005-03-04 Ken Kocienda <kocienda@apple.com>
1727 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Shame on me!
1728 I landed my last fix without running layout tests. This one changes in a subtle, but
1731 2005-03-04 Ken Kocienda <kocienda@apple.com>
1733 Reviewed by Harrison
1737 <rdar://problem/4032543> REGRESSION (Mail): Mail hangs when quoted text is pasted twice
1739 This code change fixes the bug in a non-obvious way. The root cause of the problem was
1740 that a VisiblePosition created using an affinity originating in Mail code caused
1741 two VisiblePosition objects that should have been equal to differ only in their
1742 affinities, which in turn caused us to run a code path that should not have run.
1744 * khtml/editing/visible_position.cpp:
1745 (khtml::VisiblePosition::VisiblePosition): Added copy constructor.
1746 (khtml::VisiblePosition::next): Factored out inline code that used to be here into new
1747 setAffinityUsingLinePosition() function.
1748 (khtml::isEqualIgnoringAffinity): New helper to handle cases when affinity in equality check does
1749 not matter. However, we want to know about such cases where a VisiblePosition differs only by affinity,
1750 and the code will assert in development when this happens.
1751 (khtml::isNotEqualIgnoringAffinity): Ditto, but not. :)
1752 (khtml::setAffinityUsingLinePosition): New helper function mentioned above. This will "correct"
1753 upstream affinity to downstream if the affinity does not make a difference for the position.
1754 * khtml/editing/visible_position.h:
1755 * khtml/editing/visible_range.h: Wacky bug. The operator== for this class took VisiblePosition classes!
1756 * khtml/editing/visible_units.cpp:
1757 (khtml::isStartOfParagraph): Now performs equality check without regard to affinity.
1758 (khtml::isEndOfParagraph): Ditto.
1759 (khtml::isStartOfBlock): Ditto.
1760 (khtml::isEndOfBlock): Ditto.
1761 * kwq/WebCoreBridge.mm:
1762 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Adjusts the affinity using setAffinityUsingLinePosition()
1765 2005-03-04 Darin Adler <darin@apple.com>
1769 - fixed <rdar://problem/4036817> REGRESSION: ctrl-y broken when a line + carriage return cut
1771 * khtml/editing/htmlediting.h: Added insertTextRunWithoutNewlines.
1772 * khtml/editing/htmlediting.cpp:
1773 (khtml::InsertTextCommand::input): Added assertion to make sure strings with newlines don't get
1775 (khtml::TypingCommand::insertText): Added. Takes the name of the old function, but is a new
1776 level that breaks runs into lines and inserts each one separately.
1777 (khtml::TypingCommand::insertTextRunWithoutNewlines): Renamed old insertText to this.
1779 * khtml/dom/dom_string.h: Made substring be a const member function.
1780 * khtml/dom/dom_string.cpp: (DOM::DOMString::substring): Made this const.
1782 2005-03-04 Darin Adler <darin@apple.com>
1786 - fixed <rdar://problem/4020413> REGRESSION (Mail): can't use fonts with names that start with "#" in Mail (Korean fonts)
1788 * khtml/css/css_valueimpl.cpp:
1789 (DOM::isLegalIdentifier): Added. Commented out and not used.
1790 (DOM::quoteStringIfNeeded): Quotes the string if needed. For now only if it starts with "#".
1791 (DOM::CSSPrimitiveValueImpl::cssText): Call quoteStringIfNeeded when asked for cssText for an arbitrary string, since we
1792 need text you can re-parse.
1793 (DOM::FontFamilyValueImpl::cssText): Ditto.
1795 * khtml/editing/markup.cpp:
1796 (khtml::startMarkup): Added comments about lack of quoting for attributes.
1797 (khtml::createMarkup): Ditto.
1799 2005-03-04 Adele Amchan <adele@apple.com>
1803 Fix for <rdar://problem/4021711> REGRESSION(125-188) blank pages when browsing forum at cooperativeresearch.org - cached external script problem
1805 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::scriptHandler): set flag needToRefCachedScript so we can make sure
1806 notifyFinished is called after pendingSrc is set up with the right data from the cached script
1808 2005-03-04 Ken Kocienda <kocienda@apple.com>
1814 <rdar://problem/4029632> Tiger 8A398:- Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
1816 * khtml/editing/htmlediting.cpp:
1817 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): VisiblePosition constructor
1818 was failing to yield a position for a node just pasted into the document since a layout was needed
1819 for the calculation to come out right. Layout added. Crash gone.
1823 2005-03-03 Chris Blumenberg <cblu@apple.com>
1825 Fixed: <rdar://problem/3992803> Cannot navigate through list items with the keyboard, you're stuck in the same <li> block unless you click out
1827 Reviewed by harrison.
1829 * khtml/rendering/render_line.cpp:
1830 (khtml::RootInlineBox::closestLeafChildForXPos): avoid returning list markers when possible. Also improved heuristic for returning the best InlineBox given the passed X position.
1833 2005-03-03 Ken Kocienda <kocienda@apple.com>
1839 <rdar://problem/4035198> Pasting text with different styles does not get reproducible results
1841 I had a good idea yesterday to improve the way we "fixup" styles after
1842 pasting, but i chose a poor data structure to do it, a map of
1843 nodes-to-styles. In the fixup step, I iterated over the map elements and
1844 did the fixup. However, since the order in which the items would come
1845 out of the map is indeterminate, we got unpredictable results.
1847 So, the concept was good, but the implementation was flawed. I have
1848 fixed this mapping to be a list instead, so the order that nodes are
1849 evaluated in the fixup step is document order. This works nicely.
1851 * khtml/editing/htmlediting.cpp:
1852 (khtml::ReplacementFragment::~ReplacementFragment): No longer need to explicity deref nodes and
1853 styles saved away for later fixup. This is now handled by the new NodeDesiredStyle class.
1854 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls computeAndStoreNodeDesiredStyle,
1855 function renamed from mapDesiredStyleForNode.
1856 Now accepts a QValueList<NodeDesiredStyle> in place of the old map.
1857 (khtml::NodeDesiredStyle::NodeDesiredStyle): New class that represents a node-to-style mapping.
1858 (khtml::NodeDesiredStyle::~NodeDesiredStyle): Ditto.
1859 (khtml::NodeDesiredStyle::operator=): Ditto.
1860 (khtml::ReplaceSelectionCommand::doApply): Now calls computeAndStoreNodeDesiredStyle,
1861 function renamed from mapDesiredStyleForNode.
1862 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Now operates on a QValueList<NodeDesiredStyle> in
1863 place of the old map.
1864 (khtml::computeAndStoreNodeDesiredStyle): Renamed from mapDesiredStyleForNode. Now operates on a
1865 QValueList<NodeDesiredStyle> in place of the old map.
1866 * khtml/editing/htmlediting.h:
1867 (khtml::NodeDesiredStyle): New class that represents a node-to-style mapping.
1868 (khtml::ReplacementFragment::desiredStyles): Now returns a QValueList<NodeDesiredStyle> in place of the old map.
1870 * layout-tests/editing/style/typing-style-003-expected.txt: Results changed in an acceptable way.
1872 2005-03-02 Darin Adler <darin@apple.com>
1876 - fixed <rdar://problem/4029741> REGRESSION (188-189): <input type=text> are cleared when you hide/show them
1878 * khtml/html/html_formimpl.h: Added detach functions for both input and text area elements, since
1879 both have m_valueMatchesRenderer flags.
1880 * khtml/html/html_formimpl.cpp:
1881 (DOM::HTMLInputElementImpl::detach): Set m_valueMatchesRenderer to false, since the renderer is going away.
1882 (DOM::HTMLTextAreaElementImpl::detach): Ditto.
1884 2005-03-02 Ken Kocienda <kocienda@apple.com>
1890 <rdar://problem/4006151> in reply, caret moves to next line after toggling bold style then typing
1892 * khtml/editing/htmlediting.cpp:
1893 (khtml::ApplyStyleCommand::applyInlineStyle): Defer cleaning up empty style until the end of the
1894 function. In some situations, the render tree can get confused when we do this removal up front.
1895 I wish I understood the reasons more deeply, but this bit of code shuffling seems harmless, and
1898 2005-03-02 Darin Adler <darin@apple.com>
1902 - fixed <rdar://problem/4024966> crash happened twice in [KWQTextField setHasFocus:] + 0xe8
1904 Added more nil checks to the widget implementations. Anywhere a widget pointer is used, do a nil check,
1905 rather than relying on high level assumptions about which calls can and can't destroy the HTML element
1906 (and hence the widget). The case in the bug seems to be a case where scrolling destroyed the element.
1907 We can't be sure this fixes the bug, but we can be relatively sure we didn't introduce any new problems,
1908 because this just avoids nil-dereferencing.
1911 (-[KWQButton becomeFirstResponder]):
1912 (-[KWQButton nextKeyView]):
1913 (-[KWQButton previousKeyView]):
1914 * kwq/KWQListBox.mm:
1915 (-[KWQTableView mouseDown:]):
1916 (-[KWQTableView becomeFirstResponder]):
1917 (-[KWQTableView numberOfRowsInTableView:]):
1918 (-[KWQTableView tableViewSelectionDidChange:]):
1919 (-[KWQTableView tableView:shouldSelectRow:]):
1920 (-[KWQTableView selectionShouldChangeInTableView:]):
1921 * kwq/KWQScrollBar.mm:
1922 (-[KWQScrollBar scroll:]):
1924 (-[KWQSlider mouseDown:]):
1925 (-[KWQSlider slide:]):
1926 (-[KWQSlider becomeFirstResponder]):
1927 (-[KWQSlider nextKeyView]):
1928 (-[KWQSlider previousKeyView]):
1929 * kwq/KWQTextArea.mm:
1930 (-[KWQTextAreaTextView becomeFirstResponder]):
1931 (-[KWQTextAreaTextView resignFirstResponder]):
1932 (-[KWQTextAreaTextView mouseDown:]):
1933 * kwq/KWQTextField.mm:
1934 (-[KWQTextFieldController action:]):
1935 (-[KWQTextFieldController controlTextDidEndEditing:]):
1936 (-[KWQTextFieldController controlTextDidChange:]):
1937 (-[KWQTextFieldController textView:didHandleEvent:]):
1938 (-[KWQTextFieldController setHasFocus:]):
1940 2005-03-02 Richard Williamson <rjw@apple.com>
1942 Fixed <rdar://problem/4031483> Leak (RenderObject::createInlineBox) reproducible with Stock widget
1944 We were leaking inline block line boxes. Argh!
1948 * khtml/rendering/render_flow.cpp:
1949 (RenderFlow::dirtyLineBoxes):
1950 * khtml/rendering/render_line.cpp:
1951 (khtml::InlineBox::deleteLine):
1953 2005-03-02 Chris Blumenberg <cblu@apple.com>
1955 Fixed: <rdar://problem/3976872> REGRESSION (Mail): Pasted plain text doesn't get the proper style if pasted into newlines
1957 Reviewed by kocienda.
1959 * khtml/editing/htmlediting.cpp:
1960 (khtml::EditCommand::styleAtPosition): new, factored out from calculateStyleBeforeInsertion
1961 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): call styleAtPosition
1962 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): clear new m_insertionStyle ivar
1963 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): deref new m_insertionStyle ivar
1964 (khtml::ReplaceSelectionCommand::doApply): store the style so it later be applied when matching style
1965 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply style from m_insertionStyle when matching style
1966 * khtml/editing/htmlediting.h:
1968 2005-03-02 Maciej Stachowiak <mjs@apple.com>
1972 <rdar://problem/4031718> REGRESSION (401-401+): Safari reproducible crash setting up scope in JSLazyEventListener::parseCode authenticating to bugweb
1974 * khtml/ecma/kjs_events.cpp:
1975 (JSLazyEventListener::parseCode): If originalNode is NULL, don't
1976 mess with the scope chain.
1978 * khtml/html/html_baseimpl.cpp:
1979 (HTMLBodyElementImpl::parseHTMLAttribute): For handlers that are
1980 delcared on body but set on the document, pass NULL to avoid
1981 swizzling the scope chain. It turns out that this is what browsers
1982 do, and it finesses the crash.
1984 2005-03-02 David Harrison <harrison@apple.com>
1988 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
1990 * khtml/editing/htmlediting.cpp:
1991 (khtml::ReplaceSelectionCommand::doApply):
1993 2005-03-02 Ken Kocienda <kocienda@apple.com>
1998 <rdar://problem/4020574> REGRESSION (Mail): copy/paste first part of reply-quoted text alters downstream style
2000 The problem was that the operation to move nodes following the newly-pasted nodes did not preserve the
2001 style of these moved nodes. I have generalized some of the functions that compute and preserve styles
2002 for nodes and then apply these styles after a DOM operation.
2004 * khtml/editing/htmlediting.cpp:
2005 (khtml::ReplacementFragment::~ReplacementFragment): Call new derefNodesAndStylesInMap() helper function
2006 in place of old code that had this deref'ing inline.
2007 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls new mapDesiredStyleForNode() helper
2008 function place of old code that had this style computation inline.
2009 (khtml::ReplacementFragment::removeStyleNodes): Updated comment for new helper name.
2010 (khtml::ReplaceSelectionCommand::doApply): Now calls new helpers in place of helpers whose names were changed,
2011 or in place of pre-refactored inline code.
2012 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Renamed from applyStyleToInsertedNodes(). Now generalized
2013 to take the map of nodes to use for the fixup. This makes it possible to call this code with different maps,
2014 and that is needed to fix the bug.
2015 (khtml::mapDesiredStyleForNode): New helper function to compute the inheritable styles for a given node
2016 and map this style to the given node in the given map. This function now also includes the code that was
2017 in the removeBlockquoteColorsIfNeeded(). This latter helper has now been removed.
2018 (khtml::derefNodesAndStylesInMap): Simple helper to deref map members.
2019 * khtml/editing/htmlediting.h:
2020 (khtml::ReplacementFragment::desiredStyles): New helper to return map of nodes-to-desiredStyles.
2022 2005-03-01 Ken Kocienda <kocienda@apple.com>
2028 <rdar://problem/4011358> REGRESSION(Mail): after dragging text to mail message and deleting, typing or dragging new text doesn't work
2030 * khtml/editing/visible_position.cpp:
2031 (khtml::VisiblePosition::isCandidate): Insertion point disappearing was due to a failed
2032 check here after deleting all the content in the body element. The special "empty block"
2033 needs to add check for DOM children. A block may have straggling anonymous render children in
2034 some cases, and so the check needs to be (!DOM-kids || !render-kids).
2036 Also, I botched the last checkin trying to split these two patches in my tree. Wrong layout tests
2037 got checked in, I checked in a conflict marker in the Changelog, etc. I fixed everything with this checkin.
2039 2005-03-01 Ken Kocienda <kocienda@apple.com>
2043 Improved fix for this bug:
2045 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
2047 Maciej and I discussed this situation at length, and we came up with a better fix than I did earlier.
2049 * khtml/editing/htmlediting.cpp:
2050 (khtml::InsertParagraphSeparatorCommand::doApply): Simplify one special case so that it only handles the
2051 "last in block" situation. Remove special case for "downstream node is in different block" and handle
2052 this case with a little bit of special code in the general insertion case.
2054 Results studied to make sure there were no problems.
2056 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt
2057 * layout-tests/editing/inserting/insert-div-001-expected.txt
2058 * layout-tests/editing/inserting/insert-div-002-expected.txt
2059 * layout-tests/editing/inserting/insert-div-004-expected.txt
2060 * layout-tests/editing/inserting/insert-div-005-expected.txt
2061 * layout-tests/editing/inserting/insert-div-009-expected.txt
2062 * layout-tests/editing/inserting/insert-div-014-expected.txt
2063 * layout-tests/editing/inserting/insert-div-018-expected.txt
2064 * layout-tests/editing/inserting/insert-div-024-expected.txt
2065 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
2066 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
2067 * layout-tests/editing/pasteboard/paste-text-015-expected.txt
2068 * layout-tests/editing/style/block-style-004-expected.txt
2069 * layout-tests/editing/style/block-style-005-expected.txt
2070 * layout-tests/editing/style/block-style-006-expected.txt
2074 * layout-tests/editing/inserting/insert-div-027.html
2075 * layout-tests/editing/inserting/insert-div-027-expected.txt
2077 2005-03-01 David Hyatt <hyatt@apple.com>
2079 Fix for 4030890, regression with <sup> on Google. Fix some bogus != comparison checks in verticalPositionHint.
2083 (RenderObject::getVerticalPosition):
2085 2005-03-01 Chris Blumenberg <cblu@apple.com>
2087 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
2091 * khtml/editing/htmlediting.cpp:
2092 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
2093 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
2094 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
2095 * layout-tests/editing/deleting/smart-delete-001.html: Added.
2096 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
2097 * layout-tests/editing/deleting/smart-delete-002.html: Added.
2099 2005-03-01 Richard Williamson <rjw@apple.com>
2101 Fixed <rdar://problem/4029772> Weather widgets use a lot of memory (more that other widgets)
2103 The string objects created by KWQHeaderStringFromDictionary() leaked.
2105 Reviewed by John Louch.
2108 (KWQHeaderStringFromDictionary):
2110 2005-03-01 Jens Alfke <jens@apple.com>
2114 <rdar://problem/4004531> Simple Sun Signed Applet throws exceptions; doesn't run
2115 Two fixes for the way we extract the parameter-y goodness from <object> tags.
2117 * khtml/rendering/render_frames.cpp:
2118 (RenderPartObject::updateWidget):
2120 2005-03-01 Richard Williamson <rjw@apple.com>
2122 Fixed <rdar://problem/3990258> REGRESSION (125.12-181): top of picture that spans two pages is cut off on print from Safari
2124 The problem was due to incorrect "object truncation" in RenderFlow::paintLines.
2125 We attempt to push objects down if they don't fit on a page at
2126 paint time. If the attempt to push object down failed we just
2127 didn't paint at all.
2131 * khtml/rendering/render_flow.cpp:
2132 (RenderFlow::paintLines):
2134 2005-03-01 Chris Blumenberg <cblu@apple.com>
2136 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
2140 * khtml/editing/htmlediting.cpp:
2141 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
2142 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
2143 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
2144 * layout-tests/editing/deleting/smart-delete-001.html: Added.
2145 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
2146 * layout-tests/editing/deleting/smart-delete-002.html: Added.
2148 2005-03-01 Ken Kocienda <kocienda@apple.com>
2154 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
2156 * khtml/editing/htmlediting.cpp:
2157 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
2159 2005-03-01 Maciej Stachowiak <mjs@apple.com>
2163 <rdar://problem/4003774> REGRESSION(125-181): JavaScript problems @ Yankee/Dixie quiz
2165 Reworked how scopes are set up for event handlers to match other
2166 browser. This includes the following changes:
2168 - Special scope entries are set up at the time the event handler
2169 is created, not at the time it fires.
2171 - Special scope is only set up for event handlers set in the html
2172 source through an html attribute, not for handlers set using
2173 addEventHandler or setting JS properties like onclick through
2176 - Special scope is based on the DOM node on which the handler is
2177 an attribute, not the event target.
2179 This fixes the regression while allowing the fix to
2180 <rdar://problem/3798453> (DIG: getting variable with same name as
2181 DOM element attribute gets attribute value instead) to keep
2184 * khtml/ecma/kjs_events.cpp:
2185 (JSEventListener::handleEvent):
2186 (JSLazyEventListener::JSLazyEventListener):
2187 (JSLazyEventListener::parseCode):
2188 * khtml/ecma/kjs_events.h:
2189 * khtml/ecma/kjs_proxy.cpp:
2190 (KJSProxyImpl::createHTMLEventHandler):
2191 * khtml/ecma/kjs_proxy.h:
2192 * khtml/ecma/kjs_window.cpp:
2193 (Window::getJSLazyEventListener):
2194 * khtml/ecma/kjs_window.h:
2195 * khtml/html/html_baseimpl.cpp:
2196 (HTMLBodyElementImpl::parseHTMLAttribute):
2197 (HTMLFrameElementImpl::parseHTMLAttribute):
2198 (HTMLFrameSetElementImpl::parseHTMLAttribute):
2199 * khtml/html/html_elementimpl.cpp:
2200 (HTMLElementImpl::parseHTMLAttribute):
2201 * khtml/html/html_formimpl.cpp:
2202 (DOM::HTMLFormElementImpl::parseHTMLAttribute):
2203 (DOM::HTMLButtonElementImpl::parseHTMLAttribute):
2204 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
2205 (DOM::HTMLLabelElementImpl::parseHTMLAttribute):
2206 (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
2207 (DOM::HTMLTextAreaElementImpl::parseHTMLAttribute):
2208 * khtml/html/html_imageimpl.cpp:
2209 (HTMLImageElementImpl::parseHTMLAttribute):
2210 * khtml/html/html_objectimpl.cpp:
2211 (HTMLObjectElementImpl::parseHTMLAttribute):
2212 * khtml/khtml_part.cpp:
2213 (KHTMLPart::createHTMLEventListener):
2214 * khtml/khtml_part.h:
2215 * khtml/xml/dom_docimpl.cpp:
2216 (DocumentImpl::createHTMLEventListener):
2217 * khtml/xml/dom_docimpl.h:
2221 2005-03-01 Chris Blumenberg <cblu@apple.com>
2223 Backed out my patch since the tree was closed.
2225 * khtml/editing/htmlediting.cpp:
2226 (khtml::DeleteSelectionCommand::initializePositionData):
2227 * khtml/editing/jsediting.cpp:
2229 2005-03-01 Chris Blumenberg <cblu@apple.com>
2231 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
2235 * khtml/editing/htmlediting.cpp:
2236 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
2237 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
2238 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
2239 * layout-tests/editing/deleting/smart-delete-001.html: Added.
2240 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
2241 * layout-tests/editing/deleting/smart-delete-002.html: Added.
2243 2005-03-01 Ken Kocienda <kocienda@apple.com>
2249 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
2251 * khtml/editing/htmlediting.cpp:
2252 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
2254 2005-03-01 David Harrison <harrison@apple.com>
2258 <rdar://problem/3915560> Mail would like an SPI to enable "smart" text paste/drop
2260 * kwq/WebCoreBridge.h:
2261 * kwq/WebCoreBridge.mm:
2262 (-[WebCoreBridge smartDeleteRangeForProposedRange:]):
2263 (-[WebCoreBridge smartInsertForString:replacingRange:beforeString:afterString:]):
2266 2005-03-01 Chris Blumenberg <cblu@apple.com>
2268 Fixed: <rdar://problem/4030404> selection granularity should be set when extending selection via JS
2270 Reviewed by kocienda.
2272 * khtml/ecma/kjs_window.cpp:
2273 (SelectionFunc::tryCall): set the granularity on the part. This will allow us to write smart paste layout tests.
2274 * layout-tests/editing/pasteboard/smart-paste-001-expected.txt: Added.
2275 * layout-tests/editing/pasteboard/smart-paste-001.html: Added.
2276 * layout-tests/editing/pasteboard/smart-paste-002-expected.txt: Added.
2277 * layout-tests/editing/pasteboard/smart-paste-002.html: Added.
2278 * layout-tests/editing/pasteboard/smart-paste-003-expected.txt: Added.
2279 * layout-tests/editing/pasteboard/smart-paste-003.html: Added.
2280 * layout-tests/editing/pasteboard/smart-paste-004-expected.txt: Added.
2281 * layout-tests/editing/pasteboard/smart-paste-004.html: Added.
2282 * layout-tests/editing/pasteboard/smart-paste-005-expected.txt: Added.
2283 * layout-tests/editing/pasteboard/smart-paste-005.html: Added.
2284 * layout-tests/editing/pasteboard/smart-paste-006-expected.txt: Added.
2285 * layout-tests/editing/pasteboard/smart-paste-006.html: Added.
2286 * layout-tests/editing/pasteboard/smart-paste-007-expected.txt: Added.
2287 * layout-tests/editing/pasteboard/smart-paste-007.html: Added.
2289 2005-03-01 Chris Blumenberg <cblu@apple.com>
2291 Fixed: <rdar://problem/4029934> smart paste with plain text can add too many spaces
2293 Reviewed by kocienda.
2295 * khtml/editing/htmlediting.cpp:
2296 (khtml::ReplaceSelectionCommand::doApply): pass true for treatNBSPAsWhitespace to leadingWhitespacePosition and trailingWhitespacePosition
2297 * khtml/xml/dom_position.cpp:
2298 (DOM::isWS): take treatNBSPAsWhitespace param
2299 (DOM::Position::leadingWhitespacePosition): ditto
2300 (DOM::Position::trailingWhitespacePosition): ditto
2301 * khtml/xml/dom_position.h:
2303 2005-03-01 Ken Kocienda <kocienda@apple.com>
2309 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
2311 * khtml/editing/htmlediting.cpp:
2312 (khtml::InsertParagraphSeparatorCommand::doApply): Look for the upstream-most block to insert after
2313 when at the visible end of a block. This helps to avoid some undesirable sequences of markup which
2314 Dave says will be vary hard to render. Changing the command in this way avoids the "limitations"
2315 of the render tree by not asking it to render markup we do not want to make anyway.
2317 All these tests change, but either in insignificant ways, or for the better.
2319 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt:
2320 * layout-tests/editing/inserting/insert-div-001-expected.txt:
2321 * layout-tests/editing/inserting/insert-div-002-expected.txt:
2322 * layout-tests/editing/inserting/insert-div-004-expected.txt:
2323 * layout-tests/editing/inserting/insert-div-005-expected.txt:
2324 * layout-tests/editing/inserting/insert-div-009-expected.txt:
2325 * layout-tests/editing/inserting/insert-div-024-expected.txt:
2326 * layout-tests/editing/pasteboard/paste-text-011-expected.txt:
2327 * layout-tests/editing/pasteboard/paste-text-013-expected.txt:
2328 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
2329 * layout-tests/editing/style/block-style-004-expected.txt:
2330 * layout-tests/editing/style/block-style-005-expected.txt:
2331 * layout-tests/editing/style/block-style-006-expected.txt:
2332 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
2333 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
2334 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
2335 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
2337 New test to check specific problem mentioned in the bug.
2339 * layout-tests/editing/inserting/insert-div-026-expected.txt: Added.
2340 * layout-tests/editing/inserting/insert-div-026.html: Added.
2342 2005-02-28 Maciej Stachowiak <mjs@apple.com>
2346 <rdar://problem/4002864> REGRESSION(125-146) getElementById in onload fails in a test case involving external resources
2348 Moved management of elementById hashtable from attach/detach to
2349 insertedIntoDocument/removedFromDocument, to avoid being thrown
2350 off by temporary detaches due to style recalcs.
2352 * khtml/xml/dom_elementimpl.cpp:
2353 (ElementImpl::insertedIntoDocument):
2354 (ElementImpl::removedFromDocument):
2355 (ElementImpl::attach):
2356 (ElementImpl::updateId):
2357 * khtml/xml/dom_elementimpl.h:
2359 Make sure that insertedIntoDocument is called before firing any
2362 * khtml/xml/dom_nodeimpl.cpp:
2363 (NodeBaseImpl::dispatchChildInsertedEvents):
2365 2005-02-28 David Hyatt <hyatt@apple.com>
2367 Fix for 4028999, safari crashes when resetting if mallocsribble is on. Clip rects were being cleared using dead
2368 render objects. Change the ordering.
2372 * khtml/rendering/render_box.cpp:
2373 (RenderBox::detach):
2374 * khtml/rendering/render_layer.cpp:
2375 (RenderLayer::~RenderLayer):
2377 2005-02-28 Chris Blumenberg <cblu@apple.com>
2379 Fixed: <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
2381 Reviewed by kocienda.
2383 * khtml/editing/htmlediting.cpp:
2384 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Call updateLayout so caretMinOffset and caretMaxOffset return correct values.
2386 2005-02-28 John Sullivan <sullivan@apple.com>
2390 - WebCore part of fix for <rdar://problem/4023490> REGRESSION (125-185): Tabbing through links
2391 on frameset page gets stuck at end (tivofaq.com)
2393 * kwq/WebCoreBridge.h:
2394 add nextValidKeyViewOutsideWebFrameViews (code is in WebKit)
2396 2005-02-28 Ken Kocienda <kocienda@apple.com>
2402 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
2404 * khtml/css/css_computedstyle.cpp: inheritableProperties array now defined in css_valueimpl.cpp.
2405 * khtml/css/css_valueimpl.cpp: Define inheritableProperties array here.
2406 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Use new name for blockProperties, and use the new
2407 constant for the number of items in the array.
2408 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
2409 (DOM::CSSMutableStyleDeclarationImpl::removeInheritableProperties): New function.
2410 * khtml/css/css_valueimpl.h: Declare inheritableProperties array and numInheritableProperties extern so they
2411 can be defined in css_valueimpl.cpp and used in css_computedstyle.cpp.
2412 * khtml/editing/htmlediting.cpp:
2413 (khtml::ReplacementFragment::removeStyleNodes): This code was misguided, and removed too much style from HTML
2414 elements. Now, it removes from HTML elements only the styles that we replace later with a call to applyStyle().
2415 Also, add ID_B to list of inline "style" nodes we are willing to remove. Leaving it off was an oversight.
2417 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: ID_B fix made this result change, without any
2418 visible change in the test.
2422 * layout-tests/editing/style/smoosh-styles-003.html
2423 * layout-tests/editing/style/smoosh-styles-003-expected.txt
2425 2005-02-28 Richard Williamson <rjw@apple.com>
2427 Fixed <rdar://problem/4026985> CrashTracer: ...14 crashes at com.apple.WebCore: -[KWQPageState invalidate] + 32
2429 Added more nil checking and ASSERTS.
2430 Without a reproducible case this is hard to definitively resolve.
2432 Reviewed by John Sullivan.
2434 * kwq/KWQPageState.mm:
2435 (-[KWQPageState invalidate]):
2437 2005-02-28 Richard Williamson <rjw@apple.com>
2439 Fixed <rdar://problem/4027702> 3.5% performance regression btwn Safari-188 and Safari-400
2441 I inadvertently checked in some debugging code that disabled
2442 style sharing. Backed out that change.
2444 * khtml/css/cssstyleselector.cpp:
2445 (khtml::CSSStyleSelector::styleForElement):
2447 2005-02-28 Chris Blumenberg <cblu@apple.com>
2449 Fixed: <rdar://problem/4026639> www.bmw.ca configurator does not work with Safari
2453 * khtml/ecma/kjs_html.cpp:
2454 (KJS::HTMLElement::tryGet): when frameset.<name of frame child> is called, return the window object of the frame child
2456 2005-02-28 Ken Kocienda <kocienda@apple.com>
2462 <rdar://problem/4026906> Paste of HTML table content can break table structure
2464 * khtml/editing/htmlediting.cpp:
2465 (khtml::ReplacementFragment::pruneEmptyNodes): Call new isProbablyTableStructureNode() function to prevent
2466 removal of empty table structure nodes.
2467 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
2468 (khtml::isProbablyTableStructureNode): New helper function.
2469 * khtml/editing/htmlediting.h: Declare new helper.
2471 2005-02-28 Chris Blumenberg <cblu@apple.com>
2473 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
2475 Reviewed by kocienda.
2477 * khtml/editing/htmlediting.cpp:
2478 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): ref and deref the element while it is "floating"
2479 (khtml::ReplacementFragment::insertFragmentForTestRendering): ditto
2480 (khtml::floatRefdElement): new, keeps an element alive while its ref count is 0
2481 (khtml::createDefaultParagraphElement): removed commented out code
2482 (khtml::createBlockPlaceholderElement): ref the element and return it as "floating"
2483 (khtml::createFontElement): ditto
2484 (khtml::createStyleSpanElement): ditto
2485 * khtml/editing/htmlediting.h:
2487 2005-02-27 Maciej Stachowiak <mjs@apple.com>
2491 <rdar://problem/3993557> REGRESSION (125-180-ish): getElementsByTagName no longer works with namespace designations
2493 * khtml/xml/dom_nodeimpl.cpp:
2494 (NodeBaseImpl::getElementsByTagNameNS): When no namespace is specified, find elements
2495 of the specified name in any namespace to match Mozilla and earlier Safari behavior.
2497 2005-02-25 Darin Adler <darin@apple.com>
2501 - fixed <rdar://problem/4025618> Crash while searching at hollywoodvideo.com
2503 * khtml/html/html_formimpl.h: Added valueWithDefault.
2504 * khtml/html/html_formimpl.cpp:
2505 (DOM::HTMLInputElementImpl::appendFormData): Call valueWithDefault instead of going at the render object
2506 to try to get the default value; there may be no render object if this is display:none.
2507 (DOM::HTMLInputElementImpl::valueWithDefault): Added. Knows about the defaults for "submit" and "reset"
2508 buttons; otherwise just returns the value as-is.
2510 * khtml/rendering/render_form.h: Removed the defaultLabel member functions.
2511 * khtml/rendering/render_form.cpp:
2512 (RenderSubmitButton::rawText): Call valueWithDefault instead of using defaultLabel function here on
2513 the render side. The DOM needs to know how to deal with the default anyway for form submission.
2514 (RenderSubmitButton::defaultLabel): Removed.
2515 (RenderResetButton::defaultLabel): Removed.
2516 (RenderPushButton::defaultLabel): Removed.
2518 2005-02-25 Darin Adler <darin@apple.com>
2522 - fixed <rdar://problem/4025088> window onblur and onfocus don't fire when text field has focus
2524 * kwq/KWQKHTMLPart.h: Added setWindowHasFocus function and m_windowHasFocus data member.
2525 * kwq/KWQKHTMLPart.mm:
2526 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Took out the code that sends the focus and blur events.
2527 (KWQKHTMLPart::setWindowHasFocus): Put that code here instead.
2529 * kwq/WebCoreBridge.h: Added setWindowHasFocus: method to the bridge.
2530 * kwq/WebCoreBridge.mm: (-[WebCoreBridge setWindowHasFocus:]): Added. Calls method on the part.
2532 2005-02-25 Darin Adler <darin@apple.com>
2536 - re-fixed <rdar://problem/3665430> horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode
2538 * kwq/KWQTextArea.mm: (-[KWQTextArea _updateTextViewWidth]): Don't change the text view width
2539 to match the text area's width in the "wrap" case.
2541 2005-02-25 Ken Kocienda <kocienda@apple.com>
2547 <rdar://problem/4021518> 8A394 Mail crashes during paste: khtml::RootInlineBox::closestLeafChildForXPos
2549 * khtml/editing/visible_units.cpp:
2550 (khtml::previousLinePosition): Adding an updateLayout call at the start of the function fixes the crash, since
2551 we caught line boxes in a not-completely-updated state.
2552 (khtml::nextLinePosition): Ditto.
2554 2005-02-25 David Hyatt <hyatt@apple.com>
2556 Fix for 4010774, make sure to avoid an O(N^2) algorithm in nextRenderer() that is triggered when large
2557 DOM subtrees are inserted into documents via one insert/append call.
2559 Reviewed by kocienda
2561 * khtml/xml/dom_nodeimpl.cpp:
2562 (NodeImpl::nextRenderer):
2564 2005-02-25 Richard Williamson <rjw@apple.com>
2566 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
2568 Second pass at fixing 3382926 w/o causing layout regressions. Same concept:
2569 if directionality of text's element is RTL and first character has neutral directionality
2570 then set the initial directionality to RTL.
2574 * khtml/rendering/bidi.cpp:
2575 (khtml::RenderBlock::bidiReorderLine):
2576 (khtml::RenderBlock::determineStartPosition):
2580 2005-02-25 Ken Kocienda <kocienda@apple.com>
2584 Roll out Chris' change to fix this bug:
2586 <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
2588 That code change is responsible for all these new crashers:
2590 <rdar://problem/4025177> crash copying safari.apple.com into Blot document
2591 <rdar://problem/4025184> crash in DOM::NodeImpl::parentNode copying "New!" from google.com to Blot
2592 <rdar://problem/4025214> crash in DOM::NodeImpl::getRect loading paste-match-style-001.html
2594 Since we wish to close the tree for a build right now, I am rolling out rather than investigating.
2596 * khtml/editing/htmlediting.cpp:
2597 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded)
2598 (khtml::ReplacementFragment::insertFragmentForTestRendering)
2599 (khtml::createDefaultParagraphElement)
2600 (khtml::createBlockPlaceholderElement)
2601 (khtml::createFontElement)
2602 (khtml::createStyleSpanElement)
2603 * khtml/editing/htmlediting.h
2605 2005-02-25 Ken Kocienda <kocienda@apple.com>
2611 <rdar://problem/4020108> Pasting text into message makes Mail crash reproducibly
2613 Note that, even with this fix, development build will crash until this bug is fixed:
2614 <rdar://problem/4024996> Applying block styles can cause assertion failure in inline style removal
2616 This will not crash deployment builds, so I am going to land.
2618 * khtml/editing/htmlediting.cpp:
2619 (khtml::ApplyStyleCommand::applyBlockStyle): Applying block styles can make the loop to reach beyondEnd
2620 fail since the structure of the document can change. Cache the next node first before operating on it,
2623 2005-02-25 Vicki Murley <vicki@apple.com>
2625 - recommit this change, since rolling it out did NOT fix the performance regression!
2627 2005-02-23 Darin Adler <darin@apple.com>
2631 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
2633 The key was to change things around so that we don't push text from the DOM to the widget
2634 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
2635 during the blur process.
2637 * khtml/html/html_formimpl.cpp:
2638 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
2639 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
2640 new value is set here.
2641 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
2643 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
2644 to true, and also sends out the input event. It's better to have this here than in the renderer code.
2645 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
2646 m_dirtyvalue) and m_valueMatchesRenderer as false.
2647 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
2648 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
2649 where the value came from.
2650 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
2651 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
2652 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
2654 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
2655 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
2656 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
2658 * khtml/rendering/render_form.cpp:
2659 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
2661 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
2663 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
2664 (RenderTextArea::handleFocusOut): Ditto.
2665 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
2666 DOM if valueMatchesRenderer is true.
2667 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
2669 2005-02-25 Chris Blumenberg <cblu@apple.com>
2671 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
2675 * khtml/editing/htmlediting.cpp:
2676 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
2677 (khtml::ReplacementFragment::insertFragmentForTestRendering):
2678 (khtml::floatRefdElement):
2679 (khtml::createDefaultParagraphElement):
2680 (khtml::createBlockPlaceholderElement):
2681 (khtml::createFontElement):
2682 (khtml::createStyleSpanElement):
2683 * khtml/editing/htmlediting.h:
2685 2005-02-25 Darin Adler <darin@apple.com>
2687 * kwq/character-sets.txt: Checked in updated file. This new file has no effect, because none of the
2688 changes affect character sets that we support, but it's good to have the latest file in here, and
2689 completely safe because I checked that the generated files have not changed.
2691 2005-02-25 Vicki Murley <vicki@apple.com>
2695 - back out this change, since it causes a 3.5% performance regression
2697 2005-02-23 Darin Adler <darin@apple.com>
2701 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
2703 The key was to change things around so that we don't push text from the DOM to the widget
2704 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
2705 during the blur process.
2707 * khtml/html/html_formimpl.cpp:
2708 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
2709 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
2710 new value is set here.
2711 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
2713 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
2714 to true, and also sends out the input event. It's better to have this here than in the renderer code.
2715 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
2716 m_dirtyvalue) and m_valueMatchesRenderer as false.
2717 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
2718 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
2719 where the value came from.
2720 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
2721 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
2722 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
2724 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
2725 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
2726 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
2728 * khtml/rendering/render_form.cpp:
2729 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
2731 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
2733 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
2734 (RenderTextArea::handleFocusOut): Ditto.
2735 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
2736 DOM if valueMatchesRenderer is true.
2737 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
2739 2005-02-25 Darin Adler <darin@apple.com>
2743 - fixed <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
2745 * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply):
2746 Use the insertNodeAfterAndUpdateNodesInserted and insertNodeBeforeAndUpdateNodesInserted
2747 functions to add the leading and trailing spaces for smart paste.
2749 2005-02-25 David Hyatt <hyatt@apple.com>
2751 Back out fix for 3382926, since it breaks LTR text inside RTL contexts.
2755 * khtml/rendering/bidi.cpp:
2756 (khtml::BidiIterator::direction):
2758 2005-02-25 David Hyatt <hyatt@apple.com>
2760 Fix for 3975039, scrolling is slow in huge RSS views. Optimize the calculation of clip rects for overflow:hidden
2761 layers. Also optimize layer movement when scrolling overflow sections.
2765 * khtml/rendering/render_layer.cpp:
2767 (ClipRects::operator delete):
2768 (ClipRects::detach):
2769 (RenderLayer::RenderLayer):
2770 (RenderLayer::~RenderLayer):
2771 (RenderLayer::updateLayerPosition):
2772 (RenderLayer::removeOnlyThisLayer):
2773 (RenderLayer::insertOnlyThisLayer):
2774 (RenderLayer::scrollToOffset):
2775 (RenderLayer::hitTest):
2776 (RenderLayer::calculateClipRects):
2777 (RenderLayer::calculateRects):
2778 (RenderLayer::containsPoint):
2779 (RenderLayer::clearClipRects):
2780 (RenderLayer::clearClipRect):
2781 * khtml/rendering/render_layer.h:
2782 (khtml::ClipRects::m_refCnt):
2783 (khtml::ClipRects::overflowClipRect):
2784 (khtml::ClipRects::fixedClipRect):
2785 (khtml::ClipRects::posClipRect):
2786 (khtml::ClipRects::ref):
2787 (khtml::ClipRects::deref):
2788 (khtml::RenderLayer::clipRects):
2789 * khtml/rendering/render_object.cpp:
2790 (RenderObject::setStyle):
2792 2005-02-24 Maciej Stachowiak <mjs@apple.com>
2794 Reviewed by Darin and Dave a while ago.
2796 <rdar://problem/3996685> REGRESSION: Crash in KWQVectorImpl::at loading http://maps.google.com/mapfiles/homepanel.xsl
2798 * kwq/WebCoreBridge.mm:
2799 (formElementFromDOMElement): Check for isHTMLElement() as well as
2800 id() == ID_FORM. This seems like an impossible situation, but
2801 papering over it seems more expedient for the time being.
2803 2005-02-24 Richard Williamson <rjw@apple.com>
2805 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
2807 Use mirror characters correctly when rendering with RTL directionality.
2811 * khtml/rendering/bidi.cpp:
2812 (khtml::BidiIterator::direction):
2814 2005-02-24 Richard Williamson <rjw@apple.com>
2816 Fixed <rdar://problem/3985889> REGRESSION (125-180): setting <img> src to GIF that already animated does not animate; just shows final frame
2820 * WebCore.pbproj/project.pbxproj:
2821 * khtml/html/html_imageimpl.cpp:
2822 (HTMLImageLoader::updateFromElement):
2823 * khtml/rendering/render_image.cpp:
2824 (RenderImage::resetAnimation):
2825 * khtml/rendering/render_image.h:
2826 * khtml/rendering/render_list.cpp:
2827 (RenderListMarker::setStyle):
2828 (RenderListMarker::paint):
2829 * khtml/rendering/render_list.h:
2833 (QPixmap::resetAnimation):
2834 * kwq/WebCoreImageRenderer.h:
2836 2005-02-24 Chris Blumenberg <cblu@apple.com>
2838 Fixed: <rdar://problem/4020110> Safari crashes in setAllData while taking a www.zoomerang.com survey
2842 * kwq/KWQResourceLoader.mm:
2843 (-[KWQResourceLoader finishJobAndHandle:]): clear the job after we've deleted to avoid reentrancy
2845 2005-02-24 Darin Adler <darin@apple.com>
2849 - fixed <rdar://problem/4023360> REGRESSION (186-187): image file upload is broken at pep.apple.com
2851 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::appendFormData): Return true after
2852 setting up the form data for an uploaded file. The old code would fall through to the ISINDEX
2853 case and send double form data (the filename instead of the file contents the second time).
2855 2005-02-24 David Harrison <harrison@apple.com>
2859 <rdar://problem/3990849> AX: textMarkerRange for an AXUIElement within an AXWebArea
2861 * kwq/KWQAccObject.mm:
2862 (-[KWQAccObject textMarkerRange]):
2863 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
2864 (-[KWQAccObject doAXTextMarkerRangeForUIElement:]):
2865 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
2866 Added AXTextMarkerRangeForUIElement, or you can send textMarkerRange to the UIElement itself.
2868 2005-02-24 David Harrison <harrison@apple.com>
2872 <rdar://problem/4004279> 3 AXSelectedTextChanged notifications are firing each time I type a character
2874 * khtml/xml/dom_docimpl.cpp:
2875 (DocumentImpl::updateSelection):
2876 Send notification only if the selection is not null. This safely ignores transitory selections set during editing.
2878 2005-02-24 Darin Adler <darin@apple.com>
2882 - fixed <rdar://problem/3987619> in some cases, text doesn't resize with Format->Style->Bigger/Smaller
2884 * khtml/editing/htmlediting.cpp:
2885 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): Only call nodeFullySelected for non-text nodes.
2886 Text nodes are already split so they're either in the range and full selected or out of the range.
2887 And nodeFullySelected doesn't work for text nodes.
2888 (khtml::ApplyStyleCommand::nodeFullySelected): Add an assertion, since this function only works for elements,
2890 (khtml::ApplyStyleCommand::nodeFullyUnselected): Ditto.
2892 - make big improvement in <rdar://problem/3953636> Mail hung for ~10sec changing font of 84328 characters: khtml::ApplyStyleCommand::nodeFullySelected
2894 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints): Improve algorithm based on suggestion
2897 - fixed <rdar://problem/4020305> REGRESSION (185-186): loading image in new window using document.write fails
2899 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::open): If there is no parent document, don't blow away the base URL.
2901 - fixed <rdar://problem/4021701> REGRESSION (188-188+): form not submitted after pressing <return> at http://hrweb.apple.com
2903 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchMouseEvent): Send activate event in the case where the event
2904 sent is a KHTML_CLICK_EVENT, not CLICK_EVENT.
2906 2005-02-23 Kevin Decker <kdecker@apple.com>
2910 Fixed <rdar://problem/4020747> REGRESSION: stray </applet> tags crash Safari
2912 * khtml/html/htmlparser.cpp:
2913 (KHTMLParser::processCloseTag): Made a typesafe check that prevents crashes
2914 whenever there is a closing applet tag without an actual <applet> in the first place.
2915 Now verifies the current token is ID_APPLET before casting it to an HTMLAppletElementImpl.
2918 2005-02-23 Ken Kocienda <kocienda@apple.com>
2924 <rdar://problem/3977962> font loses bold style after pasting next to existing text and pressing return
2926 * khtml/editing/htmlediting.cpp:
2927 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Problem here was
2928 that we were doing work in cases where we should not, and content whose style would have
2929 been correct if we had done nothing was getting clobbered. It turns out that extra work
2930 to apply style to the new paragraph added in this command only needs to be done if we're
2931 at the boundaries of a paragraph. Otherwise, content that is moved as part of the work
2932 of the command will lend their styles to the new paragraph without any extra work needed.
2933 So, make this position check and return unless at a paragraph boundary.
2937 * layout-tests/editing/style/block-styles-007-expected.txt
2938 * layout-tests/editing/style/block-styles-007.html
2940 2005-02-23 Ken Kocienda <kocienda@apple.com>
2946 <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a selection starting from end of line once
2948 Problem is with the way we figure out whether to add or remove a style based on
2949 the current selection. In this case, the code is looking at the end of the
2950 previous line, which is not bold, and deduces incorrectly that the operation is
2951 a "make bold". Then the style code runs to make bold, but there is nothing on
2952 the end of the previous line to embolden, so we get into a cycle where the same
2953 thing happens each time cmd-b is hit.
2955 * khtml/khtml_part.cpp:
2956 (KHTMLPart::selectionComputedStyle): Call editingStartPosition() to get the right position for the font determination.
2957 * khtml/xml/dom2_rangeimpl.cpp:
2958 (DOM::RangeImpl::editingStartPosition): New helper function that "does the right thing" based on whether the
2959 selection is a caret or a range, moving upstream for the former, and downstream for the latter.
2960 * khtml/xml/dom2_rangeimpl.h:
2961 * kwq/KWQKHTMLPart.mm:
2962 (KWQKHTMLPart::fontForSelection): Call editingStartPosition() to get the right position for the font determination.
2966 * layout-tests/editing/style/style-boundary-001-expected.txt
2967 * layout-tests/editing/style/style-boundary-001.html
2968 * layout-tests/editing/style/style-boundary-002-expected.txt
2969 * layout-tests/editing/style/style-boundary-002.html
2970 * layout-tests/editing/style/style-boundary-003-expected.txt
2971 * layout-tests/editing/style/style-boundary-003.html
2972 * layout-tests/editing/style/style-boundary-004-expected.txt
2973 * layout-tests/editing/style/style-boundary-004.html
2975 2005-02-23 Richard Williamson <rjw@apple.com>
2977 Fixed <rdar://problem/3985579> 8A367: Dashboard: Stock widget not visible when click remove to remove single char ticker symbol
2979 Explicitly remove scroll bar views when removing them from
2982 Don't paint synchronously when the scroll position changes,
2983 this caused funky clip problems.
2987 * khtml/rendering/render_layer.cpp:
2988 (RenderLayer::scrollToOffset):
2989 (RenderLayer::setHasHorizontalScrollbar):
2990 (RenderLayer::setHasVerticalScrollbar):
2991 (RenderLayer::updateScrollInfoAfterLayout):
2993 2005-02-23 Ken Kocienda <kocienda@apple.com>
2999 <rdar://problem/3959996> REGRESSION (Mail): cursor moves to beginning of document when click is past end
3001 * khtml/rendering/render_block.cpp:
3002 (khtml::RenderBlock::positionForCoordinates): Skip blocks that are invisible or have no height when
3003 looking for a child to pass off to. And save away the last visible block with a height to pass off
3004 to if there is no child at the right y-coordinate.
3006 2005-02-23 David Harrison <harrison@apple.com>
3010 <rdar://problem/4010059> BoundsForTextMarkerRange does not update with scrolled web area
3012 * kwq/KWQAccObject.mm:
3013 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
3014 Adjust for scrolling.
3016 2005-02-22 Maciej Stachowiak <mjs@apple.com>
3020 <rdar://problem/3949790> hitting return after pasted styled line results in extra content getting the style
3022 * khtml/editing/htmlediting.cpp:
3023 (khtml::InsertParagraphSeparatorCommand::doApply): In the case
3024 where the start block is the root, insert the newly created DIV at
3025 the end of the root block instead of after the last sibling in the
3026 start node, since the start node could be inside other
3027 style-affecting nodes and we don't want to reparent its cousins
3030 2005-02-23 David Harrison <harrison@apple.com>
3034 <rdar://problem/4014691> switch to correctly spelled NSAccessibilityForegroundColorTextAttribute constant
3036 Also removed two older, now unneeded, wrappers.
3038 * kwq/KWQAccObject.mm:
3039 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
3040 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
3041 Removed these older, now unneeded, wrappers.
3043 (NSAccessibilityForegroundColorTextAttributeWrapper):
3044 New wrapper for NSAccessibilityForegroundColorTextAttribute.
3046 (AXAttributeStringSetStyle):
3047 Use NSAccessibilityForegroundColorTextAttributeWrapper.
3049 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
3050 Remove uses of visiblePositionForStartOfTextMarkerRange and visiblePositionForEndOfTextMarkerRange.
3052 2005-02-23 David Harrison <harrison@apple.com>
3056 <rdar://problem/3524784> AX hit test doesn't return info when done in empty space of content area
3058 * kwq/KWQAccObject.mm:
3059 (-[KWQAccObject accessibilityHitTest:]):
3060 Return unignored object.
3062 2005-02-23 Darin Adler <darin@apple.com>
3066 - fixed <rdar://problem/4006509> REGRESSION (171-172): Setting CSS -khtml-user-modify property triggers crash
3068 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyProperty):
3069 Removed the code that changes the style of the element. This was never needed, and caused the
3070 style to be modified while we were iterating it.
3072 2005-02-23 Ken Kocienda <kocienda@apple.com>
3078 <rdar://problem/3980209> Mail crashed when I pressed Cmd-Shift-[ (nil-deref in ApplyStyleCommand::addBlockStyleIfNeeded)
3080 * khtml/editing/htmlediting.cpp:
3081 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Reordered the new block
3082 insertion so that it come before the move. The logic stays exactly the same, however, with the old
3083 ordering, the new block could want to become a child of itself come insertion time. I considered
3084 making a more complicated code change to fix this problem, but the simple reordering works just
3085 as well, and seems less risky.
3087 These all changed in an insignificant way. It seems that with the new code, some empty text nodes
3088 got reordered in the document. This has no effect on anything visible to the user.
3090 * layout-tests/editing/style/create-block-for-style-003-expected.txt
3091 * layout-tests/editing/style/create-block-for-style-004-expected.txt
3092 * layout-tests/editing/style/create-block-for-style-009-expected.txt
3093 * layout-tests/editing/style/create-block-for-style-011-expected.txt
3094 * layout-tests/editing/style/create-block-for-style-013-expected.txt
3096 2005-02-23 Darin Adler <darin@apple.com>
3100 - fixed <rdar://problem/4013986> REGRESSION (173-174): onclick event not sent when mouse click on checkbox is double-click
3102 We need to send an onclick event *and* an ondblclick event when we process a double click.
3104 * khtml/khtmlview.cpp: (KHTMLView::dispatchMouseEvent): In the case where we're sending a CLICK_EVENT,
3105 follow it by a KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT when handling a double click, and a DOMACTIVATE_EVENT.
3106 We no longer do the DOMACTIVATE_EVENT in dispatchGenericEvent.
3107 * khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked): send only CLICK_EVENT here, and
3108 lets dispatchMouseEvent deal with the other subsequent events.
3109 * khtml/xml/dom_nodeimpl.cpp:
3110 (NodeImpl::dispatchGenericEvent): Remove the code that sends a DOMACTIVATE_EVENT, since there's no longer
3111 a good way to figure out if this is the last event that should be sent before it is.
3112 (NodeImpl::dispatchMouseEvent): Set the meta key modifier here (as it already is set elsewhere), and
3113 follow up a CLICK_EVENT with KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT, and DOMACTIVATE_EVENT as above.
3115 2005-02-23 Darin Adler <darin@apple.com>
3119 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
3121 The key was to change things around so that we don't push text from the DOM to the widget
3122 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
3123 during the blur process.
3125 * khtml/html/html_formimpl.cpp:
3126 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
3127 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
3128 new value is set here.
3129 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
3131 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
3132 to true, and also sends out the input event. It's better to have this here than in the renderer code.
3133 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
3134 m_dirtyvalue) and m_valueMatchesRenderer as false.
3135 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
3136 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
3137 where the value came from.
3138 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
3139 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
3140 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
3142 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
3143 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
3144 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
3146 * khtml/rendering/render_form.cpp:
3147 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
3149 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
3151 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
3152 (RenderTextArea::handleFocusOut): Ditto.
3153 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
3154 DOM if valueMatchesRenderer is true.
3155 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
3157 2005-02-22 Richard Williamson <rjw@apple.com>
3159 Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions
3161 Just set dashboard dirty bit when overflow scrolling changes.
3163 Don't do comparison of regions in before scroll regions are
3164 added, instead do it in WebKit after automatic scroll regions
3169 * khtml/css/cssparser.cpp:
3170 (CSSParser::parseDashboardRegions): Cleaned up comments
3171 * khtml/css/cssstyleselector.cpp:
3172 (khtml::CSSStyleSelector::styleForElement): Cleaned up comments
3174 * khtml/khtmlview.cpp:
3175 (KHTMLView::updateDashboardRegions):
3176 * khtml/rendering/render_layer.cpp:
3177 (RenderLayer::updateScrollInfoAfterLayout):
3178 * kwq/WebDashboardRegion.m:
3179 (-[WebDashboardRegion isEqual:]):
3181 2005-02-22 Chris Blumenberg <cblu@apple.com>
3183 Fixed: <rdar://problem/3976872> Pasted plain text doesn't get the proper style if pasted into newlines
3187 * khtml/editing/htmlediting.cpp:
3188 (khtml::ReplaceSelectionCommand::doApply): don't clear the typing style when matching style
3189 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply the typing style when matching style
3190 * khtml/editing/jsediting.cpp:
3191 * khtml/khtml_part.cpp:
3192 (KHTMLPart::pasteAndMatchStyle): new
3193 * khtml/khtml_part.h:
3194 * kwq/KWQKHTMLPart.h:
3195 * kwq/KWQKHTMLPart.mm:
3196 (KWQKHTMLPart::issuePasteAndMatchStyleCommand): new
3197 * kwq/WebCoreBridge.h:
3198 * layout-tests/editing/editing.js:
3200 2005-02-22 Darin Adler <darin@apple.com>
3204 - fixed <rdar://problem/4006596> REGRESSION (183-184): crash in DOM::DocumentImpl::setFocusNode(DOM::NodeImpl*)
3206 * khtml/xml/dom_docimpl.cpp:
3207 (widgetForNode): Added helper.
3208 (DocumentImpl::setFocusNode): Re-get the widget for the node after calling updateLayout.
3209 The updateLayout can destroy the old widget, so we can't keep a stale widget pointer around.
3211 2005-02-22 Ken Kocienda <kocienda@apple.com>
3217 <rdar://problem/4003463> Mail.app HTML uses inline styling markup not understood by Entourage and Eudora
3219 * khtml/editing/htmlediting.cpp:
3220 (khtml::isEmptyFontTag): Helper for removing <font> tags.
3221 (khtml::StyleChange::styleModeForParseMode): Helper to map a document parse mode to a use/don't use
3222 legacy-html-styles value.
3223 (khtml::StyleChange::checkForLegacyHTMLStyleChange): Add support for colors, font faces, and font sizes.
3224 (khtml::ApplyStyleCommand::isHTMLStyleNode):
3225 (khtml::ApplyStyleCommand::removeHTMLFontStyle):
3226 (khtml::ApplyStyleCommand::applyTextDecorationStyle): Now call styleModeForParseMode to determine
3227 whether to use legacy html styles or not.
3228 (khtml::ApplyStyleCommand::removeInlineStyle): Now properly removes <font> styles.
3229 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
3230 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
3231 (khtml::createFontElement): Helper for applying <font> elements.
3232 * khtml/editing/htmlediting.h: All the following support the new bits of data we need to store.
3233 (khtml::StyleChange::applyFontColor)
3234 (khtml::StyleChange::applyFontFace)
3235 (khtml::StyleChange::applyFontSize)
3236 (khtml::StyleChange::fontColor)
3237 (khtml::StyleChange::fontFace)
3238 (khtml::StyleChange::fontSize)
3240 Test results updated now that we will write out <font> tags for quirks mode documents.
3242 * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt
3243 * layout-tests/editing/style/block-style-004-expected.txt
3244 * layout-tests/editing/editing/pasteboard/paste-text-011-expected.txt
3245 * layout-tests/editing/style/block-style-005-expected.txt
3246 * layout-tests/editing/style/block-style-006-expected.txt
3247 * layout-tests/editing/style/smoosh-styles-001-expected.txt
3248 * layout-tests/editing/style/smoosh-styles-002-expected.txt
3250 2005-02-22 Maciej Stachowiak <mjs@apple.com>
3254 <rdar://problem/4017066> crash in KJS::ValueImp::dispatchType() every time I load www.nytimes.com/pages/automobiles
3256 When creating option elements, use lowercase "option" instead of
3257 uppercase "OPTION" to create option elements, because only
3258 lowercase works for XHTML.
3260 * khtml/ecma/kjs_html.cpp:
3261 (KJS::HTMLSelectCollection::tryPut):
3262 (OptionConstructorImp::construct):
3264 2005-02-22 Chris Blumenberg <cblu@apple.com>
3266 WebCore fix for: <rdar://problem/3918056> Mail not line breaking my <pre> formatted emails on replies
3268 Mail must 4018993 to fully address the problem.
3270 Reviewed by kocienda.
3272 * khtml/editing/markup.cpp:
3273 (khtml::startMarkup): don't compute style for text in PRE tags
3274 (khtml::createMarkup): include PRE if it is an ancestor of the nodes in the range
3276 2005-02-21 Richard Williamson <rjw@apple.com>
3278 Fixed <rdar://problem/4008338> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
3280 There was a long standing bug in cssText(). Double value were always cast int! So,
3281 opacity values values were incorrectly converted to text, i.e. 0.75 became 0.
3283 The problem was newly triggered because we parse the css for opacity *TWICE*. This is a result of
3284 incorrectly "invalidating" the style attribute (from fix for 3790449). The second parse was from
3285 the cssText() of the style.
3289 * khtml/css/css_valueimpl.cpp:
3290 (DOM::CSSPrimitiveValueImpl::cssText):
3292 2005-02-21 David Hyatt <hyatt@apple.com>
3294 Fix for 4017204, apply the same fix to the base class nodeAtPoint that was already applied to RenderBlock.
3295 Skip elements with layers and inline flows. Demoted <form>s can end up causing trouble otherwise.
3297 Reviewed by Richard Williamson
3299 * khtml/rendering/render_box.cpp:
3300 (RenderBox::nodeAtPoint):
3302 2005-02-21 David Hyatt <hyatt@apple.com>
3304 Fix for 4017033, CSS is being parsed twice. Make sure to always validate the style attribute when it is
3305 initially parsed. Add code to clean up decls when the style attribute is completely removed. Add a new
3306 synchronizing boolean that avoids reparsing the style declaration when the attribute is simply
3307 being synced up to the declaration.
3311 * khtml/css/css_valueimpl.cpp:
3312 (DOM::CSSMutableStyleDeclarationImpl::setChanged):
3313 * khtml/html/html_elementimpl.cpp:
3314 (HTMLElementImpl::invalidateStyleAttribute):
3315 (HTMLElementImpl::updateStyleAttributeIfNeeded):
3316 (HTMLElementImpl::HTMLElementImpl):
3317 (HTMLElementImpl::~HTMLElementImpl):
3318 (HTMLElementImpl::destroyInlineStyleDecl):
3319 (HTMLElementImpl::mapToEntry):
3320 (HTMLElementImpl::parseHTMLAttribute):
3321 * khtml/html/html_elementimpl.h:
3322 * khtml/xml/dom_elementimpl.cpp:
3323 (ElementImpl::ElementImpl):
3324 (ElementImpl::setAttribute):
3325 * khtml/xml/dom_elementimpl.h:
3326 (DOM::ElementImpl::updateStyleAttributeIfNeeded):
3330 2005-02-21 Darin Adler <darin@apple.com>
3332 - fixed Panther deployment build
3334 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Put more stuff inside #if.
3336 2005-02-21 David Harrison <harrison@apple.com>
3340 <rdar://problem/3943090> REGRESSION (Mail): Spelling underline incompletely erased following certain steps
3342 * khtml/rendering/render_text.cpp:
3343 (InlineTextBox::paintMarker):
3344 Make sure underline is placed within the text bounds.
3347 * kwq/KWQPainter.mm:
3348 (QPainter::misspellingLineThickness):
3349 * kwq/WebCoreTextRenderer.h:
3350 Add misspellingLineThickness for use by InlineTextBox::paintMarker.
3352 2005-02-21 Darin Adler <darin@apple.com>
3356 - fixed <rdar://problem/4012978> -[DOMRange markupString] crashes when range contains only a text node with a single space
3358 * khtml/editing/markup.cpp: (khtml::createMarkup): Added updateLayout calls, and added a missing
3361 2005-02-21 Darin Adler <darin@apple.com>
3365 - fixed <rdar://problem/4005435> Safari hung while pasting text into a <textarea> (Panther-only)
3367 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Don't setAutohidesScrollers:YES on Panther.
3369 2005-02-21 Ken Kocienda <kocienda@apple.com>
3375 <rdar://problem/4015499> REGRESSION (186-187): pasted quoted text starting with a blank line increases quote level of pasted text when pasted
3377 * khtml/editing/markup.cpp:
3378 (khtml::markup): Changed over to ASSERT instead of assert.
3379 (khtml::createMarkup): The issue was that the code to add parents all the way back to the common ancestor
3380 block did not check for blocks whose markup had already been added, and could result in adding markup for
3381 nodes twice (hence the additional and erroneous quote level). Now there is a new check that will
3382 only add markup for those nodes before the start of the selection range. This fixes the bug.
3383 (khtml::createFragmentFromMarkup): Changed over to ASSERT instead of assert.
3384 (khtml::createFragmentFromText): Ditto.
3386 2005-02-21 Ken Kocienda <kocienda@apple.com>
3392 <rdar://problem/4015494> REGRESSION (186-187) <cr> removed if quoted word is copy/pasted on line immediately above quoted text
3394 * khtml/editing/htmlediting.cpp:
3395 (khtml::ReplaceSelectionCommand::doApply): Relatively new check designed to remove a <br> element when
3396 that element was on a line by itself did not do an adequate check for this condition, causing the
3397 failure described in the bug. Fixed.
3399 2005-02-19 Ken Kocienda <kocienda@apple.com>
3403 * khtml/editing/htmlediting.cpp:
3404 (khtml::matchNearestBlockquoteColorString): New function which abstracts away the CSS property we use
3405 for this pseudo-color.
3406 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Set the new nearestBlockquoteColorString
3407 psuedo-color here, rather than removing colors as was done before.
3408 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): Check for the pseudo-color in the desired
3409 style, and determine the real color based on the nearest blockquote (or none) to the node.
3410 (khtml::nearestMailBlockquote): Name change from closestMailBlockquote to match new property better.
3412 All the rest of this change is the mechanical coding you need to do to add a new CSS property, in this
3413 case, -khtml-match-nearest-mail-blockquote-color.
3415 * khtml/css/css_computedstyle.cpp:
3416 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue)
3417 * khtml/css/cssparser.cpp:
3418 (CSSParser::parseValue):
3419 * khtml/css/cssproperties.c:
3422 * khtml/css/cssproperties.h:
3423 * khtml/css/cssproperties.in:
3424 * khtml/css/cssstyleselector.cpp:
3425 (khtml::CSSStyleSelector::applyProperty)
3426 * khtml/css/cssvalues.c:
3428 * khtml/css/cssvalues.h:
3429 * khtml/css/cssvalues.in:
3430 * khtml/rendering/render_style.h:
3431 (khtml::RenderStyle::matchNearestMailBlockquoteColor)
3432 (khtml::RenderStyle::setMatchNearestMailBlockquoteColor)
3433 (khtml::RenderStyle::initialMatchNearestMailBlockquoteColor)
3435 2005-02-19 Ken Kocienda <kocienda@apple.com>
3441 <rdar://problem/4014228> REGRESSION (186-187) extra, uneditable lines inserted above and below a line of pasted quoted text
3442 <rdar://problem/4014393> REGRESSION (186-187) pasted quoted text gets extra <cr>s when pasted at top of document
3444 * khtml/editing/htmlediting.cpp:
3445 (khtml::ReplacementFragment::ReplacementFragment): Part of a general refactoring of how
3446 the fragment is inserted into the document, rendered, and then tested for certain
3447 important pieces of information that are required for pasting.
3448 (khtml::ReplacementFragment::insertFragmentForTestRendering): New helper. Handles inserting
3449 the fragment nodes into the document.
3450 (khtml::ReplacementFragment::restoreTestRenderingNodesToFragment): Removes nodes from the
3451 document, and restores them to the fragment.
3452 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Factored out code that
3453 did this before into its own function.
3454 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
3455 (khtml::ReplacementFragment::countRenderedBlocks): This is a real improvement, as it
3456 eliminates a major use of the isProbablyBlock() function. Now, the blocks that are
3457 counted are real, rendered blocks.
3458 (khtml::ReplacementFragment::removeStyleNodes): Made this function retain margin-zeroing
3459 CSS properties on paragraphs. This does two things: 1) It helps us to maintain good behavior
3460 in the short term while there are still versions of Mail out there that use <p> elements
3461 instead of <div> elements for new paragraphs; and 2) It will help to maintain the compatibility
3462 with other mail clients that use <p> elements for their paragraphs but render them themselves
3463 with no margins as the result of quirks.
3464 (khtml::ReplaceSelectionCommand::doApply): Do some work to fix up and improve the handling
3465 of blank lines, be they <p> elements or <br> elements, that can be removed after pasting. This,
3466 coupled with the refactoring, fixes 4014393.
3467 * khtml/editing/htmlediting.h: Updated for new functions.
3468 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Updated results, actually improved with this change.
3469 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Ditto.
3471 2005-02-19 Kevin Decker <kdecker@apple.com>
3475 Fixed <rdar://problem/4010765> Flash player can be used to arbitrarily open popup windows without user permission
3477 Our window.open() policy is to refuse the <script>window.open(...)</script> case and allow the inline the <a href="javascript:window.open('foo')> case. Clever advertisers at some point realized that by executing their Javascript through the Flash plugin, Safari would always treat their code as the inline case, and thus, they were able to work around our popup blocker.
3479 * kwq/WebCoreBridge.h:
3480 * kwq/WebCoreBridge.mm:
3481 (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Changed this to invoke the new stringByEvaluatingJavaScriptFromString:forceUserGesture method below.
3482 (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]): Let the WebKit make the determination if this was a user originated gesture or not; we must no longer assume this is always the case.
3484 2005-02-18 Chris Blumenberg <cblu@apple.com>
3486 Fixed: <rdar://problem/3951196> REGRESSION (Mail): too many levels of reply quotes after certain steps
3488 Reviewed by kocienda.
3490 * khtml/editing/htmlediting.cpp:
3491 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
3492 - If we find a new start node, update topBlockquote so we don't use too many block quotes for the contents following the new line.
3493 - Build up the list of ancestors after we've determined the actual topBlockquote.
3494 - Don't insert an extra new line if there is a new start node.
3496 2005-02-19 Chris Blumenberg <cblu@apple.com>
3498 Fixed: <rdar://problem/3978461> smart paste is broken
3502 * khtml/editing/htmlediting.cpp:
3503 (khtml::ReplaceSelectionCommand::doApply): properly check for leading and trailing whitespace. These checks were incorrectly reversed. Also check if we're pasting at the beginning or end of a line. We should not insert spaces in either case.
3505 2005-02-18 Adele Amchan <adele@apple.com>
3509 Fix for <rdar://problem/3975568> REGRESSION(125-180)Australian Open pages have drawing problem
3511 This patch fixes two problems caused by our added support for custom tags. First, the layout problem at the sites mentioned in the bug
3512 was caused by custom tags within tables. In checkChild, we needed to treat these tags as spans so they get placed correctly in the DOM tree.
3513 Also, we were indexing the tagPriority and endTag arrays with id values from the custom tags that were greater than the size of the array. So now
3514 we have functions to check for the custom tags, and again, treat them as spans. To avoid confusion, we changed the names of the arrays to
3515 endTagArray and tagPriorityArray.
3517 * khtml/html/dtd.h: changed all uses of the endTag array to endTagArray for our new wrapper functions
3518 (DOM::tagPriority): added function to check array bounds and to treat custom tags as spans
3519 (DOM::endTagRequirement): added function to check array bounds and to treat custom tags as spans
3520 * khtml/html/dtd.cpp: changed name of endTag and tagPriority arrays to endTagArray and tagPriorityArray
3521 (DOM::checkChild): treat custom tags as spans during this check
3522 * khtml/html/html_elementimpl.cpp: changed all uses of the endTag array to the endTagRequirement function
3523 (HTMLElementImpl::createContextualFragment):
3524 (HTMLElementImpl::setInnerText):
3525 (HTMLElementImpl::setOuterText):
3526 (HTMLElementImpl::toString):
3527 * khtml/html/htmlparser.cpp: changed all uses of the endTag array to the endTagRequirement function and all uses of the tagPriority array to the tagPriority function.
3528 (KHTMLParser::parseToken):
3529 (KHTMLParser::insertNode):
3530 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): changed all uses of the endTag array to the endTagRequirement function
3531 * khtml/editing/markup.cpp: changed all uses of the endTag array to the endTagRequirement function
3535 2005-02-18 Jens Alfke <jens@apple.com>
3539 Fixed build: Whoops, setNeedsLayout's parameter is NOT optional.
3541 * khtml/html/html_objectimpl.cpp:
3542 (HTMLAppletElementImpl::setAllParamsAvailable):
3544 2005-02-18 Jens Alfke <jens@apple.com>
3546 Reviewed by cblu, hyatt.
3548 Fixes <rdar://problem/3603191> "REGRESSION: Applets not receiving all of the Applet Parameters in Java 1.4.1/1.4.2"
3549 Defer instantiation of Java applet plugin until after all of the <applet> tag's nested <param> tags have been parsed, otherwise the list of parameters passed to the applet is incomplete. The regression was introduced (says Dave) when the parser's close-tag notifications were removed in the name of performance.
3551 * khtml/html/html_objectimpl.cpp:
3552 (HTMLAppletElementImpl::HTMLAppletElementImpl):
3553 (HTMLAppletElementImpl::getAppletInstance):
3554 (HTMLAppletElementImpl::setAllParamsAvailable):
3555 (HTMLAppletElementImpl::allParamsAvailable):
3556 * khtml/html/html_objectimpl.h:
3557 * khtml/html/htmlparser.cpp:
3558 (KHTMLParser::processCloseTag):
3559 * khtml/rendering/render_applet.cpp:
3560 (RenderApplet::createWidgetIfNecessary):
3562 2005-02-18 Richard Williamson <rjw@apple.com>
3564 Fixed <rdar://problem/4006161> Tiger8A380: Widgets leak dashboard regions
3566 We were leaking the DashboardRegionImpls.
3570 * khtml/css/css_valueimpl.cpp:
3571 (DOM::CSSPrimitiveValueImpl::cleanup):
3573 2005-02-18 Chris Blumenberg <cblu@apple.com>
3575 Fixed: <rdar://problem/3945271> REGRESSION (Mail): pasted plain text should pick up typing style instead of being unstyled
3577 Reviewed by kocienda.
3579 * khtml/editing/htmlediting.cpp:
3580 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): don't set class on element returned by createStyleSpanElement since that's already done
3581 (khtml::ReplacementFragment::ReplacementFragment): take matchStyle param, don't call computeStylesAndRemoveUnrendered() if !matchStyle
3582 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take matchStyle param
3583 (khtml::ReplaceSelectionCommand::doApply): if m_matchStyle, use selection.start() as the insertion position and don't call applyStyleToInsertedNodes()
3584 * khtml/editing/htmlediting.h:
3585 * kwq/WebCoreBridge.h:
3586 * kwq/WebCoreBridge.mm:
3587 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): take matchStyle param and pass it
3588 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): pass NO for matchStyle
3589 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): pass NO for matchStyle
3590 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): pass YES for matchStyle
3592 2005-02-18 Ken Kocienda <kocienda@apple.com>
3598 <rdar://problem/4013025> Copy/Paste of quoted word results in removal of any following <cr>
3599 <rdar://problem/4013100> Copy/Paste quoted text and then decrease quote level does not change text color
3601 For the most part, these bugs were caused by errors and lack of foresight on my part when
3602 I added the better paste code. Chalk these fixes up to the result of bake time.
3604 * khtml/editing/htmlediting.cpp:
3605 (khtml::ReplacementFragment::ReplacementFragment): Need to move count of number of blocks in
3606 fragment after the call to remove unrendered nodes. Meant to do this before, but forgot to.
3607 (khtml::ReplacementFragment::removeStyleNodes): Need to remove inline styles from elements!
3608 Terrible omission now fixed.
3609 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Remove blockquote colors for now.
3610 Code has a more extensive comment in it now to explain the difficulty, and the need for more
3612 (khtml::ReplaceSelectionCommand::doApply): Need to call applyStyleToInsertedNodes() in the
3613 m_fragment.hasInterchangeNewline() case. This was just missed before.
3614 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Updated results, subtly different, but OK.
3615 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Updated for <p> to <div> change in test content.
3616 * layout-tests/editing/pasteboard/paste-text-017.html: Needed to change <p> to <div> to
3617 make this test go with the new design of using <div> tags for default paragraphs.
3619 2005-02-18 David Hyatt <hyatt@apple.com>
3621 Fix for 3974263 (and possibly others). Don't let fixed tables use maxint as their maxwidth when some
3622 cells have percentage values.
3624 Reviewed by kocienda
3626 * khtml/misc/arena.cpp:
3628 * khtml/rendering/table_layout.cpp:
3629 (FixedTableLayout::calcWidthArray):
3630 (FixedTableLayout::calcMinMaxWidth):
3631 (AutoTableLayout::layout):
3633 2005-02-17 Darin Adler <darin@apple.com>
3637 - fixed <rdar://problem/3998627> WebKit crashes when deleting text in a modified div
3639 * khtml/khtml_part.cpp: (KHTMLPart::selectionComputedStyle): Add a ref and deref to keep
3640 the element alive until it's added to the DOM tree.
3641 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::styleForSelectionStart): Ditto.
3643 2005-02-17 Richard Williamson <rjw@apple.com>
3645 Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead
3647 Fixed w/o introducing a performance regression. Add early
3648 check for Osaka-Mono to avoid expensive call into WebKit.
3653 (QFont::isFixedPitch):
3655 2005-02-17 Darin Adler <darin@apple.com>
3659 - fixed <rdar://problem/4011210> REGRESSION (180-181): Maxlength property for INPUT object not working
3661 * kwq/KWQTextField.mm:
3662 (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): If controller returns
3663 YES, go on to call super, since super does the text formatter handling, which we need.
3664 (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
3665 (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
3669 2005-02-17 Ken Kocienda <kocienda@apple.com>
3675 <rdar://problem/4012058> Copy from quoted text and paste results in blue text
3677 The relatively-new paste code tries hard to retain style of the content from the
3678 source location. However, in the case of quoted material in mail messages, we do
3679 not want to carry the quoting color along. This fixes the problem by factoring
3682 * khtml/editing/htmlediting.cpp:
3683 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Now calls removeBlockquoteColorsIfNeeded()
3685 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): New function. Factors out colors that are
3686 the result of text being quoted.
3687 (khtml::isNodeRendered): Function moved in file. No other change.
3688 (khtml::isProbablyBlock): Function moved in file. No other change.
3689 (khtml::closestMailBlockquote): New function. Helps fix bug.
3690 (khtml::isMailBlockquote): Function moved to be free-floating instead of being a
3691 member of CompositeEditCommand. No other change.
3692 * khtml/editing/htmlediting.h: Moved around some functions. Added removeBlockquoteColorsIfNeeded().
3693 * khtml/editing/markup.cpp: Remove redundant static implementation of isMailBlockquote.
3695 2005-02-17 Richard Williamson <rjw@apple.com>
3697 Fixed <rdar://problem/4008163> dynamic support for -apple-dashboard-region is flakey
3699 Style operator== wasn't including regions.
3703 * khtml/rendering/render_style.cpp:
3704 (StyleCSS3NonInheritedData::operator==):
3706 2005-02-17 Adele Amchan <adele@apple.com>
3710 fix for <rdar://problem/4010028> 8A383: Safari v185 crash loading united.com multi city fare finder page.
3712 * khtml/dom/dom_string.cpp: (DOM::DOMString::operator += ): prevent nil dereference when DOMString being added is nil
3714 2005-02-17 Jens Alfke <jens@apple.com>
3718 Fix for rdar://3963151 "Mail only pasted ~950 of 1407 text lines into my message!"
3719 Force tokenizer to run synchronously while parsing document fragments, so it doesn't stop halfway through and cause truncated content.
3721 * khtml/html/html_elementimpl.cpp:
3722 (HTMLElementImpl::createContextualFragment):
3723 * khtml/html/htmltokenizer.cpp:
3724 (khtml::HTMLTokenizer::reset):
3725 (khtml::HTMLTokenizer::begin):
3726 (khtml::HTMLTokenizer::setForceSynchronous):
3727 (khtml::HTMLTokenizer::continueProcessing):
3728 * khtml/html/htmltokenizer.h:
3730 2005-02-17 Ken Kocienda <kocienda@apple.com>
3736 <rdar://problem/3982183> Mail's HTML paragraphs appear with unintended margins in Entourage and Eudora
3738 * khtml/editing/htmlediting.cpp:
3739 (khtml::createDefaultParagraphElement): Change element we make from <p> to <div>.
3740 This fixes the problem, as these other mailers show <div> elements without margins.
3742 Some test files needed to change to preserve the ability to "eyeball" the results.
3743 Many others changed just because their <p> elements changed to <div> elements.
3745 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt
3746 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt
3747 * layout-tests/editing/inserting/insert-div-013-expected.txt
3748 * layout-tests/editing/inserting/insert-div-013.html
3749 * layout-tests/editing/inserting/insert-div-014-expected.txt
3750 * layout-tests/editing/inserting/insert-div-014.html
3751 * layout-tests/editing/inserting/insert-div-018-expected.txt
3752 * layout-tests/editing/inserting/insert-div-018.html
3753 * layout-tests/editing/inserting/insert-div-019-expected.txt
3754 * layout-tests/editing/inserting/insert-div-019.html
3755 * layout-tests/editing/inserting/insert-div-020-expected.txt
3756 * layout-tests/editing/inserting/insert-div-020.html
3757 * layout-tests/editing/inserting/insert-div-021-expected.txt
3758 * layout-tests/editing/inserting/insert-div-021.html
3759 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
3760 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
3761 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt
3762 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt
3764 2005-02-17 Ken Kocienda <kocienda@apple.com>
3770 <rdar://problem/3996737> REGRESSION (Mail): Copy/paste in Mail inserts returns
3772 The root cause of the problem is that a couple of pieces of code in AppKit and Mail
3773 insert newlines into markup as it is generated, and the paste code in WebCore was
3774 not smart about nodes that do not render (as is the case with these added newlines).
3775 So, the solution is to remove these unrendered nodes in the paste code in a pre-pass.
3776 Fortunately, my recent addition of such a pass to the paste code to handle styles
3777 gave me a convenient place to put this new logic.
3779 * khtml/editing/htmlediting.cpp:
3780 (khtml::ReplacementFragment::ReplacementFragment): Use new name for function below.
3781 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Name change from computeStylesForNodes().
3782 Now does the additional work of removing unrendered nodes, as mentioned above.
3783 (khtml::isNodeRendered): New helper function.
3784 * khtml/editing/htmlediting.h: Updated as necessary.
3786 2005-02-17 Ken Kocienda <kocienda@apple.com>
3792 <rdar://problem/3998892> REGRESSION (Mail): bolding a selection from end of line changes unselected text on starting line.
3794 The styling code did not move to the next node when the starting position was
3795 at the last offset of a node. Instead, it styled it. Clearly wrong. Solution
3796 is to borrow a check from the delete algorithm. Though I call caretMaxOffset(),
3797 which I consider deprecated, it is still the simplest and most strightforward
3798 way to ask the right question for this kind of problem.
3800 * khtml/editing/htmlediting.cpp:
3801 (khtml::ApplyStyleCommand::applyInlineStyle): Fixed, as described above.
3802 * layout-tests/editing/style/style-3998892-fix-expected.txt: Added.
3803 * layout-tests/editing/style/style-3998892-fix.html: Added.
3805 2005-02-16 Chris Blumenberg <cblu@apple.com>
3807 Fixed: <rdar://problem/3954842> Forward/reply to an HTML email can result in nothing (in cases with <link> tags for CSS)
3811 * khtml/xml/dom_nodeimpl.cpp:
3812 (NodeBaseImpl::addChild): don't call insertedIntoDocument on the added child if "this" itself is not in the document.
3814 2005-02-16 John Sullivan <sullivan@apple.com>
3816 Written by Darin, reviewed by Maciej and me
3818 - change required to make previous checkin work with English language RSS pages
3821 new private method isHierarchical
3824 add hierarchical base URL check when determining whether the URL is absolute
3825 (KURL::isHierarchical):
3826 new method, returns true if this is a valid URL with a slash just past the scheme's trailing colon
3828 2005-02-16 John Sullivan <sullivan@apple.com>
3830 Written by Darin, reviewed by me.
3832 - WebCore part of fix for <rdar://problem/4007384>
3833 FILTER: Bookmark of RSS with Japanese search word & multiple RSS pages loses filter
3836 (-[DOMElement _getURLAttribute:]):
3837 new SPI method, uses parseURL and completeURL to get valid URL from attribute value
3840 declare new SPI method
3842 2005-02-15 Maciej Stachowiak <mjs@apple.com>
3846 <rdar://problem/3942428> reproducible crash loading cbs.sportsline.com
3848 This change reverts the fix for <rdar://problem/3805311>, and
3849 re-fixes it in a different (better) way. Instead of preventing
3850 programmatic open from setting the parsing flag, instead make sure
3851 that programmatic close resets it.