3 2005-03-27 Darin Adler <darin@apple.com>
5 Reviewed by me, fix by Kida-san.
7 - fixed <rdar://problem/4067474> 8A424: Safari immediately quit by Cmd+Ctrll+'D'
9 * kwq/WebCoreBridge.mm: (-[WebCoreBridge convertToNSRange:DOM::]):
14 2005-03-24 Richard Williamson <rjw@apple.com>
16 Fixed <rdar://problem/4052683> After adding/removing stocks from Stocks Widget, stock areas went blank
18 The request was being collected before firing it's load handler.
19 We now gc protect the request while it's loading.
23 * khtml/ecma/xmlhttprequest.cpp:
24 (KJS::XMLHttpRequest::send):
25 (KJS::XMLHttpRequest::abort):
26 (KJS::XMLHttpRequest::slotFinished):
27 (KJS::XMLHttpRequestProtoFunc::tryCall):
31 2005-03-23 Darin Adler <darin@apple.com>
33 Further fix for 4053515.
35 Covered cases where text position doesn't lie inside a
40 * khtml/editing/visible_text.cpp:
41 (khtml::TextIterator::setRangeFromLocationAndLength):
43 2005-03-23 Richard Williamson <rjw@apple.com>
45 Fixed <rdar://problem/4053515> REGRESSION (Mail): Kotoeri input method reconversion does not work in WebViews
47 We now use actual document NSRanges to represent both marked text
48 ranges and selection ranges.
52 * khtml/editing/visible_text.cpp:
53 (khtml::TextIterator::rangeLength):
54 (khtml::TextIterator::setRangeFromLocationAndLength):
55 * khtml/editing/visible_text.h:
56 * kwq/WebCoreBridge.h:
57 * kwq/WebCoreBridge.mm:
58 (-[WebCoreBridge convertToNSRange:DOM::]):
59 (-[WebCoreBridge DOM::convertToDOMRange:]):
60 (-[WebCoreBridge selectNSRange:]):
61 (-[WebCoreBridge markedTextDOMRange]):
62 (-[WebCoreBridge markedTextNSRange]):
64 2005-03-22 Kevin Decker <kdecker@apple.com>
68 Fixed <rdar://problem/4062336> REGRESSION (406-407): HTML submenus not working at hrweb.apple.com after going back
70 Rolled out the fix for <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
72 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.
74 * khtml/khtml_part.cpp:
75 (KHTMLPart::closeURL):
76 * khtml/xml/dom_docimpl.cpp:
77 (DocumentImpl::detach):
81 2005-03-22 Vicki Murley <vicki@apple.com>
83 - roll the fix for <rdar://problem/4060266> back in, since its
86 * khtml/editing/visible_text.cpp:
87 (khtml::TextIterator::handleTextBox):
89 2005-03-22 Vicki Murley <vicki@apple.com>
91 - roll out the fix for <rdar://problem/4060266> since it was denied by CCC
93 * khtml/editing/visible_text.cpp:
94 (khtml::TextIterator::handleTextBox):
96 2005-03-22 David Harrison <harrison@apple.com>
100 <rdar://problem/4060266> Double-clicking in Dictionary.app doesn't work for some words (coming just after style change)
102 * khtml/editing/visible_text.cpp:
103 (khtml::TextIterator::handleTextBox):
104 Complete the check of whether to emit space for collapsed space.
106 2005-03-22 David Harrison <harrison@apple.com>
110 <rdar://problem/4061443> REGRESSION (8A420-8A421): Pasting in the Stickies widget is broken again
112 * khtml/editing/htmlediting.cpp:
113 (khtml::positionBeforeContainingSpecialElement):
114 (khtml::positionAfterContainingSpecialElement):
115 Return unchanged Position rather than a null or non-editable one.
119 2005-03-20 Ken Kocienda <kocienda@apple.com>
123 I made an error in this test earlier. It was not testing what I intended. Fixed.
125 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt
126 * layout-tests/editing/unsupported-content/list-delete-001.html
130 * layout-tests/editing/unsupported-content/table-delete-001-expected.txt: Added.
131 * layout-tests/editing/unsupported-content/table-delete-001.html: Added.
132 * layout-tests/editing/unsupported-content/table-delete-002-expected.txt: Added.
133 * layout-tests/editing/unsupported-content/table-delete-002.html: Added.
134 * layout-tests/editing/unsupported-content/table-delete-003-expected.txt: Added.
135 * layout-tests/editing/unsupported-content/table-delete-003.html: Added.
136 * layout-tests/editing/unsupported-content/table-type-after-expected.txt: Added.
137 * layout-tests/editing/unsupported-content/table-type-after.html: Added.
138 * layout-tests/editing/unsupported-content/table-type-before-expected.txt: Added.
139 * layout-tests/editing/unsupported-content/table-type-before.html: Added.
141 2005-03-20 Darin Adler <darin@apple.com>
145 - fixed <rdar://problem/3923903> REGRESSION (164-165): Repro Safari crash in khtml::RenderLayer::scrollToOffset
147 * khtml/rendering/render_layer.cpp: (RenderLayer::scrollToOffset): Check canvas for nil.
149 2005-03-20 David Harrison <harrison@apple.com>
153 <rdar://problem/4055127> Dictionary pop-up panel misplaced at beginning of text blocks (breaks double-clicking in Dictionary.app)
155 SimplifiedBackwardsTextIterator::advance() needed to not limit to textnodes
156 when checking whether moving back across block boundaries
158 VisibleUnits previousBoundary() needed to INIT_DOWN when creating result VisiblePosition
160 All editing tests pass.
162 * khtml/editing/visible_text.cpp:
163 (khtml::SimplifiedBackwardsTextIterator::advance):
164 * khtml/editing/visible_units.cpp:
165 (khtml::previousBoundary):
167 2005-03-20 Darin Adler <darin@apple.com>
169 Reviewed by Harrison.
171 - 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
173 * khtml/khtml_part.h: Added selectFrameElementInParentIfFullySelected.
174 * khtml/khtml_part.cpp:
176 (KHTMLPart::setFocusNodeIfNeeded): Changed to not set focus to a frame; was not what this function was
177 intended to do, and caused trouble when trying to select a frame element.
178 (KHTMLPart::khtmlMouseReleaseEvent): Call selectFrameElementInParentIfFullySelected.
179 (KHTMLPart::selectAll): Call selectFrameElementInParentIfFullySelected.
180 (KHTMLPart::selectFrameElementInParentIfFullySelected): Added. Selects the frame element in the parent
181 if a frame is entirely selected, which makes it easier to delete or replace the frame and is consistent
182 with the changes Maciej made recently for other elements.
184 * kwq/WebCoreBridge.mm:
185 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Call selectFrameElementInParentIfFullySelected.
186 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Call selectFrameElementInParentIfFullySelected.
188 2005-03-20 Darin Adler <darin@apple.com>
190 Reviewed by me, code change by Ken.
192 - fixed <rdar://problem/4059852> Deleting from first element of list makes content jump to wrong place
194 * khtml/editing/htmlediting.cpp:
195 (khtml::isListStructureNode): Added.
196 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Check for list nodes as well as table nodes.
198 2005-03-20 Ken Kocienda <kocienda@apple.com>
202 Added tests to cover new "unsupported content" editing code.
204 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt: Added.
205 * layout-tests/editing/unsupported-content/list-delete-001.html: Added.
206 * layout-tests/editing/unsupported-content/list-delete-002-expected.txt: Added.
207 * layout-tests/editing/unsupported-content/list-delete-002.html: Added.
208 * layout-tests/editing/unsupported-content/list-delete-003-expected.txt: Added.
209 * layout-tests/editing/unsupported-content/list-delete-003.html: Added.
210 * layout-tests/editing/unsupported-content/list-type-after-expected.txt: Added.
211 * layout-tests/editing/unsupported-content/list-type-after.html: Added.
212 * layout-tests/editing/unsupported-content/list-type-before-expected.txt: Added.
213 * layout-tests/editing/unsupported-content/list-type-before.html: Added.
215 2005-03-20 Ken Kocienda <kocienda@apple.com>
221 <rdar://problem/4059578> Entire list deleted, and caret disappears, when delete key hit at end of list
223 The problem is that a new case in the delete code did not consider when the
224 downstream end node of the selection might be an ancestor of the upstream start
225 node. That is the case in this bug. The downstream end is the body element, and
226 this line of code would delete all the children of the downstream end:
227 removeChildrenInRangePreservingPosition(m_downstreamEnd.node(), 0,
228 m_downstreamEnd.offset(), m_upstreamStart);
230 The fix is to check for this "is ancestor" case, and do some tree logic to find
231 the right offset of the downstream end node for the call to
232 removeChildrenInRangePreservingPosition().
234 * khtml/editing/htmlediting.cpp:
235 (khtml::DeleteSelectionCommand::handleGeneralDelete): Fixed as described.
237 2005-03-19 Ken Kocienda <kocienda@apple.com>
243 <rdar://problem/4059384> Cannot place insertion point correctly in editable text that avoids floating elements
245 Note: I strongly suspect this bug blocks a complete solution to this other Tiger/P2:
246 <rdar://problem/4055748> AX: Dictionary pop-up panel shows at wrong place on specific parts of particular pages
248 * khtml/rendering/render_text.cpp:
249 (RenderText::caretRect): Change the y-coordinate used to calculate the available width for a line. Height is wrong.
250 Top of the box containing the text where the click is done is correct. Also, add in the x-offset for the start
251 of the text box when calculating the available width. If this text box is avoiding a float at the y-coordinate
252 for the relevant box, failure to add in the amount of float-avoidance will make the text at the coordinates
253 greater than end-of-line minus float-avoidance ineligible for caret placement.
255 2005-03-19 Darin Adler <darin@apple.com>
259 - fixed <rdar://problem/4057594> REGRESSION (125-406): Unrepro crash in HTMLTokenizer::allDataProcessed after hitting Back button
261 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::allDataProcessed):
262 To get the part safely after calling end, save a guarded pointer to the view.
263 The old way could end trying to call a virtual function a part that was destroyed.
265 2005-03-19 Maciej Stachowiak <mjs@apple.com>
269 <rdar://problem/4053506> Pasting Tables and Cells in Mail does not allow editing before or after
270 <rdar://problem/4005954> REGRESSION (Mail): After copy/paste of content containing list element cannot go back to entering text at left side of page
272 * khtml/editing/htmlediting.cpp:
273 (khtml::maxDeepOffset):
274 (khtml::CompositeEditCommand::removeFullySelectedNodePreservingPosition):
275 (khtml::CompositeEditCommand::removeChildrenInRangePreservingPosition):
276 (khtml::CompositeEditCommand::removeNodePreservingPosition):
277 (khtml::CompositeEditCommand::insertBlockPlaceholder):
278 (khtml::CompositeEditCommand::appendBlockPlaceholder):
279 (khtml::CompositeEditCommand::forceBlockPlaceholder):
280 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
281 (khtml::isSpecialElement):
282 (khtml::isFirstVisiblePositionInSpecialElementInFragment):
283 (khtml::positionBeforePossibleContainingSpecialElement):
284 (khtml::positionAfterPossibleContainingSpecialElement):
285 (khtml::ApplyStyleCommand::applyInlineStyle):
286 (khtml::DeleteSelectionCommand::initializePositionData):
287 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
288 (khtml::DeleteSelectionCommand::handleGeneralDelete):
289 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
290 (khtml::DeleteSelectionCommand::doApply):
291 (khtml::InsertParagraphSeparatorCommand::doApply):
292 (khtml::ReplacementFragment::ReplacementFragment):
293 (khtml::ReplaceSelectionCommand::doApply):
294 * khtml/editing/htmlediting.h:
295 * khtml/editing/visible_position.cpp:
296 (khtml::isRenderedBR):
297 (khtml::VisiblePosition::initDownstream):
298 (khtml::isLastVisiblePositionInBlock):
299 * khtml/rendering/render_line.cpp:
300 (khtml::RootInlineBox::closestLeafChildForXPos):
301 * khtml/xml/dom_nodeimpl.cpp:
302 (NodeImpl::isBlockFlowOrTable):
303 (NodeImpl::isEditableBlock):
304 (NodeImpl::enclosingBlockFlowOrTableElement):
305 * khtml/xml/dom_nodeimpl.h:
306 * khtml/xml/dom_position.cpp:
307 (DOM::Position::upstream):
308 (DOM::Position::downstream):
309 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
310 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
311 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
312 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
313 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt:
315 2005-03-19 John Sullivan <sullivan@apple.com>
319 - fixed <rdar://problem/4058740> Crash (nil-deref) editing Mail reply
320 message in KWQKHTMLPart::fontForSelection (MailViewer-723)
322 * kwq/KWQKHTMLPart.mm:
323 (KWQKHTMLPart::fontForSelection):
324 Add nil check to loop. It shouldn't be necessary, but this crash trace seems to be
325 running into it. We're not completely certain, but the check is harmless at worst.
329 2005-03-18 David Harrison <harrison@apple.com>
333 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
337 * kwq/KWQAccObject.mm:
338 (-[KWQAccObject rendererForView:]):
339 New to cover both the WebCore and WebKit NSViews.
341 (-[KWQAccObject _accessibilityParentForSubview:]):
344 * kwq/WebCoreFrameView.h:
345 Add WebCoreBridgeHolder protocol to get access to WebKit NSViews.
347 2005-03-18 David Harrison <harrison@apple.com>
349 Reviewed by Darin, Ken.
351 <rdar://problem/3735625> AX: add AXPress action if an element has an onclick handler
353 * khtml/dom/html_form.cpp:
354 (HTMLInputElement::click):
355 * khtml/html/html_elementimpl.cpp:
356 (HTMLElementImpl::click):
357 (HTMLElementImpl::accessKeyAction):
358 * khtml/html/html_elementimpl.h:
359 * khtml/html/html_formimpl.cpp:
360 (DOM::HTMLFormElementImpl::submitClick):
361 (DOM::HTMLButtonElementImpl::click):
362 (DOM::HTMLButtonElementImpl::accessKeyAction):
363 (DOM::HTMLInputElementImpl::click):
364 (DOM::HTMLInputElementImpl::accessKeyAction):
365 (DOM::HTMLInputElementImpl::defaultEventHandler):
366 (DOM::HTMLLabelElementImpl::accessKeyAction):
367 (DOM::HTMLSelectElementImpl::accessKeyAction):
368 (DOM::HTMLTextAreaElementImpl::accessKeyAction):
369 * khtml/html/html_formimpl.h:
370 * khtml/html/html_inlineimpl.cpp:
371 (HTMLAnchorElementImpl::defaultEventHandler):
372 (HTMLAnchorElementImpl::accessKeyAction):
373 * khtml/html/html_inlineimpl.h:
374 * khtml/rendering/render_form.cpp:
375 (RenderFileButton::click):
376 * khtml/rendering/render_form.h:
377 * khtml/xml/dom_docimpl.cpp:
378 (DocumentImpl::defaultEventHandler):
379 * khtml/xml/dom_elementimpl.h:
380 (DOM::ElementImpl::accessKeyAction):
382 (-[DOMHTMLInputElement click]):
386 * kwq/KWQFileButton.h:
387 * kwq/KWQFileButton.mm:
388 (KWQFileButton::click):
390 Add accessKeyAction parameter about whether to limit to HTMLElementImpl subclasses that JavaScript wants, or to apply to others as well.
392 Add click() parameter about whether to send the mousedown and mouseup events in addition to the click event.
394 * kwq/KWQAccObject.mm:
395 (-[KWQAccObject mouseButtonListener]):
396 Locate a mousedown, mouseup, or click handler in the current element and its ancestors.
398 (-[KWQAccObject actionElement]):
399 (-[KWQAccObject accessibilityIsIgnored]):
400 (-[KWQAccObject accessibilityPerformAction:]):
401 Consider mouseButtonListener.
403 2005-03-18 John Sullivan <sullivan@apple.com>
407 - fixed <rdar://problem/4002164> maps that include start and end
408 location don't print right from maps.google.com
410 I thought I checked this in yesterday but a ChangeLog conflict aborted my checkin
413 * khtml/rendering/render_style.cpp:
415 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
417 * khtml/rendering/render_style.h:
418 (khtml::RenderStyle::InheritedFlags::operator==):
419 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
420 (khtml::RenderStyle::setBitDefaults):
422 (khtml::RenderStyle::forceBackgroundsToWhite):
423 ditto, and method name changed too
424 (khtml::RenderStyle::setForceBackgroundsToWhite):
427 * khtml/rendering/render_text.cpp:
428 (InlineTextBox::paint):
429 updated for name change; also, compare text against white instead of current bg color
430 because we no longer actually modify the bg color (previously we would always set
431 the bg color to white, so the result is the same)
433 * khtml/xml/dom_docimpl.cpp:
434 (DocumentImpl::recalcStyle):
435 updated for name change
437 * kwq/WebCoreBridge.mm:
438 (-[WebCoreBridge styleSheetForPrinting]):
440 (-[WebCoreBridge reapplyStylesForDeviceType:]):
441 removed the code that called styleSheetForPrinting; we no longer use a stylesheet
444 * khtml/rendering/render_box.cpp:
445 (RenderBox::paintBackgroundExtended):
446 If forceBackgroundsToWhite flag is set, convert background images and
447 background colors to white background color with no background image.
449 2005-03-18 Ken Kocienda <kocienda@apple.com>
455 <rdar://problem/4056718> Pasting quotes the entire message
457 * khtml/editing/htmlediting.cpp:
458 (khtml::ReplaceSelectionCommand::doApply): After pasting, nodes are moved to the block containing
459 the end of the pasted content in certain cases. This move logic used to stop once it moved all the
460 siblings of the node following the last node of the pasted-in content. This means that block elements
461 could get moved, and if the pasted-in content included a mail blockquote, this could result in
462 one quote level getting added. The fix is to stop the move of nodes once a <br>, block element, or
463 <table> is seen. This only affected one of the many test cases we have for such scenarios, and
464 the change to that result makes sense given the code change.
465 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: This test result changed in a way that
466 adequately tests the behavior change, so I did not add a new test.
468 2005-03-17 Ken Kocienda <kocienda@apple.com>
474 <rdar://problem/4051809> 8A413: Cursor-up in a mail message sometimes gets stuck (with specific reproducible case)
476 * khtml/rendering/render_text.cpp:
477 (RenderText::positionForCoordinates): Consider two lines: line-above and line-below. If the caret position in line-below
478 was at an x coordinate between half way through the x coordinate of the last character on the line-above and the
479 end of that same character, this bug would happen since the positioning code would assume that it could create a
480 VisiblePosition with a DOWNSTREAM affinity. Now, I check to see if the character position on the line-above is the
481 last character on that line, and if it is, I use UPSTREAM as the affinity.
485 2005-03-17 David Harrison <harrison@apple.com>
487 Reviewed by Darin, Ken.
489 * khtml/editing/htmlediting.cpp:
490 (khtml::EditCommandPtr::setEndingSelection):
491 Fixed typo so that it calls setEndingSelection rather than setStartingSelection.
492 Commented out this unused method, tho, since this is late in Tiger. Proved unused by successful build after temporarily removing method declaration or implemenation.
494 2005-03-16 Kevin Decker <kdecker@apple.com>
498 Fixed <rdar://problem/4046665> REGRESSION (403-405): mypage.apple.com login does not work (hits assertion in Development build)
500 * kwq/WebCoreBridge.mm:
501 (-[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="">
503 2005-03-16 Darin Adler <darin@apple.com>
507 - fixed <rdar://problem/4045203> REGRESSION (125-188): Redundant JS imports crash Safari
509 * khtml/html/htmltokenizer.h: Take inWRite bool out of NDEBUG ifdef.
510 * khtml/html/htmltokenizer.cpp:
511 (khtml::HTMLTokenizer::HTMLTokenizer): Take inWrite bool management code out of NDEBUG ifdef.
512 (khtml::HTMLTokenizer::write): Ditto. Don't call end if inWrite is true, since it will be called
513 when you return to the body of the outer write() call.
514 (khtml::HTMLTokenizer::allDataProcessed): Don't call end() if inWrite is true for the same reason.
515 (khtml::HTMLTokenizer::finish): Ditto.
517 * kwq/KWQWidget.mm: (QWidget::getOuterView): Removed bogus assertion that has been vexing us of late.
519 2005-03-16 David Harrison <harrison@apple.com>
521 Reviewed by me (written by Patti Yeh).
523 * kwq/KWQAccObject.mm:
524 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
525 Use LeftWordIfOnBoundary instead of RightWordIfOnBoundary.
527 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
528 Use RightWordIfOnBoundary instead of LeftWordIfOnBoundary.
530 2005-03-16 David Harrison <harrison@apple.com>
534 <rdar://problem/4054590> AX: Dictionary panel does not work when page is scrolled on Safari
536 * kwq/KWQAccObject.mm:
537 (-[KWQAccObject doAXTextMarkerForPosition:]):
538 Add in the view's contentsX and contentsY to the point.
540 2005-03-16 David Harrison <harrison@apple.com>
544 <rdar://problem/4048506> Deleting from beginning of editable div deletes other document elements
548 * khtml/editing/visible_units.h:
549 * khtml/editing/visible_units.cpp:
550 (khtml::startOfEditableContent):
551 (khtml::endOfEditableContent):
552 (khtml::inSameEditableContent):
553 (khtml::isStartOfEditableContent):
554 (khtml::isEndOfEditableContent):
557 * kwq/WebCoreBridge.h:
558 * kwq/WebCoreBridge.mm:
559 (-[WebCoreBridge canDeleteRange:]):
562 2005-03-16 Ken Kocienda <kocienda@apple.com>
568 <rdar://problem/4042935> undo doesn't work properly during inline input
570 * kwq/WebCoreBridge.h: Declare new method below.
571 * kwq/WebCoreBridge.mm:
572 (-[WebCoreBridge replaceMarkedTextWithText:]): New method. Wraps calls to TypingCommand::deleteKeyPressed and
573 TypingCommand::insertText to map the way that international text input works onto the typing undo system.
575 2005-03-16 David Harrison <harrison@apple.com>
579 <rdar://problem/4044336> REGRESSION (8A398-8A409): Option-Delete also deletes space to left of deleted word
581 * khtml/editing/htmlediting.cpp:
582 (khtml::DeleteSelectionCommand::initializePositionData):
583 - skip smart delete if the selection to delete already starts or ends with whitespace
585 * khtml/khtml_part.cpp:
586 (KHTMLPart::handleMousePressEventDoubleClick):
587 - preserve selection on double-click when range is already selected
589 * khtml/xml/dom_position.cpp:
590 (DOM::Position::leadingWhitespacePosition):
591 (DOM::Position::trailingWhitespacePosition):
592 - fix considerNonCollapsibleWhitespace action (logic was reversed)
593 - add non-breaking space to the non-collapsable ones
595 * kwq/WebCoreBridge.mm:
596 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
597 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
598 - these methods do not set the selection, so remove calls to setSelectionGranularity
600 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
601 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]):
602 - set the granularity back to character
603 - the one exception is that we need to keep word granularity
604 to preserve smart delete behavior when extending by word
606 2005-03-15 Maciej Stachowiak <mjs@apple.com>
610 <rdar://problem/4053266> Pressing return a few times right after a link makes the new blank lines part of the link
612 * khtml/editing/htmlediting.cpp:
613 (khtml::InsertLineBreakCommand::doApply): Use
614 positionOutsideContainingSpecialElement in the right two places.
615 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
617 - move all these helper functions higher in the file
619 * khtml/editing/htmlediting.cpp:
620 (khtml::isSpecialElement):
621 (khtml::isFirstVisiblePositionInSpecialElement):
622 (khtml::positionBeforeNode):
623 (khtml::positionBeforeContainingSpecialElement):
624 (khtml::maxRangeOffset):
625 (khtml::isLastVisiblePositionInSpecialElement):
626 (khtml::positionAfterNode):
627 (khtml::positionAfterContainingSpecialElement):
628 (khtml::positionOutsideContainingSpecialElement):
630 2005-03-14 Maciej Stachowiak <mjs@apple.com>
634 <rdar://problem/4049925> Pasting right after a link makes pasted content part of the link (without visible style change)
636 * khtml/editing/htmlediting.cpp:
637 (khtml::positionOutsideContainingSpecialElement): made a helper
638 function that computes a position outside the outermost containing
639 special element if the passed in position is right at the start or
641 (khtml::InsertTextCommand::prepareForTextInsertion): use new helper here
642 (khtml::ReplaceSelectionCommand::doApply): use it here too: this is the fix
643 (khtml::positionBeforeNode): made static
644 (khtml::positionBeforeContainingSpecialElement): made static
645 (khtml::positionAfterNode): made static
646 (khtml::positionAfterContainingSpecialElement): made static
648 2005-03-15 Richard Williamson <rjw@apple.com>
650 Fixed <rdar://problem/4053658> Crash getting direction at maps.google.com
652 Add non nil style() check.
654 Reviewed by Dave Harrison.
656 * khtml/rendering/render_table.cpp:
657 (RenderTableCell::collapsedRightBorder):
659 2005-03-15 Kevin Decker <kdecker@apple.com>
663 Fixed: <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
665 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().
667 This fixes a recent regression from:
669 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
671 * khtml/khtml_part.cpp:
672 (KHTMLPart::closeURL): After dispatching event handlers, go ahead and remove them from the DOM.
673 * khtml/xml/dom_docimpl.cpp:
674 (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.
676 2005-03-15 Ken Kocienda <kocienda@apple.com>
682 <rdar://problem/4052642> Each delete keystroke is in its own undo group; not included in undo group with other typing
684 Calling -[WebCore setSelectedDOMRange:range affinity:] had the result of "closing" any active set of typing
685 keystrokes grouped together in a single undo operation. A change on 27 Jan in WebKit to change the way delete
686 keystrokes are handled made this feature regress. Previous to that change, the backwards delete
687 key went through separate code that is no longer in the tree that did not set the selection in the way
690 The solution is to add an extra argument to the set-selection call. The WebCoreBridge now offers this method:
691 -[WebCore setSelectedDOMRange:range affinity:closeTyping:]. Now, callers must indicate whether setting the
692 selection will act to close typing or not.
694 * kwq/WebCoreBridge.h: Changed header accordingly to change method shown below.
695 * kwq/WebCoreBridge.mm:
696 (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Added closeTyping argument to this method.
698 2005-03-15 John Sullivan <sullivan@apple.com>
702 - fixed <rdar://problem/4052246> crash in KWQKHTMLPart::createPart() trying to display local file in frame
704 * kwq/KWQKHTMLPart.mm:
705 (KWQKHTMLPart::createPart):
706 Check part for nil before trying to ref. This was probably a longstanding code flaw revealed by
707 the recent security fix.
709 2005-03-15 Kevin Decker <kdecker@apple.com>
711 Reviewed by Ken and Maciej.
713 New fix for <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
715 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.
717 * khtml/html/htmltokenizer.cpp:
718 (khtml::HTMLTokenizer::HTMLTokenizer): Initialize loadStopped to false.
719 (khtml::HTMLTokenizer::write): Go ahead and bail out if loadStopped is true.
720 (khtml::HTMLTokenizer::processToken):
721 * 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.
722 * khtml/khtml_part.cpp:
723 (KHTMLPart::closeURL): Notify the tokenizer to stop parsing.
724 * khtml/xml/xml_tokenizer.cpp:
725 (khtml::XMLTokenizer::XMLTokenizer): Initialize loadStopped to false.
726 * khtml/xml/xml_tokenizer.h:
727 (khtml::Tokenizer::stopParsing): Added.
729 2005-03-14 David Harrison <harrison@apple.com>
731 Reviewed by Darin, Maciej.
733 <rdar://problem/4046103> REGRESSION (Mail): clicking after style change sets insertion point incorrectly
735 Also fixes crash by adding nil check.
737 * khtml/editing/htmlediting.cpp:
738 (khtml::MoveSelectionCommand::doApply):
739 Check the node for nil.
741 * khtml/khtml_part.cpp:
742 (KHTMLPart::khtmlMouseReleaseEvent):
743 Use the node from the event rather than from the selection.
745 2005-03-14 Darin Adler <darin@apple.com>
747 Reviewed by Harrison.
749 - fixed <rdar://problem/4049776> Seed: Mail: Disable spellcheck leaves red artifacts
751 * khtml/xml/dom_docimpl.cpp:
752 (DocumentImpl::DocumentImpl): Set markers list to be "auto-delete" so they don't all leak.
753 (DocumentImpl::removeMarker): Remove markers list for a node when the last marker is removed
754 for that node. Otherwise, we can have empty marker lists for each node forever until the
756 (DocumentImpl::removeAllMarkers): Added code to dirty the markers.
757 (DocumentImpl::shiftMarkers): Remove unneeded empty check.
759 * kwq/WebCoreBridge.h: Added unmarkAllMisspellings for WebKit.
760 * kwq/WebCoreBridge.mm: (-[WebCoreBridge unmarkAllMisspellings]): Added. Calls removeAllMarkers.
762 2005-03-14 Richard Williamson <rjw@apple.com>
764 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
766 A document may be deleted as a consequence of handling an event,
767 as was the case with Acrobat.app. Ensure that the document is still valid
768 before passing the event on for further handling.
770 * khtml/xml/dom_nodeimpl.cpp:
771 (NodeImpl::dispatchUIEvent):
773 2005-03-14 Ken Kocienda <kocienda@apple.com>
777 Added a couple of comments about setChanged() to this code based on my experiences with 4047028.
779 * khtml/css/css_valueimpl.cpp:
780 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties)
781 (DOM::CSSMutableStyleDeclarationImpl::merge)
783 2005-03-14 Ken Kocienda <kocienda@apple.com>
789 <rdar://problem/4047028> Changing quote levels on stylized text causes it to be sent as colored (Blue). Tiger8A410
791 * khtml/css/css_valueimpl.cpp:
792 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): This function now calls setChanged() at the
793 end of its loop if any properties were removed. This makes the style system update correctly in response
794 to changes made by this function. The code to paste removes style from the pasted content in a
795 preliminary step, and the fact that the style system did not update properly left unwanted color
796 declarations in the document.
798 2005-03-14 Vicki Murley <vicki@apple.com>
800 - roll out this change for now, since it was denied by CCC
802 2005-03-11 David Harrison <harrison@apple.com>
806 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
808 * kwq/KWQKHTMLPart.mm:
809 (KWQKHTMLPart::advanceToNextMisspelling):
810 (KWQKHTMLPart::markMisspellings):
813 2005-03-14 Ken Kocienda <kocienda@apple.com>
819 <rdar://problem/4050403> Mail crashes after pasting and deleting the content of one Excel cell
821 * khtml/editing/htmlediting.cpp:
822 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add some null checks to the code. This fixes the crash, although
823 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
824 the document that cannot be removed (this is actually an empty table). This is undesirable, however, work Maciej is
825 doing to fix the general-case problem of trying to edit constructs we do not handle well in editing should fix this
826 particular case, making the deletion of this "blank line" possible. Maciej is doing this work as part of this bug:
827 <rdar://problem/4036051> Hard to select (and thus delete) an IFRAME in an editable WebView
829 2005-03-14 Ken Kocienda <kocienda@apple.com>
835 <rdar://problem/4029632> Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
837 The problem is that removeInlineStyle() can remove nodes, and if either the start or end node of the
838 selection at the time of the call to removeInlineStyle() was in a node that got removed, bad things
839 would happen. The fix is described below.
841 * khtml/editing/htmlediting.cpp:
842 (khtml::maxRangeOffset): Moved this static function to a different place in the file so the code below can use it.
843 (khtml::ApplyStyleCommand::applyInlineStyle): Calling removeInlineStyle() now has the side effect of
844 setting the command's ending selection. Now resets start and end using the ending selection after the call to
845 removeInlineStyle() as it is done elsewhere in this function.
846 (khtml::ApplyStyleCommand::removeInlineStyle): Track the removal of the start or end node based on
847 the positions passed in. If either the start or the end node is removed as part of style removal,
848 set an appropriate replacement start or end that is still in the document.
852 2005-03-14 Ken Kocienda <kocienda@apple.com>
856 I need to roll out Kevin's change to fix 3667701. It breaks contextual fragments, and hence breaks
857 paste in editing (among other things).
859 * khtml/html/htmltokenizer.cpp: Roll out recent change.
860 (khtml::HTMLTokenizer::write)
861 * khtml/html/htmltokenizer.h: Ditto.
863 2005-03-13 Darin Adler <darin@apple.com>
865 Reviewed by Ken and Maciej.
867 - fixed <rdar://problem/4049040> REGRESSION (403-405): security check prevents user stylesheet from loading (Dictionary.app doesn't work at all!)
869 * kwq/WebCoreBridge.mm: (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Changed to give "applewebdata:"
870 documents the same privileges to open local files that "file:" documents have.
872 2005-03-13 Kevin Decker <kdecker@apple.com>
876 Fixed: <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
878 The problem here was that the tokenizer would continue to receive chunks of data from the loader already
879 after the view and part had been destroyed. Situations like this could arise when clicking on another link
880 while still loading the current view, or during self test where we rapidly open, load, and close browser
883 * khtml/html/htmltokenizer.cpp:
884 (khtml::HTMLTokenizer::write): Simple nil check against the view.
885 * khtml/html/htmltokenizer.h: Changed the view pointer from a standard pointer to a QGuardedPtr. The tokenizer's
886 handle to the view will now automatically nil-out and never dangle.
888 2005-03-13 Darin Adler <darin@apple.com>
890 Reviewed by John and Ken.
892 - fixed <rdar://problem/4044347> REGRESSION (Mail): Control-K in particular message moves insertion point to previous line
894 Tweaked the deleting code, and added three new deleting layout tests to confirm the new code works.
896 * khtml/editing/htmlediting.cpp:
897 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Removed special case with comment that said it was
898 for the case where a "selection contains only a BR right after a block ended". This code was being triggered in
899 more cases than just that one, and in all the cases I tested, the general delete code works fine.
900 (khtml::DeleteSelectionCommand::handleGeneralDelete): Changed the code that decides whether to delete an entire
901 block to understand the case where the end block is outside the start block, but contains the start block.
902 In that case, we want to delete the entire block. Not deleting the block was causing us to delete just the <br>,
903 and not the enclosing <div> in the case in the bug.
905 * layout-tests/editing/deleting/delete-line-015-expected.txt: Added.
906 * layout-tests/editing/deleting/delete-line-015.html: Added.
907 * layout-tests/editing/deleting/delete-line-016-expected.txt: Added.
908 * layout-tests/editing/deleting/delete-line-016.html: Added.
909 * layout-tests/editing/deleting/delete-line-017-expected.txt: Added.
910 * layout-tests/editing/deleting/delete-line-017.html: Added.
911 * layout-tests/editing/style/smoosh-styles-002-expected.txt: Updated to improved results. With the code change, the deletion
912 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
913 we delete both of those.
915 2005-03-13 Darin Adler <darin@apple.com>
917 - fixed <rdar://problem/4049172> REGRESSION (403-405): Gmail: text box in "Invite a friend" section overlaps other sections
919 Rolled out fix for <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
921 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth): Back to previous version of this file.
923 2005-03-12 Maciej Stachowiak <mjs@apple.com>
927 <rdar://problem/4046144> RSS pages leave a hole in local file security policy (need to revert feed: exemption)
929 * kwq/WebCoreBridge.mm:
930 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Revert
931 emergency workaround for Safari RSS, now that a new Syndication
934 2005-03-11 Maciej Stachowiak <mjs@apple.com>
938 <rdar://problem/4026787> text typed after a link (pasted or Mail Link to this Page) is part of the link, underlined and colored blue
940 The concept of this change is every time you type at the very
941 start or very end of a link (even if nested in further inner
942 elements), the typed text goes outside the link instead of inside.
944 * khtml/editing/htmlediting.cpp:
945 (khtml::InsertTextCommand::prepareForTextInsertion): Check whether
946 we are at the first visible position or last visible position of a
947 special element. For now this only includes HTML A elements that
948 are links (i.e. they have an href).
949 (khtml::isSpecialElement): Helper function that identifies special
950 elements (for now only links).
951 (khtml::isFirstVisiblePositionInSpecialElement): Checks if a given DOM
952 position is equivalent to the first visible position in some containing
953 editable special element.
954 (khtml::positionBeforeNode): Returns the DOM position immediately
956 (khtml::positionBeforeContainingSpecialElement): Gives a DOM
957 position immediately before the outermost editable containing
958 special element where the passed-in position is equivalent to the
959 first visible position.
960 (khtml::maxRangeOffset): Helper to get the maximum allowed
961 range/position offset for a node, does the right thing based on
962 whether the node would use a character offset or child offset.
963 (khtml::isLastVisiblePositionInSpecialElement): Similar to above,
964 but for end of node instead of start.
965 (khtml::positionAfterNode): Ditto.
966 (khtml::positionAfterContainingSpecialElement): Ditto.
968 Some layout tests changed - I looked over all the diffs and found
969 that the only changes were "junk nodes" like empty spans and text
970 nodes moving from one spot in the tree to another. These changes
971 are all harmless and do not affect layout or future editing.
973 * layout-tests/editing/inserting/typing-003-expected.txt:
974 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
975 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
976 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
977 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
978 * layout-tests/editing/style/remove-underline-expected.txt:
979 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt:
980 * layout-tests/editing/style/remove-underline-in-bold-expected.txt:
981 * layout-tests/editing/style/typing-style-003-expected.txt:
982 * layout-tests/editing/style/unbold-in-bold-expected.txt:
983 * layout-tests/editing/style/underline-expected.txt:
985 2005-03-11 Adele Amchan <adele@apple.com>
987 backing out fix for <rdar://problem/4021711> REGRESSION (125-188): blank pages when browsing forum at cooperativeresearch.org - cached external script problem
989 This caused the following regressions (that we know of):
990 <rdar://problem/4047445> REGRESSION (Safari-400-403?): Some or all page contents sometimes don't appear (macworld.com)
991 <rdar://problem/4046153> 8a409: Problem loading Citibank page in Safari 2 (403)
992 <rdar://problem/4047801> REGRESSION (402-403): .Mac homepage links don't work
994 * khtml/html/htmltokenizer.cpp:
995 (khtml::HTMLTokenizer::scriptHandler):
997 2005-03-11 David Harrison <harrison@apple.com>
1001 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
1003 * kwq/KWQKHTMLPart.mm:
1004 (KWQKHTMLPart::advanceToNextMisspelling):
1005 (KWQKHTMLPart::markMisspellings):
1008 2005-03-11 Ken Kocienda <kocienda@apple.com>
1012 * ForwardingHeaders/editing/visible_units.h: Added.
1014 2005-03-11 Ken Kocienda <kocienda@apple.com>
1020 <rdar://problem/4045521> Hitting return key with full line selected does not add blank line as it should
1022 * khtml/editing/htmlediting.cpp:
1023 (khtml::InsertParagraphSeparatorCommand::doApply): Removed some "special-case" code from this
1024 function that would look for a selection that started and ended in a different block, and would
1025 then bail right after the deletion of the selection without inserting a paragraph separator.
1026 This was just wrong. So, the code change is removal only. When the general-case code runs instead
1027 of the erroneous special-case code, the bug goes away.
1031 * layout-tests/editing/inserting/return-key-with-selection-001-expected.txt: Added.
1032 * layout-tests/editing/inserting/return-key-with-selection-001.html: Added.
1033 * layout-tests/editing/inserting/return-key-with-selection-002-expected.txt: Added.
1034 * layout-tests/editing/inserting/return-key-with-selection-002.html: Added.
1035 * layout-tests/editing/inserting/return-key-with-selection-003-expected.txt: Added.
1036 * layout-tests/editing/inserting/return-key-with-selection-003.html: Added.
1038 2005-03-11 David Harrison <harrison@apple.com>
1042 <rdar://problem/4009446> AX: kAXTextMarkerForPositionParameterizedAttribute not working correctly (required for Dictionary pop-up)
1044 * kwq/KWQAccObject.mm:
1045 (-[KWQAccObject accessibilityAttributeValue:]):
1048 (-[KWQAccObject doAXTextMarkerForPosition:]):
1051 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
1052 Use the selection's document instead of the top document, to accommodate frames, etc.
1054 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
1055 Fixed parameter processing to look for NSValue instead of AXValue.
1057 2005-03-11 Ken Kocienda <kocienda@apple.com>
1059 Reviewed by Harrison
1063 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
1065 This was fixed, then regressed with Harrison's fix for this bug:
1067 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
1069 * khtml/editing/htmlediting.cpp:
1070 (khtml::ReplaceSelectionCommand::doApply): My now addresses both problems in a way that they no longer
1073 2005-03-10 Ken Kocienda <kocienda@apple.com>
1079 <rdar://problem/4045511> Copying and pasting end-of-paragraph selection puts insertion point in wrong place
1080 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
1082 The copy/paste code before this patch had no notion of a "logical newline" at the start of the selection. We have
1083 had a similar notion for "logical newline" at the end of the selection for quite some time. To fix these bugs, we
1084 need to introduce the same idea for selection starts.
1086 * khtml/editing/htmlediting.cpp:
1087 (khtml::ReplacementFragment::ReplacementFragment): Process the "logical newline" at start as we write it out
1088 in markup. Set the bit we added to this object to signify we have such a newline.
1089 (khtml::ReplaceSelectionCommand::doApply): Many, many changes to introduce the new "logical newline" at start concept.
1090 I also tried to simply the code that sets the start position for inserting content to be pasted. I also improved a
1091 weakness in the smart-paste code. Now, we check before and after the paste for whether we need to add a leading or
1092 trailing space. The code previous to this patch only did a "before" check, with the result that we sometimes added
1093 a second space. In other words, the code did not realize that DOM changes done by pasting could cause formerly
1094 unrendered whitespace to become rendered. Also moved line placeholder clean up code to its own function.
1095 (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): New helper that further refines the notion
1096 of when we can remove a line placeholder. The definition is now, "If a line placeholder is at the visible start
1097 and visible end of its line, keep it; otherwise remove it".
1098 * khtml/editing/htmlediting.h: Declare new functions. Rework inlines in ReplacementFragment class to account for
1099 addition of new "logical newline" at start concept.
1100 (khtml::ReplacementFragment::hasInterchangeNewlineAtStart): New accessor.
1101 (khtml::ReplacementFragment::hasInterchangeNewlineAtEnd): Renamed from hasInterchangeNewline(), since before we
1102 only had a bit for the end, hence we did not need to distinguish it from the start.
1103 * khtml/editing/markup.cpp:
1104 (khtml::createMarkup): Added code to detect and write out markup for cases where we have a "logical newline" at start.
1105 * khtml/xml/dom2_rangeimpl.cpp:
1106 (DOM::RangeImpl::startPosition): New helper.
1107 (DOM::RangeImpl::endPosition): Ditto.
1108 * khtml/xml/dom2_rangeimpl.h: Declare new helpers.
1111 * layout-tests/editing/pasteboard/paste-line-endings-001-expected.txt: Added.
1112 * layout-tests/editing/pasteboard/paste-line-endings-001.html: Added.
1113 * layout-tests/editing/pasteboard/paste-line-endings-002-expected.txt: Added.
1114 * layout-tests/editing/pasteboard/paste-line-endings-002.html: Added.
1115 * layout-tests/editing/pasteboard/paste-line-endings-003-expected.txt: Added.
1116 * layout-tests/editing/pasteboard/paste-line-endings-003.html: Added.
1117 * layout-tests/editing/pasteboard/paste-line-endings-004-expected.txt: Added.
1118 * layout-tests/editing/pasteboard/paste-line-endings-004.html: Added.
1119 * layout-tests/editing/pasteboard/paste-line-endings-005-expected.txt: Added.
1120 * layout-tests/editing/pasteboard/paste-line-endings-005.html: Added.
1121 * layout-tests/editing/pasteboard/paste-line-endings-006-expected.txt: Added.
1122 * layout-tests/editing/pasteboard/paste-line-endings-006.html: Added.
1123 * layout-tests/editing/pasteboard/paste-line-endings-007-expected.txt: Added.
1124 * layout-tests/editing/pasteboard/paste-line-endings-007.html: Added.
1125 * layout-tests/editing/pasteboard/paste-line-endings-008-expected.txt: Added.
1126 * layout-tests/editing/pasteboard/paste-line-endings-008.html: Added.
1127 * layout-tests/editing/pasteboard/paste-line-endings-009-expected.txt: Added.
1128 * layout-tests/editing/pasteboard/paste-line-endings-009.html: Added.
1129 * layout-tests/editing/pasteboard/paste-line-endings-010-expected.txt: Added.
1130 * layout-tests/editing/pasteboard/paste-line-endings-010.html: Added.
1134 2005-03-10 Darin Adler <darin@apple.com>
1136 Reviewed by Richard.
1138 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
1140 * khtml/rendering/render_text.cpp: (getCharacterBreakIterator): Set boolean "got iterator" to true.
1142 2005-03-10 Darin Adler <darin@apple.com>
1146 - fixed <rdar://problem/4042867> "Bigger" changes the font size of too much text when the selection is on a style-change boundary
1148 * khtml/editing/htmlediting.cpp: (khtml::ApplyStyleCommand::applyRelativeFontStyleChange):
1149 Advance out of the starting text node if we're at the end of it.
1151 2005-03-10 Darin Adler <darin@apple.com>
1153 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Fixed assertion for nested calls to write.
1155 2005-03-10 David Harrison <harrison@apple.com>
1159 <rdar://problem/4032346> REGRESSION (Mail): changing 1st line of a URL that wraps to two lines doesn't always update 2nd line
1161 * khtml/rendering/bidi.cpp:
1162 (khtml::RenderBlock::matchedEndLine):
1163 Look at first clean line in case line wrap implicitly dirtied it.
1165 2005-03-10 Maciej Stachowiak <mjs@apple.com>
1169 <rdar://problem/4046018> REGRESSION (TOT): RSS pages don't display anything
1171 * kwq/WebCoreBridge.mm:
1172 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Exempt
1173 feed: and feeds: pages from the local file security check.
1175 2005-03-10 Darin Adler <darin@apple.com>
1177 Change written by Steve Peters, reviewed by me.
1179 - fixed <rdar://problem/4045924> improve compareBoundaryPoints to make style changes faster
1181 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints):
1182 Do early outs in a couple of the loops to make things faster.
1184 2005-03-10 Jens Alfke <jens@apple.com>
1188 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.
1190 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.
1192 This ensures that the applet will get loaded even if there is no explicit </applet> tag.
1194 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.
1196 * khtml/html/html_objectimpl.cpp:
1197 (HTMLAppletElementImpl::closeRenderer):
1198 * khtml/html/html_objectimpl.h:
1199 * khtml/html/htmlparser.cpp:
1200 (KHTMLParser::insertNode):
1201 (KHTMLParser::processCloseTag):
1202 (KHTMLParser::popOneBlock):
1203 * khtml/xml/dom_nodeimpl.h:
1204 (DOM::NodeImpl::closeRenderer):
1206 2005-03-10 Ken Kocienda <kocienda@apple.com>
1212 <rdar://problem/4024929> REGRESSION (Mail): Pasting text with multiple reply levels removes one level instead of all
1214 The code to figure out which node to use to merge into an existing line did not drill into the first inline element
1215 as needed to make the feature work as user expect. Instead, it looked at the first node, and if it was a block, it
1216 skipped that node. This worked for some cases (including the important "paste-as-quotation" case) but obviously
1217 doesn't work for content quoted more than once.
1219 Now, mergeStartNode() will look for the first node in pasted content that is not a block. It will now also look
1220 for nodes specially marked by Mail as a node added to make "Paste As Quotation" work. It won't skip those.
1222 NOTE: This change will break Mail's "Paste As Quotation" feature for TOT WebKit users, but this is only a temporary
1223 problem that will exist until we sync up with Mail's pending change to mark nodes as needed in its pasteAsQuotation:
1226 * khtml/editing/html_interchange.h: Add ApplePasteAsQuotation constant used to check for "marked" blockquotes.
1227 * khtml/editing/htmlediting.cpp:
1228 (khtml::ReplacementFragment::mergeStartNode): Look for first node that is either not a block or is marked as
1229 an ApplePasteAsQuotation node.
1230 (khtml::isMailPasteAsQuotationNode): New helper that looks for nodes marked with ApplePasteAsQuotation.
1231 * khtml/editing/htmlediting.h: Updated header for new function.
1233 This test result changed is an acceptable way.
1235 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
1236 * layout-tests/editing/pasteboard/paste-text-013.html
1238 NOTE: This change causes a regression in this layout test:
1240 * layout-tests/editing/pasteboard/paste-text-013.html
1242 This problem will need to be fixed separately, and this bug has been filed to track this problem:
1243 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
1245 2005-03-09 Maciej Stachowiak <mjs@apple.com>
1247 Reviewed by Richard.
1249 <rdar://problem/4040776> Dashboard (Weather widget) is a memory hog
1251 Change things around so the event listeners for XMLHttpRequest
1252 mark their JS listener objects instead of holding a hard
1253 reference, to avoid an unbreakable reference cycle.
1255 * khtml/ecma/kjs_events.cpp:
1256 (JSAbstractEventListener::JSAbstractEventListener):
1257 (JSAbstractEventListener::~JSAbstractEventListener):
1258 (JSAbstractEventListener::handleEvent):
1259 (JSAbstractEventListener::eventListenerType):
1260 (JSUnprotectedEventListener::JSUnprotectedEventListener):
1261 (JSUnprotectedEventListener::~JSUnprotectedEventListener):
1262 (JSUnprotectedEventListener::listenerObj):
1263 (JSUnprotectedEventListener::windowObj):
1264 (JSUnprotectedEventListener::mark):
1265 (JSEventListener::JSEventListener):
1266 (JSEventListener::~JSEventListener):
1267 (JSEventListener::listenerObj):
1268 (JSEventListener::windowObj):
1269 (JSLazyEventListener::JSLazyEventListener):
1270 * khtml/ecma/kjs_events.h:
1271 * khtml/ecma/kjs_html.h:
1272 * khtml/ecma/kjs_window.cpp:
1273 (Window::getJSEventListener):
1274 (Window::getJSUnprotectedEventListener):
1275 * khtml/ecma/kjs_window.h:
1276 * khtml/ecma/xmlhttprequest.cpp:
1277 (KJS::XMLHttpRequest::putValue):
1278 (KJS::XMLHttpRequest::mark):
1279 * khtml/ecma/xmlhttprequest.h:
1280 * khtml/khtml_part.h:
1282 2005-03-06 Maciej Stachowiak <mjs@apple.com>
1286 <rdar://problem/4005575> Arbitrary file disclosure vulnerability due to ability to load local html from remote content
1288 * khtml/ecma/kjs_html.cpp:
1289 (KJS::HTMLDocument::putValue):
1290 * khtml/ecma/kjs_window.cpp:
1292 (WindowFunc::tryCall):
1294 (LocationFunc::tryCall):
1295 * khtml/khtml_part.cpp:
1297 (KHTMLPart::scheduleLocationChange):
1298 (KHTMLPart::slotRedirect):
1299 (KHTMLPart::processObjectRequest):
1300 * khtml/khtml_part.h:
1301 * khtml/khtmlpart_p.h:
1302 * kwq/KWQKHTMLPart.mm:
1303 (KWQKHTMLPart::openURLRequest):
1304 (KWQKHTMLPart::urlSelected):
1305 (KWQKHTMLPart::createPart):
1306 * kwq/KWQKHTMLPartBrowserExtension.mm:
1307 (KHTMLPartBrowserExtension::createNewWindow):
1308 * kwq/WebCoreBridge.h:
1309 * kwq/WebCoreBridge.mm:
1310 (hasCaseInsensitivePrefix):
1311 (-[WebCoreBridge didNotOpenURL:pageCache:]):
1312 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]):
1314 2005-03-09 Richard Williamson <rjw@apple.com>
1316 Fixed <rdar://problem/4032938> Safari: text layout for MS P Gothic font is corrupted
1318 Remove our hacked special case now we have our own cache of
1319 which fonts are fixed pitch.
1324 (QFont::isFixedPitch):
1326 2005-03-09 David Harrison <harrison@apple.com>
1330 <rdar://problem/4037141> REGRESSION (Mail): Pasting deletes preceding blank lines with certain steps
1332 * khtml/editing/htmlediting.cpp:
1333 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
1334 Add check for anonymous text after blocks.
1336 2005-03-08 Ken Kocienda <kocienda@apple.com>
1342 <rdar://problem/4039661> crash in ApplyStyleCommand::applyBlockStyle pasting contents of webpage into Mail or Blot
1343 <rdar://problem/4039672> hang in moveParagraphContentsToNewBlockIfNecessary after pasting contents of webpage into Blot
1345 * khtml/editing/htmlediting.cpp:
1346 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Fix for 4039672. Iteration needs to do
1347 a traverseNextSibling(), not a traverseNextNode(). The latter might iterate into a child that already got moved, and
1348 the code can infinite loop as a result.
1349 (khtml::ApplyStyleCommand::applyBlockStyle): Fix for 4039661. This function iterates over a set of nodes to apply
1350 block styles. Before, the iteration would go from the start to the end of the selection, and apply block styles
1351 as it went. However, the act of applying style could confuse the iteration. Now I iterate and store the relevant
1352 nodes in QPtrList before doing any style manipulation, and then iterate that set of nodes.
1354 2005-03-08 Darin Adler <darin@apple.com>
1356 Change written by Hyatt, reviewed by me.
1358 - fixed <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
1360 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth):
1361 Only use a minWidth of 0 for images with a percentage value. Other replaced elements aren't scalable
1362 so their minWidth should be their calculated width. This has been wrong all along, but it's a relatively
1363 safe change because it only affects replaced elements' min-width.
1365 2005-03-08 David Harrison <harrison@apple.com>
1369 <rdar://problem/4039006> REGRESSION (Mail): Command-left-arrow goes to the start of the wrong line in particular message
1371 * khtml/editing/visible_units.cpp:
1372 (khtml::startOfLine):
1373 Use firstLeafChild() instead of firstChild().
1375 2005-03-08 Richard Williamson <rjw@apple.com>
1377 Fixed by Tom Madden.
1379 Fixed <rdar://problem/4038586> 8A402: Osaka-Mono text overlaps when typing with input method
1381 We weren't clearing the "all ascii" flag when setting text on
1384 Reviewed by Richard Williamson.
1386 * khtml/rendering/render_text.cpp:
1387 (RenderText::setText):
1389 2005-03-08 Darin Adler <darin@apple.com>
1391 Reviewed by Ken and Maciej.
1393 - fixed <rdar://problem/3988809> REGRESSION (Mail): wide space characters are turned into plain old spaces when typed or pasted
1395 Changed the few places where it matters to use a "collapsible whitespace" concept instead of
1396 the general whitespace concept. This means treating only ' ' and '\n' specially instead of
1397 including other space characters, which matches what the space-collapsing logic does in RenderText,
1398 although it really needs to behave differently based on whitespace mode.
1400 * khtml/editing/visible_text.h: (khtml::isCollapsibleWhitespace): Added. This returns true only for
1401 ' ' and '\n' since they are the only characters collapsed once text is in the DOM. But really it
1402 can't do the job ignoring white-space mode, so some day it must go.
1404 * khtml/editing/html_interchange.cpp: (convertHTMLTextToInterchangeFormat): Changed to use
1405 isCollapsibleWhitespace and removed unnecessary calls to latin1().
1407 * khtml/editing/htmlediting.cpp:
1408 (khtml::isNBSP): Removed unnecessary creation/destruction of QChar each time this is called.
1409 (khtml::nextCharacterIsCollapsibleWhitespace): Renamed from isWS and changed to use isCollapsibleWhitespace.
1410 (khtml::DeleteSelectionCommand::fixupWhitespace): Use isCollapsibleWhitespace instead of isWS,
1411 since we only want to do our NBSP tricks for collapsible whitespace.
1412 (khtml::InsertTextCommand::input): Changed use of isTab to instead say == "\t" since that does the
1413 same thing and is arguably just as clear. Changed use of isWS to == " " since the input text can't
1414 include any "\n" characters, and really a plain old space is the only collapsible thing that can
1415 be passed in. Use isCollapsibleWhitespace instead of isWS since we want to do NBSP tricks only for
1416 collapsible whitespace, not all whitespace.
1417 (khtml::InsertTextCommand::insertSpace): Use isCollapsibleWhitespace instead of isWS since we want
1418 to do NBSP tricks only for collapsible whitespace, not all whitespace.
1419 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
1421 * khtml/xml/dom_position.h: Changed treatNBSPAsWhiteSpace parameters to considerNonCollapsibleWhitespace
1422 parameters. The most common callers are only interested in collapsible whitespace, and the smart copy
1423 and paste callers want to include all whitespace, including non-breaking spaces and all the Unicode spaces.
1424 * khtml/xml/dom_position.cpp:
1425 (DOM::Position::leadingWhitespacePosition): Rename the parameter, and use either QChar::isSpace or
1426 isCollapsibleWhitespace depending on the boolean passed in.
1427 (DOM::Position::trailingWhitespacePosition): Ditto.
1429 2005-03-07 John Sullivan <sullivan@apple.com>
1433 - <rdar://problem/4040868> REGRESSION (Mail, 403-403+): Drag and drop deletes text,
1434 many other bad editing problems
1436 * khtml/rendering/render_text.cpp:
1437 (RenderText::caretMaxOffset):
1438 A "-" should have been a "+" in this method that was tweaked an hour ago. Editing
1439 was completely horked.
1441 2005-03-07 Richard Williamson <rjw@apple.com>
1443 Additional nil check from fix for 4040749.
1445 * khtml/rendering/render_box.cpp:
1446 (RenderBox::setStyle):
1448 2005-03-07 Richard Williamson <rjw@apple.com>
1450 Additional nil check from fix for 4040749.
1452 * khtml/rendering/render_layer.cpp:
1453 (RenderLayer::updateLayerPosition):
1455 2005-03-07 David Harrison <harrison@apple.com>
1459 <rdar://problem/4033202> REGRESSION (Mail): Can't arrow up at a particular spot in a particular Mail message
1461 Doublecheck that new position is really on a different line, because the VisiblePosition constructor does not.
1462 Filed <rdar://problem/4040763> for that problem.
1464 * khtml/editing/visible_units.cpp:
1465 (khtml::previousLinePosition):
1467 2005-03-07 Richard Williamson <rjw@apple.com>
1469 Fixed <rdar://problem/4040749> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
1471 When layers are dynamically created/removed as a result of changing opacity they weren't being correctly
1472 sized and positioned. This happens whenever opacity goes from < 1 to 1.
1476 * khtml/rendering/render_box.cpp:
1477 (RenderBox::setStyle):
1478 * khtml/rendering/render_layer.cpp:
1479 (RenderLayer::updateLayerPosition):
1481 2005-03-07 Christy Warren <kali@apple.com>
1485 * khtml/rendering/render_text.cpp:
1486 (RenderText::caretMinOffset): modified to handle BIDI case by checking all text boxes for min offset
1487 (RenderText::caretMaxOffset): modified to handle BIDI case by checking all text boxes for max offset
1489 2005-03-07 David Harrison <harrison@apple.com>
1493 <rdar://problem/4029225> REGRESSION (Mail): Crash if hit return after dragging in attachment - DeleteSelectionCommand::initializePositionData
1495 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.
1496 Filed <rdar://problem/4040358> RenderBR height() is not accurate.
1498 * khtml/editing/htmlediting.cpp:
1499 (khtml::ReplaceSelectionCommand::doApply):
1500 When height is 0, double check that the placeholder is the first position on the line.
1504 2005-03-07 Ken Kocienda <kocienda@apple.com>
1510 <rdar://problem/4040136> Expose SPI for WebCore's functions to create document fragments from plain text and markup strings
1512 * kwq/DOMHTML.mm: Add two new SPI functions.
1513 (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:])
1514 (-[DOMHTMLDocument _createDocumentFragmentWithText:])
1515 * kwq/DOMPrivate.h: Declare the new SPI here, a privately-exported header, so Mail can make use of it.
1517 2005-03-07 Ken Kocienda <kocienda@apple.com>
1523 <rdar://problem/4039676> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date
1525 * khtml/editing/htmlediting.cpp:
1526 (khtml::ReplaceSelectionCommand::doApply): Code to "eat" a <br> element, that was creating an otherwise empty line, was running
1527 when it should not. If the content being pasted in does not end in a "logical" newline itself, then the <br> already
1528 in the content needs to be preserved. A simple one-line change now sees to this.
1530 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: This test now has an extra, but harmless,
1531 <br> at the end of a paragraph. This makes sense given the code change.
1534 * layout-tests/editing/pasteboard/paste-text-018-expected.txt: Added.
1535 * layout-tests/editing/pasteboard/paste-text-018.html: Added.
1537 2005-03-07 Ken Kocienda <kocienda@apple.com>
1543 <rdar://problem/4035648> REGRESSION (Mail): line feed in source HTML file causes bad copy/paste behavior
1545 The createMarkup() function in markup.cpp iterates over the nodes in a range,
1546 and does some bookkeeping to figure out when to add close tags to the markup.
1547 Some code added at the start of the loop to prevent markup from being written
1548 for unrendered nodes short-circuited the rest of the loop, and so prevented
1549 the close-tag-writing code from running when it should.
1551 This is why the "plain" text wound up inside of the bold tag in the example
1552 above. The addition of the unrendered return character caused an incorrect
1553 delay in the close tag for the bold element from being written out, with the
1554 result being that it wound up including additional content.
1556 The fix is to add checks for node renderers throughout the loop at the points
1557 where markup is written out for each node. This allows the additional close
1558 tag logic to run as needed.
1560 All layout tests pass with this change.
1562 * khtml/editing/markup.cpp:
1563 (khtml::createMarkup)
1567 * layout-tests/editing/pasteboard/paste-4035648-fix-expected.txt: Added.
1568 * layout-tests/editing/pasteboard/paste-4035648-fix.html: Added.
1570 2005-03-06 Christy Warren <kali@appple.com>
1574 * khtml/rendering/render_text.cpp:
1575 (lastRendererOnPrevLine): helper for RenderText::caretRect
1576 (RenderText::caretRect): added code to properly handle bidi ordered text boxes
1578 2005-03-06 Christy Warren <kali@apple.com>
1582 * khtml/editing/visible_position.cpp: Eliminated code that cuts off searching through the text boxes based on an assumption that breaks under bidi
1583 (khtml::VisiblePosition::isCandidate):
1584 * kwq/KWQFontMetrics.mm:
1585 (QFontMetrics::checkSelectionPoint): Made the initialization of the WebCoreStyle honor the reversed flag
1587 2005-03-05 John Sullivan <sullivan@apple.com>
1591 - fixed <rdar://problem/4038417> Mail crashed in StyleChange::checkForLegacyHTMLStyleChange
1592 when composing a reply
1594 * khtml/editing/htmlediting.cpp:
1595 (khtml::StyleChange::checkForLegacyHTMLStyleChange):
1596 Added missing nil check.
1598 2005-03-05 Darin Adler <darin@apple.com>
1602 - fixed <rdar://problem/4038478> Crash in renderer viewing RSS feed at feed://wvs.topleftpixel.com/index.rdf
1604 * khtml/xml/dom_docimpl.cpp: (widgetForNode): Check for nil before going from node to renderer.
1606 2005-03-05 Darin Adler <darin@apple.com>
1608 Reviewed by Richard.
1610 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
1612 * khtml/rendering/render_text.cpp:
1613 (getCharacterBreakIterator): Added. Helper that sets up an iterator for the passed-in text.
1614 Shares a single global iterator (fast, albeit not thread-safe).
1615 (RenderText::previousOffset): Changed to call getCharacterBreakIterator.
1616 (RenderText::nextOffset): Ditto.
1618 2005-03-05 Ken Kocienda <kocienda@apple.com>
1624 <rdar://problem/4038267> REGRESSION (Mail): Crash copying and pasting end of paragraph
1626 Code to handle content that has a "logical" newline at the end of the pasted content, and the code
1627 to adjust the selection at the end of the paste operation made an assumption that at least one
1628 node had been inserted by the paste command. This is not necessarily true in the case where the sole content
1629 in the pasted content is one of these "logical" newlines. Adjust some code around so that we don't deref
1630 null, but still adjust the selection correctly for this case. In each of the two functions below, some
1631 null checks have been added, and some code has been rearranged a little bit to continue on through
1632 the end of completeHTMLReplacement, even if no nodes have been inserted. The patch looks bigger and more
1633 complicated than the conceptual change.
1635 * khtml/editing/htmlediting.cpp:
1636 (khtml::ReplaceSelectionCommand::doApply)
1637 (khtml::ReplaceSelectionCommand::completeHTMLReplacement)
1639 * layout-tests/editing/pasteboard/paste-4038267-fix-expected.txt: Added.
1640 * layout-tests/editing/pasteboard/paste-4038267-fix.html: Added.
1642 2005-03-05 Darin Adler <darin@apple.com>
1646 - fixed <rdar://problem/4025918> images copied from Safari with relative src URLs aren't pasted into Mail messages (KURL resolves base URLs incorrectly)
1648 * kwq/KWQKURL.mm: (KURL::KURL): Add a slash at the start of the path if a relative part is adding
1649 a path onto a URL that has "pre-path" bits like host name, but no path yet. This doesn't come up
1650 for http because in that case we add a trailing "/" as part of canonicalization.
1652 2005-03-04 John Sullivan <sullivan@apple.com>
1656 - fixed <rdar://problem/4033705> REGRESSION (Mail): Copy/Paste from Excel
1657 crashes Mail in KWQKHTMLPart::fontForSelection(bool*) const + 232
1659 * kwq/KWQKHTMLPart.mm:
1660 (KWQKHTMLPart::fontForSelection):
1661 Check for nil startNode, not just nil renderer.
1663 2005-03-04 David Harrison <harrison@apple.com>
1665 Reviewed by Ken, Richard.
1667 <rdar://problem/3996383> REGRESSION (Mail): Deleting all of first line also deletes line ending
1669 Problem was the placeholder check was based on 0 height block, but the block in this
1670 case is the BODY, which has other content even though the paragraph is gone.
1672 * khtml/editing/htmlediting.cpp:
1673 (khtml::CompositeEditCommand::insertBlockPlaceholder):
1674 Now does insert instead of append!
1676 (khtml::CompositeEditCommand::appendBlockPlaceholder):
1677 New. Actually does append.
1679 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
1680 Renamed from insertBlockPlaceholderIfNeeded because it can insert or append. Also accepts "force insert" flag.
1682 (khtml::CompositeEditCommand::removeBlockPlaceholder):
1683 Renamed for succinctness from removeBlockPlaceholderIfNeeded.
1685 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
1686 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
1687 Use renamed methods.
1689 (khtml::DeleteSelectionCommand::doApply):
1690 Use addBlockPlaceholderIfNeeded "force insert" flag if deleting whole paragraphs did not leave an empty one.
1692 (khtml::InsertParagraphSeparatorCommand::doApply):
1693 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1694 (khtml::InsertTextCommand::input):
1695 Use renamed methods.
1697 * khtml/editing/htmlediting.h:
1698 Renamed and new methods per above.
1701 2005-03-04 Chris Blumenberg <cblu@apple.com>
1703 Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after pasting attachment at end of message
1707 * khtml/editing/visible_units.cpp:
1708 (khtml::endOfParagraph): don't consider text nodes that have no rendered characters
1710 2005-03-04 Richard Williamson <rjw@apple.com>
1712 Fixed <rdar://problem/4034764> REGRESSION(125-188)Viewing text/plain page and going back/forward corrupts HTML pages (google.com)
1714 The parse mode wasn't be restored to the document when going
1719 * kwq/KWQKHTMLPart.mm:
1720 (KWQKHTMLPart::openURLFromPageCache):
1721 * kwq/KWQPageState.h:
1722 * kwq/KWQPageState.mm:
1723 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]):
1725 2005-03-04 Ken Kocienda <kocienda@apple.com>
1729 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Shame on me!
1730 I landed my last fix without running layout tests. This one changes in a subtle, but
1733 2005-03-04 Ken Kocienda <kocienda@apple.com>
1735 Reviewed by Harrison
1739 <rdar://problem/4032543> REGRESSION (Mail): Mail hangs when quoted text is pasted twice
1741 This code change fixes the bug in a non-obvious way. The root cause of the problem was
1742 that a VisiblePosition created using an affinity originating in Mail code caused
1743 two VisiblePosition objects that should have been equal to differ only in their
1744 affinities, which in turn caused us to run a code path that should not have run.
1746 * khtml/editing/visible_position.cpp:
1747 (khtml::VisiblePosition::VisiblePosition): Added copy constructor.
1748 (khtml::VisiblePosition::next): Factored out inline code that used to be here into new
1749 setAffinityUsingLinePosition() function.
1750 (khtml::isEqualIgnoringAffinity): New helper to handle cases when affinity in equality check does
1751 not matter. However, we want to know about such cases where a VisiblePosition differs only by affinity,
1752 and the code will assert in development when this happens.
1753 (khtml::isNotEqualIgnoringAffinity): Ditto, but not. :)
1754 (khtml::setAffinityUsingLinePosition): New helper function mentioned above. This will "correct"
1755 upstream affinity to downstream if the affinity does not make a difference for the position.
1756 * khtml/editing/visible_position.h:
1757 * khtml/editing/visible_range.h: Wacky bug. The operator== for this class took VisiblePosition classes!
1758 * khtml/editing/visible_units.cpp:
1759 (khtml::isStartOfParagraph): Now performs equality check without regard to affinity.
1760 (khtml::isEndOfParagraph): Ditto.
1761 (khtml::isStartOfBlock): Ditto.
1762 (khtml::isEndOfBlock): Ditto.
1763 * kwq/WebCoreBridge.mm:
1764 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Adjusts the affinity using setAffinityUsingLinePosition()
1767 2005-03-04 Darin Adler <darin@apple.com>
1771 - fixed <rdar://problem/4036817> REGRESSION: ctrl-y broken when a line + carriage return cut
1773 * khtml/editing/htmlediting.h: Added insertTextRunWithoutNewlines.
1774 * khtml/editing/htmlediting.cpp:
1775 (khtml::InsertTextCommand::input): Added assertion to make sure strings with newlines don't get
1777 (khtml::TypingCommand::insertText): Added. Takes the name of the old function, but is a new
1778 level that breaks runs into lines and inserts each one separately.
1779 (khtml::TypingCommand::insertTextRunWithoutNewlines): Renamed old insertText to this.
1781 * khtml/dom/dom_string.h: Made substring be a const member function.
1782 * khtml/dom/dom_string.cpp: (DOM::DOMString::substring): Made this const.
1784 2005-03-04 Darin Adler <darin@apple.com>
1788 - fixed <rdar://problem/4020413> REGRESSION (Mail): can't use fonts with names that start with "#" in Mail (Korean fonts)
1790 * khtml/css/css_valueimpl.cpp:
1791 (DOM::isLegalIdentifier): Added. Commented out and not used.
1792 (DOM::quoteStringIfNeeded): Quotes the string if needed. For now only if it starts with "#".
1793 (DOM::CSSPrimitiveValueImpl::cssText): Call quoteStringIfNeeded when asked for cssText for an arbitrary string, since we
1794 need text you can re-parse.
1795 (DOM::FontFamilyValueImpl::cssText): Ditto.
1797 * khtml/editing/markup.cpp:
1798 (khtml::startMarkup): Added comments about lack of quoting for attributes.
1799 (khtml::createMarkup): Ditto.
1801 2005-03-04 Adele Amchan <adele@apple.com>
1805 Fix for <rdar://problem/4021711> REGRESSION(125-188) blank pages when browsing forum at cooperativeresearch.org - cached external script problem
1807 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::scriptHandler): set flag needToRefCachedScript so we can make sure
1808 notifyFinished is called after pendingSrc is set up with the right data from the cached script
1810 2005-03-04 Ken Kocienda <kocienda@apple.com>
1816 <rdar://problem/4029632> Tiger 8A398:- Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
1818 * khtml/editing/htmlediting.cpp:
1819 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): VisiblePosition constructor
1820 was failing to yield a position for a node just pasted into the document since a layout was needed
1821 for the calculation to come out right. Layout added. Crash gone.
1825 2005-03-03 Chris Blumenberg <cblu@apple.com>
1827 Fixed: <rdar://problem/3992803> Cannot navigate through list items with the keyboard, you're stuck in the same <li> block unless you click out
1829 Reviewed by harrison.
1831 * khtml/rendering/render_line.cpp:
1832 (khtml::RootInlineBox::closestLeafChildForXPos): avoid returning list markers when possible. Also improved heuristic for returning the best InlineBox given the passed X position.
1835 2005-03-03 Ken Kocienda <kocienda@apple.com>
1841 <rdar://problem/4035198> Pasting text with different styles does not get reproducible results
1843 I had a good idea yesterday to improve the way we "fixup" styles after
1844 pasting, but i chose a poor data structure to do it, a map of
1845 nodes-to-styles. In the fixup step, I iterated over the map elements and
1846 did the fixup. However, since the order in which the items would come
1847 out of the map is indeterminate, we got unpredictable results.
1849 So, the concept was good, but the implementation was flawed. I have
1850 fixed this mapping to be a list instead, so the order that nodes are
1851 evaluated in the fixup step is document order. This works nicely.
1853 * khtml/editing/htmlediting.cpp:
1854 (khtml::ReplacementFragment::~ReplacementFragment): No longer need to explicity deref nodes and
1855 styles saved away for later fixup. This is now handled by the new NodeDesiredStyle class.
1856 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls computeAndStoreNodeDesiredStyle,
1857 function renamed from mapDesiredStyleForNode.
1858 Now accepts a QValueList<NodeDesiredStyle> in place of the old map.
1859 (khtml::NodeDesiredStyle::NodeDesiredStyle): New class that represents a node-to-style mapping.
1860 (khtml::NodeDesiredStyle::~NodeDesiredStyle): Ditto.
1861 (khtml::NodeDesiredStyle::operator=): Ditto.
1862 (khtml::ReplaceSelectionCommand::doApply): Now calls computeAndStoreNodeDesiredStyle,
1863 function renamed from mapDesiredStyleForNode.
1864 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Now operates on a QValueList<NodeDesiredStyle> in
1865 place of the old map.
1866 (khtml::computeAndStoreNodeDesiredStyle): Renamed from mapDesiredStyleForNode. Now operates on a
1867 QValueList<NodeDesiredStyle> in place of the old map.
1868 * khtml/editing/htmlediting.h:
1869 (khtml::NodeDesiredStyle): New class that represents a node-to-style mapping.
1870 (khtml::ReplacementFragment::desiredStyles): Now returns a QValueList<NodeDesiredStyle> in place of the old map.
1872 * layout-tests/editing/style/typing-style-003-expected.txt: Results changed in an acceptable way.
1874 2005-03-02 Darin Adler <darin@apple.com>
1878 - fixed <rdar://problem/4029741> REGRESSION (188-189): <input type=text> are cleared when you hide/show them
1880 * khtml/html/html_formimpl.h: Added detach functions for both input and text area elements, since
1881 both have m_valueMatchesRenderer flags.
1882 * khtml/html/html_formimpl.cpp:
1883 (DOM::HTMLInputElementImpl::detach): Set m_valueMatchesRenderer to false, since the renderer is going away.
1884 (DOM::HTMLTextAreaElementImpl::detach): Ditto.
1886 2005-03-02 Ken Kocienda <kocienda@apple.com>
1892 <rdar://problem/4006151> in reply, caret moves to next line after toggling bold style then typing
1894 * khtml/editing/htmlediting.cpp:
1895 (khtml::ApplyStyleCommand::applyInlineStyle): Defer cleaning up empty style until the end of the
1896 function. In some situations, the render tree can get confused when we do this removal up front.
1897 I wish I understood the reasons more deeply, but this bit of code shuffling seems harmless, and
1900 2005-03-02 Darin Adler <darin@apple.com>
1904 - fixed <rdar://problem/4024966> crash happened twice in [KWQTextField setHasFocus:] + 0xe8
1906 Added more nil checks to the widget implementations. Anywhere a widget pointer is used, do a nil check,
1907 rather than relying on high level assumptions about which calls can and can't destroy the HTML element
1908 (and hence the widget). The case in the bug seems to be a case where scrolling destroyed the element.
1909 We can't be sure this fixes the bug, but we can be relatively sure we didn't introduce any new problems,
1910 because this just avoids nil-dereferencing.
1913 (-[KWQButton becomeFirstResponder]):
1914 (-[KWQButton nextKeyView]):
1915 (-[KWQButton previousKeyView]):
1916 * kwq/KWQListBox.mm:
1917 (-[KWQTableView mouseDown:]):
1918 (-[KWQTableView becomeFirstResponder]):
1919 (-[KWQTableView numberOfRowsInTableView:]):
1920 (-[KWQTableView tableViewSelectionDidChange:]):
1921 (-[KWQTableView tableView:shouldSelectRow:]):
1922 (-[KWQTableView selectionShouldChangeInTableView:]):
1923 * kwq/KWQScrollBar.mm:
1924 (-[KWQScrollBar scroll:]):
1926 (-[KWQSlider mouseDown:]):
1927 (-[KWQSlider slide:]):
1928 (-[KWQSlider becomeFirstResponder]):
1929 (-[KWQSlider nextKeyView]):
1930 (-[KWQSlider previousKeyView]):
1931 * kwq/KWQTextArea.mm:
1932 (-[KWQTextAreaTextView becomeFirstResponder]):
1933 (-[KWQTextAreaTextView resignFirstResponder]):
1934 (-[KWQTextAreaTextView mouseDown:]):
1935 * kwq/KWQTextField.mm:
1936 (-[KWQTextFieldController action:]):
1937 (-[KWQTextFieldController controlTextDidEndEditing:]):
1938 (-[KWQTextFieldController controlTextDidChange:]):
1939 (-[KWQTextFieldController textView:didHandleEvent:]):
1940 (-[KWQTextFieldController setHasFocus:]):
1942 2005-03-02 Richard Williamson <rjw@apple.com>
1944 Fixed <rdar://problem/4031483> Leak (RenderObject::createInlineBox) reproducible with Stock widget
1946 We were leaking inline block line boxes. Argh!
1950 * khtml/rendering/render_flow.cpp:
1951 (RenderFlow::dirtyLineBoxes):
1952 * khtml/rendering/render_line.cpp:
1953 (khtml::InlineBox::deleteLine):
1955 2005-03-02 Chris Blumenberg <cblu@apple.com>
1957 Fixed: <rdar://problem/3976872> REGRESSION (Mail): Pasted plain text doesn't get the proper style if pasted into newlines
1959 Reviewed by kocienda.
1961 * khtml/editing/htmlediting.cpp:
1962 (khtml::EditCommand::styleAtPosition): new, factored out from calculateStyleBeforeInsertion
1963 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): call styleAtPosition
1964 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): clear new m_insertionStyle ivar
1965 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): deref new m_insertionStyle ivar
1966 (khtml::ReplaceSelectionCommand::doApply): store the style so it later be applied when matching style
1967 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply style from m_insertionStyle when matching style
1968 * khtml/editing/htmlediting.h:
1970 2005-03-02 Maciej Stachowiak <mjs@apple.com>
1974 <rdar://problem/4031718> REGRESSION (401-401+): Safari reproducible crash setting up scope in JSLazyEventListener::parseCode authenticating to bugweb
1976 * khtml/ecma/kjs_events.cpp:
1977 (JSLazyEventListener::parseCode): If originalNode is NULL, don't
1978 mess with the scope chain.
1980 * khtml/html/html_baseimpl.cpp:
1981 (HTMLBodyElementImpl::parseHTMLAttribute): For handlers that are
1982 delcared on body but set on the document, pass NULL to avoid
1983 swizzling the scope chain. It turns out that this is what browsers
1984 do, and it finesses the crash.
1986 2005-03-02 David Harrison <harrison@apple.com>
1990 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
1992 * khtml/editing/htmlediting.cpp:
1993 (khtml::ReplaceSelectionCommand::doApply):
1995 2005-03-02 Ken Kocienda <kocienda@apple.com>
2000 <rdar://problem/4020574> REGRESSION (Mail): copy/paste first part of reply-quoted text alters downstream style
2002 The problem was that the operation to move nodes following the newly-pasted nodes did not preserve the
2003 style of these moved nodes. I have generalized some of the functions that compute and preserve styles
2004 for nodes and then apply these styles after a DOM operation.
2006 * khtml/editing/htmlediting.cpp:
2007 (khtml::ReplacementFragment::~ReplacementFragment): Call new derefNodesAndStylesInMap() helper function
2008 in place of old code that had this deref'ing inline.
2009 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls new mapDesiredStyleForNode() helper
2010 function place of old code that had this style computation inline.
2011 (khtml::ReplacementFragment::removeStyleNodes): Updated comment for new helper name.
2012 (khtml::ReplaceSelectionCommand::doApply): Now calls new helpers in place of helpers whose names were changed,
2013 or in place of pre-refactored inline code.
2014 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Renamed from applyStyleToInsertedNodes(). Now generalized
2015 to take the map of nodes to use for the fixup. This makes it possible to call this code with different maps,
2016 and that is needed to fix the bug.
2017 (khtml::mapDesiredStyleForNode): New helper function to compute the inheritable styles for a given node
2018 and map this style to the given node in the given map. This function now also includes the code that was
2019 in the removeBlockquoteColorsIfNeeded(). This latter helper has now been removed.
2020 (khtml::derefNodesAndStylesInMap): Simple helper to deref map members.
2021 * khtml/editing/htmlediting.h:
2022 (khtml::ReplacementFragment::desiredStyles): New helper to return map of nodes-to-desiredStyles.
2024 2005-03-01 Ken Kocienda <kocienda@apple.com>
2030 <rdar://problem/4011358> REGRESSION(Mail): after dragging text to mail message and deleting, typing or dragging new text doesn't work
2032 * khtml/editing/visible_position.cpp:
2033 (khtml::VisiblePosition::isCandidate): Insertion point disappearing was due to a failed
2034 check here after deleting all the content in the body element. The special "empty block"
2035 needs to add check for DOM children. A block may have straggling anonymous render children in
2036 some cases, and so the check needs to be (!DOM-kids || !render-kids).
2038 Also, I botched the last checkin trying to split these two patches in my tree. Wrong layout tests
2039 got checked in, I checked in a conflict marker in the Changelog, etc. I fixed everything with this checkin.
2041 2005-03-01 Ken Kocienda <kocienda@apple.com>
2045 Improved fix for this bug:
2047 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
2049 Maciej and I discussed this situation at length, and we came up with a better fix than I did earlier.
2051 * khtml/editing/htmlediting.cpp:
2052 (khtml::InsertParagraphSeparatorCommand::doApply): Simplify one special case so that it only handles the
2053 "last in block" situation. Remove special case for "downstream node is in different block" and handle
2054 this case with a little bit of special code in the general insertion case.
2056 Results studied to make sure there were no problems.
2058 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt
2059 * layout-tests/editing/inserting/insert-div-001-expected.txt
2060 * layout-tests/editing/inserting/insert-div-002-expected.txt
2061 * layout-tests/editing/inserting/insert-div-004-expected.txt
2062 * layout-tests/editing/inserting/insert-div-005-expected.txt
2063 * layout-tests/editing/inserting/insert-div-009-expected.txt
2064 * layout-tests/editing/inserting/insert-div-014-expected.txt
2065 * layout-tests/editing/inserting/insert-div-018-expected.txt
2066 * layout-tests/editing/inserting/insert-div-024-expected.txt
2067 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
2068 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
2069 * layout-tests/editing/pasteboard/paste-text-015-expected.txt
2070 * layout-tests/editing/style/block-style-004-expected.txt
2071 * layout-tests/editing/style/block-style-005-expected.txt
2072 * layout-tests/editing/style/block-style-006-expected.txt
2076 * layout-tests/editing/inserting/insert-div-027.html
2077 * layout-tests/editing/inserting/insert-div-027-expected.txt
2079 2005-03-01 David Hyatt <hyatt@apple.com>
2081 Fix for 4030890, regression with <sup> on Google. Fix some bogus != comparison checks in verticalPositionHint.
2085 (RenderObject::getVerticalPosition):
2087 2005-03-01 Chris Blumenberg <cblu@apple.com>
2089 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
2093 * khtml/editing/htmlediting.cpp:
2094 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
2095 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
2096 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
2097 * layout-tests/editing/deleting/smart-delete-001.html: Added.
2098 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
2099 * layout-tests/editing/deleting/smart-delete-002.html: Added.
2101 2005-03-01 Richard Williamson <rjw@apple.com>
2103 Fixed <rdar://problem/4029772> Weather widgets use a lot of memory (more that other widgets)
2105 The string objects created by KWQHeaderStringFromDictionary() leaked.
2107 Reviewed by John Louch.
2110 (KWQHeaderStringFromDictionary):
2112 2005-03-01 Jens Alfke <jens@apple.com>
2116 <rdar://problem/4004531> Simple Sun Signed Applet throws exceptions; doesn't run
2117 Two fixes for the way we extract the parameter-y goodness from <object> tags.
2119 * khtml/rendering/render_frames.cpp:
2120 (RenderPartObject::updateWidget):
2122 2005-03-01 Richard Williamson <rjw@apple.com>
2124 Fixed <rdar://problem/3990258> REGRESSION (125.12-181): top of picture that spans two pages is cut off on print from Safari
2126 The problem was due to incorrect "object truncation" in RenderFlow::paintLines.
2127 We attempt to push objects down if they don't fit on a page at
2128 paint time. If the attempt to push object down failed we just
2129 didn't paint at all.
2133 * khtml/rendering/render_flow.cpp:
2134 (RenderFlow::paintLines):
2136 2005-03-01 Chris Blumenberg <cblu@apple.com>
2138 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
2142 * khtml/editing/htmlediting.cpp:
2143 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
2144 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
2145 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
2146 * layout-tests/editing/deleting/smart-delete-001.html: Added.
2147 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
2148 * layout-tests/editing/deleting/smart-delete-002.html: Added.
2150 2005-03-01 Ken Kocienda <kocienda@apple.com>
2156 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
2158 * khtml/editing/htmlediting.cpp:
2159 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
2161 2005-03-01 Maciej Stachowiak <mjs@apple.com>
2165 <rdar://problem/4003774> REGRESSION(125-181): JavaScript problems @ Yankee/Dixie quiz
2167 Reworked how scopes are set up for event handlers to match other
2168 browser. This includes the following changes:
2170 - Special scope entries are set up at the time the event handler
2171 is created, not at the time it fires.
2173 - Special scope is only set up for event handlers set in the html
2174 source through an html attribute, not for handlers set using
2175 addEventHandler or setting JS properties like onclick through
2178 - Special scope is based on the DOM node on which the handler is
2179 an attribute, not the event target.
2181 This fixes the regression while allowing the fix to
2182 <rdar://problem/3798453> (DIG: getting variable with same name as
2183 DOM element attribute gets attribute value instead) to keep
2186 * khtml/ecma/kjs_events.cpp:
2187 (JSEventListener::handleEvent):
2188 (JSLazyEventListener::JSLazyEventListener):
2189 (JSLazyEventListener::parseCode):
2190 * khtml/ecma/kjs_events.h:
2191 * khtml/ecma/kjs_proxy.cpp:
2192 (KJSProxyImpl::createHTMLEventHandler):
2193 * khtml/ecma/kjs_proxy.h:
2194 * khtml/ecma/kjs_window.cpp:
2195 (Window::getJSLazyEventListener):
2196 * khtml/ecma/kjs_window.h:
2197 * khtml/html/html_baseimpl.cpp:
2198 (HTMLBodyElementImpl::parseHTMLAttribute):
2199 (HTMLFrameElementImpl::parseHTMLAttribute):
2200 (HTMLFrameSetElementImpl::parseHTMLAttribute):
2201 * khtml/html/html_elementimpl.cpp:
2202 (HTMLElementImpl::parseHTMLAttribute):
2203 * khtml/html/html_formimpl.cpp:
2204 (DOM::HTMLFormElementImpl::parseHTMLAttribute):
2205 (DOM::HTMLButtonElementImpl::parseHTMLAttribute):
2206 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
2207 (DOM::HTMLLabelElementImpl::parseHTMLAttribute):
2208 (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
2209 (DOM::HTMLTextAreaElementImpl::parseHTMLAttribute):
2210 * khtml/html/html_imageimpl.cpp:
2211 (HTMLImageElementImpl::parseHTMLAttribute):
2212 * khtml/html/html_objectimpl.cpp:
2213 (HTMLObjectElementImpl::parseHTMLAttribute):
2214 * khtml/khtml_part.cpp:
2215 (KHTMLPart::createHTMLEventListener):
2216 * khtml/khtml_part.h:
2217 * khtml/xml/dom_docimpl.cpp:
2218 (DocumentImpl::createHTMLEventListener):
2219 * khtml/xml/dom_docimpl.h:
2223 2005-03-01 Chris Blumenberg <cblu@apple.com>
2225 Backed out my patch since the tree was closed.
2227 * khtml/editing/htmlediting.cpp:
2228 (khtml::DeleteSelectionCommand::initializePositionData):
2229 * khtml/editing/jsediting.cpp:
2231 2005-03-01 Chris Blumenberg <cblu@apple.com>
2233 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
2237 * khtml/editing/htmlediting.cpp:
2238 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
2239 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
2240 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
2241 * layout-tests/editing/deleting/smart-delete-001.html: Added.
2242 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
2243 * layout-tests/editing/deleting/smart-delete-002.html: Added.
2245 2005-03-01 Ken Kocienda <kocienda@apple.com>
2251 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
2253 * khtml/editing/htmlediting.cpp:
2254 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
2256 2005-03-01 David Harrison <harrison@apple.com>
2260 <rdar://problem/3915560> Mail would like an SPI to enable "smart" text paste/drop
2262 * kwq/WebCoreBridge.h:
2263 * kwq/WebCoreBridge.mm:
2264 (-[WebCoreBridge smartDeleteRangeForProposedRange:]):
2265 (-[WebCoreBridge smartInsertForString:replacingRange:beforeString:afterString:]):
2268 2005-03-01 Chris Blumenberg <cblu@apple.com>
2270 Fixed: <rdar://problem/4030404> selection granularity should be set when extending selection via JS
2272 Reviewed by kocienda.
2274 * khtml/ecma/kjs_window.cpp:
2275 (SelectionFunc::tryCall): set the granularity on the part. This will allow us to write smart paste layout tests.
2276 * layout-tests/editing/pasteboard/smart-paste-001-expected.txt: Added.
2277 * layout-tests/editing/pasteboard/smart-paste-001.html: Added.
2278 * layout-tests/editing/pasteboard/smart-paste-002-expected.txt: Added.
2279 * layout-tests/editing/pasteboard/smart-paste-002.html: Added.
2280 * layout-tests/editing/pasteboard/smart-paste-003-expected.txt: Added.
2281 * layout-tests/editing/pasteboard/smart-paste-003.html: Added.
2282 * layout-tests/editing/pasteboard/smart-paste-004-expected.txt: Added.
2283 * layout-tests/editing/pasteboard/smart-paste-004.html: Added.
2284 * layout-tests/editing/pasteboard/smart-paste-005-expected.txt: Added.
2285 * layout-tests/editing/pasteboard/smart-paste-005.html: Added.
2286 * layout-tests/editing/pasteboard/smart-paste-006-expected.txt: Added.
2287 * layout-tests/editing/pasteboard/smart-paste-006.html: Added.
2288 * layout-tests/editing/pasteboard/smart-paste-007-expected.txt: Added.
2289 * layout-tests/editing/pasteboard/smart-paste-007.html: Added.
2291 2005-03-01 Chris Blumenberg <cblu@apple.com>
2293 Fixed: <rdar://problem/4029934> smart paste with plain text can add too many spaces
2295 Reviewed by kocienda.
2297 * khtml/editing/htmlediting.cpp:
2298 (khtml::ReplaceSelectionCommand::doApply): pass true for treatNBSPAsWhitespace to leadingWhitespacePosition and trailingWhitespacePosition
2299 * khtml/xml/dom_position.cpp:
2300 (DOM::isWS): take treatNBSPAsWhitespace param
2301 (DOM::Position::leadingWhitespacePosition): ditto
2302 (DOM::Position::trailingWhitespacePosition): ditto
2303 * khtml/xml/dom_position.h:
2305 2005-03-01 Ken Kocienda <kocienda@apple.com>
2311 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
2313 * khtml/editing/htmlediting.cpp:
2314 (khtml::InsertParagraphSeparatorCommand::doApply): Look for the upstream-most block to insert after
2315 when at the visible end of a block. This helps to avoid some undesirable sequences of markup which
2316 Dave says will be vary hard to render. Changing the command in this way avoids the "limitations"
2317 of the render tree by not asking it to render markup we do not want to make anyway.
2319 All these tests change, but either in insignificant ways, or for the better.
2321 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt:
2322 * layout-tests/editing/inserting/insert-div-001-expected.txt:
2323 * layout-tests/editing/inserting/insert-div-002-expected.txt:
2324 * layout-tests/editing/inserting/insert-div-004-expected.txt:
2325 * layout-tests/editing/inserting/insert-div-005-expected.txt:
2326 * layout-tests/editing/inserting/insert-div-009-expected.txt:
2327 * layout-tests/editing/inserting/insert-div-024-expected.txt:
2328 * layout-tests/editing/pasteboard/paste-text-011-expected.txt:
2329 * layout-tests/editing/pasteboard/paste-text-013-expected.txt:
2330 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
2331 * layout-tests/editing/style/block-style-004-expected.txt:
2332 * layout-tests/editing/style/block-style-005-expected.txt:
2333 * layout-tests/editing/style/block-style-006-expected.txt:
2334 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
2335 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
2336 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
2337 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
2339 New test to check specific problem mentioned in the bug.
2341 * layout-tests/editing/inserting/insert-div-026-expected.txt: Added.
2342 * layout-tests/editing/inserting/insert-div-026.html: Added.
2344 2005-02-28 Maciej Stachowiak <mjs@apple.com>
2348 <rdar://problem/4002864> REGRESSION(125-146) getElementById in onload fails in a test case involving external resources
2350 Moved management of elementById hashtable from attach/detach to
2351 insertedIntoDocument/removedFromDocument, to avoid being thrown
2352 off by temporary detaches due to style recalcs.
2354 * khtml/xml/dom_elementimpl.cpp:
2355 (ElementImpl::insertedIntoDocument):
2356 (ElementImpl::removedFromDocument):
2357 (ElementImpl::attach):
2358 (ElementImpl::updateId):
2359 * khtml/xml/dom_elementimpl.h:
2361 Make sure that insertedIntoDocument is called before firing any
2364 * khtml/xml/dom_nodeimpl.cpp:
2365 (NodeBaseImpl::dispatchChildInsertedEvents):
2367 2005-02-28 David Hyatt <hyatt@apple.com>
2369 Fix for 4028999, safari crashes when resetting if mallocsribble is on. Clip rects were being cleared using dead
2370 render objects. Change the ordering.
2374 * khtml/rendering/render_box.cpp:
2375 (RenderBox::detach):
2376 * khtml/rendering/render_layer.cpp:
2377 (RenderLayer::~RenderLayer):
2379 2005-02-28 Chris Blumenberg <cblu@apple.com>
2381 Fixed: <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
2383 Reviewed by kocienda.
2385 * khtml/editing/htmlediting.cpp:
2386 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Call updateLayout so caretMinOffset and caretMaxOffset return correct values.
2388 2005-02-28 John Sullivan <sullivan@apple.com>
2392 - WebCore part of fix for <rdar://problem/4023490> REGRESSION (125-185): Tabbing through links
2393 on frameset page gets stuck at end (tivofaq.com)
2395 * kwq/WebCoreBridge.h:
2396 add nextValidKeyViewOutsideWebFrameViews (code is in WebKit)
2398 2005-02-28 Ken Kocienda <kocienda@apple.com>
2404 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
2406 * khtml/css/css_computedstyle.cpp: inheritableProperties array now defined in css_valueimpl.cpp.
2407 * khtml/css/css_valueimpl.cpp: Define inheritableProperties array here.
2408 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Use new name for blockProperties, and use the new
2409 constant for the number of items in the array.
2410 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
2411 (DOM::CSSMutableStyleDeclarationImpl::removeInheritableProperties): New function.
2412 * khtml/css/css_valueimpl.h: Declare inheritableProperties array and numInheritableProperties extern so they
2413 can be defined in css_valueimpl.cpp and used in css_computedstyle.cpp.
2414 * khtml/editing/htmlediting.cpp:
2415 (khtml::ReplacementFragment::removeStyleNodes): This code was misguided, and removed too much style from HTML
2416 elements. Now, it removes from HTML elements only the styles that we replace later with a call to applyStyle().
2417 Also, add ID_B to list of inline "style" nodes we are willing to remove. Leaving it off was an oversight.
2419 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: ID_B fix made this result change, without any
2420 visible change in the test.
2424 * layout-tests/editing/style/smoosh-styles-003.html
2425 * layout-tests/editing/style/smoosh-styles-003-expected.txt
2427 2005-02-28 Richard Williamson <rjw@apple.com>
2429 Fixed <rdar://problem/4026985> CrashTracer: ...14 crashes at com.apple.WebCore: -[KWQPageState invalidate] + 32
2431 Added more nil checking and ASSERTS.
2432 Without a reproducible case this is hard to definitively resolve.
2434 Reviewed by John Sullivan.
2436 * kwq/KWQPageState.mm:
2437 (-[KWQPageState invalidate]):
2439 2005-02-28 Richard Williamson <rjw@apple.com>
2441 Fixed <rdar://problem/4027702> 3.5% performance regression btwn Safari-188 and Safari-400
2443 I inadvertently checked in some debugging code that disabled
2444 style sharing. Backed out that change.
2446 * khtml/css/cssstyleselector.cpp:
2447 (khtml::CSSStyleSelector::styleForElement):
2449 2005-02-28 Chris Blumenberg <cblu@apple.com>
2451 Fixed: <rdar://problem/4026639> www.bmw.ca configurator does not work with Safari
2455 * khtml/ecma/kjs_html.cpp:
2456 (KJS::HTMLElement::tryGet): when frameset.<name of frame child> is called, return the window object of the frame child
2458 2005-02-28 Ken Kocienda <kocienda@apple.com>
2464 <rdar://problem/4026906> Paste of HTML table content can break table structure
2466 * khtml/editing/htmlediting.cpp:
2467 (khtml::ReplacementFragment::pruneEmptyNodes): Call new isProbablyTableStructureNode() function to prevent
2468 removal of empty table structure nodes.
2469 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
2470 (khtml::isProbablyTableStructureNode): New helper function.
2471 * khtml/editing/htmlediting.h: Declare new helper.
2473 2005-02-28 Chris Blumenberg <cblu@apple.com>
2475 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
2477 Reviewed by kocienda.
2479 * khtml/editing/htmlediting.cpp:
2480 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): ref and deref the element while it is "floating"
2481 (khtml::ReplacementFragment::insertFragmentForTestRendering): ditto
2482 (khtml::floatRefdElement): new, keeps an element alive while its ref count is 0
2483 (khtml::createDefaultParagraphElement): removed commented out code
2484 (khtml::createBlockPlaceholderElement): ref the element and return it as "floating"
2485 (khtml::createFontElement): ditto
2486 (khtml::createStyleSpanElement): ditto
2487 * khtml/editing/htmlediting.h:
2489 2005-02-27 Maciej Stachowiak <mjs@apple.com>
2493 <rdar://problem/3993557> REGRESSION (125-180-ish): getElementsByTagName no longer works with namespace designations
2495 * khtml/xml/dom_nodeimpl.cpp:
2496 (NodeBaseImpl::getElementsByTagNameNS): When no namespace is specified, find elements
2497 of the specified name in any namespace to match Mozilla and earlier Safari behavior.
2499 2005-02-25 Darin Adler <darin@apple.com>
2503 - fixed <rdar://problem/4025618> Crash while searching at hollywoodvideo.com
2505 * khtml/html/html_formimpl.h: Added valueWithDefault.
2506 * khtml/html/html_formimpl.cpp:
2507 (DOM::HTMLInputElementImpl::appendFormData): Call valueWithDefault instead of going at the render object
2508 to try to get the default value; there may be no render object if this is display:none.
2509 (DOM::HTMLInputElementImpl::valueWithDefault): Added. Knows about the defaults for "submit" and "reset"
2510 buttons; otherwise just returns the value as-is.
2512 * khtml/rendering/render_form.h: Removed the defaultLabel member functions.
2513 * khtml/rendering/render_form.cpp:
2514 (RenderSubmitButton::rawText): Call valueWithDefault instead of using defaultLabel function here on
2515 the render side. The DOM needs to know how to deal with the default anyway for form submission.
2516 (RenderSubmitButton::defaultLabel): Removed.
2517 (RenderResetButton::defaultLabel): Removed.
2518 (RenderPushButton::defaultLabel): Removed.
2520 2005-02-25 Darin Adler <darin@apple.com>
2524 - fixed <rdar://problem/4025088> window onblur and onfocus don't fire when text field has focus
2526 * kwq/KWQKHTMLPart.h: Added setWindowHasFocus function and m_windowHasFocus data member.
2527 * kwq/KWQKHTMLPart.mm:
2528 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Took out the code that sends the focus and blur events.
2529 (KWQKHTMLPart::setWindowHasFocus): Put that code here instead.
2531 * kwq/WebCoreBridge.h: Added setWindowHasFocus: method to the bridge.
2532 * kwq/WebCoreBridge.mm: (-[WebCoreBridge setWindowHasFocus:]): Added. Calls method on the part.
2534 2005-02-25 Darin Adler <darin@apple.com>
2538 - re-fixed <rdar://problem/3665430> horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode
2540 * kwq/KWQTextArea.mm: (-[KWQTextArea _updateTextViewWidth]): Don't change the text view width
2541 to match the text area's width in the "wrap" case.
2543 2005-02-25 Ken Kocienda <kocienda@apple.com>
2549 <rdar://problem/4021518> 8A394 Mail crashes during paste: khtml::RootInlineBox::closestLeafChildForXPos
2551 * khtml/editing/visible_units.cpp:
2552 (khtml::previousLinePosition): Adding an updateLayout call at the start of the function fixes the crash, since
2553 we caught line boxes in a not-completely-updated state.
2554 (khtml::nextLinePosition): Ditto.
2556 2005-02-25 David Hyatt <hyatt@apple.com>
2558 Fix for 4010774, make sure to avoid an O(N^2) algorithm in nextRenderer() that is triggered when large
2559 DOM subtrees are inserted into documents via one insert/append call.
2561 Reviewed by kocienda
2563 * khtml/xml/dom_nodeimpl.cpp:
2564 (NodeImpl::nextRenderer):
2566 2005-02-25 Richard Williamson <rjw@apple.com>
2568 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
2570 Second pass at fixing 3382926 w/o causing layout regressions. Same concept:
2571 if directionality of text's element is RTL and first character has neutral directionality
2572 then set the initial directionality to RTL.
2576 * khtml/rendering/bidi.cpp:
2577 (khtml::RenderBlock::bidiReorderLine):
2578 (khtml::RenderBlock::determineStartPosition):
2582 2005-02-25 Ken Kocienda <kocienda@apple.com>
2586 Roll out Chris' change to fix this bug:
2588 <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
2590 That code change is responsible for all these new crashers:
2592 <rdar://problem/4025177> crash copying safari.apple.com into Blot document
2593 <rdar://problem/4025184> crash in DOM::NodeImpl::parentNode copying "New!" from google.com to Blot
2594 <rdar://problem/4025214> crash in DOM::NodeImpl::getRect loading paste-match-style-001.html
2596 Since we wish to close the tree for a build right now, I am rolling out rather than investigating.
2598 * khtml/editing/htmlediting.cpp:
2599 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded)
2600 (khtml::ReplacementFragment::insertFragmentForTestRendering)
2601 (khtml::createDefaultParagraphElement)
2602 (khtml::createBlockPlaceholderElement)
2603 (khtml::createFontElement)
2604 (khtml::createStyleSpanElement)
2605 * khtml/editing/htmlediting.h
2607 2005-02-25 Ken Kocienda <kocienda@apple.com>
2613 <rdar://problem/4020108> Pasting text into message makes Mail crash reproducibly
2615 Note that, even with this fix, development build will crash until this bug is fixed:
2616 <rdar://problem/4024996> Applying block styles can cause assertion failure in inline style removal
2618 This will not crash deployment builds, so I am going to land.
2620 * khtml/editing/htmlediting.cpp:
2621 (khtml::ApplyStyleCommand::applyBlockStyle): Applying block styles can make the loop to reach beyondEnd
2622 fail since the structure of the document can change. Cache the next node first before operating on it,
2625 2005-02-25 Vicki Murley <vicki@apple.com>
2627 - recommit this change, since rolling it out did NOT fix the performance regression!
2629 2005-02-23 Darin Adler <darin@apple.com>
2633 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
2635 The key was to change things around so that we don't push text from the DOM to the widget
2636 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
2637 during the blur process.
2639 * khtml/html/html_formimpl.cpp:
2640 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
2641 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
2642 new value is set here.
2643 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
2645 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
2646 to true, and also sends out the input event. It's better to have this here than in the renderer code.
2647 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
2648 m_dirtyvalue) and m_valueMatchesRenderer as false.
2649 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
2650 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
2651 where the value came from.
2652 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
2653 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
2654 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
2656 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
2657 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
2658 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
2660 * khtml/rendering/render_form.cpp:
2661 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
2663 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
2665 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
2666 (RenderTextArea::handleFocusOut): Ditto.
2667 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
2668 DOM if valueMatchesRenderer is true.
2669 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
2671 2005-02-25 Chris Blumenberg <cblu@apple.com>
2673 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
2677 * khtml/editing/htmlediting.cpp:
2678 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
2679 (khtml::ReplacementFragment::insertFragmentForTestRendering):
2680 (khtml::floatRefdElement):
2681 (khtml::createDefaultParagraphElement):
2682 (khtml::createBlockPlaceholderElement):
2683 (khtml::createFontElement):
2684 (khtml::createStyleSpanElement):
2685 * khtml/editing/htmlediting.h:
2687 2005-02-25 Darin Adler <darin@apple.com>
2689 * kwq/character-sets.txt: Checked in updated file. This new file has no effect, because none of the
2690 changes affect character sets that we support, but it's good to have the latest file in here, and
2691 completely safe because I checked that the generated files have not changed.
2693 2005-02-25 Vicki Murley <vicki@apple.com>
2697 - back out this change, since it causes a 3.5% performance regression
2699 2005-02-23 Darin Adler <darin@apple.com>
2703 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
2705 The key was to change things around so that we don't push text from the DOM to the widget
2706 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
2707 during the blur process.
2709 * khtml/html/html_formimpl.cpp:
2710 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
2711 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
2712 new value is set here.
2713 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
2715 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
2716 to true, and also sends out the input event. It's better to have this here than in the renderer code.
2717 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
2718 m_dirtyvalue) and m_valueMatchesRenderer as false.
2719 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
2720 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
2721 where the value came from.
2722 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
2723 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
2724 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
2726 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
2727 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
2728 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
2730 * khtml/rendering/render_form.cpp:
2731 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
2733 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
2735 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
2736 (RenderTextArea::handleFocusOut): Ditto.
2737 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
2738 DOM if valueMatchesRenderer is true.
2739 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
2741 2005-02-25 Darin Adler <darin@apple.com>
2745 - fixed <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
2747 * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply):
2748 Use the insertNodeAfterAndUpdateNodesInserted and insertNodeBeforeAndUpdateNodesInserted
2749 functions to add the leading and trailing spaces for smart paste.
2751 2005-02-25 David Hyatt <hyatt@apple.com>
2753 Back out fix for 3382926, since it breaks LTR text inside RTL contexts.
2757 * khtml/rendering/bidi.cpp:
2758 (khtml::BidiIterator::direction):
2760 2005-02-25 David Hyatt <hyatt@apple.com>
2762 Fix for 3975039, scrolling is slow in huge RSS views. Optimize the calculation of clip rects for overflow:hidden
2763 layers. Also optimize layer movement when scrolling overflow sections.
2767 * khtml/rendering/render_layer.cpp:
2769 (ClipRects::operator delete):
2770 (ClipRects::detach):
2771 (RenderLayer::RenderLayer):
2772 (RenderLayer::~RenderLayer):
2773 (RenderLayer::updateLayerPosition):
2774 (RenderLayer::removeOnlyThisLayer):
2775 (RenderLayer::insertOnlyThisLayer):
2776 (RenderLayer::scrollToOffset):
2777 (RenderLayer::hitTest):
2778 (RenderLayer::calculateClipRects):
2779 (RenderLayer::calculateRects):
2780 (RenderLayer::containsPoint):
2781 (RenderLayer::clearClipRects):
2782 (RenderLayer::clearClipRect):
2783 * khtml/rendering/render_layer.h:
2784 (khtml::ClipRects::m_refCnt):
2785 (khtml::ClipRects::overflowClipRect):
2786 (khtml::ClipRects::fixedClipRect):
2787 (khtml::ClipRects::posClipRect):
2788 (khtml::ClipRects::ref):
2789 (khtml::ClipRects::deref):
2790 (khtml::RenderLayer::clipRects):
2791 * khtml/rendering/render_object.cpp:
2792 (RenderObject::setStyle):
2794 2005-02-24 Maciej Stachowiak <mjs@apple.com>
2796 Reviewed by Darin and Dave a while ago.
2798 <rdar://problem/3996685> REGRESSION: Crash in KWQVectorImpl::at loading http://maps.google.com/mapfiles/homepanel.xsl
2800 * kwq/WebCoreBridge.mm:
2801 (formElementFromDOMElement): Check for isHTMLElement() as well as
2802 id() == ID_FORM. This seems like an impossible situation, but
2803 papering over it seems more expedient for the time being.
2805 2005-02-24 Richard Williamson <rjw@apple.com>
2807 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
2809 Use mirror characters correctly when rendering with RTL directionality.
2813 * khtml/rendering/bidi.cpp:
2814 (khtml::BidiIterator::direction):
2816 2005-02-24 Richard Williamson <rjw@apple.com>
2818 Fixed <rdar://problem/3985889> REGRESSION (125-180): setting <img> src to GIF that already animated does not animate; just shows final frame
2822 * WebCore.pbproj/project.pbxproj:
2823 * khtml/html/html_imageimpl.cpp:
2824 (HTMLImageLoader::updateFromElement):
2825 * khtml/rendering/render_image.cpp:
2826 (RenderImage::resetAnimation):
2827 * khtml/rendering/render_image.h:
2828 * khtml/rendering/render_list.cpp:
2829 (RenderListMarker::setStyle):
2830 (RenderListMarker::paint):
2831 * khtml/rendering/render_list.h:
2835 (QPixmap::resetAnimation):
2836 * kwq/WebCoreImageRenderer.h:
2838 2005-02-24 Chris Blumenberg <cblu@apple.com>
2840 Fixed: <rdar://problem/4020110> Safari crashes in setAllData while taking a www.zoomerang.com survey
2844 * kwq/KWQResourceLoader.mm:
2845 (-[KWQResourceLoader finishJobAndHandle:]): clear the job after we've deleted to avoid reentrancy
2847 2005-02-24 Darin Adler <darin@apple.com>
2851 - fixed <rdar://problem/4023360> REGRESSION (186-187): image file upload is broken at pep.apple.com
2853 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::appendFormData): Return true after
2854 setting up the form data for an uploaded file. The old code would fall through to the ISINDEX
2855 case and send double form data (the filename instead of the file contents the second time).
2857 2005-02-24 David Harrison <harrison@apple.com>
2861 <rdar://problem/3990849> AX: textMarkerRange for an AXUIElement within an AXWebArea
2863 * kwq/KWQAccObject.mm:
2864 (-[KWQAccObject textMarkerRange]):
2865 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
2866 (-[KWQAccObject doAXTextMarkerRangeForUIElement:]):
2867 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
2868 Added AXTextMarkerRangeForUIElement, or you can send textMarkerRange to the UIElement itself.
2870 2005-02-24 David Harrison <harrison@apple.com>
2874 <rdar://problem/4004279> 3 AXSelectedTextChanged notifications are firing each time I type a character
2876 * khtml/xml/dom_docimpl.cpp:
2877 (DocumentImpl::updateSelection):
2878 Send notification only if the selection is not null. This safely ignores transitory selections set during editing.
2880 2005-02-24 Darin Adler <darin@apple.com>
2884 - fixed <rdar://problem/3987619> in some cases, text doesn't resize with Format->Style->Bigger/Smaller
2886 * khtml/editing/htmlediting.cpp:
2887 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): Only call nodeFullySelected for non-text nodes.
2888 Text nodes are already split so they're either in the range and full selected or out of the range.
2889 And nodeFullySelected doesn't work for text nodes.
2890 (khtml::ApplyStyleCommand::nodeFullySelected): Add an assertion, since this function only works for elements,
2892 (khtml::ApplyStyleCommand::nodeFullyUnselected): Ditto.
2894 - make big improvement in <rdar://problem/3953636> Mail hung for ~10sec changing font of 84328 characters: khtml::ApplyStyleCommand::nodeFullySelected
2896 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints): Improve algorithm based on suggestion
2899 - fixed <rdar://problem/4020305> REGRESSION (185-186): loading image in new window using document.write fails
2901 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::open): If there is no parent document, don't blow away the base URL.
2903 - fixed <rdar://problem/4021701> REGRESSION (188-188+): form not submitted after pressing <return> at http://hrweb.apple.com
2905 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchMouseEvent): Send activate event in the case where the event
2906 sent is a KHTML_CLICK_EVENT, not CLICK_EVENT.
2908 2005-02-23 Kevin Decker <kdecker@apple.com>
2912 Fixed <rdar://problem/4020747> REGRESSION: stray </applet> tags crash Safari
2914 * khtml/html/htmlparser.cpp:
2915 (KHTMLParser::processCloseTag): Made a typesafe check that prevents crashes
2916 whenever there is a closing applet tag without an actual <applet> in the first place.
2917 Now verifies the current token is ID_APPLET before casting it to an HTMLAppletElementImpl.
2920 2005-02-23 Ken Kocienda <kocienda@apple.com>
2926 <rdar://problem/3977962> font loses bold style after pasting next to existing text and pressing return
2928 * khtml/editing/htmlediting.cpp:
2929 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Problem here was
2930 that we were doing work in cases where we should not, and content whose style would have
2931 been correct if we had done nothing was getting clobbered. It turns out that extra work
2932 to apply style to the new paragraph added in this command only needs to be done if we're
2933 at the boundaries of a paragraph. Otherwise, content that is moved as part of the work
2934 of the command will lend their styles to the new paragraph without any extra work needed.
2935 So, make this position check and return unless at a paragraph boundary.
2939 * layout-tests/editing/style/block-styles-007-expected.txt
2940 * layout-tests/editing/style/block-styles-007.html
2942 2005-02-23 Ken Kocienda <kocienda@apple.com>
2948 <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a selection starting from end of line once
2950 Problem is with the way we figure out whether to add or remove a style based on
2951 the current selection. In this case, the code is looking at the end of the
2952 previous line, which is not bold, and deduces incorrectly that the operation is
2953 a "make bold". Then the style code runs to make bold, but there is nothing on
2954 the end of the previous line to embolden, so we get into a cycle where the same
2955 thing happens each time cmd-b is hit.
2957 * khtml/khtml_part.cpp:
2958 (KHTMLPart::selectionComputedStyle): Call editingStartPosition() to get the right position for the font determination.
2959 * khtml/xml/dom2_rangeimpl.cpp:
2960 (DOM::RangeImpl::editingStartPosition): New helper function that "does the right thing" based on whether the
2961 selection is a caret or a range, moving upstream for the former, and downstream for the latter.
2962 * khtml/xml/dom2_rangeimpl.h:
2963 * kwq/KWQKHTMLPart.mm:
2964 (KWQKHTMLPart::fontForSelection): Call editingStartPosition() to get the right position for the font determination.
2968 * layout-tests/editing/style/style-boundary-001-expected.txt
2969 * layout-tests/editing/style/style-boundary-001.html
2970 * layout-tests/editing/style/style-boundary-002-expected.txt
2971 * layout-tests/editing/style/style-boundary-002.html
2972 * layout-tests/editing/style/style-boundary-003-expected.txt
2973 * layout-tests/editing/style/style-boundary-003.html
2974 * layout-tests/editing/style/style-boundary-004-expected.txt
2975 * layout-tests/editing/style/style-boundary-004.html
2977 2005-02-23 Richard Williamson <rjw@apple.com>
2979 Fixed <rdar://problem/3985579> 8A367: Dashboard: Stock widget not visible when click remove to remove single char ticker symbol
2981 Explicitly remove scroll bar views when removing them from
2984 Don't paint synchronously when the scroll position changes,
2985 this caused funky clip problems.
2989 * khtml/rendering/render_layer.cpp:
2990 (RenderLayer::scrollToOffset):
2991 (RenderLayer::setHasHorizontalScrollbar):
2992 (RenderLayer::setHasVerticalScrollbar):
2993 (RenderLayer::updateScrollInfoAfterLayout):
2995 2005-02-23 Ken Kocienda <kocienda@apple.com>
3001 <rdar://problem/3959996> REGRESSION (Mail): cursor moves to beginning of document when click is past end
3003 * khtml/rendering/render_block.cpp:
3004 (khtml::RenderBlock::positionForCoordinates): Skip blocks that are invisible or have no height when
3005 looking for a child to pass off to. And save away the last visible block with a height to pass off
3006 to if there is no child at the right y-coordinate.
3008 2005-02-23 David Harrison <harrison@apple.com>
3012 <rdar://problem/4010059> BoundsForTextMarkerRange does not update with scrolled web area
3014 * kwq/KWQAccObject.mm:
3015 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
3016 Adjust for scrolling.
3018 2005-02-22 Maciej Stachowiak <mjs@apple.com>
3022 <rdar://problem/3949790> hitting return after pasted styled line results in extra content getting the style
3024 * khtml/editing/htmlediting.cpp:
3025 (khtml::InsertParagraphSeparatorCommand::doApply): In the case
3026 where the start block is the root, insert the newly created DIV at
3027 the end of the root block instead of after the last sibling in the
3028 start node, since the start node could be inside other
3029 style-affecting nodes and we don't want to reparent its cousins
3032 2005-02-23 David Harrison <harrison@apple.com>
3036 <rdar://problem/4014691> switch to correctly spelled NSAccessibilityForegroundColorTextAttribute constant
3038 Also removed two older, now unneeded, wrappers.
3040 * kwq/KWQAccObject.mm:
3041 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
3042 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
3043 Removed these older, now unneeded, wrappers.
3045 (NSAccessibilityForegroundColorTextAttributeWrapper):
3046 New wrapper for NSAccessibilityForegroundColorTextAttribute.
3048 (AXAttributeStringSetStyle):
3049 Use NSAccessibilityForegroundColorTextAttributeWrapper.
3051 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
3052 Remove uses of visiblePositionForStartOfTextMarkerRange and visiblePositionForEndOfTextMarkerRange.
3054 2005-02-23 David Harrison <harrison@apple.com>
3058 <rdar://problem/3524784> AX hit test doesn't return info when done in empty space of content area
3060 * kwq/KWQAccObject.mm:
3061 (-[KWQAccObject accessibilityHitTest:]):
3062 Return unignored object.
3064 2005-02-23 Darin Adler <darin@apple.com>
3068 - fixed <rdar://problem/4006509> REGRESSION (171-172): Setting CSS -khtml-user-modify property triggers crash
3070 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyProperty):
3071 Removed the code that changes the style of the element. This was never needed, and caused the
3072 style to be modified while we were iterating it.
3074 2005-02-23 Ken Kocienda <kocienda@apple.com>
3080 <rdar://problem/3980209> Mail crashed when I pressed Cmd-Shift-[ (nil-deref in ApplyStyleCommand::addBlockStyleIfNeeded)
3082 * khtml/editing/htmlediting.cpp:
3083 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Reordered the new block
3084 insertion so that it come before the move. The logic stays exactly the same, however, with the old
3085 ordering, the new block could want to become a child of itself come insertion time. I considered
3086 making a more complicated code change to fix this problem, but the simple reordering works just
3087 as well, and seems less risky.
3089 These all changed in an insignificant way. It seems that with the new code, some empty text nodes
3090 got reordered in the document. This has no effect on anything visible to the user.
3092 * layout-tests/editing/style/create-block-for-style-003-expected.txt
3093 * layout-tests/editing/style/create-block-for-style-004-expected.txt
3094 * layout-tests/editing/style/create-block-for-style-009-expected.txt
3095 * layout-tests/editing/style/create-block-for-style-011-expected.txt
3096 * layout-tests/editing/style/create-block-for-style-013-expected.txt
3098 2005-02-23 Darin Adler <darin@apple.com>
3102 - fixed <rdar://problem/4013986> REGRESSION (173-174): onclick event not sent when mouse click on checkbox is double-click
3104 We need to send an onclick event *and* an ondblclick event when we process a double click.
3106 * khtml/khtmlview.cpp: (KHTMLView::dispatchMouseEvent): In the case where we're sending a CLICK_EVENT,
3107 follow it by a KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT when handling a double click, and a DOMACTIVATE_EVENT.
3108 We no longer do the DOMACTIVATE_EVENT in dispatchGenericEvent.
3109 * khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked): send only CLICK_EVENT here, and
3110 lets dispatchMouseEvent deal with the other subsequent events.
3111 * khtml/xml/dom_nodeimpl.cpp:
3112 (NodeImpl::dispatchGenericEvent): Remove the code that sends a DOMACTIVATE_EVENT, since there's no longer
3113 a good way to figure out if this is the last event that should be sent before it is.
3114 (NodeImpl::dispatchMouseEvent): Set the meta key modifier here (as it already is set elsewhere), and
3115 follow up a CLICK_EVENT with KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT, and DOMACTIVATE_EVENT as above.
3117 2005-02-23 Darin Adler <darin@apple.com>
3121 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
3123 The key was to change things around so that we don't push text from the DOM to the widget
3124 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
3125 during the blur process.
3127 * khtml/html/html_formimpl.cpp:
3128 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
3129 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
3130 new value is set here.
3131 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
3133 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
3134 to true, and also sends out the input event. It's better to have this here than in the renderer code.
3135 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
3136 m_dirtyvalue) and m_valueMatchesRenderer as false.
3137 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
3138 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
3139 where the value came from.
3140 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
3141 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
3142 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
3144 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
3145 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
3146 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
3148 * khtml/rendering/render_form.cpp:
3149 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
3151 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
3153 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
3154 (RenderTextArea::handleFocusOut): Ditto.
3155 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
3156 DOM if valueMatchesRenderer is true.
3157 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
3159 2005-02-22 Richard Williamson <rjw@apple.com>
3161 Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions
3163 Just set dashboard dirty bit when overflow scrolling changes.
3165 Don't do comparison of regions in before scroll regions are
3166 added, instead do it in WebKit after automatic scroll regions
3171 * khtml/css/cssparser.cpp:
3172 (CSSParser::parseDashboardRegions): Cleaned up comments
3173 * khtml/css/cssstyleselector.cpp:
3174 (khtml::CSSStyleSelector::styleForElement): Cleaned up comments
3176 * khtml/khtmlview.cpp:
3177 (KHTMLView::updateDashboardRegions):
3178 * khtml/rendering/render_layer.cpp:
3179 (RenderLayer::updateScrollInfoAfterLayout):
3180 * kwq/WebDashboardRegion.m:
3181 (-[WebDashboardRegion isEqual:]):
3183 2005-02-22 Chris Blumenberg <cblu@apple.com>
3185 Fixed: <rdar://problem/3976872> Pasted plain text doesn't get the proper style if pasted into newlines
3189 * khtml/editing/htmlediting.cpp:
3190 (khtml::ReplaceSelectionCommand::doApply): don't clear the typing style when matching style
3191 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply the typing style when matching style
3192 * khtml/editing/jsediting.cpp:
3193 * khtml/khtml_part.cpp:
3194 (KHTMLPart::pasteAndMatchStyle): new
3195 * khtml/khtml_part.h:
3196 * kwq/KWQKHTMLPart.h:
3197 * kwq/KWQKHTMLPart.mm:
3198 (KWQKHTMLPart::issuePasteAndMatchStyleCommand): new
3199 * kwq/WebCoreBridge.h:
3200 * layout-tests/editing/editing.js:
3202 2005-02-22 Darin Adler <darin@apple.com>
3206 - fixed <rdar://problem/4006596> REGRESSION (183-184): crash in DOM::DocumentImpl::setFocusNode(DOM::NodeImpl*)
3208 * khtml/xml/dom_docimpl.cpp:
3209 (widgetForNode): Added helper.
3210 (DocumentImpl::setFocusNode): Re-get the widget for the node after calling updateLayout.
3211 The updateLayout can destroy the old widget, so we can't keep a stale widget pointer around.
3213 2005-02-22 Ken Kocienda <kocienda@apple.com>
3219 <rdar://problem/4003463> Mail.app HTML uses inline styling markup not understood by Entourage and Eudora
3221 * khtml/editing/htmlediting.cpp:
3222 (khtml::isEmptyFontTag): Helper for removing <font> tags.
3223 (khtml::StyleChange::styleModeForParseMode): Helper to map a document parse mode to a use/don't use
3224 legacy-html-styles value.
3225 (khtml::StyleChange::checkForLegacyHTMLStyleChange): Add support for colors, font faces, and font sizes.
3226 (khtml::ApplyStyleCommand::isHTMLStyleNode):
3227 (khtml::ApplyStyleCommand::removeHTMLFontStyle):
3228 (khtml::ApplyStyleCommand::applyTextDecorationStyle): Now call styleModeForParseMode to determine
3229 whether to use legacy html styles or not.
3230 (khtml::ApplyStyleCommand::removeInlineStyle): Now properly removes <font> styles.
3231 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
3232 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
3233 (khtml::createFontElement): Helper for applying <font> elements.
3234 * khtml/editing/htmlediting.h: All the following support the new bits of data we need to store.
3235 (khtml::StyleChange::applyFontColor)
3236 (khtml::StyleChange::applyFontFace)
3237 (khtml::StyleChange::applyFontSize)
3238 (khtml::StyleChange::fontColor)
3239 (khtml::StyleChange::fontFace)
3240 (khtml::StyleChange::fontSize)
3242 Test results updated now that we will write out <font> tags for quirks mode documents.
3244 * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt
3245 * layout-tests/editing/style/block-style-004-expected.txt
3246 * layout-tests/editing/editing/pasteboard/paste-text-011-expected.txt
3247 * layout-tests/editing/style/block-style-005-expected.txt
3248 * layout-tests/editing/style/block-style-006-expected.txt
3249 * layout-tests/editing/style/smoosh-styles-001-expected.txt
3250 * layout-tests/editing/style/smoosh-styles-002-expected.txt
3252 2005-02-22 Maciej Stachowiak <mjs@apple.com>
3256 <rdar://problem/4017066> crash in KJS::ValueImp::dispatchType() every time I load www.nytimes.com/pages/automobiles
3258 When creating option elements, use lowercase "option" instead of
3259 uppercase "OPTION" to create option elements, because only
3260 lowercase works for XHTML.
3262 * khtml/ecma/kjs_html.cpp:
3263 (KJS::HTMLSelectCollection::tryPut):
3264 (OptionConstructorImp::construct):
3266 2005-02-22 Chris Blumenberg <cblu@apple.com>
3268 WebCore fix for: <rdar://problem/3918056> Mail not line breaking my <pre> formatted emails on replies
3270 Mail must 4018993 to fully address the problem.
3272 Reviewed by kocienda.
3274 * khtml/editing/markup.cpp:
3275 (khtml::startMarkup): don't compute style for text in PRE tags
3276 (khtml::createMarkup): include PRE if it is an ancestor of the nodes in the range
3278 2005-02-21 Richard Williamson <rjw@apple.com>
3280 Fixed <rdar://problem/4008338> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
3282 There was a long standing bug in cssText(). Double value were always cast int! So,
3283 opacity values values were incorrectly converted to text, i.e. 0.75 became 0.
3285 The problem was newly triggered because we parse the css for opacity *TWICE*. This is a result of
3286 incorrectly "invalidating" the style attribute (from fix for 3790449). The second parse was from
3287 the cssText() of the style.
3291 * khtml/css/css_valueimpl.cpp:
3292 (DOM::CSSPrimitiveValueImpl::cssText):
3294 2005-02-21 David Hyatt <hyatt@apple.com>
3296 Fix for 4017204, apply the same fix to the base class nodeAtPoint that was already applied to RenderBlock.
3297 Skip elements with layers and inline flows. Demoted <form>s can end up causing trouble otherwise.
3299 Reviewed by Richard Williamson
3301 * khtml/rendering/render_box.cpp:
3302 (RenderBox::nodeAtPoint):
3304 2005-02-21 David Hyatt <hyatt@apple.com>
3306 Fix for 4017033, CSS is being parsed twice. Make sure to always validate the style attribute when it is
3307 initially parsed. Add code to clean up decls when the style attribute is completely removed. Add a new
3308 synchronizing boolean that avoids reparsing the style declaration when the attribute is simply
3309 being synced up to the declaration.
3313 * khtml/css/css_valueimpl.cpp:
3314 (DOM::CSSMutableStyleDeclarationImpl::setChanged):
3315 * khtml/html/html_elementimpl.cpp:
3316 (HTMLElementImpl::invalidateStyleAttribute):
3317 (HTMLElementImpl::updateStyleAttributeIfNeeded):
3318 (HTMLElementImpl::HTMLElementImpl):
3319 (HTMLElementImpl::~HTMLElementImpl):
3320 (HTMLElementImpl::destroyInlineStyleDecl):