1 2005-04-21 David Hyatt <hyatt@apple.com>
3 Fix for 4095839, wrong background image used on flechtwerk.de. Make sure that the global mapped
4 attribute cache hashed background attributes into per-document buckets.
6 * khtml/html/html_baseimpl.cpp:
7 (HTMLBodyElementImpl::mapToEntry):
8 * khtml/html/html_elementimpl.h:
10 * khtml/html/html_tableimpl.cpp:
11 (HTMLTableElementImpl::mapToEntry):
12 (HTMLTablePartElementImpl::mapToEntry):
13 * khtml/xml/dom_docimpl.cpp:
14 (DocumentImpl::DocumentImpl):
15 * khtml/xml/dom_docimpl.h:
16 (DOM::DocumentImpl::docID):
18 2005-04-21 Vicki Murley <vicki@apple.com>
20 - layout test for 4065447, outerHTML on images
22 * layout-tests/fast/dynamic/outerHTML-img-expected.txt: Added.
23 * layout-tests/fast/dynamic/outerHTML-img.html: Added.
25 2005-04-20 Vicki Murley <vicki@apple.com>
29 - fixed <rdar://problem/4065447> support outerHTML on IMG elements
31 * khtml/html/html_elementimpl.cpp:
32 (HTMLElementImpl::setOuterHTML):
34 2005-04-18 David Hyatt <hyatt@apple.com>
36 Fix min-height so that when it resolves to auto it does not use the box's intrinsic height.
38 * khtml/rendering/render_box.cpp:
39 (RenderBox::calcHeight):
40 (RenderBox::calcHeightUsing):
42 2005-04-18 David Hyatt <hyatt@apple.com>
44 Back out fix for 4032346, since it is causing garbled image content on many sites.
46 The bug tracking the fix is 4069093.
48 (khtml::RenderBlock::matchedEndLine):
50 2005-04-18 David Hyatt <hyatt@apple.com>
52 Fix the smile in the Acid2 test. Floats should not grow to contain other floats unless height is auto. Otherwise
53 the float should use the specified height.
55 Also fix row 14 of the Acid2 test. Although ambiguous, just modify the table cell baseline alignment code to align
56 to the bottom of the cell's content height if no suitable baseline could be found.
58 * khtml/rendering/render_block.cpp:
59 (khtml::RenderBlock::layoutBlock):
60 * khtml/rendering/render_block.h:
61 (khtml::RenderBlock::firstRootBox):
62 (khtml::RenderBlock::lastRootBox):
63 * khtml/rendering/render_table.cpp:
64 (RenderTableSection::calcRowHeight):
65 (RenderTableCell::baselinePosition):
67 2005-04-15 David Hyatt <hyatt@apple.com>
69 Make sure empty tables honor CSS-specified heights when they have no rows or sections. This is done only
70 in strict mode, since it is not compatible with WinIE.
72 * khtml/rendering/render_table.cpp:
73 (RenderTable::layout):
75 2005-04-15 David Hyatt <hyatt@apple.com>
77 Fix for row 13 of the Acid2 test. Change HTML comment parsing in strict mode to do proper SGML parsing,
78 checking for pairs of -- and only being willing to close the comment if every -- is paired up.
80 * khtml/html/htmltokenizer.cpp:
81 (khtml::HTMLTokenizer::parseComment):
83 2005-04-12 Maciej Stachowiak <mjs@apple.com>
87 - use custom single-threaded malloc for all non-GC JavaScriptCore
88 allocations, for a 9.1% speedup on JavaScript iBench
90 * khtml/ecma/kjs_binding.cpp:
92 * khtml/ecma/kjs_proxy.cpp:
93 (KJSProxyImpl::evaluate):
95 2005-04-15 David Hyatt <hyatt@apple.com>
97 Fix the six pixel gap between rows nine and ten of the Acid2 test. Make sure that percentage heights that
98 resolve to auto are properly treated as though they have auto height by the self-collapsing block check (as per
99 section 8.3.1, paragraph 7 of the CSS2.1 spec).
101 * khtml/rendering/render_block.cpp:
102 (khtml::RenderBlock::isSelfCollapsingBlock):
104 2005-04-15 David Hyatt <hyatt@apple.com>
106 The Acid2 test and the reference rendering both make use of overflow:hidden on the <html> element. Turns out
107 the CSS2.1 wording for this behavior has been revised (based off WinIE/Mozilla behavior). Change our behavior
108 to match and make <html> overflow apply to the viewport.
110 * khtml/khtmlview.cpp:
111 (KHTMLView::applyOverflowToViewport):
114 * khtml/rendering/render_box.cpp:
115 (RenderBox::setStyle):
117 2005-04-14 David Hyatt <hyatt@apple.com>
119 3258403 and 3258402 can now be fixed. min/max-width/height support is now complete. This patch makes them
120 work for positioned elements and enables us to pass row one of the Acid2 test.
122 * khtml/rendering/render_box.cpp:
123 (RenderBox::calcAbsoluteHorizontal):
124 (RenderBox::calcAbsoluteHorizontalValues):
125 (RenderBox::calcAbsoluteVertical):
126 (RenderBox::calcAbsoluteVerticalValues):
127 * khtml/rendering/render_box.h:
129 2005-04-12 David Hyatt <hyatt@apple.com>
131 Working on the Acid2 test, Row 1.
133 Improve checkChild for the DTD so that it knows what mode a document is in. This allows it to adhere more
134 strictly to the actual DTD in strict mode and almost strict mode.
136 Change the <table>-inside-<p> check so that <table> is disallowed inside <p> in
137 strict mode and almost strict mode. This matches Firefox behavior, which allows <table>
138 inside <p> only in quirks mode.
140 * khtml/html/dtd.cpp:
143 * khtml/html/htmlparser.cpp:
144 (KHTMLParser::insertNode):
145 * khtml/html/htmltokenizer.cpp:
146 (khtml::HTMLTokenizer::parseTag):
147 * khtml/xml/dom_elementimpl.cpp:
148 (ElementImpl::childAllowed):
150 2005-04-12 Vicki Murley <vicki@apple.com>
154 - fixed <rdar://problem/3760895> Request for including an implementation of the elementFromPoint function
156 * khtml/dom/dom_doc.cpp:
157 (DOM::Document::elementFromPoint):
158 * khtml/dom/dom_doc.h:
159 * khtml/ecma/kjs_dom.cpp:
160 (DOMDocumentProtoFunc::tryCall):
161 * khtml/ecma/kjs_dom.h:
162 (KJS::DOMDocument::):
163 * khtml/ecma/kjs_dom.lut.h:
165 * khtml/xml/dom_docimpl.cpp:
166 (DocumentImpl::elementFromPoint):
167 * khtml/xml/dom_docimpl.h:
169 2005-04-12 David Hyatt <hyatt@apple.com>
171 Beginning of work to support the Acid2 CSS test put forward by the Web Standards Project. Fix
172 our handling of the rel attribute on <link> elements to do a proper tokenization so that stylesheets
173 can be recognized even when other keywords are present in the rel attribute.
175 * khtml/html/html_headimpl.cpp:
176 (HTMLLinkElementImpl::HTMLLinkElementImpl):
177 (HTMLLinkElementImpl::parseHTMLAttribute):
178 (HTMLLinkElementImpl::tokenizeRelAttribute):
179 (HTMLLinkElementImpl::process):
180 * khtml/html/html_headimpl.h:
182 2005-04-12 John Sullivan <sullivan@apple.com>
184 - fixed these two bugs (I also fixed these on the experimental-ui-branch)
185 <rdar://problem/3154293> Find Next should not scroll page if the next target is already visible
186 <rdar://problem/3121828> scrollToVisible on find cuts off the left part of the view due to needless horiz. scroll
190 * kwq/KWQKHTMLPart.mm:
191 (KWQKHTMLPart::jumpToSelection):
192 Trey had written code to address these issues, but left it commented out due to other
193 problems. The other problems no longer occur, so I uncommented Trey's code, and then
194 discovered that I could make it behave more like TextEdit with many fewer lines of
197 2005-04-08 David Harrison <harrison@apple.com>
199 Reviewed by Dave Hyatt.
201 <rdar://problem/4084106> Remove NSAccessibilityForegroundColorTextAttributeWrapper
203 * kwq/KWQAccObject.mm:
204 (AXAttributeStringSetStyle):
205 Use NSAccessibilityForegroundColorTextAttribute directly.
207 2005-04-05 David Hyatt <hyatt@apple.com>
209 Fix for 4077106, make sure that mouse wheeling in overflow sections uses 40 rather than 10 as the base line
214 * khtml/rendering/render_layer.cpp:
215 (RenderLayer::positionScrollbars):
216 * kwq/KWQScrollBar.mm:
217 (QScrollBar::scroll):
219 2005-04-04 Vicki Murley <vicki@apple.com>
223 - fixed <rdar://problem/3871669> no focus or blur methods on HTML button elements
225 * khtml/dom/html_form.cpp:
226 (HTMLButtonElement::focus):
227 (HTMLButtonElement::blur):
228 * khtml/dom/html_form.h:
229 * khtml/ecma/kjs_html.cpp:
230 (KJS::HTMLElementFunction::tryCall):
231 * khtml/ecma/kjs_html.h:
232 (KJS::HTMLElement::):
233 * khtml/ecma/kjs_html.lut.h:
235 * khtml/html/html_formimpl.cpp:
236 (DOM::HTMLButtonElementImpl::blur):
237 (DOM::HTMLButtonElementImpl::focus):
238 * khtml/html/html_formimpl.h:
242 2005-03-28 David Harrison <harrison@apple.com>
246 <rdar://problem/4069161> REGRESSION (8A416-8A419): Safari crash bringing up context menu for non-HTML content in a frame
248 * kwq/KWQAccObject.mm:
249 (-[KWQAccObject rendererForView:]):
250 Nil-check node variable instead of rechecking document variable.
254 2005-03-27 Darin Adler <darin@apple.com>
256 Reviewed by me, fix by Kida-san.
258 - fixed <rdar://problem/4067474> 8A424: Safari immediately quit by Cmd+Ctrll+'D'
260 * kwq/WebCoreBridge.mm: (-[WebCoreBridge convertToNSRange:DOM::]):
265 2005-03-24 Richard Williamson <rjw@apple.com>
267 Fixed <rdar://problem/4052683> After adding/removing stocks from Stocks Widget, stock areas went blank
269 The request was being collected before firing it's load handler.
270 We now gc protect the request while it's loading.
274 * khtml/ecma/xmlhttprequest.cpp:
275 (KJS::XMLHttpRequest::send):
276 (KJS::XMLHttpRequest::abort):
277 (KJS::XMLHttpRequest::slotFinished):
278 (KJS::XMLHttpRequestProtoFunc::tryCall):
282 2005-03-23 Darin Adler <darin@apple.com>
284 Further fix for 4053515.
286 Covered cases where text position doesn't lie inside a
291 * khtml/editing/visible_text.cpp:
292 (khtml::TextIterator::setRangeFromLocationAndLength):
294 2005-03-23 Richard Williamson <rjw@apple.com>
296 Fixed <rdar://problem/4053515> REGRESSION (Mail): Kotoeri input method reconversion does not work in WebViews
298 We now use actual document NSRanges to represent both marked text
299 ranges and selection ranges.
303 * khtml/editing/visible_text.cpp:
304 (khtml::TextIterator::rangeLength):
305 (khtml::TextIterator::setRangeFromLocationAndLength):
306 * khtml/editing/visible_text.h:
307 * kwq/WebCoreBridge.h:
308 * kwq/WebCoreBridge.mm:
309 (-[WebCoreBridge convertToNSRange:DOM::]):
310 (-[WebCoreBridge DOM::convertToDOMRange:]):
311 (-[WebCoreBridge selectNSRange:]):
312 (-[WebCoreBridge markedTextDOMRange]):
313 (-[WebCoreBridge markedTextNSRange]):
315 2005-03-22 Kevin Decker <kdecker@apple.com>
319 Fixed <rdar://problem/4062336> REGRESSION (406-407): HTML submenus not working at hrweb.apple.com after going back
321 Rolled out the fix for <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
323 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.
325 * khtml/khtml_part.cpp:
326 (KHTMLPart::closeURL):
327 * khtml/xml/dom_docimpl.cpp:
328 (DocumentImpl::detach):
332 2005-03-22 Vicki Murley <vicki@apple.com>
334 - roll the fix for <rdar://problem/4060266> back in, since its
337 * khtml/editing/visible_text.cpp:
338 (khtml::TextIterator::handleTextBox):
340 2005-03-22 Vicki Murley <vicki@apple.com>
342 - roll out the fix for <rdar://problem/4060266> since it was denied by CCC
344 * khtml/editing/visible_text.cpp:
345 (khtml::TextIterator::handleTextBox):
347 2005-03-22 David Harrison <harrison@apple.com>
351 <rdar://problem/4060266> Double-clicking in Dictionary.app doesn't work for some words (coming just after style change)
353 * khtml/editing/visible_text.cpp:
354 (khtml::TextIterator::handleTextBox):
355 Complete the check of whether to emit space for collapsed space.
357 2005-03-22 David Harrison <harrison@apple.com>
361 <rdar://problem/4061443> REGRESSION (8A420-8A421): Pasting in the Stickies widget is broken again
363 * khtml/editing/htmlediting.cpp:
364 (khtml::positionBeforeContainingSpecialElement):
365 (khtml::positionAfterContainingSpecialElement):
366 Return unchanged Position rather than a null or non-editable one.
370 2005-03-20 Ken Kocienda <kocienda@apple.com>
374 I made an error in this test earlier. It was not testing what I intended. Fixed.
376 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt
377 * layout-tests/editing/unsupported-content/list-delete-001.html
381 * layout-tests/editing/unsupported-content/table-delete-001-expected.txt: Added.
382 * layout-tests/editing/unsupported-content/table-delete-001.html: Added.
383 * layout-tests/editing/unsupported-content/table-delete-002-expected.txt: Added.
384 * layout-tests/editing/unsupported-content/table-delete-002.html: Added.
385 * layout-tests/editing/unsupported-content/table-delete-003-expected.txt: Added.
386 * layout-tests/editing/unsupported-content/table-delete-003.html: Added.
387 * layout-tests/editing/unsupported-content/table-type-after-expected.txt: Added.
388 * layout-tests/editing/unsupported-content/table-type-after.html: Added.
389 * layout-tests/editing/unsupported-content/table-type-before-expected.txt: Added.
390 * layout-tests/editing/unsupported-content/table-type-before.html: Added.
392 2005-03-20 Darin Adler <darin@apple.com>
396 - fixed <rdar://problem/3923903> REGRESSION (164-165): Repro Safari crash in khtml::RenderLayer::scrollToOffset
398 * khtml/rendering/render_layer.cpp: (RenderLayer::scrollToOffset): Check canvas for nil.
400 2005-03-20 David Harrison <harrison@apple.com>
404 <rdar://problem/4055127> Dictionary pop-up panel misplaced at beginning of text blocks (breaks double-clicking in Dictionary.app)
406 SimplifiedBackwardsTextIterator::advance() needed to not limit to textnodes
407 when checking whether moving back across block boundaries
409 VisibleUnits previousBoundary() needed to INIT_DOWN when creating result VisiblePosition
411 All editing tests pass.
413 * khtml/editing/visible_text.cpp:
414 (khtml::SimplifiedBackwardsTextIterator::advance):
415 * khtml/editing/visible_units.cpp:
416 (khtml::previousBoundary):
418 2005-03-20 Darin Adler <darin@apple.com>
420 Reviewed by Harrison.
422 - 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
424 * khtml/khtml_part.h: Added selectFrameElementInParentIfFullySelected.
425 * khtml/khtml_part.cpp:
427 (KHTMLPart::setFocusNodeIfNeeded): Changed to not set focus to a frame; was not what this function was
428 intended to do, and caused trouble when trying to select a frame element.
429 (KHTMLPart::khtmlMouseReleaseEvent): Call selectFrameElementInParentIfFullySelected.
430 (KHTMLPart::selectAll): Call selectFrameElementInParentIfFullySelected.
431 (KHTMLPart::selectFrameElementInParentIfFullySelected): Added. Selects the frame element in the parent
432 if a frame is entirely selected, which makes it easier to delete or replace the frame and is consistent
433 with the changes Maciej made recently for other elements.
435 * kwq/WebCoreBridge.mm:
436 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Call selectFrameElementInParentIfFullySelected.
437 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Call selectFrameElementInParentIfFullySelected.
439 2005-03-20 Darin Adler <darin@apple.com>
441 Reviewed by me, code change by Ken.
443 - fixed <rdar://problem/4059852> Deleting from first element of list makes content jump to wrong place
445 * khtml/editing/htmlediting.cpp:
446 (khtml::isListStructureNode): Added.
447 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Check for list nodes as well as table nodes.
449 2005-03-20 Ken Kocienda <kocienda@apple.com>
453 Added tests to cover new "unsupported content" editing code.
455 * layout-tests/editing/unsupported-content/list-delete-001-expected.txt: Added.
456 * layout-tests/editing/unsupported-content/list-delete-001.html: Added.
457 * layout-tests/editing/unsupported-content/list-delete-002-expected.txt: Added.
458 * layout-tests/editing/unsupported-content/list-delete-002.html: Added.
459 * layout-tests/editing/unsupported-content/list-delete-003-expected.txt: Added.
460 * layout-tests/editing/unsupported-content/list-delete-003.html: Added.
461 * layout-tests/editing/unsupported-content/list-type-after-expected.txt: Added.
462 * layout-tests/editing/unsupported-content/list-type-after.html: Added.
463 * layout-tests/editing/unsupported-content/list-type-before-expected.txt: Added.
464 * layout-tests/editing/unsupported-content/list-type-before.html: Added.
466 2005-03-20 Ken Kocienda <kocienda@apple.com>
472 <rdar://problem/4059578> Entire list deleted, and caret disappears, when delete key hit at end of list
474 The problem is that a new case in the delete code did not consider when the
475 downstream end node of the selection might be an ancestor of the upstream start
476 node. That is the case in this bug. The downstream end is the body element, and
477 this line of code would delete all the children of the downstream end:
478 removeChildrenInRangePreservingPosition(m_downstreamEnd.node(), 0,
479 m_downstreamEnd.offset(), m_upstreamStart);
481 The fix is to check for this "is ancestor" case, and do some tree logic to find
482 the right offset of the downstream end node for the call to
483 removeChildrenInRangePreservingPosition().
485 * khtml/editing/htmlediting.cpp:
486 (khtml::DeleteSelectionCommand::handleGeneralDelete): Fixed as described.
488 2005-03-19 Ken Kocienda <kocienda@apple.com>
494 <rdar://problem/4059384> Cannot place insertion point correctly in editable text that avoids floating elements
496 Note: I strongly suspect this bug blocks a complete solution to this other Tiger/P2:
497 <rdar://problem/4055748> AX: Dictionary pop-up panel shows at wrong place on specific parts of particular pages
499 * khtml/rendering/render_text.cpp:
500 (RenderText::caretRect): Change the y-coordinate used to calculate the available width for a line. Height is wrong.
501 Top of the box containing the text where the click is done is correct. Also, add in the x-offset for the start
502 of the text box when calculating the available width. If this text box is avoiding a float at the y-coordinate
503 for the relevant box, failure to add in the amount of float-avoidance will make the text at the coordinates
504 greater than end-of-line minus float-avoidance ineligible for caret placement.
506 2005-03-19 Darin Adler <darin@apple.com>
510 - fixed <rdar://problem/4057594> REGRESSION (125-406): Unrepro crash in HTMLTokenizer::allDataProcessed after hitting Back button
512 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::allDataProcessed):
513 To get the part safely after calling end, save a guarded pointer to the view.
514 The old way could end trying to call a virtual function a part that was destroyed.
516 2005-03-19 Maciej Stachowiak <mjs@apple.com>
520 <rdar://problem/4053506> Pasting Tables and Cells in Mail does not allow editing before or after
521 <rdar://problem/4005954> REGRESSION (Mail): After copy/paste of content containing list element cannot go back to entering text at left side of page
523 * khtml/editing/htmlediting.cpp:
524 (khtml::maxDeepOffset):
525 (khtml::CompositeEditCommand::removeFullySelectedNodePreservingPosition):
526 (khtml::CompositeEditCommand::removeChildrenInRangePreservingPosition):
527 (khtml::CompositeEditCommand::removeNodePreservingPosition):
528 (khtml::CompositeEditCommand::insertBlockPlaceholder):
529 (khtml::CompositeEditCommand::appendBlockPlaceholder):
530 (khtml::CompositeEditCommand::forceBlockPlaceholder):
531 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
532 (khtml::isSpecialElement):
533 (khtml::isFirstVisiblePositionInSpecialElementInFragment):
534 (khtml::positionBeforePossibleContainingSpecialElement):
535 (khtml::positionAfterPossibleContainingSpecialElement):
536 (khtml::ApplyStyleCommand::applyInlineStyle):
537 (khtml::DeleteSelectionCommand::initializePositionData):
538 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
539 (khtml::DeleteSelectionCommand::handleGeneralDelete):
540 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
541 (khtml::DeleteSelectionCommand::doApply):
542 (khtml::InsertParagraphSeparatorCommand::doApply):
543 (khtml::ReplacementFragment::ReplacementFragment):
544 (khtml::ReplaceSelectionCommand::doApply):
545 * khtml/editing/htmlediting.h:
546 * khtml/editing/visible_position.cpp:
547 (khtml::isRenderedBR):
548 (khtml::VisiblePosition::initDownstream):
549 (khtml::isLastVisiblePositionInBlock):
550 * khtml/rendering/render_line.cpp:
551 (khtml::RootInlineBox::closestLeafChildForXPos):
552 * khtml/xml/dom_nodeimpl.cpp:
553 (NodeImpl::isBlockFlowOrTable):
554 (NodeImpl::isEditableBlock):
555 (NodeImpl::enclosingBlockFlowOrTableElement):
556 * khtml/xml/dom_nodeimpl.h:
557 * khtml/xml/dom_position.cpp:
558 (DOM::Position::upstream):
559 (DOM::Position::downstream):
560 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
561 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt:
562 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
563 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
564 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt:
566 2005-03-19 John Sullivan <sullivan@apple.com>
570 - fixed <rdar://problem/4058740> Crash (nil-deref) editing Mail reply
571 message in KWQKHTMLPart::fontForSelection (MailViewer-723)
573 * kwq/KWQKHTMLPart.mm:
574 (KWQKHTMLPart::fontForSelection):
575 Add nil check to loop. It shouldn't be necessary, but this crash trace seems to be
576 running into it. We're not completely certain, but the check is harmless at worst.
580 2005-03-18 David Harrison <harrison@apple.com>
584 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
588 * kwq/KWQAccObject.mm:
589 (-[KWQAccObject rendererForView:]):
590 New to cover both the WebCore and WebKit NSViews.
592 (-[KWQAccObject _accessibilityParentForSubview:]):
595 * kwq/WebCoreFrameView.h:
596 Add WebCoreBridgeHolder protocol to get access to WebKit NSViews.
598 2005-03-18 David Harrison <harrison@apple.com>
600 Reviewed by Darin, Ken.
602 <rdar://problem/3735625> AX: add AXPress action if an element has an onclick handler
604 * khtml/dom/html_form.cpp:
605 (HTMLInputElement::click):
606 * khtml/html/html_elementimpl.cpp:
607 (HTMLElementImpl::click):
608 (HTMLElementImpl::accessKeyAction):
609 * khtml/html/html_elementimpl.h:
610 * khtml/html/html_formimpl.cpp:
611 (DOM::HTMLFormElementImpl::submitClick):
612 (DOM::HTMLButtonElementImpl::click):
613 (DOM::HTMLButtonElementImpl::accessKeyAction):
614 (DOM::HTMLInputElementImpl::click):
615 (DOM::HTMLInputElementImpl::accessKeyAction):
616 (DOM::HTMLInputElementImpl::defaultEventHandler):
617 (DOM::HTMLLabelElementImpl::accessKeyAction):
618 (DOM::HTMLSelectElementImpl::accessKeyAction):
619 (DOM::HTMLTextAreaElementImpl::accessKeyAction):
620 * khtml/html/html_formimpl.h:
621 * khtml/html/html_inlineimpl.cpp:
622 (HTMLAnchorElementImpl::defaultEventHandler):
623 (HTMLAnchorElementImpl::accessKeyAction):
624 * khtml/html/html_inlineimpl.h:
625 * khtml/rendering/render_form.cpp:
626 (RenderFileButton::click):
627 * khtml/rendering/render_form.h:
628 * khtml/xml/dom_docimpl.cpp:
629 (DocumentImpl::defaultEventHandler):
630 * khtml/xml/dom_elementimpl.h:
631 (DOM::ElementImpl::accessKeyAction):
633 (-[DOMHTMLInputElement click]):
637 * kwq/KWQFileButton.h:
638 * kwq/KWQFileButton.mm:
639 (KWQFileButton::click):
641 Add accessKeyAction parameter about whether to limit to HTMLElementImpl subclasses that JavaScript wants, or to apply to others as well.
643 Add click() parameter about whether to send the mousedown and mouseup events in addition to the click event.
645 * kwq/KWQAccObject.mm:
646 (-[KWQAccObject mouseButtonListener]):
647 Locate a mousedown, mouseup, or click handler in the current element and its ancestors.
649 (-[KWQAccObject actionElement]):
650 (-[KWQAccObject accessibilityIsIgnored]):
651 (-[KWQAccObject accessibilityPerformAction:]):
652 Consider mouseButtonListener.
654 2005-03-18 John Sullivan <sullivan@apple.com>
658 - fixed <rdar://problem/4002164> maps that include start and end
659 location don't print right from maps.google.com
661 I thought I checked this in yesterday but a ChangeLog conflict aborted my checkin
664 * khtml/rendering/render_style.cpp:
666 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
668 * khtml/rendering/render_style.h:
669 (khtml::RenderStyle::InheritedFlags::operator==):
670 flag name changed from _should_correct_text_color to _force_backgrounds_to_white
671 (khtml::RenderStyle::setBitDefaults):
673 (khtml::RenderStyle::forceBackgroundsToWhite):
674 ditto, and method name changed too
675 (khtml::RenderStyle::setForceBackgroundsToWhite):
678 * khtml/rendering/render_text.cpp:
679 (InlineTextBox::paint):
680 updated for name change; also, compare text against white instead of current bg color
681 because we no longer actually modify the bg color (previously we would always set
682 the bg color to white, so the result is the same)
684 * khtml/xml/dom_docimpl.cpp:
685 (DocumentImpl::recalcStyle):
686 updated for name change
688 * kwq/WebCoreBridge.mm:
689 (-[WebCoreBridge styleSheetForPrinting]):
691 (-[WebCoreBridge reapplyStylesForDeviceType:]):
692 removed the code that called styleSheetForPrinting; we no longer use a stylesheet
695 * khtml/rendering/render_box.cpp:
696 (RenderBox::paintBackgroundExtended):
697 If forceBackgroundsToWhite flag is set, convert background images and
698 background colors to white background color with no background image.
700 2005-03-18 Ken Kocienda <kocienda@apple.com>
706 <rdar://problem/4056718> Pasting quotes the entire message
708 * khtml/editing/htmlediting.cpp:
709 (khtml::ReplaceSelectionCommand::doApply): After pasting, nodes are moved to the block containing
710 the end of the pasted content in certain cases. This move logic used to stop once it moved all the
711 siblings of the node following the last node of the pasted-in content. This means that block elements
712 could get moved, and if the pasted-in content included a mail blockquote, this could result in
713 one quote level getting added. The fix is to stop the move of nodes once a <br>, block element, or
714 <table> is seen. This only affected one of the many test cases we have for such scenarios, and
715 the change to that result makes sense given the code change.
716 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: This test result changed in a way that
717 adequately tests the behavior change, so I did not add a new test.
719 2005-03-17 Ken Kocienda <kocienda@apple.com>
725 <rdar://problem/4051809> 8A413: Cursor-up in a mail message sometimes gets stuck (with specific reproducible case)
727 * khtml/rendering/render_text.cpp:
728 (RenderText::positionForCoordinates): Consider two lines: line-above and line-below. If the caret position in line-below
729 was at an x coordinate between half way through the x coordinate of the last character on the line-above and the
730 end of that same character, this bug would happen since the positioning code would assume that it could create a
731 VisiblePosition with a DOWNSTREAM affinity. Now, I check to see if the character position on the line-above is the
732 last character on that line, and if it is, I use UPSTREAM as the affinity.
736 2005-03-17 David Harrison <harrison@apple.com>
738 Reviewed by Darin, Ken.
740 * khtml/editing/htmlediting.cpp:
741 (khtml::EditCommandPtr::setEndingSelection):
742 Fixed typo so that it calls setEndingSelection rather than setStartingSelection.
743 Commented out this unused method, tho, since this is late in Tiger. Proved unused by successful build after temporarily removing method declaration or implemenation.
745 2005-03-16 Kevin Decker <kdecker@apple.com>
749 Fixed <rdar://problem/4046665> REGRESSION (403-405): mypage.apple.com login does not work (hits assertion in Development build)
751 * kwq/WebCoreBridge.mm:
752 (-[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="">
754 2005-03-16 Darin Adler <darin@apple.com>
758 - fixed <rdar://problem/4045203> REGRESSION (125-188): Redundant JS imports crash Safari
760 * khtml/html/htmltokenizer.h: Take inWRite bool out of NDEBUG ifdef.
761 * khtml/html/htmltokenizer.cpp:
762 (khtml::HTMLTokenizer::HTMLTokenizer): Take inWrite bool management code out of NDEBUG ifdef.
763 (khtml::HTMLTokenizer::write): Ditto. Don't call end if inWrite is true, since it will be called
764 when you return to the body of the outer write() call.
765 (khtml::HTMLTokenizer::allDataProcessed): Don't call end() if inWrite is true for the same reason.
766 (khtml::HTMLTokenizer::finish): Ditto.
768 * kwq/KWQWidget.mm: (QWidget::getOuterView): Removed bogus assertion that has been vexing us of late.
770 2005-03-16 David Harrison <harrison@apple.com>
772 Reviewed by me (written by Patti Yeh).
774 * kwq/KWQAccObject.mm:
775 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
776 Use LeftWordIfOnBoundary instead of RightWordIfOnBoundary.
778 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
779 Use RightWordIfOnBoundary instead of LeftWordIfOnBoundary.
781 2005-03-16 David Harrison <harrison@apple.com>
785 <rdar://problem/4054590> AX: Dictionary panel does not work when page is scrolled on Safari
787 * kwq/KWQAccObject.mm:
788 (-[KWQAccObject doAXTextMarkerForPosition:]):
789 Add in the view's contentsX and contentsY to the point.
791 2005-03-16 David Harrison <harrison@apple.com>
795 <rdar://problem/4048506> Deleting from beginning of editable div deletes other document elements
799 * khtml/editing/visible_units.h:
800 * khtml/editing/visible_units.cpp:
801 (khtml::startOfEditableContent):
802 (khtml::endOfEditableContent):
803 (khtml::inSameEditableContent):
804 (khtml::isStartOfEditableContent):
805 (khtml::isEndOfEditableContent):
808 * kwq/WebCoreBridge.h:
809 * kwq/WebCoreBridge.mm:
810 (-[WebCoreBridge canDeleteRange:]):
813 2005-03-16 Ken Kocienda <kocienda@apple.com>
819 <rdar://problem/4042935> undo doesn't work properly during inline input
821 * kwq/WebCoreBridge.h: Declare new method below.
822 * kwq/WebCoreBridge.mm:
823 (-[WebCoreBridge replaceMarkedTextWithText:]): New method. Wraps calls to TypingCommand::deleteKeyPressed and
824 TypingCommand::insertText to map the way that international text input works onto the typing undo system.
826 2005-03-16 David Harrison <harrison@apple.com>
830 <rdar://problem/4044336> REGRESSION (8A398-8A409): Option-Delete also deletes space to left of deleted word
832 * khtml/editing/htmlediting.cpp:
833 (khtml::DeleteSelectionCommand::initializePositionData):
834 - skip smart delete if the selection to delete already starts or ends with whitespace
836 * khtml/khtml_part.cpp:
837 (KHTMLPart::handleMousePressEventDoubleClick):
838 - preserve selection on double-click when range is already selected
840 * khtml/xml/dom_position.cpp:
841 (DOM::Position::leadingWhitespacePosition):
842 (DOM::Position::trailingWhitespacePosition):
843 - fix considerNonCollapsibleWhitespace action (logic was reversed)
844 - add non-breaking space to the non-collapsable ones
846 * kwq/WebCoreBridge.mm:
847 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
848 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
849 - these methods do not set the selection, so remove calls to setSelectionGranularity
851 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
852 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]):
853 - set the granularity back to character
854 - the one exception is that we need to keep word granularity
855 to preserve smart delete behavior when extending by word
857 2005-03-15 Maciej Stachowiak <mjs@apple.com>
861 <rdar://problem/4053266> Pressing return a few times right after a link makes the new blank lines part of the link
863 * khtml/editing/htmlediting.cpp:
864 (khtml::InsertLineBreakCommand::doApply): Use
865 positionOutsideContainingSpecialElement in the right two places.
866 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
868 - move all these helper functions higher in the file
870 * khtml/editing/htmlediting.cpp:
871 (khtml::isSpecialElement):
872 (khtml::isFirstVisiblePositionInSpecialElement):
873 (khtml::positionBeforeNode):
874 (khtml::positionBeforeContainingSpecialElement):
875 (khtml::maxRangeOffset):
876 (khtml::isLastVisiblePositionInSpecialElement):
877 (khtml::positionAfterNode):
878 (khtml::positionAfterContainingSpecialElement):
879 (khtml::positionOutsideContainingSpecialElement):
881 2005-03-14 Maciej Stachowiak <mjs@apple.com>
885 <rdar://problem/4049925> Pasting right after a link makes pasted content part of the link (without visible style change)
887 * khtml/editing/htmlediting.cpp:
888 (khtml::positionOutsideContainingSpecialElement): made a helper
889 function that computes a position outside the outermost containing
890 special element if the passed in position is right at the start or
892 (khtml::InsertTextCommand::prepareForTextInsertion): use new helper here
893 (khtml::ReplaceSelectionCommand::doApply): use it here too: this is the fix
894 (khtml::positionBeforeNode): made static
895 (khtml::positionBeforeContainingSpecialElement): made static
896 (khtml::positionAfterNode): made static
897 (khtml::positionAfterContainingSpecialElement): made static
899 2005-03-15 Richard Williamson <rjw@apple.com>
901 Fixed <rdar://problem/4053658> Crash getting direction at maps.google.com
903 Add non nil style() check.
905 Reviewed by Dave Harrison.
907 * khtml/rendering/render_table.cpp:
908 (RenderTableCell::collapsedRightBorder):
910 2005-03-15 Kevin Decker <kdecker@apple.com>
914 Fixed: <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken
916 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().
918 This fixes a recent regression from:
920 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
922 * khtml/khtml_part.cpp:
923 (KHTMLPart::closeURL): After dispatching event handlers, go ahead and remove them from the DOM.
924 * khtml/xml/dom_docimpl.cpp:
925 (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.
927 2005-03-15 Ken Kocienda <kocienda@apple.com>
933 <rdar://problem/4052642> Each delete keystroke is in its own undo group; not included in undo group with other typing
935 Calling -[WebCore setSelectedDOMRange:range affinity:] had the result of "closing" any active set of typing
936 keystrokes grouped together in a single undo operation. A change on 27 Jan in WebKit to change the way delete
937 keystrokes are handled made this feature regress. Previous to that change, the backwards delete
938 key went through separate code that is no longer in the tree that did not set the selection in the way
941 The solution is to add an extra argument to the set-selection call. The WebCoreBridge now offers this method:
942 -[WebCore setSelectedDOMRange:range affinity:closeTyping:]. Now, callers must indicate whether setting the
943 selection will act to close typing or not.
945 * kwq/WebCoreBridge.h: Changed header accordingly to change method shown below.
946 * kwq/WebCoreBridge.mm:
947 (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Added closeTyping argument to this method.
949 2005-03-15 John Sullivan <sullivan@apple.com>
953 - fixed <rdar://problem/4052246> crash in KWQKHTMLPart::createPart() trying to display local file in frame
955 * kwq/KWQKHTMLPart.mm:
956 (KWQKHTMLPart::createPart):
957 Check part for nil before trying to ref. This was probably a longstanding code flaw revealed by
958 the recent security fix.
960 2005-03-15 Kevin Decker <kdecker@apple.com>
962 Reviewed by Ken and Maciej.
964 New fix for <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
966 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.
968 * khtml/html/htmltokenizer.cpp:
969 (khtml::HTMLTokenizer::HTMLTokenizer): Initialize loadStopped to false.
970 (khtml::HTMLTokenizer::write): Go ahead and bail out if loadStopped is true.
971 (khtml::HTMLTokenizer::processToken):
972 * 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.
973 * khtml/khtml_part.cpp:
974 (KHTMLPart::closeURL): Notify the tokenizer to stop parsing.
975 * khtml/xml/xml_tokenizer.cpp:
976 (khtml::XMLTokenizer::XMLTokenizer): Initialize loadStopped to false.
977 * khtml/xml/xml_tokenizer.h:
978 (khtml::Tokenizer::stopParsing): Added.
980 2005-03-14 David Harrison <harrison@apple.com>
982 Reviewed by Darin, Maciej.
984 <rdar://problem/4046103> REGRESSION (Mail): clicking after style change sets insertion point incorrectly
986 Also fixes crash by adding nil check.
988 * khtml/editing/htmlediting.cpp:
989 (khtml::MoveSelectionCommand::doApply):
990 Check the node for nil.
992 * khtml/khtml_part.cpp:
993 (KHTMLPart::khtmlMouseReleaseEvent):
994 Use the node from the event rather than from the selection.
996 2005-03-14 Darin Adler <darin@apple.com>
998 Reviewed by Harrison.
1000 - fixed <rdar://problem/4049776> Seed: Mail: Disable spellcheck leaves red artifacts
1002 * khtml/xml/dom_docimpl.cpp:
1003 (DocumentImpl::DocumentImpl): Set markers list to be "auto-delete" so they don't all leak.
1004 (DocumentImpl::removeMarker): Remove markers list for a node when the last marker is removed
1005 for that node. Otherwise, we can have empty marker lists for each node forever until the
1007 (DocumentImpl::removeAllMarkers): Added code to dirty the markers.
1008 (DocumentImpl::shiftMarkers): Remove unneeded empty check.
1010 * kwq/WebCoreBridge.h: Added unmarkAllMisspellings for WebKit.
1011 * kwq/WebCoreBridge.mm: (-[WebCoreBridge unmarkAllMisspellings]): Added. Calls removeAllMarkers.
1013 2005-03-14 Richard Williamson <rjw@apple.com>
1015 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
1017 A document may be deleted as a consequence of handling an event,
1018 as was the case with Acrobat.app. Ensure that the document is still valid
1019 before passing the event on for further handling.
1021 * khtml/xml/dom_nodeimpl.cpp:
1022 (NodeImpl::dispatchUIEvent):
1024 2005-03-14 Ken Kocienda <kocienda@apple.com>
1028 Added a couple of comments about setChanged() to this code based on my experiences with 4047028.
1030 * khtml/css/css_valueimpl.cpp:
1031 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties)
1032 (DOM::CSSMutableStyleDeclarationImpl::merge)
1034 2005-03-14 Ken Kocienda <kocienda@apple.com>
1040 <rdar://problem/4047028> Changing quote levels on stylized text causes it to be sent as colored (Blue). Tiger8A410
1042 * khtml/css/css_valueimpl.cpp:
1043 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): This function now calls setChanged() at the
1044 end of its loop if any properties were removed. This makes the style system update correctly in response
1045 to changes made by this function. The code to paste removes style from the pasted content in a
1046 preliminary step, and the fact that the style system did not update properly left unwanted color
1047 declarations in the document.
1049 2005-03-14 Vicki Murley <vicki@apple.com>
1051 - roll out this change for now, since it was denied by CCC
1053 2005-03-11 David Harrison <harrison@apple.com>
1057 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
1059 * kwq/KWQKHTMLPart.mm:
1060 (KWQKHTMLPart::advanceToNextMisspelling):
1061 (KWQKHTMLPart::markMisspellings):
1064 2005-03-14 Ken Kocienda <kocienda@apple.com>
1070 <rdar://problem/4050403> Mail crashes after pasting and deleting the content of one Excel cell
1072 * khtml/editing/htmlediting.cpp:
1073 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add some null checks to the code. This fixes the crash, although
1074 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
1075 the document that cannot be removed (this is actually an empty table). This is undesirable, however, work Maciej is
1076 doing to fix the general-case problem of trying to edit constructs we do not handle well in editing should fix this
1077 particular case, making the deletion of this "blank line" possible. Maciej is doing this work as part of this bug:
1078 <rdar://problem/4036051> Hard to select (and thus delete) an IFRAME in an editable WebView
1080 2005-03-14 Ken Kocienda <kocienda@apple.com>
1086 <rdar://problem/4029632> Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
1088 The problem is that removeInlineStyle() can remove nodes, and if either the start or end node of the
1089 selection at the time of the call to removeInlineStyle() was in a node that got removed, bad things
1090 would happen. The fix is described below.
1092 * khtml/editing/htmlediting.cpp:
1093 (khtml::maxRangeOffset): Moved this static function to a different place in the file so the code below can use it.
1094 (khtml::ApplyStyleCommand::applyInlineStyle): Calling removeInlineStyle() now has the side effect of
1095 setting the command's ending selection. Now resets start and end using the ending selection after the call to
1096 removeInlineStyle() as it is done elsewhere in this function.
1097 (khtml::ApplyStyleCommand::removeInlineStyle): Track the removal of the start or end node based on
1098 the positions passed in. If either the start or the end node is removed as part of style removal,
1099 set an appropriate replacement start or end that is still in the document.
1103 2005-03-14 Ken Kocienda <kocienda@apple.com>
1107 I need to roll out Kevin's change to fix 3667701. It breaks contextual fragments, and hence breaks
1108 paste in editing (among other things).
1110 * khtml/html/htmltokenizer.cpp: Roll out recent change.
1111 (khtml::HTMLTokenizer::write)
1112 * khtml/html/htmltokenizer.h: Ditto.
1114 2005-03-13 Darin Adler <darin@apple.com>
1116 Reviewed by Ken and Maciej.
1118 - fixed <rdar://problem/4049040> REGRESSION (403-405): security check prevents user stylesheet from loading (Dictionary.app doesn't work at all!)
1120 * kwq/WebCoreBridge.mm: (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Changed to give "applewebdata:"
1121 documents the same privileges to open local files that "file:" documents have.
1123 2005-03-13 Kevin Decker <kdecker@apple.com>
1127 Fixed: <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
1129 The problem here was that the tokenizer would continue to receive chunks of data from the loader already
1130 after the view and part had been destroyed. Situations like this could arise when clicking on another link
1131 while still loading the current view, or during self test where we rapidly open, load, and close browser
1134 * khtml/html/htmltokenizer.cpp:
1135 (khtml::HTMLTokenizer::write): Simple nil check against the view.
1136 * khtml/html/htmltokenizer.h: Changed the view pointer from a standard pointer to a QGuardedPtr. The tokenizer's
1137 handle to the view will now automatically nil-out and never dangle.
1139 2005-03-13 Darin Adler <darin@apple.com>
1141 Reviewed by John and Ken.
1143 - fixed <rdar://problem/4044347> REGRESSION (Mail): Control-K in particular message moves insertion point to previous line
1145 Tweaked the deleting code, and added three new deleting layout tests to confirm the new code works.
1147 * khtml/editing/htmlediting.cpp:
1148 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Removed special case with comment that said it was
1149 for the case where a "selection contains only a BR right after a block ended". This code was being triggered in
1150 more cases than just that one, and in all the cases I tested, the general delete code works fine.
1151 (khtml::DeleteSelectionCommand::handleGeneralDelete): Changed the code that decides whether to delete an entire
1152 block to understand the case where the end block is outside the start block, but contains the start block.
1153 In that case, we want to delete the entire block. Not deleting the block was causing us to delete just the <br>,
1154 and not the enclosing <div> in the case in the bug.
1156 * layout-tests/editing/deleting/delete-line-015-expected.txt: Added.
1157 * layout-tests/editing/deleting/delete-line-015.html: Added.
1158 * layout-tests/editing/deleting/delete-line-016-expected.txt: Added.
1159 * layout-tests/editing/deleting/delete-line-016.html: Added.
1160 * layout-tests/editing/deleting/delete-line-017-expected.txt: Added.
1161 * layout-tests/editing/deleting/delete-line-017.html: Added.
1162 * layout-tests/editing/style/smoosh-styles-002-expected.txt: Updated to improved results. With the code change, the deletion
1163 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
1164 we delete both of those.
1166 2005-03-13 Darin Adler <darin@apple.com>
1168 - fixed <rdar://problem/4049172> REGRESSION (403-405): Gmail: text box in "Invite a friend" section overlaps other sections
1170 Rolled out fix for <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
1172 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth): Back to previous version of this file.
1174 2005-03-12 Maciej Stachowiak <mjs@apple.com>
1178 <rdar://problem/4046144> RSS pages leave a hole in local file security policy (need to revert feed: exemption)
1180 * kwq/WebCoreBridge.mm:
1181 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Revert
1182 emergency workaround for Safari RSS, now that a new Syndication
1185 2005-03-11 Maciej Stachowiak <mjs@apple.com>
1189 <rdar://problem/4026787> text typed after a link (pasted or Mail Link to this Page) is part of the link, underlined and colored blue
1191 The concept of this change is every time you type at the very
1192 start or very end of a link (even if nested in further inner
1193 elements), the typed text goes outside the link instead of inside.
1195 * khtml/editing/htmlediting.cpp:
1196 (khtml::InsertTextCommand::prepareForTextInsertion): Check whether
1197 we are at the first visible position or last visible position of a
1198 special element. For now this only includes HTML A elements that
1199 are links (i.e. they have an href).
1200 (khtml::isSpecialElement): Helper function that identifies special
1201 elements (for now only links).
1202 (khtml::isFirstVisiblePositionInSpecialElement): Checks if a given DOM
1203 position is equivalent to the first visible position in some containing
1204 editable special element.
1205 (khtml::positionBeforeNode): Returns the DOM position immediately
1207 (khtml::positionBeforeContainingSpecialElement): Gives a DOM
1208 position immediately before the outermost editable containing
1209 special element where the passed-in position is equivalent to the
1210 first visible position.
1211 (khtml::maxRangeOffset): Helper to get the maximum allowed
1212 range/position offset for a node, does the right thing based on
1213 whether the node would use a character offset or child offset.
1214 (khtml::isLastVisiblePositionInSpecialElement): Similar to above,
1215 but for end of node instead of start.
1216 (khtml::positionAfterNode): Ditto.
1217 (khtml::positionAfterContainingSpecialElement): Ditto.
1219 Some layout tests changed - I looked over all the diffs and found
1220 that the only changes were "junk nodes" like empty spans and text
1221 nodes moving from one spot in the tree to another. These changes
1222 are all harmless and do not affect layout or future editing.
1224 * layout-tests/editing/inserting/typing-003-expected.txt:
1225 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
1226 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
1227 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
1228 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
1229 * layout-tests/editing/style/remove-underline-expected.txt:
1230 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt:
1231 * layout-tests/editing/style/remove-underline-in-bold-expected.txt:
1232 * layout-tests/editing/style/typing-style-003-expected.txt:
1233 * layout-tests/editing/style/unbold-in-bold-expected.txt:
1234 * layout-tests/editing/style/underline-expected.txt:
1236 2005-03-11 Adele Amchan <adele@apple.com>
1238 backing out fix for <rdar://problem/4021711> REGRESSION (125-188): blank pages when browsing forum at cooperativeresearch.org - cached external script problem
1240 This caused the following regressions (that we know of):
1241 <rdar://problem/4047445> REGRESSION (Safari-400-403?): Some or all page contents sometimes don't appear (macworld.com)
1242 <rdar://problem/4046153> 8a409: Problem loading Citibank page in Safari 2 (403)
1243 <rdar://problem/4047801> REGRESSION (402-403): .Mac homepage links don't work
1245 * khtml/html/htmltokenizer.cpp:
1246 (khtml::HTMLTokenizer::scriptHandler):
1248 2005-03-11 David Harrison <harrison@apple.com>
1252 <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running
1254 * kwq/KWQKHTMLPart.mm:
1255 (KWQKHTMLPart::advanceToNextMisspelling):
1256 (KWQKHTMLPart::markMisspellings):
1259 2005-03-11 Ken Kocienda <kocienda@apple.com>
1263 * ForwardingHeaders/editing/visible_units.h: Added.
1265 2005-03-11 Ken Kocienda <kocienda@apple.com>
1271 <rdar://problem/4045521> Hitting return key with full line selected does not add blank line as it should
1273 * khtml/editing/htmlediting.cpp:
1274 (khtml::InsertParagraphSeparatorCommand::doApply): Removed some "special-case" code from this
1275 function that would look for a selection that started and ended in a different block, and would
1276 then bail right after the deletion of the selection without inserting a paragraph separator.
1277 This was just wrong. So, the code change is removal only. When the general-case code runs instead
1278 of the erroneous special-case code, the bug goes away.
1282 * layout-tests/editing/inserting/return-key-with-selection-001-expected.txt: Added.
1283 * layout-tests/editing/inserting/return-key-with-selection-001.html: Added.
1284 * layout-tests/editing/inserting/return-key-with-selection-002-expected.txt: Added.
1285 * layout-tests/editing/inserting/return-key-with-selection-002.html: Added.
1286 * layout-tests/editing/inserting/return-key-with-selection-003-expected.txt: Added.
1287 * layout-tests/editing/inserting/return-key-with-selection-003.html: Added.
1289 2005-03-11 David Harrison <harrison@apple.com>
1293 <rdar://problem/4009446> AX: kAXTextMarkerForPositionParameterizedAttribute not working correctly (required for Dictionary pop-up)
1295 * kwq/KWQAccObject.mm:
1296 (-[KWQAccObject accessibilityAttributeValue:]):
1299 (-[KWQAccObject doAXTextMarkerForPosition:]):
1302 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
1303 Use the selection's document instead of the top document, to accommodate frames, etc.
1305 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
1306 Fixed parameter processing to look for NSValue instead of AXValue.
1308 2005-03-11 Ken Kocienda <kocienda@apple.com>
1310 Reviewed by Harrison
1314 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
1316 This was fixed, then regressed with Harrison's fix for this bug:
1318 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
1320 * khtml/editing/htmlediting.cpp:
1321 (khtml::ReplaceSelectionCommand::doApply): My now addresses both problems in a way that they no longer
1324 2005-03-10 Ken Kocienda <kocienda@apple.com>
1330 <rdar://problem/4045511> Copying and pasting end-of-paragraph selection puts insertion point in wrong place
1331 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
1333 The copy/paste code before this patch had no notion of a "logical newline" at the start of the selection. We have
1334 had a similar notion for "logical newline" at the end of the selection for quite some time. To fix these bugs, we
1335 need to introduce the same idea for selection starts.
1337 * khtml/editing/htmlediting.cpp:
1338 (khtml::ReplacementFragment::ReplacementFragment): Process the "logical newline" at start as we write it out
1339 in markup. Set the bit we added to this object to signify we have such a newline.
1340 (khtml::ReplaceSelectionCommand::doApply): Many, many changes to introduce the new "logical newline" at start concept.
1341 I also tried to simply the code that sets the start position for inserting content to be pasted. I also improved a
1342 weakness in the smart-paste code. Now, we check before and after the paste for whether we need to add a leading or
1343 trailing space. The code previous to this patch only did a "before" check, with the result that we sometimes added
1344 a second space. In other words, the code did not realize that DOM changes done by pasting could cause formerly
1345 unrendered whitespace to become rendered. Also moved line placeholder clean up code to its own function.
1346 (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): New helper that further refines the notion
1347 of when we can remove a line placeholder. The definition is now, "If a line placeholder is at the visible start
1348 and visible end of its line, keep it; otherwise remove it".
1349 * khtml/editing/htmlediting.h: Declare new functions. Rework inlines in ReplacementFragment class to account for
1350 addition of new "logical newline" at start concept.
1351 (khtml::ReplacementFragment::hasInterchangeNewlineAtStart): New accessor.
1352 (khtml::ReplacementFragment::hasInterchangeNewlineAtEnd): Renamed from hasInterchangeNewline(), since before we
1353 only had a bit for the end, hence we did not need to distinguish it from the start.
1354 * khtml/editing/markup.cpp:
1355 (khtml::createMarkup): Added code to detect and write out markup for cases where we have a "logical newline" at start.
1356 * khtml/xml/dom2_rangeimpl.cpp:
1357 (DOM::RangeImpl::startPosition): New helper.
1358 (DOM::RangeImpl::endPosition): Ditto.
1359 * khtml/xml/dom2_rangeimpl.h: Declare new helpers.
1362 * layout-tests/editing/pasteboard/paste-line-endings-001-expected.txt: Added.
1363 * layout-tests/editing/pasteboard/paste-line-endings-001.html: Added.
1364 * layout-tests/editing/pasteboard/paste-line-endings-002-expected.txt: Added.
1365 * layout-tests/editing/pasteboard/paste-line-endings-002.html: Added.
1366 * layout-tests/editing/pasteboard/paste-line-endings-003-expected.txt: Added.
1367 * layout-tests/editing/pasteboard/paste-line-endings-003.html: Added.
1368 * layout-tests/editing/pasteboard/paste-line-endings-004-expected.txt: Added.
1369 * layout-tests/editing/pasteboard/paste-line-endings-004.html: Added.
1370 * layout-tests/editing/pasteboard/paste-line-endings-005-expected.txt: Added.
1371 * layout-tests/editing/pasteboard/paste-line-endings-005.html: Added.
1372 * layout-tests/editing/pasteboard/paste-line-endings-006-expected.txt: Added.
1373 * layout-tests/editing/pasteboard/paste-line-endings-006.html: Added.
1374 * layout-tests/editing/pasteboard/paste-line-endings-007-expected.txt: Added.
1375 * layout-tests/editing/pasteboard/paste-line-endings-007.html: Added.
1376 * layout-tests/editing/pasteboard/paste-line-endings-008-expected.txt: Added.
1377 * layout-tests/editing/pasteboard/paste-line-endings-008.html: Added.
1378 * layout-tests/editing/pasteboard/paste-line-endings-009-expected.txt: Added.
1379 * layout-tests/editing/pasteboard/paste-line-endings-009.html: Added.
1380 * layout-tests/editing/pasteboard/paste-line-endings-010-expected.txt: Added.
1381 * layout-tests/editing/pasteboard/paste-line-endings-010.html: Added.
1385 2005-03-10 Darin Adler <darin@apple.com>
1387 Reviewed by Richard.
1389 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
1391 * khtml/rendering/render_text.cpp: (getCharacterBreakIterator): Set boolean "got iterator" to true.
1393 2005-03-10 Darin Adler <darin@apple.com>
1397 - fixed <rdar://problem/4042867> "Bigger" changes the font size of too much text when the selection is on a style-change boundary
1399 * khtml/editing/htmlediting.cpp: (khtml::ApplyStyleCommand::applyRelativeFontStyleChange):
1400 Advance out of the starting text node if we're at the end of it.
1402 2005-03-10 Darin Adler <darin@apple.com>
1404 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Fixed assertion for nested calls to write.
1406 2005-03-10 David Harrison <harrison@apple.com>
1410 <rdar://problem/4032346> REGRESSION (Mail): changing 1st line of a URL that wraps to two lines doesn't always update 2nd line
1412 * khtml/rendering/bidi.cpp:
1413 (khtml::RenderBlock::matchedEndLine):
1414 Look at first clean line in case line wrap implicitly dirtied it.
1416 2005-03-10 Maciej Stachowiak <mjs@apple.com>
1420 <rdar://problem/4046018> REGRESSION (TOT): RSS pages don't display anything
1422 * kwq/WebCoreBridge.mm:
1423 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Exempt
1424 feed: and feeds: pages from the local file security check.
1426 2005-03-10 Darin Adler <darin@apple.com>
1428 Change written by Steve Peters, reviewed by me.
1430 - fixed <rdar://problem/4045924> improve compareBoundaryPoints to make style changes faster
1432 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints):
1433 Do early outs in a couple of the loops to make things faster.
1435 2005-03-10 Jens Alfke <jens@apple.com>
1439 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.
1441 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.
1443 This ensures that the applet will get loaded even if there is no explicit </applet> tag.
1445 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.
1447 * khtml/html/html_objectimpl.cpp:
1448 (HTMLAppletElementImpl::closeRenderer):
1449 * khtml/html/html_objectimpl.h:
1450 * khtml/html/htmlparser.cpp:
1451 (KHTMLParser::insertNode):
1452 (KHTMLParser::processCloseTag):
1453 (KHTMLParser::popOneBlock):
1454 * khtml/xml/dom_nodeimpl.h:
1455 (DOM::NodeImpl::closeRenderer):
1457 2005-03-10 Ken Kocienda <kocienda@apple.com>
1463 <rdar://problem/4024929> REGRESSION (Mail): Pasting text with multiple reply levels removes one level instead of all
1465 The code to figure out which node to use to merge into an existing line did not drill into the first inline element
1466 as needed to make the feature work as user expect. Instead, it looked at the first node, and if it was a block, it
1467 skipped that node. This worked for some cases (including the important "paste-as-quotation" case) but obviously
1468 doesn't work for content quoted more than once.
1470 Now, mergeStartNode() will look for the first node in pasted content that is not a block. It will now also look
1471 for nodes specially marked by Mail as a node added to make "Paste As Quotation" work. It won't skip those.
1473 NOTE: This change will break Mail's "Paste As Quotation" feature for TOT WebKit users, but this is only a temporary
1474 problem that will exist until we sync up with Mail's pending change to mark nodes as needed in its pasteAsQuotation:
1477 * khtml/editing/html_interchange.h: Add ApplePasteAsQuotation constant used to check for "marked" blockquotes.
1478 * khtml/editing/htmlediting.cpp:
1479 (khtml::ReplacementFragment::mergeStartNode): Look for first node that is either not a block or is marked as
1480 an ApplePasteAsQuotation node.
1481 (khtml::isMailPasteAsQuotationNode): New helper that looks for nodes marked with ApplePasteAsQuotation.
1482 * khtml/editing/htmlediting.h: Updated header for new function.
1484 This test result changed is an acceptable way.
1486 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
1487 * layout-tests/editing/pasteboard/paste-text-013.html
1489 NOTE: This change causes a regression in this layout test:
1491 * layout-tests/editing/pasteboard/paste-text-013.html
1493 This problem will need to be fixed separately, and this bug has been filed to track this problem:
1494 <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break
1496 2005-03-09 Maciej Stachowiak <mjs@apple.com>
1498 Reviewed by Richard.
1500 <rdar://problem/4040776> Dashboard (Weather widget) is a memory hog
1502 Change things around so the event listeners for XMLHttpRequest
1503 mark their JS listener objects instead of holding a hard
1504 reference, to avoid an unbreakable reference cycle.
1506 * khtml/ecma/kjs_events.cpp:
1507 (JSAbstractEventListener::JSAbstractEventListener):
1508 (JSAbstractEventListener::~JSAbstractEventListener):
1509 (JSAbstractEventListener::handleEvent):
1510 (JSAbstractEventListener::eventListenerType):
1511 (JSUnprotectedEventListener::JSUnprotectedEventListener):
1512 (JSUnprotectedEventListener::~JSUnprotectedEventListener):
1513 (JSUnprotectedEventListener::listenerObj):
1514 (JSUnprotectedEventListener::windowObj):
1515 (JSUnprotectedEventListener::mark):
1516 (JSEventListener::JSEventListener):
1517 (JSEventListener::~JSEventListener):
1518 (JSEventListener::listenerObj):
1519 (JSEventListener::windowObj):
1520 (JSLazyEventListener::JSLazyEventListener):
1521 * khtml/ecma/kjs_events.h:
1522 * khtml/ecma/kjs_html.h:
1523 * khtml/ecma/kjs_window.cpp:
1524 (Window::getJSEventListener):
1525 (Window::getJSUnprotectedEventListener):
1526 * khtml/ecma/kjs_window.h:
1527 * khtml/ecma/xmlhttprequest.cpp:
1528 (KJS::XMLHttpRequest::putValue):
1529 (KJS::XMLHttpRequest::mark):
1530 * khtml/ecma/xmlhttprequest.h:
1531 * khtml/khtml_part.h:
1533 2005-03-06 Maciej Stachowiak <mjs@apple.com>
1537 <rdar://problem/4005575> Arbitrary file disclosure vulnerability due to ability to load local html from remote content
1539 * khtml/ecma/kjs_html.cpp:
1540 (KJS::HTMLDocument::putValue):
1541 * khtml/ecma/kjs_window.cpp:
1543 (WindowFunc::tryCall):
1545 (LocationFunc::tryCall):
1546 * khtml/khtml_part.cpp:
1548 (KHTMLPart::scheduleLocationChange):
1549 (KHTMLPart::slotRedirect):
1550 (KHTMLPart::processObjectRequest):
1551 * khtml/khtml_part.h:
1552 * khtml/khtmlpart_p.h:
1553 * kwq/KWQKHTMLPart.mm:
1554 (KWQKHTMLPart::openURLRequest):
1555 (KWQKHTMLPart::urlSelected):
1556 (KWQKHTMLPart::createPart):
1557 * kwq/KWQKHTMLPartBrowserExtension.mm:
1558 (KHTMLPartBrowserExtension::createNewWindow):
1559 * kwq/WebCoreBridge.h:
1560 * kwq/WebCoreBridge.mm:
1561 (hasCaseInsensitivePrefix):
1562 (-[WebCoreBridge didNotOpenURL:pageCache:]):
1563 (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]):
1565 2005-03-09 Richard Williamson <rjw@apple.com>
1567 Fixed <rdar://problem/4032938> Safari: text layout for MS P Gothic font is corrupted
1569 Remove our hacked special case now we have our own cache of
1570 which fonts are fixed pitch.
1575 (QFont::isFixedPitch):
1577 2005-03-09 David Harrison <harrison@apple.com>
1581 <rdar://problem/4037141> REGRESSION (Mail): Pasting deletes preceding blank lines with certain steps
1583 * khtml/editing/htmlediting.cpp:
1584 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
1585 Add check for anonymous text after blocks.
1587 2005-03-08 Ken Kocienda <kocienda@apple.com>
1593 <rdar://problem/4039661> crash in ApplyStyleCommand::applyBlockStyle pasting contents of webpage into Mail or Blot
1594 <rdar://problem/4039672> hang in moveParagraphContentsToNewBlockIfNecessary after pasting contents of webpage into Blot
1596 * khtml/editing/htmlediting.cpp:
1597 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Fix for 4039672. Iteration needs to do
1598 a traverseNextSibling(), not a traverseNextNode(). The latter might iterate into a child that already got moved, and
1599 the code can infinite loop as a result.
1600 (khtml::ApplyStyleCommand::applyBlockStyle): Fix for 4039661. This function iterates over a set of nodes to apply
1601 block styles. Before, the iteration would go from the start to the end of the selection, and apply block styles
1602 as it went. However, the act of applying style could confuse the iteration. Now I iterate and store the relevant
1603 nodes in QPtrList before doing any style manipulation, and then iterate that set of nodes.
1605 2005-03-08 Darin Adler <darin@apple.com>
1607 Change written by Hyatt, reviewed by me.
1609 - fixed <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail
1611 * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth):
1612 Only use a minWidth of 0 for images with a percentage value. Other replaced elements aren't scalable
1613 so their minWidth should be their calculated width. This has been wrong all along, but it's a relatively
1614 safe change because it only affects replaced elements' min-width.
1616 2005-03-08 David Harrison <harrison@apple.com>
1620 <rdar://problem/4039006> REGRESSION (Mail): Command-left-arrow goes to the start of the wrong line in particular message
1622 * khtml/editing/visible_units.cpp:
1623 (khtml::startOfLine):
1624 Use firstLeafChild() instead of firstChild().
1626 2005-03-08 Richard Williamson <rjw@apple.com>
1628 Fixed by Tom Madden.
1630 Fixed <rdar://problem/4038586> 8A402: Osaka-Mono text overlaps when typing with input method
1632 We weren't clearing the "all ascii" flag when setting text on
1635 Reviewed by Richard Williamson.
1637 * khtml/rendering/render_text.cpp:
1638 (RenderText::setText):
1640 2005-03-08 Darin Adler <darin@apple.com>
1642 Reviewed by Ken and Maciej.
1644 - fixed <rdar://problem/3988809> REGRESSION (Mail): wide space characters are turned into plain old spaces when typed or pasted
1646 Changed the few places where it matters to use a "collapsible whitespace" concept instead of
1647 the general whitespace concept. This means treating only ' ' and '\n' specially instead of
1648 including other space characters, which matches what the space-collapsing logic does in RenderText,
1649 although it really needs to behave differently based on whitespace mode.
1651 * khtml/editing/visible_text.h: (khtml::isCollapsibleWhitespace): Added. This returns true only for
1652 ' ' and '\n' since they are the only characters collapsed once text is in the DOM. But really it
1653 can't do the job ignoring white-space mode, so some day it must go.
1655 * khtml/editing/html_interchange.cpp: (convertHTMLTextToInterchangeFormat): Changed to use
1656 isCollapsibleWhitespace and removed unnecessary calls to latin1().
1658 * khtml/editing/htmlediting.cpp:
1659 (khtml::isNBSP): Removed unnecessary creation/destruction of QChar each time this is called.
1660 (khtml::nextCharacterIsCollapsibleWhitespace): Renamed from isWS and changed to use isCollapsibleWhitespace.
1661 (khtml::DeleteSelectionCommand::fixupWhitespace): Use isCollapsibleWhitespace instead of isWS,
1662 since we only want to do our NBSP tricks for collapsible whitespace.
1663 (khtml::InsertTextCommand::input): Changed use of isTab to instead say == "\t" since that does the
1664 same thing and is arguably just as clear. Changed use of isWS to == " " since the input text can't
1665 include any "\n" characters, and really a plain old space is the only collapsible thing that can
1666 be passed in. Use isCollapsibleWhitespace instead of isWS since we want to do NBSP tricks only for
1667 collapsible whitespace, not all whitespace.
1668 (khtml::InsertTextCommand::insertSpace): Use isCollapsibleWhitespace instead of isWS since we want
1669 to do NBSP tricks only for collapsible whitespace, not all whitespace.
1670 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
1672 * khtml/xml/dom_position.h: Changed treatNBSPAsWhiteSpace parameters to considerNonCollapsibleWhitespace
1673 parameters. The most common callers are only interested in collapsible whitespace, and the smart copy
1674 and paste callers want to include all whitespace, including non-breaking spaces and all the Unicode spaces.
1675 * khtml/xml/dom_position.cpp:
1676 (DOM::Position::leadingWhitespacePosition): Rename the parameter, and use either QChar::isSpace or
1677 isCollapsibleWhitespace depending on the boolean passed in.
1678 (DOM::Position::trailingWhitespacePosition): Ditto.
1680 2005-03-07 John Sullivan <sullivan@apple.com>
1684 - <rdar://problem/4040868> REGRESSION (Mail, 403-403+): Drag and drop deletes text,
1685 many other bad editing problems
1687 * khtml/rendering/render_text.cpp:
1688 (RenderText::caretMaxOffset):
1689 A "-" should have been a "+" in this method that was tweaked an hour ago. Editing
1690 was completely horked.
1692 2005-03-07 Richard Williamson <rjw@apple.com>
1694 Additional nil check from fix for 4040749.
1696 * khtml/rendering/render_box.cpp:
1697 (RenderBox::setStyle):
1699 2005-03-07 Richard Williamson <rjw@apple.com>
1701 Additional nil check from fix for 4040749.
1703 * khtml/rendering/render_layer.cpp:
1704 (RenderLayer::updateLayerPosition):
1706 2005-03-07 David Harrison <harrison@apple.com>
1710 <rdar://problem/4033202> REGRESSION (Mail): Can't arrow up at a particular spot in a particular Mail message
1712 Doublecheck that new position is really on a different line, because the VisiblePosition constructor does not.
1713 Filed <rdar://problem/4040763> for that problem.
1715 * khtml/editing/visible_units.cpp:
1716 (khtml::previousLinePosition):
1718 2005-03-07 Richard Williamson <rjw@apple.com>
1720 Fixed <rdar://problem/4040749> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
1722 When layers are dynamically created/removed as a result of changing opacity they weren't being correctly
1723 sized and positioned. This happens whenever opacity goes from < 1 to 1.
1727 * khtml/rendering/render_box.cpp:
1728 (RenderBox::setStyle):
1729 * khtml/rendering/render_layer.cpp:
1730 (RenderLayer::updateLayerPosition):
1732 2005-03-07 Christy Warren <kali@apple.com>
1736 * khtml/rendering/render_text.cpp:
1737 (RenderText::caretMinOffset): modified to handle BIDI case by checking all text boxes for min offset
1738 (RenderText::caretMaxOffset): modified to handle BIDI case by checking all text boxes for max offset
1740 2005-03-07 David Harrison <harrison@apple.com>
1744 <rdar://problem/4029225> REGRESSION (Mail): Crash if hit return after dragging in attachment - DeleteSelectionCommand::initializePositionData
1746 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.
1747 Filed <rdar://problem/4040358> RenderBR height() is not accurate.
1749 * khtml/editing/htmlediting.cpp:
1750 (khtml::ReplaceSelectionCommand::doApply):
1751 When height is 0, double check that the placeholder is the first position on the line.
1755 2005-03-07 Ken Kocienda <kocienda@apple.com>
1761 <rdar://problem/4040136> Expose SPI for WebCore's functions to create document fragments from plain text and markup strings
1763 * kwq/DOMHTML.mm: Add two new SPI functions.
1764 (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:])
1765 (-[DOMHTMLDocument _createDocumentFragmentWithText:])
1766 * kwq/DOMPrivate.h: Declare the new SPI here, a privately-exported header, so Mail can make use of it.
1768 2005-03-07 Ken Kocienda <kocienda@apple.com>
1774 <rdar://problem/4039676> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date
1776 * khtml/editing/htmlediting.cpp:
1777 (khtml::ReplaceSelectionCommand::doApply): Code to "eat" a <br> element, that was creating an otherwise empty line, was running
1778 when it should not. If the content being pasted in does not end in a "logical" newline itself, then the <br> already
1779 in the content needs to be preserved. A simple one-line change now sees to this.
1781 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: This test now has an extra, but harmless,
1782 <br> at the end of a paragraph. This makes sense given the code change.
1785 * layout-tests/editing/pasteboard/paste-text-018-expected.txt: Added.
1786 * layout-tests/editing/pasteboard/paste-text-018.html: Added.
1788 2005-03-07 Ken Kocienda <kocienda@apple.com>
1794 <rdar://problem/4035648> REGRESSION (Mail): line feed in source HTML file causes bad copy/paste behavior
1796 The createMarkup() function in markup.cpp iterates over the nodes in a range,
1797 and does some bookkeeping to figure out when to add close tags to the markup.
1798 Some code added at the start of the loop to prevent markup from being written
1799 for unrendered nodes short-circuited the rest of the loop, and so prevented
1800 the close-tag-writing code from running when it should.
1802 This is why the "plain" text wound up inside of the bold tag in the example
1803 above. The addition of the unrendered return character caused an incorrect
1804 delay in the close tag for the bold element from being written out, with the
1805 result being that it wound up including additional content.
1807 The fix is to add checks for node renderers throughout the loop at the points
1808 where markup is written out for each node. This allows the additional close
1809 tag logic to run as needed.
1811 All layout tests pass with this change.
1813 * khtml/editing/markup.cpp:
1814 (khtml::createMarkup)
1818 * layout-tests/editing/pasteboard/paste-4035648-fix-expected.txt: Added.
1819 * layout-tests/editing/pasteboard/paste-4035648-fix.html: Added.
1821 2005-03-06 Christy Warren <kali@appple.com>
1825 * khtml/rendering/render_text.cpp:
1826 (lastRendererOnPrevLine): helper for RenderText::caretRect
1827 (RenderText::caretRect): added code to properly handle bidi ordered text boxes
1829 2005-03-06 Christy Warren <kali@apple.com>
1833 * khtml/editing/visible_position.cpp: Eliminated code that cuts off searching through the text boxes based on an assumption that breaks under bidi
1834 (khtml::VisiblePosition::isCandidate):
1835 * kwq/KWQFontMetrics.mm:
1836 (QFontMetrics::checkSelectionPoint): Made the initialization of the WebCoreStyle honor the reversed flag
1838 2005-03-05 John Sullivan <sullivan@apple.com>
1842 - fixed <rdar://problem/4038417> Mail crashed in StyleChange::checkForLegacyHTMLStyleChange
1843 when composing a reply
1845 * khtml/editing/htmlediting.cpp:
1846 (khtml::StyleChange::checkForLegacyHTMLStyleChange):
1847 Added missing nil check.
1849 2005-03-05 Darin Adler <darin@apple.com>
1853 - fixed <rdar://problem/4038478> Crash in renderer viewing RSS feed at feed://wvs.topleftpixel.com/index.rdf
1855 * khtml/xml/dom_docimpl.cpp: (widgetForNode): Check for nil before going from node to renderer.
1857 2005-03-05 Darin Adler <darin@apple.com>
1859 Reviewed by Richard.
1861 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
1863 * khtml/rendering/render_text.cpp:
1864 (getCharacterBreakIterator): Added. Helper that sets up an iterator for the passed-in text.
1865 Shares a single global iterator (fast, albeit not thread-safe).
1866 (RenderText::previousOffset): Changed to call getCharacterBreakIterator.
1867 (RenderText::nextOffset): Ditto.
1869 2005-03-05 Ken Kocienda <kocienda@apple.com>
1875 <rdar://problem/4038267> REGRESSION (Mail): Crash copying and pasting end of paragraph
1877 Code to handle content that has a "logical" newline at the end of the pasted content, and the code
1878 to adjust the selection at the end of the paste operation made an assumption that at least one
1879 node had been inserted by the paste command. This is not necessarily true in the case where the sole content
1880 in the pasted content is one of these "logical" newlines. Adjust some code around so that we don't deref
1881 null, but still adjust the selection correctly for this case. In each of the two functions below, some
1882 null checks have been added, and some code has been rearranged a little bit to continue on through
1883 the end of completeHTMLReplacement, even if no nodes have been inserted. The patch looks bigger and more
1884 complicated than the conceptual change.
1886 * khtml/editing/htmlediting.cpp:
1887 (khtml::ReplaceSelectionCommand::doApply)
1888 (khtml::ReplaceSelectionCommand::completeHTMLReplacement)
1890 * layout-tests/editing/pasteboard/paste-4038267-fix-expected.txt: Added.
1891 * layout-tests/editing/pasteboard/paste-4038267-fix.html: Added.
1893 2005-03-05 Darin Adler <darin@apple.com>
1897 - fixed <rdar://problem/4025918> images copied from Safari with relative src URLs aren't pasted into Mail messages (KURL resolves base URLs incorrectly)
1899 * kwq/KWQKURL.mm: (KURL::KURL): Add a slash at the start of the path if a relative part is adding
1900 a path onto a URL that has "pre-path" bits like host name, but no path yet. This doesn't come up
1901 for http because in that case we add a trailing "/" as part of canonicalization.
1903 2005-03-04 John Sullivan <sullivan@apple.com>
1907 - fixed <rdar://problem/4033705> REGRESSION (Mail): Copy/Paste from Excel
1908 crashes Mail in KWQKHTMLPart::fontForSelection(bool*) const + 232
1910 * kwq/KWQKHTMLPart.mm:
1911 (KWQKHTMLPart::fontForSelection):
1912 Check for nil startNode, not just nil renderer.
1914 2005-03-04 David Harrison <harrison@apple.com>
1916 Reviewed by Ken, Richard.
1918 <rdar://problem/3996383> REGRESSION (Mail): Deleting all of first line also deletes line ending
1920 Problem was the placeholder check was based on 0 height block, but the block in this
1921 case is the BODY, which has other content even though the paragraph is gone.
1923 * khtml/editing/htmlediting.cpp:
1924 (khtml::CompositeEditCommand::insertBlockPlaceholder):
1925 Now does insert instead of append!
1927 (khtml::CompositeEditCommand::appendBlockPlaceholder):
1928 New. Actually does append.
1930 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
1931 Renamed from insertBlockPlaceholderIfNeeded because it can insert or append. Also accepts "force insert" flag.
1933 (khtml::CompositeEditCommand::removeBlockPlaceholder):
1934 Renamed for succinctness from removeBlockPlaceholderIfNeeded.
1936 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
1937 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
1938 Use renamed methods.
1940 (khtml::DeleteSelectionCommand::doApply):
1941 Use addBlockPlaceholderIfNeeded "force insert" flag if deleting whole paragraphs did not leave an empty one.
1943 (khtml::InsertParagraphSeparatorCommand::doApply):
1944 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1945 (khtml::InsertTextCommand::input):
1946 Use renamed methods.
1948 * khtml/editing/htmlediting.h:
1949 Renamed and new methods per above.
1952 2005-03-04 Chris Blumenberg <cblu@apple.com>
1954 Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after pasting attachment at end of message
1958 * khtml/editing/visible_units.cpp:
1959 (khtml::endOfParagraph): don't consider text nodes that have no rendered characters
1961 2005-03-04 Richard Williamson <rjw@apple.com>
1963 Fixed <rdar://problem/4034764> REGRESSION(125-188)Viewing text/plain page and going back/forward corrupts HTML pages (google.com)
1965 The parse mode wasn't be restored to the document when going
1970 * kwq/KWQKHTMLPart.mm:
1971 (KWQKHTMLPart::openURLFromPageCache):
1972 * kwq/KWQPageState.h:
1973 * kwq/KWQPageState.mm:
1974 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]):
1976 2005-03-04 Ken Kocienda <kocienda@apple.com>
1980 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Shame on me!
1981 I landed my last fix without running layout tests. This one changes in a subtle, but
1984 2005-03-04 Ken Kocienda <kocienda@apple.com>
1986 Reviewed by Harrison
1990 <rdar://problem/4032543> REGRESSION (Mail): Mail hangs when quoted text is pasted twice
1992 This code change fixes the bug in a non-obvious way. The root cause of the problem was
1993 that a VisiblePosition created using an affinity originating in Mail code caused
1994 two VisiblePosition objects that should have been equal to differ only in their
1995 affinities, which in turn caused us to run a code path that should not have run.
1997 * khtml/editing/visible_position.cpp:
1998 (khtml::VisiblePosition::VisiblePosition): Added copy constructor.
1999 (khtml::VisiblePosition::next): Factored out inline code that used to be here into new
2000 setAffinityUsingLinePosition() function.
2001 (khtml::isEqualIgnoringAffinity): New helper to handle cases when affinity in equality check does
2002 not matter. However, we want to know about such cases where a VisiblePosition differs only by affinity,
2003 and the code will assert in development when this happens.
2004 (khtml::isNotEqualIgnoringAffinity): Ditto, but not. :)
2005 (khtml::setAffinityUsingLinePosition): New helper function mentioned above. This will "correct"
2006 upstream affinity to downstream if the affinity does not make a difference for the position.
2007 * khtml/editing/visible_position.h:
2008 * khtml/editing/visible_range.h: Wacky bug. The operator== for this class took VisiblePosition classes!
2009 * khtml/editing/visible_units.cpp:
2010 (khtml::isStartOfParagraph): Now performs equality check without regard to affinity.
2011 (khtml::isEndOfParagraph): Ditto.
2012 (khtml::isStartOfBlock): Ditto.
2013 (khtml::isEndOfBlock): Ditto.
2014 * kwq/WebCoreBridge.mm:
2015 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Adjusts the affinity using setAffinityUsingLinePosition()
2018 2005-03-04 Darin Adler <darin@apple.com>
2022 - fixed <rdar://problem/4036817> REGRESSION: ctrl-y broken when a line + carriage return cut
2024 * khtml/editing/htmlediting.h: Added insertTextRunWithoutNewlines.
2025 * khtml/editing/htmlediting.cpp:
2026 (khtml::InsertTextCommand::input): Added assertion to make sure strings with newlines don't get
2028 (khtml::TypingCommand::insertText): Added. Takes the name of the old function, but is a new
2029 level that breaks runs into lines and inserts each one separately.
2030 (khtml::TypingCommand::insertTextRunWithoutNewlines): Renamed old insertText to this.
2032 * khtml/dom/dom_string.h: Made substring be a const member function.
2033 * khtml/dom/dom_string.cpp: (DOM::DOMString::substring): Made this const.
2035 2005-03-04 Darin Adler <darin@apple.com>
2039 - fixed <rdar://problem/4020413> REGRESSION (Mail): can't use fonts with names that start with "#" in Mail (Korean fonts)
2041 * khtml/css/css_valueimpl.cpp:
2042 (DOM::isLegalIdentifier): Added. Commented out and not used.
2043 (DOM::quoteStringIfNeeded): Quotes the string if needed. For now only if it starts with "#".
2044 (DOM::CSSPrimitiveValueImpl::cssText): Call quoteStringIfNeeded when asked for cssText for an arbitrary string, since we
2045 need text you can re-parse.
2046 (DOM::FontFamilyValueImpl::cssText): Ditto.
2048 * khtml/editing/markup.cpp:
2049 (khtml::startMarkup): Added comments about lack of quoting for attributes.
2050 (khtml::createMarkup): Ditto.
2052 2005-03-04 Adele Amchan <adele@apple.com>
2056 Fix for <rdar://problem/4021711> REGRESSION(125-188) blank pages when browsing forum at cooperativeresearch.org - cached external script problem
2058 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::scriptHandler): set flag needToRefCachedScript so we can make sure
2059 notifyFinished is called after pendingSrc is set up with the right data from the cached script
2061 2005-03-04 Ken Kocienda <kocienda@apple.com>
2067 <rdar://problem/4029632> Tiger 8A398:- Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
2069 * khtml/editing/htmlediting.cpp:
2070 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): VisiblePosition constructor
2071 was failing to yield a position for a node just pasted into the document since a layout was needed
2072 for the calculation to come out right. Layout added. Crash gone.
2076 2005-03-03 Chris Blumenberg <cblu@apple.com>
2078 Fixed: <rdar://problem/3992803> Cannot navigate through list items with the keyboard, you're stuck in the same <li> block unless you click out
2080 Reviewed by harrison.
2082 * khtml/rendering/render_line.cpp:
2083 (khtml::RootInlineBox::closestLeafChildForXPos): avoid returning list markers when possible. Also improved heuristic for returning the best InlineBox given the passed X position.
2086 2005-03-03 Ken Kocienda <kocienda@apple.com>
2092 <rdar://problem/4035198> Pasting text with different styles does not get reproducible results
2094 I had a good idea yesterday to improve the way we "fixup" styles after
2095 pasting, but i chose a poor data structure to do it, a map of
2096 nodes-to-styles. In the fixup step, I iterated over the map elements and
2097 did the fixup. However, since the order in which the items would come
2098 out of the map is indeterminate, we got unpredictable results.
2100 So, the concept was good, but the implementation was flawed. I have
2101 fixed this mapping to be a list instead, so the order that nodes are
2102 evaluated in the fixup step is document order. This works nicely.
2104 * khtml/editing/htmlediting.cpp:
2105 (khtml::ReplacementFragment::~ReplacementFragment): No longer need to explicity deref nodes and
2106 styles saved away for later fixup. This is now handled by the new NodeDesiredStyle class.
2107 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls computeAndStoreNodeDesiredStyle,
2108 function renamed from mapDesiredStyleForNode.
2109 Now accepts a QValueList<NodeDesiredStyle> in place of the old map.
2110 (khtml::NodeDesiredStyle::NodeDesiredStyle): New class that represents a node-to-style mapping.
2111 (khtml::NodeDesiredStyle::~NodeDesiredStyle): Ditto.
2112 (khtml::NodeDesiredStyle::operator=): Ditto.
2113 (khtml::ReplaceSelectionCommand::doApply): Now calls computeAndStoreNodeDesiredStyle,
2114 function renamed from mapDesiredStyleForNode.
2115 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Now operates on a QValueList<NodeDesiredStyle> in
2116 place of the old map.
2117 (khtml::computeAndStoreNodeDesiredStyle): Renamed from mapDesiredStyleForNode. Now operates on a
2118 QValueList<NodeDesiredStyle> in place of the old map.
2119 * khtml/editing/htmlediting.h:
2120 (khtml::NodeDesiredStyle): New class that represents a node-to-style mapping.
2121 (khtml::ReplacementFragment::desiredStyles): Now returns a QValueList<NodeDesiredStyle> in place of the old map.
2123 * layout-tests/editing/style/typing-style-003-expected.txt: Results changed in an acceptable way.
2125 2005-03-02 Darin Adler <darin@apple.com>
2129 - fixed <rdar://problem/4029741> REGRESSION (188-189): <input type=text> are cleared when you hide/show them
2131 * khtml/html/html_formimpl.h: Added detach functions for both input and text area elements, since
2132 both have m_valueMatchesRenderer flags.
2133 * khtml/html/html_formimpl.cpp:
2134 (DOM::HTMLInputElementImpl::detach): Set m_valueMatchesRenderer to false, since the renderer is going away.
2135 (DOM::HTMLTextAreaElementImpl::detach): Ditto.
2137 2005-03-02 Ken Kocienda <kocienda@apple.com>
2143 <rdar://problem/4006151> in reply, caret moves to next line after toggling bold style then typing
2145 * khtml/editing/htmlediting.cpp:
2146 (khtml::ApplyStyleCommand::applyInlineStyle): Defer cleaning up empty style until the end of the
2147 function. In some situations, the render tree can get confused when we do this removal up front.
2148 I wish I understood the reasons more deeply, but this bit of code shuffling seems harmless, and
2151 2005-03-02 Darin Adler <darin@apple.com>
2155 - fixed <rdar://problem/4024966> crash happened twice in [KWQTextField setHasFocus:] + 0xe8
2157 Added more nil checks to the widget implementations. Anywhere a widget pointer is used, do a nil check,
2158 rather than relying on high level assumptions about which calls can and can't destroy the HTML element
2159 (and hence the widget). The case in the bug seems to be a case where scrolling destroyed the element.
2160 We can't be sure this fixes the bug, but we can be relatively sure we didn't introduce any new problems,
2161 because this just avoids nil-dereferencing.
2164 (-[KWQButton becomeFirstResponder]):
2165 (-[KWQButton nextKeyView]):
2166 (-[KWQButton previousKeyView]):
2167 * kwq/KWQListBox.mm:
2168 (-[KWQTableView mouseDown:]):
2169 (-[KWQTableView becomeFirstResponder]):
2170 (-[KWQTableView numberOfRowsInTableView:]):
2171 (-[KWQTableView tableViewSelectionDidChange:]):
2172 (-[KWQTableView tableView:shouldSelectRow:]):
2173 (-[KWQTableView selectionShouldChangeInTableView:]):
2174 * kwq/KWQScrollBar.mm:
2175 (-[KWQScrollBar scroll:]):
2177 (-[KWQSlider mouseDown:]):
2178 (-[KWQSlider slide:]):
2179 (-[KWQSlider becomeFirstResponder]):
2180 (-[KWQSlider nextKeyView]):
2181 (-[KWQSlider previousKeyView]):
2182 * kwq/KWQTextArea.mm:
2183 (-[KWQTextAreaTextView becomeFirstResponder]):
2184 (-[KWQTextAreaTextView resignFirstResponder]):
2185 (-[KWQTextAreaTextView mouseDown:]):
2186 * kwq/KWQTextField.mm:
2187 (-[KWQTextFieldController action:]):
2188 (-[KWQTextFieldController controlTextDidEndEditing:]):
2189 (-[KWQTextFieldController controlTextDidChange:]):
2190 (-[KWQTextFieldController textView:didHandleEvent:]):
2191 (-[KWQTextFieldController setHasFocus:]):
2193 2005-03-02 Richard Williamson <rjw@apple.com>
2195 Fixed <rdar://problem/4031483> Leak (RenderObject::createInlineBox) reproducible with Stock widget
2197 We were leaking inline block line boxes. Argh!
2201 * khtml/rendering/render_flow.cpp:
2202 (RenderFlow::dirtyLineBoxes):
2203 * khtml/rendering/render_line.cpp:
2204 (khtml::InlineBox::deleteLine):
2206 2005-03-02 Chris Blumenberg <cblu@apple.com>
2208 Fixed: <rdar://problem/3976872> REGRESSION (Mail): Pasted plain text doesn't get the proper style if pasted into newlines
2210 Reviewed by kocienda.
2212 * khtml/editing/htmlediting.cpp:
2213 (khtml::EditCommand::styleAtPosition): new, factored out from calculateStyleBeforeInsertion
2214 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): call styleAtPosition
2215 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): clear new m_insertionStyle ivar
2216 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): deref new m_insertionStyle ivar
2217 (khtml::ReplaceSelectionCommand::doApply): store the style so it later be applied when matching style
2218 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply style from m_insertionStyle when matching style
2219 * khtml/editing/htmlediting.h:
2221 2005-03-02 Maciej Stachowiak <mjs@apple.com>
2225 <rdar://problem/4031718> REGRESSION (401-401+): Safari reproducible crash setting up scope in JSLazyEventListener::parseCode authenticating to bugweb
2227 * khtml/ecma/kjs_events.cpp:
2228 (JSLazyEventListener::parseCode): If originalNode is NULL, don't
2229 mess with the scope chain.
2231 * khtml/html/html_baseimpl.cpp:
2232 (HTMLBodyElementImpl::parseHTMLAttribute): For handlers that are
2233 delcared on body but set on the document, pass NULL to avoid
2234 swizzling the scope chain. It turns out that this is what browsers
2235 do, and it finesses the crash.
2237 2005-03-02 David Harrison <harrison@apple.com>
2241 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
2243 * khtml/editing/htmlediting.cpp:
2244 (khtml::ReplaceSelectionCommand::doApply):
2246 2005-03-02 Ken Kocienda <kocienda@apple.com>
2251 <rdar://problem/4020574> REGRESSION (Mail): copy/paste first part of reply-quoted text alters downstream style
2253 The problem was that the operation to move nodes following the newly-pasted nodes did not preserve the
2254 style of these moved nodes. I have generalized some of the functions that compute and preserve styles
2255 for nodes and then apply these styles after a DOM operation.
2257 * khtml/editing/htmlediting.cpp:
2258 (khtml::ReplacementFragment::~ReplacementFragment): Call new derefNodesAndStylesInMap() helper function
2259 in place of old code that had this deref'ing inline.
2260 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls new mapDesiredStyleForNode() helper
2261 function place of old code that had this style computation inline.
2262 (khtml::ReplacementFragment::removeStyleNodes): Updated comment for new helper name.
2263 (khtml::ReplaceSelectionCommand::doApply): Now calls new helpers in place of helpers whose names were changed,
2264 or in place of pre-refactored inline code.
2265 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Renamed from applyStyleToInsertedNodes(). Now generalized
2266 to take the map of nodes to use for the fixup. This makes it possible to call this code with different maps,
2267 and that is needed to fix the bug.
2268 (khtml::mapDesiredStyleForNode): New helper function to compute the inheritable styles for a given node
2269 and map this style to the given node in the given map. This function now also includes the code that was
2270 in the removeBlockquoteColorsIfNeeded(). This latter helper has now been removed.
2271 (khtml::derefNodesAndStylesInMap): Simple helper to deref map members.
2272 * khtml/editing/htmlediting.h:
2273 (khtml::ReplacementFragment::desiredStyles): New helper to return map of nodes-to-desiredStyles.
2275 2005-03-01 Ken Kocienda <kocienda@apple.com>
2281 <rdar://problem/4011358> REGRESSION(Mail): after dragging text to mail message and deleting, typing or dragging new text doesn't work
2283 * khtml/editing/visible_position.cpp:
2284 (khtml::VisiblePosition::isCandidate): Insertion point disappearing was due to a failed
2285 check here after deleting all the content in the body element. The special "empty block"
2286 needs to add check for DOM children. A block may have straggling anonymous render children in
2287 some cases, and so the check needs to be (!DOM-kids || !render-kids).
2289 Also, I botched the last checkin trying to split these two patches in my tree. Wrong layout tests
2290 got checked in, I checked in a conflict marker in the Changelog, etc. I fixed everything with this checkin.
2292 2005-03-01 Ken Kocienda <kocienda@apple.com>
2296 Improved fix for this bug:
2298 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
2300 Maciej and I discussed this situation at length, and we came up with a better fix than I did earlier.
2302 * khtml/editing/htmlediting.cpp:
2303 (khtml::InsertParagraphSeparatorCommand::doApply): Simplify one special case so that it only handles the
2304 "last in block" situation. Remove special case for "downstream node is in different block" and handle
2305 this case with a little bit of special code in the general insertion case.
2307 Results studied to make sure there were no problems.
2309 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt
2310 * layout-tests/editing/inserting/insert-div-001-expected.txt
2311 * layout-tests/editing/inserting/insert-div-002-expected.txt
2312 * layout-tests/editing/inserting/insert-div-004-expected.txt
2313 * layout-tests/editing/inserting/insert-div-005-expected.txt
2314 * layout-tests/editing/inserting/insert-div-009-expected.txt
2315 * layout-tests/editing/inserting/insert-div-014-expected.txt
2316 * layout-tests/editing/inserting/insert-div-018-expected.txt
2317 * layout-tests/editing/inserting/insert-div-024-expected.txt
2318 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
2319 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
2320 * layout-tests/editing/pasteboard/paste-text-015-expected.txt
2321 * layout-tests/editing/style/block-style-004-expected.txt
2322 * layout-tests/editing/style/block-style-005-expected.txt
2323 * layout-tests/editing/style/block-style-006-expected.txt
2327 * layout-tests/editing/inserting/insert-div-027.html
2328 * layout-tests/editing/inserting/insert-div-027-expected.txt
2330 2005-03-01 David Hyatt <hyatt@apple.com>
2332 Fix for 4030890, regression with <sup> on Google. Fix some bogus != comparison checks in verticalPositionHint.
2336 (RenderObject::getVerticalPosition):
2338 2005-03-01 Chris Blumenberg <cblu@apple.com>
2340 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
2344 * khtml/editing/htmlediting.cpp:
2345 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
2346 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
2347 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
2348 * layout-tests/editing/deleting/smart-delete-001.html: Added.
2349 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
2350 * layout-tests/editing/deleting/smart-delete-002.html: Added.
2352 2005-03-01 Richard Williamson <rjw@apple.com>
2354 Fixed <rdar://problem/4029772> Weather widgets use a lot of memory (more that other widgets)
2356 The string objects created by KWQHeaderStringFromDictionary() leaked.
2358 Reviewed by John Louch.
2361 (KWQHeaderStringFromDictionary):
2363 2005-03-01 Jens Alfke <jens@apple.com>
2367 <rdar://problem/4004531> Simple Sun Signed Applet throws exceptions; doesn't run
2368 Two fixes for the way we extract the parameter-y goodness from <object> tags.
2370 * khtml/rendering/render_frames.cpp:
2371 (RenderPartObject::updateWidget):
2373 2005-03-01 Richard Williamson <rjw@apple.com>
2375 Fixed <rdar://problem/3990258> REGRESSION (125.12-181): top of picture that spans two pages is cut off on print from Safari
2377 The problem was due to incorrect "object truncation" in RenderFlow::paintLines.
2378 We attempt to push objects down if they don't fit on a page at
2379 paint time. If the attempt to push object down failed we just
2380 didn't paint at all.
2384 * khtml/rendering/render_flow.cpp:
2385 (RenderFlow::paintLines):
2387 2005-03-01 Chris Blumenberg <cblu@apple.com>
2389 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
2393 * khtml/editing/htmlediting.cpp:
2394 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
2395 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
2396 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
2397 * layout-tests/editing/deleting/smart-delete-001.html: Added.
2398 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
2399 * layout-tests/editing/deleting/smart-delete-002.html: Added.
2401 2005-03-01 Ken Kocienda <kocienda@apple.com>
2407 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
2409 * khtml/editing/htmlediting.cpp:
2410 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
2412 2005-03-01 Maciej Stachowiak <mjs@apple.com>
2416 <rdar://problem/4003774> REGRESSION(125-181): JavaScript problems @ Yankee/Dixie quiz
2418 Reworked how scopes are set up for event handlers to match other
2419 browser. This includes the following changes:
2421 - Special scope entries are set up at the time the event handler
2422 is created, not at the time it fires.
2424 - Special scope is only set up for event handlers set in the html
2425 source through an html attribute, not for handlers set using
2426 addEventHandler or setting JS properties like onclick through
2429 - Special scope is based on the DOM node on which the handler is
2430 an attribute, not the event target.
2432 This fixes the regression while allowing the fix to
2433 <rdar://problem/3798453> (DIG: getting variable with same name as
2434 DOM element attribute gets attribute value instead) to keep
2437 * khtml/ecma/kjs_events.cpp:
2438 (JSEventListener::handleEvent):
2439 (JSLazyEventListener::JSLazyEventListener):
2440 (JSLazyEventListener::parseCode):
2441 * khtml/ecma/kjs_events.h:
2442 * khtml/ecma/kjs_proxy.cpp:
2443 (KJSProxyImpl::createHTMLEventHandler):
2444 * khtml/ecma/kjs_proxy.h:
2445 * khtml/ecma/kjs_window.cpp:
2446 (Window::getJSLazyEventListener):
2447 * khtml/ecma/kjs_window.h:
2448 * khtml/html/html_baseimpl.cpp:
2449 (HTMLBodyElementImpl::parseHTMLAttribute):
2450 (HTMLFrameElementImpl::parseHTMLAttribute):
2451 (HTMLFrameSetElementImpl::parseHTMLAttribute):
2452 * khtml/html/html_elementimpl.cpp:
2453 (HTMLElementImpl::parseHTMLAttribute):
2454 * khtml/html/html_formimpl.cpp:
2455 (DOM::HTMLFormElementImpl::parseHTMLAttribute):
2456 (DOM::HTMLButtonElementImpl::parseHTMLAttribute):
2457 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
2458 (DOM::HTMLLabelElementImpl::parseHTMLAttribute):
2459 (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
2460 (DOM::HTMLTextAreaElementImpl::parseHTMLAttribute):
2461 * khtml/html/html_imageimpl.cpp:
2462 (HTMLImageElementImpl::parseHTMLAttribute):
2463 * khtml/html/html_objectimpl.cpp:
2464 (HTMLObjectElementImpl::parseHTMLAttribute):
2465 * khtml/khtml_part.cpp:
2466 (KHTMLPart::createHTMLEventListener):
2467 * khtml/khtml_part.h:
2468 * khtml/xml/dom_docimpl.cpp:
2469 (DocumentImpl::createHTMLEventListener):
2470 * khtml/xml/dom_docimpl.h:
2474 2005-03-01 Chris Blumenberg <cblu@apple.com>
2476 Backed out my patch since the tree was closed.
2478 * khtml/editing/htmlediting.cpp:
2479 (khtml::DeleteSelectionCommand::initializePositionData):
2480 * khtml/editing/jsediting.cpp:
2482 2005-03-01 Chris Blumenberg <cblu@apple.com>
2484 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
2488 * khtml/editing/htmlediting.cpp:
2489 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
2490 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
2491 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
2492 * layout-tests/editing/deleting/smart-delete-001.html: Added.
2493 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
2494 * layout-tests/editing/deleting/smart-delete-002.html: Added.
2496 2005-03-01 Ken Kocienda <kocienda@apple.com>
2502 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
2504 * khtml/editing/htmlediting.cpp:
2505 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
2507 2005-03-01 David Harrison <harrison@apple.com>
2511 <rdar://problem/3915560> Mail would like an SPI to enable "smart" text paste/drop
2513 * kwq/WebCoreBridge.h:
2514 * kwq/WebCoreBridge.mm:
2515 (-[WebCoreBridge smartDeleteRangeForProposedRange:]):
2516 (-[WebCoreBridge smartInsertForString:replacingRange:beforeString:afterString:]):
2519 2005-03-01 Chris Blumenberg <cblu@apple.com>
2521 Fixed: <rdar://problem/4030404> selection granularity should be set when extending selection via JS
2523 Reviewed by kocienda.
2525 * khtml/ecma/kjs_window.cpp:
2526 (SelectionFunc::tryCall): set the granularity on the part. This will allow us to write smart paste layout tests.
2527 * layout-tests/editing/pasteboard/smart-paste-001-expected.txt: Added.
2528 * layout-tests/editing/pasteboard/smart-paste-001.html: Added.
2529 * layout-tests/editing/pasteboard/smart-paste-002-expected.txt: Added.
2530 * layout-tests/editing/pasteboard/smart-paste-002.html: Added.
2531 * layout-tests/editing/pasteboard/smart-paste-003-expected.txt: Added.
2532 * layout-tests/editing/pasteboard/smart-paste-003.html: Added.
2533 * layout-tests/editing/pasteboard/smart-paste-004-expected.txt: Added.
2534 * layout-tests/editing/pasteboard/smart-paste-004.html: Added.
2535 * layout-tests/editing/pasteboard/smart-paste-005-expected.txt: Added.
2536 * layout-tests/editing/pasteboard/smart-paste-005.html: Added.
2537 * layout-tests/editing/pasteboard/smart-paste-006-expected.txt: Added.
2538 * layout-tests/editing/pasteboard/smart-paste-006.html: Added.
2539 * layout-tests/editing/pasteboard/smart-paste-007-expected.txt: Added.
2540 * layout-tests/editing/pasteboard/smart-paste-007.html: Added.
2542 2005-03-01 Chris Blumenberg <cblu@apple.com>
2544 Fixed: <rdar://problem/4029934> smart paste with plain text can add too many spaces
2546 Reviewed by kocienda.
2548 * khtml/editing/htmlediting.cpp:
2549 (khtml::ReplaceSelectionCommand::doApply): pass true for treatNBSPAsWhitespace to leadingWhitespacePosition and trailingWhitespacePosition
2550 * khtml/xml/dom_position.cpp:
2551 (DOM::isWS): take treatNBSPAsWhitespace param
2552 (DOM::Position::leadingWhitespacePosition): ditto
2553 (DOM::Position::trailingWhitespacePosition): ditto
2554 * khtml/xml/dom_position.h:
2556 2005-03-01 Ken Kocienda <kocienda@apple.com>
2562 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
2564 * khtml/editing/htmlediting.cpp:
2565 (khtml::InsertParagraphSeparatorCommand::doApply): Look for the upstream-most block to insert after
2566 when at the visible end of a block. This helps to avoid some undesirable sequences of markup which
2567 Dave says will be vary hard to render. Changing the command in this way avoids the "limitations"
2568 of the render tree by not asking it to render markup we do not want to make anyway.
2570 All these tests change, but either in insignificant ways, or for the better.
2572 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt:
2573 * layout-tests/editing/inserting/insert-div-001-expected.txt:
2574 * layout-tests/editing/inserting/insert-div-002-expected.txt:
2575 * layout-tests/editing/inserting/insert-div-004-expected.txt:
2576 * layout-tests/editing/inserting/insert-div-005-expected.txt:
2577 * layout-tests/editing/inserting/insert-div-009-expected.txt:
2578 * layout-tests/editing/inserting/insert-div-024-expected.txt:
2579 * layout-tests/editing/pasteboard/paste-text-011-expected.txt:
2580 * layout-tests/editing/pasteboard/paste-text-013-expected.txt:
2581 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
2582 * layout-tests/editing/style/block-style-004-expected.txt:
2583 * layout-tests/editing/style/block-style-005-expected.txt:
2584 * layout-tests/editing/style/block-style-006-expected.txt:
2585 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
2586 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
2587 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
2588 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
2590 New test to check specific problem mentioned in the bug.
2592 * layout-tests/editing/inserting/insert-div-026-expected.txt: Added.
2593 * layout-tests/editing/inserting/insert-div-026.html: Added.
2595 2005-02-28 Maciej Stachowiak <mjs@apple.com>
2599 <rdar://problem/4002864> REGRESSION(125-146) getElementById in onload fails in a test case involving external resources
2601 Moved management of elementById hashtable from attach/detach to
2602 insertedIntoDocument/removedFromDocument, to avoid being thrown
2603 off by temporary detaches due to style recalcs.
2605 * khtml/xml/dom_elementimpl.cpp:
2606 (ElementImpl::insertedIntoDocument):
2607 (ElementImpl::removedFromDocument):
2608 (ElementImpl::attach):
2609 (ElementImpl::updateId):
2610 * khtml/xml/dom_elementimpl.h:
2612 Make sure that insertedIntoDocument is called before firing any
2615 * khtml/xml/dom_nodeimpl.cpp:
2616 (NodeBaseImpl::dispatchChildInsertedEvents):
2618 2005-02-28 David Hyatt <hyatt@apple.com>
2620 Fix for 4028999, safari crashes when resetting if mallocsribble is on. Clip rects were being cleared using dead
2621 render objects. Change the ordering.
2625 * khtml/rendering/render_box.cpp:
2626 (RenderBox::detach):
2627 * khtml/rendering/render_layer.cpp:
2628 (RenderLayer::~RenderLayer):
2630 2005-02-28 Chris Blumenberg <cblu@apple.com>
2632 Fixed: <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
2634 Reviewed by kocienda.
2636 * khtml/editing/htmlediting.cpp:
2637 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Call updateLayout so caretMinOffset and caretMaxOffset return correct values.
2639 2005-02-28 John Sullivan <sullivan@apple.com>
2643 - WebCore part of fix for <rdar://problem/4023490> REGRESSION (125-185): Tabbing through links
2644 on frameset page gets stuck at end (tivofaq.com)
2646 * kwq/WebCoreBridge.h:
2647 add nextValidKeyViewOutsideWebFrameViews (code is in WebKit)
2649 2005-02-28 Ken Kocienda <kocienda@apple.com>
2655 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
2657 * khtml/css/css_computedstyle.cpp: inheritableProperties array now defined in css_valueimpl.cpp.
2658 * khtml/css/css_valueimpl.cpp: Define inheritableProperties array here.
2659 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Use new name for blockProperties, and use the new
2660 constant for the number of items in the array.
2661 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
2662 (DOM::CSSMutableStyleDeclarationImpl::removeInheritableProperties): New function.
2663 * khtml/css/css_valueimpl.h: Declare inheritableProperties array and numInheritableProperties extern so they
2664 can be defined in css_valueimpl.cpp and used in css_computedstyle.cpp.
2665 * khtml/editing/htmlediting.cpp:
2666 (khtml::ReplacementFragment::removeStyleNodes): This code was misguided, and removed too much style from HTML
2667 elements. Now, it removes from HTML elements only the styles that we replace later with a call to applyStyle().
2668 Also, add ID_B to list of inline "style" nodes we are willing to remove. Leaving it off was an oversight.
2670 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: ID_B fix made this result change, without any
2671 visible change in the test.
2675 * layout-tests/editing/style/smoosh-styles-003.html
2676 * layout-tests/editing/style/smoosh-styles-003-expected.txt
2678 2005-02-28 Richard Williamson <rjw@apple.com>
2680 Fixed <rdar://problem/4026985> CrashTracer: ...14 crashes at com.apple.WebCore: -[KWQPageState invalidate] + 32
2682 Added more nil checking and ASSERTS.
2683 Without a reproducible case this is hard to definitively resolve.
2685 Reviewed by John Sullivan.
2687 * kwq/KWQPageState.mm:
2688 (-[KWQPageState invalidate]):
2690 2005-02-28 Richard Williamson <rjw@apple.com>
2692 Fixed <rdar://problem/4027702> 3.5% performance regression btwn Safari-188 and Safari-400
2694 I inadvertently checked in some debugging code that disabled
2695 style sharing. Backed out that change.
2697 * khtml/css/cssstyleselector.cpp:
2698 (khtml::CSSStyleSelector::styleForElement):
2700 2005-02-28 Chris Blumenberg <cblu@apple.com>
2702 Fixed: <rdar://problem/4026639> www.bmw.ca configurator does not work with Safari
2706 * khtml/ecma/kjs_html.cpp:
2707 (KJS::HTMLElement::tryGet): when frameset.<name of frame child> is called, return the window object of the frame child
2709 2005-02-28 Ken Kocienda <kocienda@apple.com>
2715 <rdar://problem/4026906> Paste of HTML table content can break table structure
2717 * khtml/editing/htmlediting.cpp:
2718 (khtml::ReplacementFragment::pruneEmptyNodes): Call new isProbablyTableStructureNode() function to prevent
2719 removal of empty table structure nodes.
2720 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
2721 (khtml::isProbablyTableStructureNode): New helper function.
2722 * khtml/editing/htmlediting.h: Declare new helper.
2724 2005-02-28 Chris Blumenberg <cblu@apple.com>
2726 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
2728 Reviewed by kocienda.
2730 * khtml/editing/htmlediting.cpp:
2731 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): ref and deref the element while it is "floating"
2732 (khtml::ReplacementFragment::insertFragmentForTestRendering): ditto
2733 (khtml::floatRefdElement): new, keeps an element alive while its ref count is 0
2734 (khtml::createDefaultParagraphElement): removed commented out code
2735 (khtml::createBlockPlaceholderElement): ref the element and return it as "floating"
2736 (khtml::createFontElement): ditto
2737 (khtml::createStyleSpanElement): ditto
2738 * khtml/editing/htmlediting.h:
2740 2005-02-27 Maciej Stachowiak <mjs@apple.com>
2744 <rdar://problem/3993557> REGRESSION (125-180-ish): getElementsByTagName no longer works with namespace designations
2746 * khtml/xml/dom_nodeimpl.cpp:
2747 (NodeBaseImpl::getElementsByTagNameNS): When no namespace is specified, find elements
2748 of the specified name in any namespace to match Mozilla and earlier Safari behavior.
2750 2005-02-25 Darin Adler <darin@apple.com>
2754 - fixed <rdar://problem/4025618> Crash while searching at hollywoodvideo.com
2756 * khtml/html/html_formimpl.h: Added valueWithDefault.
2757 * khtml/html/html_formimpl.cpp:
2758 (DOM::HTMLInputElementImpl::appendFormData): Call valueWithDefault instead of going at the render object
2759 to try to get the default value; there may be no render object if this is display:none.
2760 (DOM::HTMLInputElementImpl::valueWithDefault): Added. Knows about the defaults for "submit" and "reset"
2761 buttons; otherwise just returns the value as-is.
2763 * khtml/rendering/render_form.h: Removed the defaultLabel member functions.
2764 * khtml/rendering/render_form.cpp:
2765 (RenderSubmitButton::rawText): Call valueWithDefault instead of using defaultLabel function here on
2766 the render side. The DOM needs to know how to deal with the default anyway for form submission.
2767 (RenderSubmitButton::defaultLabel): Removed.
2768 (RenderResetButton::defaultLabel): Removed.
2769 (RenderPushButton::defaultLabel): Removed.
2771 2005-02-25 Darin Adler <darin@apple.com>
2775 - fixed <rdar://problem/4025088> window onblur and onfocus don't fire when text field has focus
2777 * kwq/KWQKHTMLPart.h: Added setWindowHasFocus function and m_windowHasFocus data member.
2778 * kwq/KWQKHTMLPart.mm:
2779 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Took out the code that sends the focus and blur events.
2780 (KWQKHTMLPart::setWindowHasFocus): Put that code here instead.
2782 * kwq/WebCoreBridge.h: Added setWindowHasFocus: method to the bridge.
2783 * kwq/WebCoreBridge.mm: (-[WebCoreBridge setWindowHasFocus:]): Added. Calls method on the part.
2785 2005-02-25 Darin Adler <darin@apple.com>
2789 - re-fixed <rdar://problem/3665430> horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode
2791 * kwq/KWQTextArea.mm: (-[KWQTextArea _updateTextViewWidth]): Don't change the text view width
2792 to match the text area's width in the "wrap" case.
2794 2005-02-25 Ken Kocienda <kocienda@apple.com>
2800 <rdar://problem/4021518> 8A394 Mail crashes during paste: khtml::RootInlineBox::closestLeafChildForXPos
2802 * khtml/editing/visible_units.cpp:
2803 (khtml::previousLinePosition): Adding an updateLayout call at the start of the function fixes the crash, since
2804 we caught line boxes in a not-completely-updated state.
2805 (khtml::nextLinePosition): Ditto.
2807 2005-02-25 David Hyatt <hyatt@apple.com>
2809 Fix for 4010774, make sure to avoid an O(N^2) algorithm in nextRenderer() that is triggered when large
2810 DOM subtrees are inserted into documents via one insert/append call.
2812 Reviewed by kocienda
2814 * khtml/xml/dom_nodeimpl.cpp:
2815 (NodeImpl::nextRenderer):
2817 2005-02-25 Richard Williamson <rjw@apple.com>
2819 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
2821 Second pass at fixing 3382926 w/o causing layout regressions. Same concept:
2822 if directionality of text's element is RTL and first character has neutral directionality
2823 then set the initial directionality to RTL.
2827 * khtml/rendering/bidi.cpp:
2828 (khtml::RenderBlock::bidiReorderLine):
2829 (khtml::RenderBlock::determineStartPosition):
2833 2005-02-25 Ken Kocienda <kocienda@apple.com>
2837 Roll out Chris' change to fix this bug:
2839 <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
2841 That code change is responsible for all these new crashers:
2843 <rdar://problem/4025177> crash copying safari.apple.com into Blot document
2844 <rdar://problem/4025184> crash in DOM::NodeImpl::parentNode copying "New!" from google.com to Blot
2845 <rdar://problem/4025214> crash in DOM::NodeImpl::getRect loading paste-match-style-001.html
2847 Since we wish to close the tree for a build right now, I am rolling out rather than investigating.
2849 * khtml/editing/htmlediting.cpp:
2850 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded)
2851 (khtml::ReplacementFragment::insertFragmentForTestRendering)
2852 (khtml::createDefaultParagraphElement)
2853 (khtml::createBlockPlaceholderElement)
2854 (khtml::createFontElement)
2855 (khtml::createStyleSpanElement)
2856 * khtml/editing/htmlediting.h
2858 2005-02-25 Ken Kocienda <kocienda@apple.com>
2864 <rdar://problem/4020108> Pasting text into message makes Mail crash reproducibly
2866 Note that, even with this fix, development build will crash until this bug is fixed:
2867 <rdar://problem/4024996> Applying block styles can cause assertion failure in inline style removal
2869 This will not crash deployment builds, so I am going to land.
2871 * khtml/editing/htmlediting.cpp:
2872 (khtml::ApplyStyleCommand::applyBlockStyle): Applying block styles can make the loop to reach beyondEnd
2873 fail since the structure of the document can change. Cache the next node first before operating on it,
2876 2005-02-25 Vicki Murley <vicki@apple.com>
2878 - recommit this change, since rolling it out did NOT fix the performance regression!
2880 2005-02-23 Darin Adler <darin@apple.com>
2884 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
2886 The key was to change things around so that we don't push text from the DOM to the widget
2887 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
2888 during the blur process.
2890 * khtml/html/html_formimpl.cpp:
2891 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
2892 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
2893 new value is set here.
2894 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
2896 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
2897 to true, and also sends out the input event. It's better to have this here than in the renderer code.
2898 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
2899 m_dirtyvalue) and m_valueMatchesRenderer as false.
2900 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
2901 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
2902 where the value came from.
2903 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
2904 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
2905 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
2907 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
2908 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
2909 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
2911 * khtml/rendering/render_form.cpp:
2912 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
2914 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
2916 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
2917 (RenderTextArea::handleFocusOut): Ditto.
2918 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
2919 DOM if valueMatchesRenderer is true.
2920 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
2922 2005-02-25 Chris Blumenberg <cblu@apple.com>
2924 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
2928 * khtml/editing/htmlediting.cpp:
2929 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
2930 (khtml::ReplacementFragment::insertFragmentForTestRendering):
2931 (khtml::floatRefdElement):
2932 (khtml::createDefaultParagraphElement):
2933 (khtml::createBlockPlaceholderElement):
2934 (khtml::createFontElement):
2935 (khtml::createStyleSpanElement):
2936 * khtml/editing/htmlediting.h:
2938 2005-02-25 Darin Adler <darin@apple.com>
2940 * kwq/character-sets.txt: Checked in updated file. This new file has no effect, because none of the
2941 changes affect character sets that we support, but it's good to have the latest file in here, and
2942 completely safe because I checked that the generated files have not changed.
2944 2005-02-25 Vicki Murley <vicki@apple.com>
2948 - back out this change, since it causes a 3.5% performance regression
2950 2005-02-23 Darin Adler <darin@apple.com>
2954 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
2956 The key was to change things around so that we don't push text from the DOM to the widget
2957 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
2958 during the blur process.
2960 * khtml/html/html_formimpl.cpp:
2961 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
2962 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
2963 new value is set here.
2964 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
2966 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
2967 to true, and also sends out the input event. It's better to have this here than in the renderer code.
2968 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
2969 m_dirtyvalue) and m_valueMatchesRenderer as false.
2970 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
2971 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
2972 where the value came from.
2973 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
2974 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
2975 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
2977 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
2978 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
2979 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
2981 * khtml/rendering/render_form.cpp:
2982 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
2984 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
2986 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
2987 (RenderTextArea::handleFocusOut): Ditto.
2988 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
2989 DOM if valueMatchesRenderer is true.
2990 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
2992 2005-02-25 Darin Adler <darin@apple.com>
2996 - fixed <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
2998 * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply):
2999 Use the insertNodeAfterAndUpdateNodesInserted and insertNodeBeforeAndUpdateNodesInserted
3000 functions to add the leading and trailing spaces for smart paste.
3002 2005-02-25 David Hyatt <hyatt@apple.com>
3004 Back out fix for 3382926, since it breaks LTR text inside RTL contexts.
3008 * khtml/rendering/bidi.cpp:
3009 (khtml::BidiIterator::direction):
3011 2005-02-25 David Hyatt <hyatt@apple.com>
3013 Fix for 3975039, scrolling is slow in huge RSS views. Optimize the calculation of clip rects for overflow:hidden
3014 layers. Also optimize layer movement when scrolling overflow sections.
3018 * khtml/rendering/render_layer.cpp:
3020 (ClipRects::operator delete):
3021 (ClipRects::detach):
3022 (RenderLayer::RenderLayer):
3023 (RenderLayer::~RenderLayer):
3024 (RenderLayer::updateLayerPosition):
3025 (RenderLayer::removeOnlyThisLayer):
3026 (RenderLayer::insertOnlyThisLayer):
3027 (RenderLayer::scrollToOffset):
3028 (RenderLayer::hitTest):
3029 (RenderLayer::calculateClipRects):
3030 (RenderLayer::calculateRects):
3031 (RenderLayer::containsPoint):
3032 (RenderLayer::clearClipRects):
3033 (RenderLayer::clearClipRect):
3034 * khtml/rendering/render_layer.h:
3035 (khtml::ClipRects::m_refCnt):
3036 (khtml::ClipRects::overflowClipRect):
3037 (khtml::ClipRects::fixedClipRect):
3038 (khtml::ClipRects::posClipRect):
3039 (khtml::ClipRects::ref):
3040 (khtml::ClipRects::deref):
3041 (khtml::RenderLayer::clipRects):
3042 * khtml/rendering/render_object.cpp:
3043 (RenderObject::setStyle):
3045 2005-02-24 Maciej Stachowiak <mjs@apple.com>
3047 Reviewed by Darin and Dave a while ago.
3049 <rdar://problem/3996685> REGRESSION: Crash in KWQVectorImpl::at loading http://maps.google.com/mapfiles/homepanel.xsl
3051 * kwq/WebCoreBridge.mm:
3052 (formElementFromDOMElement): Check for isHTMLElement() as well as
3053 id() == ID_FORM. This seems like an impossible situation, but
3054 papering over it seems more expedient for the time being.
3056 2005-02-24 Richard Williamson <rjw@apple.com>
3058 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
3060 Use mirror characters correctly when rendering with RTL directionality.
3064 * khtml/rendering/bidi.cpp:
3065 (khtml::BidiIterator::direction):
3067 2005-02-24 Richard Williamson <rjw@apple.com>
3069 Fixed <rdar://problem/3985889> REGRESSION (125-180): setting <img> src to GIF that already animated does not animate; just shows final frame
3073 * WebCore.pbproj/project.pbxproj:
3074 * khtml/html/html_imageimpl.cpp:
3075 (HTMLImageLoader::updateFromElement):
3076 * khtml/rendering/render_image.cpp:
3077 (RenderImage::resetAnimation):
3078 * khtml/rendering/render_image.h:
3079 * khtml/rendering/render_list.cpp:
3080 (RenderListMarker::setStyle):
3081 (RenderListMarker::paint):
3082 * khtml/rendering/render_list.h:
3086 (QPixmap::resetAnimation):
3087 * kwq/WebCoreImageRenderer.h:
3089 2005-02-24 Chris Blumenberg <cblu@apple.com>
3091 Fixed: <rdar://problem/4020110> Safari crashes in setAllData while taking a www.zoomerang.com survey
3095 * kwq/KWQResourceLoader.mm:
3096 (-[KWQResourceLoader finishJobAndHandle:]): clear the job after we've deleted to avoid reentrancy
3098 2005-02-24 Darin Adler <darin@apple.com>
3102 - fixed <rdar://problem/4023360> REGRESSION (186-187): image file upload is broken at pep.apple.com
3104 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::appendFormData): Return true after
3105 setting up the form data for an uploaded file. The old code would fall through to the ISINDEX
3106 case and send double form data (the filename instead of the file contents the second time).
3108 2005-02-24 David Harrison <harrison@apple.com>
3112 <rdar://problem/3990849> AX: textMarkerRange for an AXUIElement within an AXWebArea
3114 * kwq/KWQAccObject.mm:
3115 (-[KWQAccObject textMarkerRange]):
3116 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
3117 (-[KWQAccObject doAXTextMarkerRangeForUIElement:]):
3118 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
3119 Added AXTextMarkerRangeForUIElement, or you can send textMarkerRange to the UIElement itself.
3121 2005-02-24 David Harrison <harrison@apple.com>
3125 <rdar://problem/4004279> 3 AXSelectedTextChanged notifications are firing each time I type a character
3127 * khtml/xml/dom_docimpl.cpp:
3128 (DocumentImpl::updateSelection):
3129 Send notification only if the selection is not null. This safely ignores transitory selections set during editing.
3131 2005-02-24 Darin Adler <darin@apple.com>
3135 - fixed <rdar://problem/3987619> in some cases, text doesn't resize with Format->Style->Bigger/Smaller
3137 * khtml/editing/htmlediting.cpp:
3138 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): Only call nodeFullySelected for non-text nodes.
3139 Text nodes are already split so they're either in the range and full selected or out of the range.
3140 And nodeFullySelected doesn't work for text nodes.
3141 (khtml::ApplyStyleCommand::nodeFullySelected): Add an assertion, since this function only works for elements,
3143 (khtml::ApplyStyleCommand::nodeFullyUnselected): Ditto.
3145 - make big improvement in <rdar://problem/3953636> Mail hung for ~10sec changing font of 84328 characters: khtml::ApplyStyleCommand::nodeFullySelected
3147 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints): Improve algorithm based on suggestion
3150 - fixed <rdar://problem/4020305> REGRESSION (185-186): loading image in new window using document.write fails
3152 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::open): If there is no parent document, don't blow away the base URL.
3154 - fixed <rdar://problem/4021701> REGRESSION (188-188+): form not submitted after pressing <return> at http://hrweb.apple.com
3156 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchMouseEvent): Send activate event in the case where the event
3157 sent is a KHTML_CLICK_EVENT, not CLICK_EVENT.
3159 2005-02-23 Kevin Decker <kdecker@apple.com>
3163 Fixed <rdar://problem/4020747> REGRESSION: stray </applet> tags crash Safari
3165 * khtml/html/htmlparser.cpp:
3166 (KHTMLParser::processCloseTag): Made a typesafe check that prevents crashes
3167 whenever there is a closing applet tag without an actual <applet> in the first place.
3168 Now verifies the current token is ID_APPLET before casting it to an HTMLAppletElementImpl.
3171 2005-02-23 Ken Kocienda <kocienda@apple.com>
3177 <rdar://problem/3977962> font loses bold style after pasting next to existing text and pressing return
3179 * khtml/editing/htmlediting.cpp:
3180 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Problem here was
3181 that we were doing work in cases where we should not, and content whose style would have
3182 been correct if we had done nothing was getting clobbered. It turns out that extra work
3183 to apply style to the new paragraph added in this command only needs to be done if we're
3184 at the boundaries of a paragraph. Otherwise, content that is moved as part of the work
3185 of the command will lend their styles to the new paragraph without any extra work needed.
3186 So, make this position check and return unless at a paragraph boundary.
3190 * layout-tests/editing/style/block-styles-007-expected.txt
3191 * layout-tests/editing/style/block-styles-007.html
3193 2005-02-23 Ken Kocienda <kocienda@apple.com>
3199 <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a selection starting from end of line once
3201 Problem is with the way we figure out whether to add or remove a style based on
3202 the current selection. In this case, the code is looking at the end of the
3203 previous line, which is not bold, and deduces incorrectly that the operation is
3204 a "make bold". Then the style code runs to make bold, but there is nothing on
3205 the end of the previous line to embolden, so we get into a cycle where the same
3206 thing happens each time cmd-b is hit.
3208 * khtml/khtml_part.cpp:
3209 (KHTMLPart::selectionComputedStyle): Call editingStartPosition() to get the right position for the font determination.
3210 * khtml/xml/dom2_rangeimpl.cpp:
3211 (DOM::RangeImpl::editingStartPosition): New helper function that "does the right thing" based on whether the
3212 selection is a caret or a range, moving upstream for the former, and downstream for the latter.
3213 * khtml/xml/dom2_rangeimpl.h:
3214 * kwq/KWQKHTMLPart.mm:
3215 (KWQKHTMLPart::fontForSelection): Call editingStartPosition() to get the right position for the font determination.
3219 * layout-tests/editing/style/style-boundary-001-expected.txt
3220 * layout-tests/editing/style/style-boundary-001.html
3221 * layout-tests/editing/style/style-boundary-002-expected.txt
3222 * layout-tests/editing/style/style-boundary-002.html
3223 * layout-tests/editing/style/style-boundary-003-expected.txt
3224 * layout-tests/editing/style/style-boundary-003.html
3225 * layout-tests/editing/style/style-boundary-004-expected.txt
3226 * layout-tests/editing/style/style-boundary-004.html
3228 2005-02-23 Richard Williamson <rjw@apple.com>
3230 Fixed <rdar://problem/3985579> 8A367: Dashboard: Stock widget not visible when click remove to remove single char ticker symbol
3232 Explicitly remove scroll bar views when removing them from
3235 Don't paint synchronously when the scroll position changes,
3236 this caused funky clip problems.
3240 * khtml/rendering/render_layer.cpp:
3241 (RenderLayer::scrollToOffset):
3242 (RenderLayer::setHasHorizontalScrollbar):
3243 (RenderLayer::setHasVerticalScrollbar):
3244 (RenderLayer::updateScrollInfoAfterLayout):
3246 2005-02-23 Ken Kocienda <kocienda@apple.com>
3252 <rdar://problem/3959996> REGRESSION (Mail): cursor moves to beginning of document when click is past end
3254 * khtml/rendering/render_block.cpp:
3255 (khtml::RenderBlock::positionForCoordinates): Skip blocks that are invisible or have no height when
3256 looking for a child to pass off to. And save away the last visible block with a height to pass off
3257 to if there is no child at the right y-coordinate.
3259 2005-02-23 David Harrison <harrison@apple.com>
3263 <rdar://problem/4010059> BoundsForTextMarkerRange does not update with scrolled web area
3265 * kwq/KWQAccObject.mm:
3266 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
3267 Adjust for scrolling.
3269 2005-02-22 Maciej Stachowiak <mjs@apple.com>
3273 <rdar://problem/3949790> hitting return after pasted styled line results in extra content getting the style
3275 * khtml/editing/htmlediting.cpp:
3276 (khtml::InsertParagraphSeparatorCommand::doApply): In the case
3277 where the start block is the root, insert the newly created DIV at
3278 the end of the root block instead of after the last sibling in the
3279 start node, since the start node could be inside other
3280 style-affecting nodes and we don't want to reparent its cousins
3283 2005-02-23 David Harrison <harrison@apple.com>
3287 <rdar://problem/4014691> switch to correctly spelled NSAccessibilityForegroundColorTextAttribute constant
3289 Also removed two older, now unneeded, wrappers.
3291 * kwq/KWQAccObject.mm:
3292 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
3293 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
3294 Removed these older, now unneeded, wrappers.
3296 (NSAccessibilityForegroundColorTextAttributeWrapper):
3297 New wrapper for NSAccessibilityForegroundColorTextAttribute.
3299 (AXAttributeStringSetStyle):
3300 Use NSAccessibilityForegroundColorTextAttributeWrapper.
3302 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
3303 Remove uses of visiblePositionForStartOfTextMarkerRange and visiblePositionForEndOfTextMarkerRange.
3305 2005-02-23 David Harrison <harrison@apple.com>
3309 <rdar://problem/3524784> AX hit test doesn't return info when done in empty space of content area
3311 * kwq/KWQAccObject.mm:
3312 (-[KWQAccObject accessibilityHitTest:]):
3313 Return unignored object.
3315 2005-02-23 Darin Adler <darin@apple.com>
3319 - fixed <rdar://problem/4006509> REGRESSION (171-172): Setting CSS -khtml-user-modify property triggers crash
3321 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyProperty):
3322 Removed the code that changes the style of the element. This was never needed, and caused the
3323 style to be modified while we were iterating it.
3325 2005-02-23 Ken Kocienda <kocienda@apple.com>
3331 <rdar://problem/3980209> Mail crashed when I pressed Cmd-Shift-[ (nil-deref in ApplyStyleCommand::addBlockStyleIfNeeded)
3333 * khtml/editing/htmlediting.cpp:
3334 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Reordered the new block
3335 insertion so that it come before the move. The logic stays exactly the same, however, with the old
3336 ordering, the new block could want to become a child of itself come insertion time. I considered
3337 making a more complicated code change to fix this problem, but the simple reordering works just
3338 as well, and seems less risky.
3340 These all changed in an insignificant way. It seems that with the new code, some empty text nodes
3341 got reordered in the document. This has no effect on anything visible to the user.
3343 * layout-tests/editing/style/create-block-for-style-003-expected.txt
3344 * layout-tests/editing/style/create-block-for-style-004-expected.txt
3345 * layout-tests/editing/style/create-block-for-style-009-expected.txt
3346 * layout-tests/editing/style/create-block-for-style-011-expected.txt
3347 * layout-tests/editing/style/create-block-for-style-013-expected.txt
3349 2005-02-23 Darin Adler <darin@apple.com>
3353 - fixed <rdar://problem/4013986> REGRESSION (173-174): onclick event not sent when mouse click on checkbox is double-click
3355 We need to send an onclick event *and* an ondblclick event when we process a double click.
3357 * khtml/khtmlview.cpp: (KHTMLView::dispatchMouseEvent): In the case where we're sending a CLICK_EVENT,
3358 follow it by a KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT when handling a double click, and a DOMACTIVATE_EVENT.
3359 We no longer do the DOMACTIVATE_EVENT in dispatchGenericEvent.
3360 * khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked): send only CLICK_EVENT here, and
3361 lets dispatchMouseEvent deal with the other subsequent events.
3362 * khtml/xml/dom_nodeimpl.cpp:
3363 (NodeImpl::dispatchGenericEvent): Remove the code that sends a DOMACTIVATE_EVENT, since there's no longer
3364 a good way to figure out if this is the last event that should be sent before it is.
3365 (NodeImpl::dispatchMouseEvent): Set the meta key modifier here (as it already is set elsewhere), and
3366 follow up a CLICK_EVENT with KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT, and DOMACTIVATE_EVENT as above.
3368 2005-02-23 Darin Adler <darin@apple.com>
3372 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
3374 The key was to change things around so that we don't push text from the DOM to the widget
3375 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
3376 during the blur process.
3378 * khtml/html/html_formimpl.cpp:
3379 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
3380 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
3381 new value is set here.
3382 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
3384 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
3385 to true, and also sends out the input event. It's better to have this here than in the renderer code.
3386 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
3387 m_dirtyvalue) and m_valueMatchesRenderer as false.
3388 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
3389 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
3390 where the value came from.
3391 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
3392 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
3393 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
3395 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
3396 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
3397 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
3399 * khtml/rendering/render_form.cpp:
3400 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
3402 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
3404 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
3405 (RenderTextArea::handleFocusOut): Ditto.
3406 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
3407 DOM if valueMatchesRenderer is true.
3408 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
3410 2005-02-22 Richard Williamson <rjw@apple.com>
3412 Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions
3414 Just set dashboard dirty bit when overflow scrolling changes.
3416 Don't do comparison of regions in before scroll regions are
3417 added, instead do it in WebKit after automatic scroll regions
3422 * khtml/css/cssparser.cpp:
3423 (CSSParser::parseDashboardRegions): Cleaned up comments
3424 * khtml/css/cssstyleselector.cpp:
3425 (khtml::CSSStyleSelector::styleForElement): Cleaned up comments
3427 * khtml/khtmlview.cpp:
3428 (KHTMLView::updateDashboardRegions):
3429 * khtml/rendering/render_layer.cpp:
3430 (RenderLayer::updateScrollInfoAfterLayout):
3431 * kwq/WebDashboardRegion.m:
3432 (-[WebDashboardRegion isEqual:]):
3434 2005-02-22 Chris Blumenberg <cblu@apple.com>
3436 Fixed: <rdar://problem/3976872> Pasted plain text doesn't get the proper style if pasted into newlines
3440 * khtml/editing/htmlediting.cpp:
3441 (khtml::ReplaceSelectionCommand::doApply): don't clear the typing style when matching style
3442 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply the typing style when matching style
3443 * khtml/editing/jsediting.cpp:
3444 * khtml/khtml_part.cpp:
3445 (KHTMLPart::pasteAndMatchStyle): new
3446 * khtml/khtml_part.h:
3447 * kwq/KWQKHTMLPart.h:
3448 * kwq/KWQKHTMLPart.mm:
3449 (KWQKHTMLPart::issuePasteAndMatchStyleCommand): new
3450 * kwq/WebCoreBridge.h:
3451 * layout-tests/editing/editing.js:
3453 2005-02-22 Darin Adler <darin@apple.com>
3457 - fixed <rdar://problem/4006596> REGRESSION (183-184): crash in DOM::DocumentImpl::setFocusNode(DOM::NodeImpl*)
3459 * khtml/xml/dom_docimpl.cpp:
3460 (widgetForNode): Added helper.
3461 (DocumentImpl::setFocusNode): Re-get the widget for the node after calling updateLayout.
3462 The updateLayout can destroy the old widget, so we can't keep a stale widget pointer around.
3464 2005-02-22 Ken Kocienda <kocienda@apple.com>
3470 <rdar://problem/4003463> Mail.app HTML uses inline styling markup not understood by Entourage and Eudora
3472 * khtml/editing/htmlediting.cpp:
3473 (khtml::isEmptyFontTag): Helper for removing <font> tags.
3474 (khtml::StyleChange::styleModeForParseMode): Helper to map a document parse mode to a use/don't use
3475 legacy-html-styles value.
3476 (khtml::StyleChange::checkForLegacyHTMLStyleChange): Add support for colors, font faces, and font sizes.
3477 (khtml::ApplyStyleCommand::isHTMLStyleNode):
3478 (khtml::ApplyStyleCommand::removeHTMLFontStyle):
3479 (khtml::ApplyStyleCommand::applyTextDecorationStyle): Now call styleModeForParseMode to determine
3480 whether to use legacy html styles or not.
3481 (khtml::ApplyStyleCommand::removeInlineStyle): Now properly removes <font> styles.
3482 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
3483 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
3484 (khtml::createFontElement): Helper for applying <font> elements.
3485 * khtml/editing/htmlediting.h: All the following support the new bits of data we need to store.
3486 (khtml::StyleChange::applyFontColor)
3487 (khtml::StyleChange::applyFontFace)
3488 (khtml::StyleChange::applyFontSize)
3489 (khtml::StyleChange::fontColor)
3490 (khtml::StyleChange::fontFace)
3491 (khtml::StyleChange::fontSize)
3493 Test results updated now that we will write out <font> tags for quirks mode documents.
3495 * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt
3496 * layout-tests/editing/style/block-style-004-expected.txt
3497 * layout-tests/editing/editing/pasteboard/paste-text-011-expected.txt
3498 * layout-tests/editing/style/block-style-005-expected.txt
3499 * layout-tests/editing/style/block-style-006-expected.txt
3500 * layout-tests/editing/style/smoosh-styles-001-expected.txt
3501 * layout-tests/editing/style/smoosh-styles-002-expected.txt
3503 2005-02-22 Maciej Stachowiak <mjs@apple.com>
3507 <rdar://problem/4017066> crash in KJS::ValueImp::dispatchType() every time I load www.nytimes.com/pages/automobiles
3509 When creating option elements, use lowercase "option" instead of
3510 uppercase "OPTION" to create option elements, because only
3511 lowercase works for XHTML.
3513 * khtml/ecma/kjs_html.cpp:
3514 (KJS::HTMLSelectCollection::tryPut):
3515 (OptionConstructorImp::construct):
3517 2005-02-22 Chris Blumenberg <cblu@apple.com>
3519 WebCore fix for: <rdar://problem/3918056> Mail not line breaking my <pre> formatted emails on replies
3521 Mail must 4018993 to fully address the problem.
3523 Reviewed by kocienda.
3525 * khtml/editing/markup.cpp:
3526 (khtml::startMarkup): don't compute style for text in PRE tags
3527 (khtml::createMarkup): include PRE if it is an ancestor of the nodes in the range
3529 2005-02-21 Richard Williamson <rjw@apple.com>
3531 Fixed <rdar://problem/4008338> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
3533 There was a long standing bug in cssText(). Double value were always cast int! So,
3534 opacity values values were incorrectly converted to text, i.e. 0.75 became 0.
3536 The problem was newly triggered because we parse the css for opacity *TWICE*. This is a result of
3537 incorrectly "invalidating" the style attribute (from fix for 3790449). The second parse was from
3538 the cssText() of the style.
3542 * khtml/css/css_valueimpl.cpp:
3543 (DOM::CSSPrimitiveValueImpl::cssText):
3545 2005-02-21 David Hyatt <hyatt@apple.com>
3547 Fix for 4017204, apply the same fix to the base class nodeAtPoint that was already applied to RenderBlock.
3548 Skip elements with layers and inline flows. Demoted <form>s can end up causing trouble otherwise.
3550 Reviewed by Richard Williamson
3552 * khtml/rendering/render_box.cpp:
3553 (RenderBox::nodeAtPoint):
3555 2005-02-21 David Hyatt <hyatt@apple.com>
3557 Fix for 4017033, CSS is being parsed twice. Make sure to always validate the style attribute when it is
3558 initially parsed. Add code to clean up decls when the style attribute is completely removed. Add a new
3559 synchronizing boolean that avoids reparsing the style declaration when the attribute is simply
3560 being synced up to the declaration.
3564 * khtml/css/css_valueimpl.cpp:
3565 (DOM::CSSMutableStyleDeclarationImpl::setChanged):
3566 * khtml/html/html_elementimpl.cpp:
3567 (HTMLElementImpl::invalidateStyleAttribute):
3568 (HTMLElementImpl::updateStyleAttributeIfNeeded):
3569 (HTMLElementImpl::HTMLElementImpl):
3570 (HTMLElementImpl::~HTMLElementImpl):
3571 (HTMLElementImpl::destroyInlineStyleDecl):
3572 (HTMLElementImpl::mapToEntry):
3573 (HTMLElementImpl::parseHTMLAttribute):
3574 * khtml/html/html_elementimpl.h:
3575 * khtml/xml/dom_elementimpl.cpp:
3576 (ElementImpl::ElementImpl):
3577 (ElementImpl::setAttribute):
3578 * khtml/xml/dom_elementimpl.h:
3579 (DOM::ElementImpl::updateStyleAttributeIfNeeded):
3583 2005-02-21 Darin Adler <darin@apple.com>
3585 - fixed Panther deployment build
3587 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Put more stuff inside #if.
3589 2005-02-21 David Harrison <harrison@apple.com>
3593 <rdar://problem/3943090> REGRESSION (Mail): Spelling underline incompletely erased following certain steps
3595 * khtml/rendering/render_text.cpp:
3596 (InlineTextBox::paintMarker):
3597 Make sure underline is placed within the text bounds.
3600 * kwq/KWQPainter.mm:
3601 (QPainter::misspellingLineThickness):
3602 * kwq/WebCoreTextRenderer.h:
3603 Add misspellingLineThickness for use by InlineTextBox::paintMarker.
3605 2005-02-21 Darin Adler <darin@apple.com>
3609 - fixed <rdar://problem/4012978> -[DOMRange markupString] crashes when range contains only a text node with a single space
3611 * khtml/editing/markup.cpp: (khtml::createMarkup): Added updateLayout calls, and added a missing
3614 2005-02-21 Darin Adler <darin@apple.com>
3618 - fixed <rdar://problem/4005435> Safari hung while pasting text into a <textarea> (Panther-only)
3620 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Don't setAutohidesScrollers:YES on Panther.
3622 2005-02-21 Ken Kocienda <kocienda@apple.com>
3628 <rdar://problem/4015499> REGRESSION (186-187): pasted quoted text starting with a blank line increases quote level of pasted text when pasted
3630 * khtml/editing/markup.cpp:
3631 (khtml::markup): Changed over to ASSERT instead of assert.
3632 (khtml::createMarkup): The issue was that the code to add parents all the way back to the common ancestor
3633 block did not check for blocks whose markup had already been added, and could result in adding markup for
3634 nodes twice (hence the additional and erroneous quote level). Now there is a new check that will
3635 only add markup for those nodes before the start of the selection range. This fixes the bug.
3636 (khtml::createFragmentFromMarkup): Changed over to ASSERT instead of assert.
3637 (khtml::createFragmentFromText): Ditto.
3639 2005-02-21 Ken Kocienda <kocienda@apple.com>
3645 <rdar://problem/4015494> REGRESSION (186-187) <cr> removed if quoted word is copy/pasted on line immediately above quoted text
3647 * khtml/editing/htmlediting.cpp:
3648 (khtml::ReplaceSelectionCommand::doApply): Relatively new check designed to remove a <br> element when
3649 that element was on a line by itself did not do an adequate check for this condition, causing the
3650 failure described in the bug. Fixed.
3652 2005-02-19 Ken Kocienda <kocienda@apple.com>
3656 * khtml/editing/htmlediting.cpp:
3657 (khtml::matchNearestBlockquoteColorString): New function which abstracts away the CSS property we use
3658 for this pseudo-color.
3659 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Set the new nearestBlockquoteColorString
3660 psuedo-color here, rather than removing colors as was done before.
3661 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): Check for the pseudo-color in the desired
3662 style, and determine the real color based on the nearest blockquote (or none) to the node.
3663 (khtml::nearestMailBlockquote): Name change from closestMailBlockquote to match new property better.
3665 All the rest of this change is the mechanical coding you need to do to add a new CSS property, in this
3666 case, -khtml-match-nearest-mail-blockquote-color.
3668 * khtml/css/css_computedstyle.cpp:
3669 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue)
3670 * khtml/css/cssparser.cpp:
3671 (CSSParser::parseValue):
3672 * khtml/css/cssproperties.c:
3675 * khtml/css/cssproperties.h:
3676 * khtml/css/cssproperties.in:
3677 * khtml/css/cssstyleselector.cpp:
3678 (khtml::CSSStyleSelector::applyProperty)
3679 * khtml/css/cssvalues.c:
3681 * khtml/css/cssvalues.h:
3682 * khtml/css/cssvalues.in:
3683 * khtml/rendering/render_style.h:
3684 (khtml::RenderStyle::matchNearestMailBlockquoteColor)
3685 (khtml::RenderStyle::setMatchNearestMailBlockquoteColor)
3686 (khtml::RenderStyle::initialMatchNearestMailBlockquoteColor)
3688 2005-02-19 Ken Kocienda <kocienda@apple.com>
3694 <rdar://problem/4014228> REGRESSION (186-187) extra, uneditable lines inserted above and below a line of pasted quoted text
3695 <rdar://problem/4014393> REGRESSION (186-187) pasted quoted text gets extra <cr>s when pasted at top of document
3697 * khtml/editing/htmlediting.cpp:
3698 (khtml::ReplacementFragment::ReplacementFragment): Part of a general refactoring of how
3699 the fragment is inserted into the document, rendered, and then tested for certain
3700 important pieces of information that are required for pasting.
3701 (khtml::ReplacementFragment::insertFragmentForTestRendering): New helper. Handles inserting
3702 the fragment nodes into the document.
3703 (khtml::ReplacementFragment::restoreTestRenderingNodesToFragment): Removes nodes from the
3704 document, and restores them to the fragment.
3705 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Factored out code that
3706 did this before into its own function.
3707 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
3708 (khtml::ReplacementFragment::countRenderedBlocks): This is a real improvement, as it
3709 eliminates a major use of the isProbablyBlock() function. Now, the blocks that are
3710 counted are real, rendered blocks.
3711 (khtml::ReplacementFragment::removeStyleNodes): Made this function retain margin-zeroing
3712 CSS properties on paragraphs. This does two things: 1) It helps us to maintain good behavior
3713 in the short term while there are still versions of Mail out there that use <p> elements
3714 instead of <div> elements for new paragraphs; and 2) It will help to maintain the compatibility
3715 with other mail clients that use <p> elements for their paragraphs but render them themselves
3716 with no margins as the result of quirks.
3717 (khtml::ReplaceSelectionCommand::doApply): Do some work to fix up and improve the handling
3718 of blank lines, be they <p> elements or <br> elements, that can be removed after pasting. This,
3719 coupled with the refactoring, fixes 4014393.
3720 * khtml/editing/htmlediting.h: Updated for new functions.
3721 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Updated results, actually improved with this change.
3722 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Ditto.
3724 2005-02-19 Kevin Decker <kdecker@apple.com>
3728 Fixed <rdar://problem/4010765> Flash player can be used to arbitrarily open popup windows without user permission
3730 Our window.open() policy is to refuse the <script>window.open(...)</script> case and allow the inline the <a href="javascript:window.open('foo')> case. Clever advertisers at some point realized that by executing their Javascript through the Flash plugin, Safari would always treat their code as the inline case, and thus, they were able to work around our popup blocker.
3732 * kwq/WebCoreBridge.h:
3733 * kwq/WebCoreBridge.mm:
3734 (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Changed this to invoke the new stringByEvaluatingJavaScriptFromString:forceUserGesture method below.
3735 (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]): Let the WebKit make the determination if this was a user originated gesture or not; we must no longer assume this is always the case.
3737 2005-02-18 Chris Blumenberg <cblu@apple.com>
3739 Fixed: <rdar://problem/3951196> REGRESSION (Mail): too many levels of reply quotes after certain steps
3741 Reviewed by kocienda.
3743 * khtml/editing/htmlediting.cpp:
3744 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
3745 - If we find a new start node, update topBlockquote so we don't use too many block quotes for the contents following the new line.
3746 - Build up the list of ancestors after we've determined the actual topBlockquote.
3747 - Don't insert an extra new line if there is a new start node.
3749 2005-02-19 Chris Blumenberg <cblu@apple.com>
3751 Fixed: <rdar://problem/3978461> smart paste is broken
3755 * khtml/editing/htmlediting.cpp:
3756 (khtml::ReplaceSelectionCommand::doApply): properly check for leading and trailing whitespace. These checks were incorrectly reversed. Also check if we're pasting at the beginning or end of a line. We should not insert spaces in either case.
3758 2005-02-18 Adele Amchan <adele@apple.com>
3762 Fix for <rdar://problem/3975568> REGRESSION(125-180)Australian Open pages have drawing problem
3764 This patch fixes two problems caused by our added support for custom tags. First, the layout problem at the sites mentioned in the bug
3765 was caused by custom tags within tables. In checkChild, we needed to treat these tags as spans so they get placed correctly in the DOM tree.
3766 Also, we were indexing the tagPriority and endTag arrays with id values from the custom tags that were greater than the size of the array. So now
3767 we have functions to check for the custom tags, and again, treat them as spans. To avoid confusion, we changed the names of the arrays to
3768 endTagArray and tagPriorityArray.
3770 * khtml/html/dtd.h: changed all uses of the endTag array to endTagArray for our new wrapper functions
3771 (DOM::tagPriority): added function to check array bounds and to treat custom tags as spans
3772 (DOM::endTagRequirement): added function to check array bounds and to treat custom tags as spans
3773 * khtml/html/dtd.cpp: changed name of endTag and tagPriority arrays to endTagArray and tagPriorityArray
3774 (DOM::checkChild): treat custom tags as spans during this check
3775 * khtml/html/html_elementimpl.cpp: changed all uses of the endTag array to the endTagRequirement function
3776 (HTMLElementImpl::createContextualFragment):
3777 (HTMLElementImpl::setInnerText):
3778 (HTMLElementImpl::setOuterText):
3779 (HTMLElementImpl::toString):
3780 * khtml/html/htmlparser.cpp: changed all uses of the endTag array to the endTagRequirement function and all uses of the tagPriority array to the tagPriority function.
3781 (KHTMLParser::parseToken):
3782 (KHTMLParser::insertNode):
3783 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): changed all uses of the endTag array to the endTagRequirement function
3784 * khtml/editing/markup.cpp: changed all uses of the endTag array to the endTagRequirement function
3788 2005-02-18 Jens Alfke <jens@apple.com>
3792 Fixed build: Whoops, setNeedsLayout's parameter is NOT optional.
3794 * khtml/html/html_objectimpl.cpp:
3795 (HTMLAppletElementImpl::setAllParamsAvailable):
3797 2005-02-18 Jens Alfke <jens@apple.com>
3799 Reviewed by cblu, hyatt.
3801 Fixes <rdar://problem/3603191> "REGRESSION: Applets not receiving all of the Applet Parameters in Java 1.4.1/1.4.2"
3802 Defer instantiation of Java applet plugin until after all of the <applet> tag's nested <param> tags have been parsed, otherwise the list of parameters passed to the applet is incomplete. The regression was introduced (says Dave) when the parser's close-tag notifications were removed in the name of performance.
3804 * khtml/html/html_objectimpl.cpp:
3805 (HTMLAppletElementImpl::HTMLAppletElementImpl):
3806 (HTMLAppletElementImpl::getAppletInstance):
3807 (HTMLAppletElementImpl::setAllParamsAvailable):
3808 (HTMLAppletElementImpl::allParamsAvailable):
3809 * khtml/html/html_objectimpl.h:
3810 * khtml/html/htmlparser.cpp:
3811 (KHTMLParser::processCloseTag):
3812 * khtml/rendering/render_applet.cpp:
3813 (RenderApplet::createWidgetIfNecessary):
3815 2005-02-18 Richard Williamson <rjw@apple.com>
3817 Fixed <rdar://problem/4006161> Tiger8A380: Widgets leak dashboard regions
3819 We were leaking the DashboardRegionImpls.
3823 * khtml/css/css_valueimpl.cpp:
3824 (DOM::CSSPrimitiveValueImpl::cleanup):
3826 2005-02-18 Chris Blumenberg <cblu@apple.com>
3828 Fixed: <rdar://problem/3945271> REGRESSION (Mail): pasted plain text should pick up typing style instead of being unstyled
3830 Reviewed by kocienda.
3832 * khtml/editing/htmlediting.cpp:
3833 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): don't set class on element returned by createStyleSpanElement since that's already done
3834 (khtml::ReplacementFragment::ReplacementFragment): take matchStyle param, don't call computeStylesAndRemoveUnrendered() if !matchStyle
3835 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take matchStyle param
3836 (khtml::ReplaceSelectionCommand::doApply): if m_matchStyle, use selection.start() as the insertion position and don't call applyStyleToInsertedNodes()
3837 * khtml/editing/htmlediting.h:
3838 * kwq/WebCoreBridge.h:
3839 * kwq/WebCoreBridge.mm:
3840 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): take matchStyle param and pass it
3841 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): pass NO for matchStyle
3842 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): pass NO for matchStyle
3843 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): pass YES for matchStyle
3845 2005-02-18 Ken Kocienda <kocienda@apple.com>
3851 <rdar://problem/4013025> Copy/Paste of quoted word results in removal of any following <cr>
3852 <rdar://problem/4013100> Copy/Paste quoted text and then decrease quote level does not change text color
3854 For the most part, these bugs were caused by errors and lack of foresight on my part when
3855 I added the better paste code. Chalk these fixes up to the result of bake time.
3857 * khtml/editing/htmlediting.cpp:
3858 (khtml::ReplacementFragment::ReplacementFragment): Need to move count of number of blocks in
3859 fragment after the call to remove unrendered nodes. Meant to do this before, but forgot to.
3860 (khtml::ReplacementFragment::removeStyleNodes): Need to remove inline styles from elements!
3861 Terrible omission now fixed.
3862 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Remove blockquote colors for now.
3863 Code has a more extensive comment in it now to explain the difficulty, and the need for more