1 2005-02-27 Maciej Stachowiak <mjs@apple.com>
5 <rdar://problem/3993557> REGRESSION (125-180-ish): getElementsByTagName no longer works with namespace designations
7 * khtml/xml/dom_nodeimpl.cpp:
8 (NodeBaseImpl::getElementsByTagNameNS): When no namespace is specified, find elements
9 of the specified name in any namespace to match Mozilla and earlier Safari behavior.
11 2005-02-25 Darin Adler <darin@apple.com>
15 - fixed <rdar://problem/4025618> Crash while searching at hollywoodvideo.com
17 * khtml/html/html_formimpl.h: Added valueWithDefault.
18 * khtml/html/html_formimpl.cpp:
19 (DOM::HTMLInputElementImpl::appendFormData): Call valueWithDefault instead of going at the render object
20 to try to get the default value; there may be no render object if this is display:none.
21 (DOM::HTMLInputElementImpl::valueWithDefault): Added. Knows about the defaults for "submit" and "reset"
22 buttons; otherwise just returns the value as-is.
24 * khtml/rendering/render_form.h: Removed the defaultLabel member functions.
25 * khtml/rendering/render_form.cpp:
26 (RenderSubmitButton::rawText): Call valueWithDefault instead of using defaultLabel function here on
27 the render side. The DOM needs to know how to deal with the default anyway for form submission.
28 (RenderSubmitButton::defaultLabel): Removed.
29 (RenderResetButton::defaultLabel): Removed.
30 (RenderPushButton::defaultLabel): Removed.
32 2005-02-25 Darin Adler <darin@apple.com>
36 - fixed <rdar://problem/4025088> window onblur and onfocus don't fire when text field has focus
38 * kwq/KWQKHTMLPart.h: Added setWindowHasFocus function and m_windowHasFocus data member.
39 * kwq/KWQKHTMLPart.mm:
40 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Took out the code that sends the focus and blur events.
41 (KWQKHTMLPart::setWindowHasFocus): Put that code here instead.
43 * kwq/WebCoreBridge.h: Added setWindowHasFocus: method to the bridge.
44 * kwq/WebCoreBridge.mm: (-[WebCoreBridge setWindowHasFocus:]): Added. Calls method on the part.
46 2005-02-25 Darin Adler <darin@apple.com>
50 - re-fixed <rdar://problem/3665430> horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode
52 * kwq/KWQTextArea.mm: (-[KWQTextArea _updateTextViewWidth]): Don't change the text view width
53 to match the text area's width in the "wrap" case.
55 2005-02-25 Ken Kocienda <kocienda@apple.com>
61 <rdar://problem/4021518> 8A394 Mail crashes during paste: khtml::RootInlineBox::closestLeafChildForXPos
63 * khtml/editing/visible_units.cpp:
64 (khtml::previousLinePosition): Adding an updateLayout call at the start of the function fixes the crash, since
65 we caught line boxes in a not-completely-updated state.
66 (khtml::nextLinePosition): Ditto.
68 2005-02-25 David Hyatt <hyatt@apple.com>
70 Fix for 4010774, make sure to avoid an O(N^2) algorithm in nextRenderer() that is triggered when large
71 DOM subtrees are inserted into documents via one insert/append call.
75 * khtml/xml/dom_nodeimpl.cpp:
76 (NodeImpl::nextRenderer):
78 2005-02-25 Richard Williamson <rjw@apple.com>
80 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
82 Second pass at fixing 3382926 w/o causing layout regressions. Same concept:
83 if directionality of text's element is RTL and first character has neutral directionality
84 then set the initial directionality to RTL.
88 * khtml/rendering/bidi.cpp:
89 (khtml::RenderBlock::bidiReorderLine):
90 (khtml::RenderBlock::determineStartPosition):
94 2005-02-25 Ken Kocienda <kocienda@apple.com>
98 Roll out Chris' change to fix this bug:
100 <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
102 That code change is responsible for all these new crashers:
104 <rdar://problem/4025177> crash copying safari.apple.com into Blot document
105 <rdar://problem/4025184> crash in DOM::NodeImpl::parentNode copying "New!" from google.com to Blot
106 <rdar://problem/4025214> crash in DOM::NodeImpl::getRect loading paste-match-style-001.html
108 Since we wish to close the tree for a build right now, I am rolling out rather than investigating.
110 * khtml/editing/htmlediting.cpp:
111 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded)
112 (khtml::ReplacementFragment::insertFragmentForTestRendering)
113 (khtml::createDefaultParagraphElement)
114 (khtml::createBlockPlaceholderElement)
115 (khtml::createFontElement)
116 (khtml::createStyleSpanElement)
117 * khtml/editing/htmlediting.h
119 2005-02-25 Ken Kocienda <kocienda@apple.com>
125 <rdar://problem/4020108> Pasting text into message makes Mail crash reproducibly
127 Note that, even with this fix, development build will crash until this bug is fixed:
128 <rdar://problem/4024996> Applying block styles can cause assertion failure in inline style removal
130 This will not crash deployment builds, so I am going to land.
132 * khtml/editing/htmlediting.cpp:
133 (khtml::ApplyStyleCommand::applyBlockStyle): Applying block styles can make the loop to reach beyondEnd
134 fail since the structure of the document can change. Cache the next node first before operating on it,
137 2005-02-25 Vicki Murley <vicki@apple.com>
139 - recommit this change, since rolling it out did NOT fix the performance regression!
141 2005-02-23 Darin Adler <darin@apple.com>
145 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
147 The key was to change things around so that we don't push text from the DOM to the widget
148 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
149 during the blur process.
151 * khtml/html/html_formimpl.cpp:
152 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
153 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
154 new value is set here.
155 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
157 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
158 to true, and also sends out the input event. It's better to have this here than in the renderer code.
159 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
160 m_dirtyvalue) and m_valueMatchesRenderer as false.
161 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
162 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
163 where the value came from.
164 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
165 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
166 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
168 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
169 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
170 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
172 * khtml/rendering/render_form.cpp:
173 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
175 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
177 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
178 (RenderTextArea::handleFocusOut): Ditto.
179 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
180 DOM if valueMatchesRenderer is true.
181 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
183 2005-02-25 Chris Blumenberg <cblu@apple.com>
185 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
189 * khtml/editing/htmlediting.cpp:
190 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
191 (khtml::ReplacementFragment::insertFragmentForTestRendering):
192 (khtml::floatRefdElement):
193 (khtml::createDefaultParagraphElement):
194 (khtml::createBlockPlaceholderElement):
195 (khtml::createFontElement):
196 (khtml::createStyleSpanElement):
197 * khtml/editing/htmlediting.h:
199 2005-02-25 Darin Adler <darin@apple.com>
201 * kwq/character-sets.txt: Checked in updated file. This new file has no effect, because none of the
202 changes affect character sets that we support, but it's good to have the latest file in here, and
203 completely safe because I checked that the generated files have not changed.
205 2005-02-25 Vicki Murley <vicki@apple.com>
209 - back out this change, since it causes a 3.5% performance regression
211 2005-02-23 Darin Adler <darin@apple.com>
215 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
217 The key was to change things around so that we don't push text from the DOM to the widget
218 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
219 during the blur process.
221 * khtml/html/html_formimpl.cpp:
222 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
223 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
224 new value is set here.
225 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
227 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
228 to true, and also sends out the input event. It's better to have this here than in the renderer code.
229 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
230 m_dirtyvalue) and m_valueMatchesRenderer as false.
231 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
232 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
233 where the value came from.
234 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
235 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
236 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
238 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
239 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
240 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
242 * khtml/rendering/render_form.cpp:
243 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
245 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
247 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
248 (RenderTextArea::handleFocusOut): Ditto.
249 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
250 DOM if valueMatchesRenderer is true.
251 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
253 2005-02-25 Darin Adler <darin@apple.com>
257 - fixed <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
259 * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply):
260 Use the insertNodeAfterAndUpdateNodesInserted and insertNodeBeforeAndUpdateNodesInserted
261 functions to add the leading and trailing spaces for smart paste.
263 2005-02-25 David Hyatt <hyatt@apple.com>
265 Back out fix for 3382926, since it breaks LTR text inside RTL contexts.
269 * khtml/rendering/bidi.cpp:
270 (khtml::BidiIterator::direction):
272 2005-02-25 David Hyatt <hyatt@apple.com>
274 Fix for 3975039, scrolling is slow in huge RSS views. Optimize the calculation of clip rects for overflow:hidden
275 layers. Also optimize layer movement when scrolling overflow sections.
279 * khtml/rendering/render_layer.cpp:
281 (ClipRects::operator delete):
283 (RenderLayer::RenderLayer):
284 (RenderLayer::~RenderLayer):
285 (RenderLayer::updateLayerPosition):
286 (RenderLayer::removeOnlyThisLayer):
287 (RenderLayer::insertOnlyThisLayer):
288 (RenderLayer::scrollToOffset):
289 (RenderLayer::hitTest):
290 (RenderLayer::calculateClipRects):
291 (RenderLayer::calculateRects):
292 (RenderLayer::containsPoint):
293 (RenderLayer::clearClipRects):
294 (RenderLayer::clearClipRect):
295 * khtml/rendering/render_layer.h:
296 (khtml::ClipRects::m_refCnt):
297 (khtml::ClipRects::overflowClipRect):
298 (khtml::ClipRects::fixedClipRect):
299 (khtml::ClipRects::posClipRect):
300 (khtml::ClipRects::ref):
301 (khtml::ClipRects::deref):
302 (khtml::RenderLayer::clipRects):
303 * khtml/rendering/render_object.cpp:
304 (RenderObject::setStyle):
306 2005-02-24 Maciej Stachowiak <mjs@apple.com>
308 Reviewed by Darin and Dave a while ago.
310 <rdar://problem/3996685> REGRESSION: Crash in KWQVectorImpl::at loading http://maps.google.com/mapfiles/homepanel.xsl
312 * kwq/WebCoreBridge.mm:
313 (formElementFromDOMElement): Check for isHTMLElement() as well as
314 id() == ID_FORM. This seems like an impossible situation, but
315 papering over it seems more expedient for the time being.
317 2005-02-24 Richard Williamson <rjw@apple.com>
319 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
321 Use mirror characters correctly when rendering with RTL directionality.
325 * khtml/rendering/bidi.cpp:
326 (khtml::BidiIterator::direction):
328 2005-02-24 Richard Williamson <rjw@apple.com>
330 Fixed <rdar://problem/3985889> REGRESSION (125-180): setting <img> src to GIF that already animated does not animate; just shows final frame
334 * WebCore.pbproj/project.pbxproj:
335 * khtml/html/html_imageimpl.cpp:
336 (HTMLImageLoader::updateFromElement):
337 * khtml/rendering/render_image.cpp:
338 (RenderImage::resetAnimation):
339 * khtml/rendering/render_image.h:
340 * khtml/rendering/render_list.cpp:
341 (RenderListMarker::setStyle):
342 (RenderListMarker::paint):
343 * khtml/rendering/render_list.h:
347 (QPixmap::resetAnimation):
348 * kwq/WebCoreImageRenderer.h:
350 2005-02-24 Chris Blumenberg <cblu@apple.com>
352 Fixed: <rdar://problem/4020110> Safari crashes in setAllData while taking a www.zoomerang.com survey
356 * kwq/KWQResourceLoader.mm:
357 (-[KWQResourceLoader finishJobAndHandle:]): clear the job after we've deleted to avoid reentrancy
359 2005-02-24 Darin Adler <darin@apple.com>
363 - fixed <rdar://problem/4023360> REGRESSION (186-187): image file upload is broken at pep.apple.com
365 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::appendFormData): Return true after
366 setting up the form data for an uploaded file. The old code would fall through to the ISINDEX
367 case and send double form data (the filename instead of the file contents the second time).
369 2005-02-24 David Harrison <harrison@apple.com>
373 <rdar://problem/3990849> AX: textMarkerRange for an AXUIElement within an AXWebArea
375 * kwq/KWQAccObject.mm:
376 (-[KWQAccObject textMarkerRange]):
377 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
378 (-[KWQAccObject doAXTextMarkerRangeForUIElement:]):
379 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
380 Added AXTextMarkerRangeForUIElement, or you can send textMarkerRange to the UIElement itself.
382 2005-02-24 David Harrison <harrison@apple.com>
386 <rdar://problem/4004279> 3 AXSelectedTextChanged notifications are firing each time I type a character
388 * khtml/xml/dom_docimpl.cpp:
389 (DocumentImpl::updateSelection):
390 Send notification only if the selection is not null. This safely ignores transitory selections set during editing.
392 2005-02-24 Darin Adler <darin@apple.com>
396 - fixed <rdar://problem/3987619> in some cases, text doesn't resize with Format->Style->Bigger/Smaller
398 * khtml/editing/htmlediting.cpp:
399 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): Only call nodeFullySelected for non-text nodes.
400 Text nodes are already split so they're either in the range and full selected or out of the range.
401 And nodeFullySelected doesn't work for text nodes.
402 (khtml::ApplyStyleCommand::nodeFullySelected): Add an assertion, since this function only works for elements,
404 (khtml::ApplyStyleCommand::nodeFullyUnselected): Ditto.
406 - make big improvement in <rdar://problem/3953636> Mail hung for ~10sec changing font of 84328 characters: khtml::ApplyStyleCommand::nodeFullySelected
408 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints): Improve algorithm based on suggestion
411 - fixed <rdar://problem/4020305> REGRESSION (185-186): loading image in new window using document.write fails
413 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::open): If there is no parent document, don't blow away the base URL.
415 - fixed <rdar://problem/4021701> REGRESSION (188-188+): form not submitted after pressing <return> at http://hrweb.apple.com
417 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchMouseEvent): Send activate event in the case where the event
418 sent is a KHTML_CLICK_EVENT, not CLICK_EVENT.
420 2005-02-23 Kevin Decker <kdecker@apple.com>
424 Fixed <rdar://problem/4020747> REGRESSION: stray </applet> tags crash Safari
426 * khtml/html/htmlparser.cpp:
427 (KHTMLParser::processCloseTag): Made a typesafe check that prevents crashes
428 whenever there is a closing applet tag without an actual <applet> in the first place.
429 Now verifies the current token is ID_APPLET before casting it to an HTMLAppletElementImpl.
432 2005-02-23 Ken Kocienda <kocienda@apple.com>
438 <rdar://problem/3977962> font loses bold style after pasting next to existing text and pressing return
440 * khtml/editing/htmlediting.cpp:
441 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Problem here was
442 that we were doing work in cases where we should not, and content whose style would have
443 been correct if we had done nothing was getting clobbered. It turns out that extra work
444 to apply style to the new paragraph added in this command only needs to be done if we're
445 at the boundaries of a paragraph. Otherwise, content that is moved as part of the work
446 of the command will lend their styles to the new paragraph without any extra work needed.
447 So, make this position check and return unless at a paragraph boundary.
451 * layout-tests/editing/style/block-styles-007-expected.txt
452 * layout-tests/editing/style/block-styles-007.html
454 2005-02-23 Ken Kocienda <kocienda@apple.com>
460 <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a selection starting from end of line once
462 Problem is with the way we figure out whether to add or remove a style based on
463 the current selection. In this case, the code is looking at the end of the
464 previous line, which is not bold, and deduces incorrectly that the operation is
465 a "make bold". Then the style code runs to make bold, but there is nothing on
466 the end of the previous line to embolden, so we get into a cycle where the same
467 thing happens each time cmd-b is hit.
469 * khtml/khtml_part.cpp:
470 (KHTMLPart::selectionComputedStyle): Call editingStartPosition() to get the right position for the font determination.
471 * khtml/xml/dom2_rangeimpl.cpp:
472 (DOM::RangeImpl::editingStartPosition): New helper function that "does the right thing" based on whether the
473 selection is a caret or a range, moving upstream for the former, and downstream for the latter.
474 * khtml/xml/dom2_rangeimpl.h:
475 * kwq/KWQKHTMLPart.mm:
476 (KWQKHTMLPart::fontForSelection): Call editingStartPosition() to get the right position for the font determination.
480 * layout-tests/editing/style/style-boundary-001-expected.txt
481 * layout-tests/editing/style/style-boundary-001.html
482 * layout-tests/editing/style/style-boundary-002-expected.txt
483 * layout-tests/editing/style/style-boundary-002.html
484 * layout-tests/editing/style/style-boundary-003-expected.txt
485 * layout-tests/editing/style/style-boundary-003.html
486 * layout-tests/editing/style/style-boundary-004-expected.txt
487 * layout-tests/editing/style/style-boundary-004.html
489 2005-02-23 Richard Williamson <rjw@apple.com>
491 Fixed <rdar://problem/3985579> 8A367: Dashboard: Stock widget not visible when click remove to remove single char ticker symbol
493 Explicitly remove scroll bar views when removing them from
496 Don't paint synchronously when the scroll position changes,
497 this caused funky clip problems.
501 * khtml/rendering/render_layer.cpp:
502 (RenderLayer::scrollToOffset):
503 (RenderLayer::setHasHorizontalScrollbar):
504 (RenderLayer::setHasVerticalScrollbar):
505 (RenderLayer::updateScrollInfoAfterLayout):
507 2005-02-23 Ken Kocienda <kocienda@apple.com>
513 <rdar://problem/3959996> REGRESSION (Mail): cursor moves to beginning of document when click is past end
515 * khtml/rendering/render_block.cpp:
516 (khtml::RenderBlock::positionForCoordinates): Skip blocks that are invisible or have no height when
517 looking for a child to pass off to. And save away the last visible block with a height to pass off
518 to if there is no child at the right y-coordinate.
520 2005-02-23 David Harrison <harrison@apple.com>
524 <rdar://problem/4010059> BoundsForTextMarkerRange does not update with scrolled web area
526 * kwq/KWQAccObject.mm:
527 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
528 Adjust for scrolling.
530 2005-02-22 Maciej Stachowiak <mjs@apple.com>
534 <rdar://problem/3949790> hitting return after pasted styled line results in extra content getting the style
536 * khtml/editing/htmlediting.cpp:
537 (khtml::InsertParagraphSeparatorCommand::doApply): In the case
538 where the start block is the root, insert the newly created DIV at
539 the end of the root block instead of after the last sibling in the
540 start node, since the start node could be inside other
541 style-affecting nodes and we don't want to reparent its cousins
544 2005-02-23 David Harrison <harrison@apple.com>
548 <rdar://problem/4014691> switch to correctly spelled NSAccessibilityForegroundColorTextAttribute constant
550 Also removed two older, now unneeded, wrappers.
552 * kwq/KWQAccObject.mm:
553 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
554 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
555 Removed these older, now unneeded, wrappers.
557 (NSAccessibilityForegroundColorTextAttributeWrapper):
558 New wrapper for NSAccessibilityForegroundColorTextAttribute.
560 (AXAttributeStringSetStyle):
561 Use NSAccessibilityForegroundColorTextAttributeWrapper.
563 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
564 Remove uses of visiblePositionForStartOfTextMarkerRange and visiblePositionForEndOfTextMarkerRange.
566 2005-02-23 David Harrison <harrison@apple.com>
570 <rdar://problem/3524784> AX hit test doesn't return info when done in empty space of content area
572 * kwq/KWQAccObject.mm:
573 (-[KWQAccObject accessibilityHitTest:]):
574 Return unignored object.
576 2005-02-23 Darin Adler <darin@apple.com>
580 - fixed <rdar://problem/4006509> REGRESSION (171-172): Setting CSS -khtml-user-modify property triggers crash
582 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyProperty):
583 Removed the code that changes the style of the element. This was never needed, and caused the
584 style to be modified while we were iterating it.
586 2005-02-23 Ken Kocienda <kocienda@apple.com>
592 <rdar://problem/3980209> Mail crashed when I pressed Cmd-Shift-[ (nil-deref in ApplyStyleCommand::addBlockStyleIfNeeded)
594 * khtml/editing/htmlediting.cpp:
595 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Reordered the new block
596 insertion so that it come before the move. The logic stays exactly the same, however, with the old
597 ordering, the new block could want to become a child of itself come insertion time. I considered
598 making a more complicated code change to fix this problem, but the simple reordering works just
599 as well, and seems less risky.
601 These all changed in an insignificant way. It seems that with the new code, some empty text nodes
602 got reordered in the document. This has no effect on anything visible to the user.
604 * layout-tests/editing/style/create-block-for-style-003-expected.txt
605 * layout-tests/editing/style/create-block-for-style-004-expected.txt
606 * layout-tests/editing/style/create-block-for-style-009-expected.txt
607 * layout-tests/editing/style/create-block-for-style-011-expected.txt
608 * layout-tests/editing/style/create-block-for-style-013-expected.txt
610 2005-02-23 Darin Adler <darin@apple.com>
614 - fixed <rdar://problem/4013986> REGRESSION (173-174): onclick event not sent when mouse click on checkbox is double-click
616 We need to send an onclick event *and* an ondblclick event when we process a double click.
618 * khtml/khtmlview.cpp: (KHTMLView::dispatchMouseEvent): In the case where we're sending a CLICK_EVENT,
619 follow it by a KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT when handling a double click, and a DOMACTIVATE_EVENT.
620 We no longer do the DOMACTIVATE_EVENT in dispatchGenericEvent.
621 * khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked): send only CLICK_EVENT here, and
622 lets dispatchMouseEvent deal with the other subsequent events.
623 * khtml/xml/dom_nodeimpl.cpp:
624 (NodeImpl::dispatchGenericEvent): Remove the code that sends a DOMACTIVATE_EVENT, since there's no longer
625 a good way to figure out if this is the last event that should be sent before it is.
626 (NodeImpl::dispatchMouseEvent): Set the meta key modifier here (as it already is set elsewhere), and
627 follow up a CLICK_EVENT with KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT, and DOMACTIVATE_EVENT as above.
629 2005-02-23 Darin Adler <darin@apple.com>
633 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
635 The key was to change things around so that we don't push text from the DOM to the widget
636 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
637 during the blur process.
639 * khtml/html/html_formimpl.cpp:
640 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
641 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
642 new value is set here.
643 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
645 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
646 to true, and also sends out the input event. It's better to have this here than in the renderer code.
647 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
648 m_dirtyvalue) and m_valueMatchesRenderer as false.
649 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
650 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
651 where the value came from.
652 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
653 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
654 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
656 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
657 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
658 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
660 * khtml/rendering/render_form.cpp:
661 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
663 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
665 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
666 (RenderTextArea::handleFocusOut): Ditto.
667 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
668 DOM if valueMatchesRenderer is true.
669 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
671 2005-02-22 Richard Williamson <rjw@apple.com>
673 Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions
675 Just set dashboard dirty bit when overflow scrolling changes.
677 Don't do comparison of regions in before scroll regions are
678 added, instead do it in WebKit after automatic scroll regions
683 * khtml/css/cssparser.cpp:
684 (CSSParser::parseDashboardRegions): Cleaned up comments
685 * khtml/css/cssstyleselector.cpp:
686 (khtml::CSSStyleSelector::styleForElement): Cleaned up comments
688 * khtml/khtmlview.cpp:
689 (KHTMLView::updateDashboardRegions):
690 * khtml/rendering/render_layer.cpp:
691 (RenderLayer::updateScrollInfoAfterLayout):
692 * kwq/WebDashboardRegion.m:
693 (-[WebDashboardRegion isEqual:]):
695 2005-02-22 Chris Blumenberg <cblu@apple.com>
697 Fixed: <rdar://problem/3976872> Pasted plain text doesn't get the proper style if pasted into newlines
701 * khtml/editing/htmlediting.cpp:
702 (khtml::ReplaceSelectionCommand::doApply): don't clear the typing style when matching style
703 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply the typing style when matching style
704 * khtml/editing/jsediting.cpp:
705 * khtml/khtml_part.cpp:
706 (KHTMLPart::pasteAndMatchStyle): new
707 * khtml/khtml_part.h:
708 * kwq/KWQKHTMLPart.h:
709 * kwq/KWQKHTMLPart.mm:
710 (KWQKHTMLPart::issuePasteAndMatchStyleCommand): new
711 * kwq/WebCoreBridge.h:
712 * layout-tests/editing/editing.js:
714 2005-02-22 Darin Adler <darin@apple.com>
718 - fixed <rdar://problem/4006596> REGRESSION (183-184): crash in DOM::DocumentImpl::setFocusNode(DOM::NodeImpl*)
720 * khtml/xml/dom_docimpl.cpp:
721 (widgetForNode): Added helper.
722 (DocumentImpl::setFocusNode): Re-get the widget for the node after calling updateLayout.
723 The updateLayout can destroy the old widget, so we can't keep a stale widget pointer around.
725 2005-02-22 Ken Kocienda <kocienda@apple.com>
731 <rdar://problem/4003463> Mail.app HTML uses inline styling markup not understood by Entourage and Eudora
733 * khtml/editing/htmlediting.cpp:
734 (khtml::isEmptyFontTag): Helper for removing <font> tags.
735 (khtml::StyleChange::styleModeForParseMode): Helper to map a document parse mode to a use/don't use
736 legacy-html-styles value.
737 (khtml::StyleChange::checkForLegacyHTMLStyleChange): Add support for colors, font faces, and font sizes.
738 (khtml::ApplyStyleCommand::isHTMLStyleNode):
739 (khtml::ApplyStyleCommand::removeHTMLFontStyle):
740 (khtml::ApplyStyleCommand::applyTextDecorationStyle): Now call styleModeForParseMode to determine
741 whether to use legacy html styles or not.
742 (khtml::ApplyStyleCommand::removeInlineStyle): Now properly removes <font> styles.
743 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
744 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
745 (khtml::createFontElement): Helper for applying <font> elements.
746 * khtml/editing/htmlediting.h: All the following support the new bits of data we need to store.
747 (khtml::StyleChange::applyFontColor)
748 (khtml::StyleChange::applyFontFace)
749 (khtml::StyleChange::applyFontSize)
750 (khtml::StyleChange::fontColor)
751 (khtml::StyleChange::fontFace)
752 (khtml::StyleChange::fontSize)
754 Test results updated now that we will write out <font> tags for quirks mode documents.
756 * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt
757 * layout-tests/editing/style/block-style-004-expected.txt
758 * layout-tests/editing/editing/pasteboard/paste-text-011-expected.txt
759 * layout-tests/editing/style/block-style-005-expected.txt
760 * layout-tests/editing/style/block-style-006-expected.txt
761 * layout-tests/editing/style/smoosh-styles-001-expected.txt
762 * layout-tests/editing/style/smoosh-styles-002-expected.txt
764 2005-02-22 Maciej Stachowiak <mjs@apple.com>
768 <rdar://problem/4017066> crash in KJS::ValueImp::dispatchType() every time I load www.nytimes.com/pages/automobiles
770 When creating option elements, use lowercase "option" instead of
771 uppercase "OPTION" to create option elements, because only
772 lowercase works for XHTML.
774 * khtml/ecma/kjs_html.cpp:
775 (KJS::HTMLSelectCollection::tryPut):
776 (OptionConstructorImp::construct):
778 2005-02-22 Chris Blumenberg <cblu@apple.com>
780 WebCore fix for: <rdar://problem/3918056> Mail not line breaking my <pre> formatted emails on replies
782 Mail must 4018993 to fully address the problem.
784 Reviewed by kocienda.
786 * khtml/editing/markup.cpp:
787 (khtml::startMarkup): don't compute style for text in PRE tags
788 (khtml::createMarkup): include PRE if it is an ancestor of the nodes in the range
790 2005-02-21 Richard Williamson <rjw@apple.com>
792 Fixed <rdar://problem/4008338> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
794 There was a long standing bug in cssText(). Double value were always cast int! So,
795 opacity values values were incorrectly converted to text, i.e. 0.75 became 0.
797 The problem was newly triggered because we parse the css for opacity *TWICE*. This is a result of
798 incorrectly "invalidating" the style attribute (from fix for 3790449). The second parse was from
799 the cssText() of the style.
803 * khtml/css/css_valueimpl.cpp:
804 (DOM::CSSPrimitiveValueImpl::cssText):
806 2005-02-21 David Hyatt <hyatt@apple.com>
808 Fix for 4017204, apply the same fix to the base class nodeAtPoint that was already applied to RenderBlock.
809 Skip elements with layers and inline flows. Demoted <form>s can end up causing trouble otherwise.
811 Reviewed by Richard Williamson
813 * khtml/rendering/render_box.cpp:
814 (RenderBox::nodeAtPoint):
816 2005-02-21 David Hyatt <hyatt@apple.com>
818 Fix for 4017033, CSS is being parsed twice. Make sure to always validate the style attribute when it is
819 initially parsed. Add code to clean up decls when the style attribute is completely removed. Add a new
820 synchronizing boolean that avoids reparsing the style declaration when the attribute is simply
821 being synced up to the declaration.
825 * khtml/css/css_valueimpl.cpp:
826 (DOM::CSSMutableStyleDeclarationImpl::setChanged):
827 * khtml/html/html_elementimpl.cpp:
828 (HTMLElementImpl::invalidateStyleAttribute):
829 (HTMLElementImpl::updateStyleAttributeIfNeeded):
830 (HTMLElementImpl::HTMLElementImpl):
831 (HTMLElementImpl::~HTMLElementImpl):
832 (HTMLElementImpl::destroyInlineStyleDecl):
833 (HTMLElementImpl::mapToEntry):
834 (HTMLElementImpl::parseHTMLAttribute):
835 * khtml/html/html_elementimpl.h:
836 * khtml/xml/dom_elementimpl.cpp:
837 (ElementImpl::ElementImpl):
838 (ElementImpl::setAttribute):
839 * khtml/xml/dom_elementimpl.h:
840 (DOM::ElementImpl::updateStyleAttributeIfNeeded):
844 2005-02-21 Darin Adler <darin@apple.com>
846 - fixed Panther deployment build
848 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Put more stuff inside #if.
850 2005-02-21 David Harrison <harrison@apple.com>
854 <rdar://problem/3943090> REGRESSION (Mail): Spelling underline incompletely erased following certain steps
856 * khtml/rendering/render_text.cpp:
857 (InlineTextBox::paintMarker):
858 Make sure underline is placed within the text bounds.
862 (QPainter::misspellingLineThickness):
863 * kwq/WebCoreTextRenderer.h:
864 Add misspellingLineThickness for use by InlineTextBox::paintMarker.
866 2005-02-21 Darin Adler <darin@apple.com>
870 - fixed <rdar://problem/4012978> -[DOMRange markupString] crashes when range contains only a text node with a single space
872 * khtml/editing/markup.cpp: (khtml::createMarkup): Added updateLayout calls, and added a missing
875 2005-02-21 Darin Adler <darin@apple.com>
879 - fixed <rdar://problem/4005435> Safari hung while pasting text into a <textarea> (Panther-only)
881 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Don't setAutohidesScrollers:YES on Panther.
883 2005-02-21 Ken Kocienda <kocienda@apple.com>
889 <rdar://problem/4015499> REGRESSION (186-187): pasted quoted text starting with a blank line increases quote level of pasted text when pasted
891 * khtml/editing/markup.cpp:
892 (khtml::markup): Changed over to ASSERT instead of assert.
893 (khtml::createMarkup): The issue was that the code to add parents all the way back to the common ancestor
894 block did not check for blocks whose markup had already been added, and could result in adding markup for
895 nodes twice (hence the additional and erroneous quote level). Now there is a new check that will
896 only add markup for those nodes before the start of the selection range. This fixes the bug.
897 (khtml::createFragmentFromMarkup): Changed over to ASSERT instead of assert.
898 (khtml::createFragmentFromText): Ditto.
900 2005-02-21 Ken Kocienda <kocienda@apple.com>
906 <rdar://problem/4015494> REGRESSION (186-187) <cr> removed if quoted word is copy/pasted on line immediately above quoted text
908 * khtml/editing/htmlediting.cpp:
909 (khtml::ReplaceSelectionCommand::doApply): Relatively new check designed to remove a <br> element when
910 that element was on a line by itself did not do an adequate check for this condition, causing the
911 failure described in the bug. Fixed.
913 2005-02-19 Ken Kocienda <kocienda@apple.com>
917 * khtml/editing/htmlediting.cpp:
918 (khtml::matchNearestBlockquoteColorString): New function which abstracts away the CSS property we use
919 for this pseudo-color.
920 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Set the new nearestBlockquoteColorString
921 psuedo-color here, rather than removing colors as was done before.
922 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): Check for the pseudo-color in the desired
923 style, and determine the real color based on the nearest blockquote (or none) to the node.
924 (khtml::nearestMailBlockquote): Name change from closestMailBlockquote to match new property better.
926 All the rest of this change is the mechanical coding you need to do to add a new CSS property, in this
927 case, -khtml-match-nearest-mail-blockquote-color.
929 * khtml/css/css_computedstyle.cpp:
930 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue)
931 * khtml/css/cssparser.cpp:
932 (CSSParser::parseValue):
933 * khtml/css/cssproperties.c:
936 * khtml/css/cssproperties.h:
937 * khtml/css/cssproperties.in:
938 * khtml/css/cssstyleselector.cpp:
939 (khtml::CSSStyleSelector::applyProperty)
940 * khtml/css/cssvalues.c:
942 * khtml/css/cssvalues.h:
943 * khtml/css/cssvalues.in:
944 * khtml/rendering/render_style.h:
945 (khtml::RenderStyle::matchNearestMailBlockquoteColor)
946 (khtml::RenderStyle::setMatchNearestMailBlockquoteColor)
947 (khtml::RenderStyle::initialMatchNearestMailBlockquoteColor)
949 2005-02-19 Ken Kocienda <kocienda@apple.com>
955 <rdar://problem/4014228> REGRESSION (186-187) extra, uneditable lines inserted above and below a line of pasted quoted text
956 <rdar://problem/4014393> REGRESSION (186-187) pasted quoted text gets extra <cr>s when pasted at top of document
958 * khtml/editing/htmlediting.cpp:
959 (khtml::ReplacementFragment::ReplacementFragment): Part of a general refactoring of how
960 the fragment is inserted into the document, rendered, and then tested for certain
961 important pieces of information that are required for pasting.
962 (khtml::ReplacementFragment::insertFragmentForTestRendering): New helper. Handles inserting
963 the fragment nodes into the document.
964 (khtml::ReplacementFragment::restoreTestRenderingNodesToFragment): Removes nodes from the
965 document, and restores them to the fragment.
966 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Factored out code that
967 did this before into its own function.
968 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
969 (khtml::ReplacementFragment::countRenderedBlocks): This is a real improvement, as it
970 eliminates a major use of the isProbablyBlock() function. Now, the blocks that are
971 counted are real, rendered blocks.
972 (khtml::ReplacementFragment::removeStyleNodes): Made this function retain margin-zeroing
973 CSS properties on paragraphs. This does two things: 1) It helps us to maintain good behavior
974 in the short term while there are still versions of Mail out there that use <p> elements
975 instead of <div> elements for new paragraphs; and 2) It will help to maintain the compatibility
976 with other mail clients that use <p> elements for their paragraphs but render them themselves
977 with no margins as the result of quirks.
978 (khtml::ReplaceSelectionCommand::doApply): Do some work to fix up and improve the handling
979 of blank lines, be they <p> elements or <br> elements, that can be removed after pasting. This,
980 coupled with the refactoring, fixes 4014393.
981 * khtml/editing/htmlediting.h: Updated for new functions.
982 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Updated results, actually improved with this change.
983 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Ditto.
985 2005-02-19 Kevin Decker <kdecker@apple.com>
989 Fixed <rdar://problem/4010765> Flash player can be used to arbitrarily open popup windows without user permission
991 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.
993 * kwq/WebCoreBridge.h:
994 * kwq/WebCoreBridge.mm:
995 (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Changed this to invoke the new stringByEvaluatingJavaScriptFromString:forceUserGesture method below.
996 (-[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.
998 2005-02-18 Chris Blumenberg <cblu@apple.com>
1000 Fixed: <rdar://problem/3951196> REGRESSION (Mail): too many levels of reply quotes after certain steps
1002 Reviewed by kocienda.
1004 * khtml/editing/htmlediting.cpp:
1005 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1006 - 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.
1007 - Build up the list of ancestors after we've determined the actual topBlockquote.
1008 - Don't insert an extra new line if there is a new start node.
1010 2005-02-19 Chris Blumenberg <cblu@apple.com>
1012 Fixed: <rdar://problem/3978461> smart paste is broken
1016 * khtml/editing/htmlediting.cpp:
1017 (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.
1019 2005-02-18 Adele Amchan <adele@apple.com>
1023 Fix for <rdar://problem/3975568> REGRESSION(125-180)Australian Open pages have drawing problem
1025 This patch fixes two problems caused by our added support for custom tags. First, the layout problem at the sites mentioned in the bug
1026 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.
1027 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
1028 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
1029 endTagArray and tagPriorityArray.
1031 * khtml/html/dtd.h: changed all uses of the endTag array to endTagArray for our new wrapper functions
1032 (DOM::tagPriority): added function to check array bounds and to treat custom tags as spans
1033 (DOM::endTagRequirement): added function to check array bounds and to treat custom tags as spans
1034 * khtml/html/dtd.cpp: changed name of endTag and tagPriority arrays to endTagArray and tagPriorityArray
1035 (DOM::checkChild): treat custom tags as spans during this check
1036 * khtml/html/html_elementimpl.cpp: changed all uses of the endTag array to the endTagRequirement function
1037 (HTMLElementImpl::createContextualFragment):
1038 (HTMLElementImpl::setInnerText):
1039 (HTMLElementImpl::setOuterText):
1040 (HTMLElementImpl::toString):
1041 * 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.
1042 (KHTMLParser::parseToken):
1043 (KHTMLParser::insertNode):
1044 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): changed all uses of the endTag array to the endTagRequirement function
1045 * khtml/editing/markup.cpp: changed all uses of the endTag array to the endTagRequirement function
1049 2005-02-18 Jens Alfke <jens@apple.com>
1053 Fixed build: Whoops, setNeedsLayout's parameter is NOT optional.
1055 * khtml/html/html_objectimpl.cpp:
1056 (HTMLAppletElementImpl::setAllParamsAvailable):
1058 2005-02-18 Jens Alfke <jens@apple.com>
1060 Reviewed by cblu, hyatt.
1062 Fixes <rdar://problem/3603191> "REGRESSION: Applets not receiving all of the Applet Parameters in Java 1.4.1/1.4.2"
1063 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.
1065 * khtml/html/html_objectimpl.cpp:
1066 (HTMLAppletElementImpl::HTMLAppletElementImpl):
1067 (HTMLAppletElementImpl::getAppletInstance):
1068 (HTMLAppletElementImpl::setAllParamsAvailable):
1069 (HTMLAppletElementImpl::allParamsAvailable):
1070 * khtml/html/html_objectimpl.h:
1071 * khtml/html/htmlparser.cpp:
1072 (KHTMLParser::processCloseTag):
1073 * khtml/rendering/render_applet.cpp:
1074 (RenderApplet::createWidgetIfNecessary):
1076 2005-02-18 Richard Williamson <rjw@apple.com>
1078 Fixed <rdar://problem/4006161> Tiger8A380: Widgets leak dashboard regions
1080 We were leaking the DashboardRegionImpls.
1084 * khtml/css/css_valueimpl.cpp:
1085 (DOM::CSSPrimitiveValueImpl::cleanup):
1087 2005-02-18 Chris Blumenberg <cblu@apple.com>
1089 Fixed: <rdar://problem/3945271> REGRESSION (Mail): pasted plain text should pick up typing style instead of being unstyled
1091 Reviewed by kocienda.
1093 * khtml/editing/htmlediting.cpp:
1094 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): don't set class on element returned by createStyleSpanElement since that's already done
1095 (khtml::ReplacementFragment::ReplacementFragment): take matchStyle param, don't call computeStylesAndRemoveUnrendered() if !matchStyle
1096 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take matchStyle param
1097 (khtml::ReplaceSelectionCommand::doApply): if m_matchStyle, use selection.start() as the insertion position and don't call applyStyleToInsertedNodes()
1098 * khtml/editing/htmlediting.h:
1099 * kwq/WebCoreBridge.h:
1100 * kwq/WebCoreBridge.mm:
1101 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): take matchStyle param and pass it
1102 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): pass NO for matchStyle
1103 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): pass NO for matchStyle
1104 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): pass YES for matchStyle
1106 2005-02-18 Ken Kocienda <kocienda@apple.com>
1112 <rdar://problem/4013025> Copy/Paste of quoted word results in removal of any following <cr>
1113 <rdar://problem/4013100> Copy/Paste quoted text and then decrease quote level does not change text color
1115 For the most part, these bugs were caused by errors and lack of foresight on my part when
1116 I added the better paste code. Chalk these fixes up to the result of bake time.
1118 * khtml/editing/htmlediting.cpp:
1119 (khtml::ReplacementFragment::ReplacementFragment): Need to move count of number of blocks in
1120 fragment after the call to remove unrendered nodes. Meant to do this before, but forgot to.
1121 (khtml::ReplacementFragment::removeStyleNodes): Need to remove inline styles from elements!
1122 Terrible omission now fixed.
1123 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Remove blockquote colors for now.
1124 Code has a more extensive comment in it now to explain the difficulty, and the need for more
1126 (khtml::ReplaceSelectionCommand::doApply): Need to call applyStyleToInsertedNodes() in the
1127 m_fragment.hasInterchangeNewline() case. This was just missed before.
1128 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Updated results, subtly different, but OK.
1129 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Updated for <p> to <div> change in test content.
1130 * layout-tests/editing/pasteboard/paste-text-017.html: Needed to change <p> to <div> to
1131 make this test go with the new design of using <div> tags for default paragraphs.
1133 2005-02-18 David Hyatt <hyatt@apple.com>
1135 Fix for 3974263 (and possibly others). Don't let fixed tables use maxint as their maxwidth when some
1136 cells have percentage values.
1138 Reviewed by kocienda
1140 * khtml/misc/arena.cpp:
1142 * khtml/rendering/table_layout.cpp:
1143 (FixedTableLayout::calcWidthArray):
1144 (FixedTableLayout::calcMinMaxWidth):
1145 (AutoTableLayout::layout):
1147 2005-02-17 Darin Adler <darin@apple.com>
1151 - fixed <rdar://problem/3998627> WebKit crashes when deleting text in a modified div
1153 * khtml/khtml_part.cpp: (KHTMLPart::selectionComputedStyle): Add a ref and deref to keep
1154 the element alive until it's added to the DOM tree.
1155 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::styleForSelectionStart): Ditto.
1157 2005-02-17 Richard Williamson <rjw@apple.com>
1159 Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead
1161 Fixed w/o introducing a performance regression. Add early
1162 check for Osaka-Mono to avoid expensive call into WebKit.
1167 (QFont::isFixedPitch):
1169 2005-02-17 Darin Adler <darin@apple.com>
1173 - fixed <rdar://problem/4011210> REGRESSION (180-181): Maxlength property for INPUT object not working
1175 * kwq/KWQTextField.mm:
1176 (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): If controller returns
1177 YES, go on to call super, since super does the text formatter handling, which we need.
1178 (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
1179 (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
1183 2005-02-17 Ken Kocienda <kocienda@apple.com>
1189 <rdar://problem/4012058> Copy from quoted text and paste results in blue text
1191 The relatively-new paste code tries hard to retain style of the content from the
1192 source location. However, in the case of quoted material in mail messages, we do
1193 not want to carry the quoting color along. This fixes the problem by factoring
1196 * khtml/editing/htmlediting.cpp:
1197 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Now calls removeBlockquoteColorsIfNeeded()
1199 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): New function. Factors out colors that are
1200 the result of text being quoted.
1201 (khtml::isNodeRendered): Function moved in file. No other change.
1202 (khtml::isProbablyBlock): Function moved in file. No other change.
1203 (khtml::closestMailBlockquote): New function. Helps fix bug.
1204 (khtml::isMailBlockquote): Function moved to be free-floating instead of being a
1205 member of CompositeEditCommand. No other change.
1206 * khtml/editing/htmlediting.h: Moved around some functions. Added removeBlockquoteColorsIfNeeded().
1207 * khtml/editing/markup.cpp: Remove redundant static implementation of isMailBlockquote.
1209 2005-02-17 Richard Williamson <rjw@apple.com>
1211 Fixed <rdar://problem/4008163> dynamic support for -apple-dashboard-region is flakey
1213 Style operator== wasn't including regions.
1217 * khtml/rendering/render_style.cpp:
1218 (StyleCSS3NonInheritedData::operator==):
1220 2005-02-17 Adele Amchan <adele@apple.com>
1224 fix for <rdar://problem/4010028> 8A383: Safari v185 crash loading united.com multi city fare finder page.
1226 * khtml/dom/dom_string.cpp: (DOM::DOMString::operator += ): prevent nil dereference when DOMString being added is nil
1228 2005-02-17 Jens Alfke <jens@apple.com>
1232 Fix for rdar://3963151 "Mail only pasted ~950 of 1407 text lines into my message!"
1233 Force tokenizer to run synchronously while parsing document fragments, so it doesn't stop halfway through and cause truncated content.
1235 * khtml/html/html_elementimpl.cpp:
1236 (HTMLElementImpl::createContextualFragment):
1237 * khtml/html/htmltokenizer.cpp:
1238 (khtml::HTMLTokenizer::reset):
1239 (khtml::HTMLTokenizer::begin):
1240 (khtml::HTMLTokenizer::setForceSynchronous):
1241 (khtml::HTMLTokenizer::continueProcessing):
1242 * khtml/html/htmltokenizer.h:
1244 2005-02-17 Ken Kocienda <kocienda@apple.com>
1250 <rdar://problem/3982183> Mail's HTML paragraphs appear with unintended margins in Entourage and Eudora
1252 * khtml/editing/htmlediting.cpp:
1253 (khtml::createDefaultParagraphElement): Change element we make from <p> to <div>.
1254 This fixes the problem, as these other mailers show <div> elements without margins.
1256 Some test files needed to change to preserve the ability to "eyeball" the results.
1257 Many others changed just because their <p> elements changed to <div> elements.
1259 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt
1260 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt
1261 * layout-tests/editing/inserting/insert-div-013-expected.txt
1262 * layout-tests/editing/inserting/insert-div-013.html
1263 * layout-tests/editing/inserting/insert-div-014-expected.txt
1264 * layout-tests/editing/inserting/insert-div-014.html
1265 * layout-tests/editing/inserting/insert-div-018-expected.txt
1266 * layout-tests/editing/inserting/insert-div-018.html
1267 * layout-tests/editing/inserting/insert-div-019-expected.txt
1268 * layout-tests/editing/inserting/insert-div-019.html
1269 * layout-tests/editing/inserting/insert-div-020-expected.txt
1270 * layout-tests/editing/inserting/insert-div-020.html
1271 * layout-tests/editing/inserting/insert-div-021-expected.txt
1272 * layout-tests/editing/inserting/insert-div-021.html
1273 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
1274 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
1275 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt
1276 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt
1278 2005-02-17 Ken Kocienda <kocienda@apple.com>
1284 <rdar://problem/3996737> REGRESSION (Mail): Copy/paste in Mail inserts returns
1286 The root cause of the problem is that a couple of pieces of code in AppKit and Mail
1287 insert newlines into markup as it is generated, and the paste code in WebCore was
1288 not smart about nodes that do not render (as is the case with these added newlines).
1289 So, the solution is to remove these unrendered nodes in the paste code in a pre-pass.
1290 Fortunately, my recent addition of such a pass to the paste code to handle styles
1291 gave me a convenient place to put this new logic.
1293 * khtml/editing/htmlediting.cpp:
1294 (khtml::ReplacementFragment::ReplacementFragment): Use new name for function below.
1295 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Name change from computeStylesForNodes().
1296 Now does the additional work of removing unrendered nodes, as mentioned above.
1297 (khtml::isNodeRendered): New helper function.
1298 * khtml/editing/htmlediting.h: Updated as necessary.
1300 2005-02-17 Ken Kocienda <kocienda@apple.com>
1306 <rdar://problem/3998892> REGRESSION (Mail): bolding a selection from end of line changes unselected text on starting line.
1308 The styling code did not move to the next node when the starting position was
1309 at the last offset of a node. Instead, it styled it. Clearly wrong. Solution
1310 is to borrow a check from the delete algorithm. Though I call caretMaxOffset(),
1311 which I consider deprecated, it is still the simplest and most strightforward
1312 way to ask the right question for this kind of problem.
1314 * khtml/editing/htmlediting.cpp:
1315 (khtml::ApplyStyleCommand::applyInlineStyle): Fixed, as described above.
1316 * layout-tests/editing/style/style-3998892-fix-expected.txt: Added.
1317 * layout-tests/editing/style/style-3998892-fix.html: Added.
1319 2005-02-16 Chris Blumenberg <cblu@apple.com>
1321 Fixed: <rdar://problem/3954842> Forward/reply to an HTML email can result in nothing (in cases with <link> tags for CSS)
1325 * khtml/xml/dom_nodeimpl.cpp:
1326 (NodeBaseImpl::addChild): don't call insertedIntoDocument on the added child if "this" itself is not in the document.
1328 2005-02-16 John Sullivan <sullivan@apple.com>
1330 Written by Darin, reviewed by Maciej and me
1332 - change required to make previous checkin work with English language RSS pages
1335 new private method isHierarchical
1338 add hierarchical base URL check when determining whether the URL is absolute
1339 (KURL::isHierarchical):
1340 new method, returns true if this is a valid URL with a slash just past the scheme's trailing colon
1342 2005-02-16 John Sullivan <sullivan@apple.com>
1344 Written by Darin, reviewed by me.
1346 - WebCore part of fix for <rdar://problem/4007384>
1347 FILTER: Bookmark of RSS with Japanese search word & multiple RSS pages loses filter
1350 (-[DOMElement _getURLAttribute:]):
1351 new SPI method, uses parseURL and completeURL to get valid URL from attribute value
1354 declare new SPI method
1356 2005-02-15 Maciej Stachowiak <mjs@apple.com>
1360 <rdar://problem/3942428> reproducible crash loading cbs.sportsline.com
1362 This change reverts the fix for <rdar://problem/3805311>, and
1363 re-fixes it in a different (better) way. Instead of preventing
1364 programmatic open from setting the parsing flag, instead make sure
1365 that programmatic close resets it.
1367 * khtml/khtml_part.cpp:
1368 (KHTMLPart::openURL):
1369 (KHTMLPart::didExplicitOpen):
1370 (KHTMLPart::closeURL):
1373 (KHTMLPart::endIfNotLoading):
1374 (KHTMLPart::slotFinishedParsing):
1375 (KHTMLPart::checkEmitLoadEvent):
1376 * khtml/khtml_part.h:
1377 * khtml/khtmlpart_p.h:
1378 (KHTMLPartPrivate::KHTMLPartPrivate):
1379 * khtml/xml/dom_docimpl.cpp:
1380 (DocumentImpl::open):
1381 (DocumentImpl::implicitOpen):
1382 (DocumentImpl::close):
1383 (DocumentImpl::implicitClose):
1384 * khtml/xml/dom_docimpl.h:
1386 2005-02-15 David Harrison <harrison@apple.com>
1390 <rdar://problem/3933665> smart delete seems to delete too much after expanding selection with arrow keys
1392 Fixed by updating the selection granularity. Only byWord granularity enables smart delete, but in this
1393 case the granularity changed from byWord to byCharacter.
1395 * khtml/khtml_part.cpp:
1396 (KHTMLPart::setSelectionGranularity):
1397 * khtml/khtml_part.h:
1398 * kwq/WebCoreBridge.mm:
1399 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
1400 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
1401 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
1403 2005-02-15 David Harrison <harrison@apple.com>
1407 (continued) <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
1409 This was supposed have been committed yesterday with the other part of the fix, but was not.
1411 * khtml/editing/visible_units.cpp:
1414 2005-02-15 Ken Kocienda <kocienda@apple.com>
1420 <rdar://problem/3951178> REGRESSION (Mail): blank line lost after pasting as quotation
1422 Problem was that the blank line after the selection was getting deleted incorrectly since the
1423 paste code thought this was an unneeded placeholder rather than a placeholder outside of the
1426 * khtml/editing/htmlediting.cpp:
1427 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now calls findBlockPlaceholder.
1428 (khtml::CompositeEditCommand::findBlockPlaceholder): Moved finding code formerly in
1429 removeBlockPlaceholderIfNeeded to this new helper.
1430 (khtml::ReplaceSelectionCommand::doApply): Do not delete placeholder up front. Call
1431 findBlockPlaceholder, and delete it later if needed in the already-existing cleanup step.
1432 * khtml/editing/htmlediting.h: Add new function.
1436 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Added.
1437 * layout-tests/editing/pasteboard/paste-text-017.html: Added.
1439 Result changed for the better.
1441 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
1443 2005-02-14 David Harrison <harrison@apple.com>
1447 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
1451 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
1453 * khtml/editing/visible_text.cpp:
1454 (khtml::SimplifiedBackwardsTextIterator::advance):
1455 Add BR in for <rdar://problem/3917929> fix only if leaving a visible text node.
1457 * khtml/editing/visible_units.cpp:
1459 Do not move left over a paragraph boundary.
1461 2005-02-14 Darin Adler <darin@apple.com>
1465 - fixed <rdar://problem/3686434> Safari uses too much RAM on file upload, leading to malloc errors and crashes (HP printers)
1467 * khtml/html/html_formimpl.cpp:
1468 (DOM::FormDataList::begin): Updated to use a list of FormDataListItem instead of QCString.
1469 (DOM::FormDataList::end): Ditto.
1470 (DOM::HTMLFormElementImpl::formData): Same here, and also use appendFile rather than appendData
1471 when we encounter a path name rather than data.
1472 (DOM::HTMLInputElementImpl::appendFormData): Use appendFile here rather than reading the file
1473 in; the reading now happens inside WebKit.
1474 (DOM::FormDataList::appendString): Updated for FormDataListItem.
1475 (DOM::FormDataList::appendFile): Added.
1477 * ForwardingHeaders/kfileitem.h: Emptied out the file; no longer includes KWQKFileItem.h.
1478 * ForwardingHeaders/netaccess.h: Emptied out the file; no longer includes KWQKIONetAccess.h.
1479 * kwq/KWQKFileItem.h: Removed.
1480 * kwq/KWQKFileItem.mm: Removed.
1481 * kwq/KWQKIONetAccess.h: Removed.
1482 * kwq/KWQKIONetAccess.mm: Removed.
1483 * WebCore.pbproj/project.pbxproj: Removed the 4 files above.
1485 - small unrelated fix (not reviewed by John)
1487 * khtml/ecma/kjs_window.cpp: (Window::isSafeScript): Put some logging code outside if statements so it works all the time.
1489 2005-02-14 David Harrison <harrison@apple.com>
1493 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
1495 Fixed nextLinePosition to calculate affinity rather than take it as a parameter. Propagated the parameter change out to related methods.
1497 * khtml/editing/htmlediting.cpp:
1498 (khtml::DeleteSelectionCommand::initializePositionData):
1499 (khtml::InsertLineBreakCommand::doApply):
1500 (khtml::InsertParagraphSeparatorCommand::doApply):
1501 (khtml::InsertTextCommand::input):
1502 (khtml::ReplaceSelectionCommand::doApply):
1503 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes):
1504 * khtml/editing/selection.cpp:
1505 (khtml::Selection::modifyExtendingRightForward):
1506 (khtml::Selection::modifyMovingRightForward):
1507 (khtml::Selection::modifyExtendingLeftBackward):
1508 (khtml::Selection::modifyMovingLeftBackward):
1509 (khtml::Selection::modify):
1510 (khtml::Selection::validate):
1511 * khtml/editing/visible_position.cpp:
1512 (khtml::visiblePositionsOnDifferentLines):
1513 * khtml/editing/visible_units.cpp:
1514 (khtml::rootBoxForLine):
1515 (khtml::startOfLine):
1517 (khtml::inSameLine):
1518 (khtml::isStartOfLine):
1519 (khtml::isEndOfLine):
1520 (khtml::previousLinePosition):
1521 (khtml::nextLinePosition):
1522 (khtml::previousSentencePosition):
1523 (khtml::nextSentencePosition):
1524 (khtml::previousParagraphPosition):
1525 (khtml::nextParagraphPosition):
1526 * khtml/editing/visible_units.h:
1527 * khtml/khtml_events.cpp:
1528 (khtml::MouseEvent::offset):
1529 * khtml/khtml_part.cpp:
1530 (KHTMLPart::isPointInsideSelection):
1531 (KHTMLPart::selectClosestWordFromMouseEvent):
1532 (KHTMLPart::handleMousePressEventTripleClick):
1533 (KHTMLPart::handleMousePressEventSingleClick):
1534 (KHTMLPart::handleMouseMoveEventSelection):
1535 (KHTMLPart::khtmlMouseReleaseEvent):
1536 * khtml/rendering/render_block.cpp:
1537 (khtml::RenderBlock::positionForCoordinates):
1538 * khtml/rendering/render_block.h:
1539 * khtml/rendering/render_br.cpp:
1540 (RenderBR::positionForCoordinates):
1541 * khtml/rendering/render_br.h:
1542 * khtml/rendering/render_container.cpp:
1543 (RenderContainer::positionForCoordinates):
1544 * khtml/rendering/render_container.h:
1545 * khtml/rendering/render_inline.cpp:
1546 (RenderInline::positionForCoordinates):
1547 * khtml/rendering/render_inline.h:
1548 * khtml/rendering/render_object.cpp:
1549 (RenderObject::caretRect):
1550 (RenderObject::positionForCoordinates):
1551 * khtml/rendering/render_object.h:
1552 * khtml/rendering/render_replaced.cpp:
1553 (RenderReplaced::positionForCoordinates):
1554 * khtml/rendering/render_replaced.h:
1555 * khtml/rendering/render_text.cpp:
1556 (RenderText::positionForCoordinates):
1557 * khtml/rendering/render_text.h:
1558 * khtml/xml/dom_position.cpp:
1559 (DOM::Position::previousCharacterPosition):
1560 (DOM::Position::nextCharacterPosition):
1561 (DOM::Position::leadingWhitespacePosition):
1562 (DOM::Position::trailingWhitespacePosition):
1563 * khtml/xml/dom_position.h:
1564 * kwq/KWQAccObject.mm:
1565 (-[KWQAccObject value]):
1566 (-[KWQAccObject accessibilityAttributeValue:]):
1567 (-[KWQAccObject doAXLineForTextMarker:]):
1568 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
1569 (-[KWQAccObject doAXTextMarkerForPosition:]):
1570 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
1571 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
1572 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
1573 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
1574 * kwq/KWQKHTMLPart.mm:
1575 * kwq/WebCoreBridge.mm:
1576 (-[WebCoreBridge _visiblePositionForPoint:]):
1578 05-02-07 Maciej Stachowiak <mjs@apple.com>
1580 Reviewed by Ken and John.
1582 Re-fixed a specific case of the following:
1584 <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
1586 Oddly, Cmd-B, Cmd-U, type some text, return, Cmd-U, Cmd-B, type
1587 some text, worked fine. But hitting the second Cmd-B before the
1588 second Cmd-U still failed to remove underlining. The reason for
1589 this is that our code to compute the style of the current position
1590 did not work when you had a typing style and were positioned right
1591 at a <br> element. For various reasons, this did not show up for
1592 bold and italic, since those are handled through the font manager.
1594 The following change fixes this - for elements that can't have
1595 children, we add the dummy span after the element of interest,
1596 rather than as a child of it.
1598 * khtml/khtml_part.cpp:
1599 (KHTMLPart::selectionComputedStyle):
1601 2005-02-11 David Harrison <harrison@apple.com>
1605 <rdar://problem/3978980> Double Clicking on a line in Mail selected the entire body
1607 * khtml/editing/visible_units.cpp:
1608 (khtml::startOfWord):
1610 Pay attention to being at the end of a paragraph.
1612 (khtml::previousLinePosition):
1613 (khtml::nextLinePosition):
1614 (khtml::endOfParagraph):
1615 Use DOWNSTREAM per recent affinity changes.
1617 2005-02-11 Richard Williamson <rjw@apple.com>
1619 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
1621 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
1622 creates these wrappers. The WebCore subclass of the interpreter now overrides
1623 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
1625 * WebCore.pbproj/project.pbxproj:
1626 * khtml/ecma/kjs_binding.cpp:
1627 (ScriptInterpreter::createLanguageInstanceForValue):
1628 * khtml/ecma/kjs_binding.h:
1629 * kwq/DOMUtility.mm: Added.
1630 (KJS::ScriptInterpreter::createObjcInstanceForValue):
1631 * kwq/KWQKHTMLPart.mm:
1632 (KWQKHTMLPart::getAppletInstanceForView):
1633 (getInstanceForView):
1634 (KWQKHTMLPart::getEmbedInstanceForView):
1635 (KWQKHTMLPart::getObjectInstanceForView):
1637 2005-02-11 Chris Blumenberg <cblu@apple.com>
1639 Fixed: <rdar://problem/3937352> Quote level not maintained when copied and pasted within a Mail message
1641 Reviewed by harrison.
1643 * khtml/editing/markup.cpp:
1644 (khtml::isMailBlockquote): new
1645 (khtml::createMarkup): retain the Mail quote level by including all ancestor mail block quotes
1646 * khtml/rendering/render_block.cpp:
1647 (khtml::RenderBlock::positionForCoordinates): default to downstream for the affinity since the affinity is only upstream when the cursor is clicked to the right of a wrapped line
1648 * khtml/rendering/render_text.cpp:
1649 (RenderText::positionForCoordinates): ditto
1651 2005-02-11 Adele Amchan <adele@apple.com>
1655 fix for <rdar://problem/4004004> no need to add body element for xml documents
1657 In the fix for <rdar://problem/3758785> we decided to add a body element when closing a document
1658 to ensure that the onload handler would fire. This is unnecessary for xml documents,
1659 so now we also check to see if we're dealing with an html document before adding the body element.
1661 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
1663 2005-02-11 Adele Amchan <adele@apple.com>
1667 * layout-tests/apple-only/base/www.excite.com/index-expected.txt: updates tests because of custom tag change.
1668 * layout-tests/apple-only/base/www.msnbc.com/index-expected.txt:
1669 * layout-tests/apple-only/base/www.time.com/index-expected.txt:
1670 * layout-tests/apple-only/base/www.travelocity.com/index-expected.txt:
1671 * layout-tests/apple-only/base/www.zdnet.com/index-expected.txt:
1672 * layout-tests/fast/overflow/003-expected.txt:
1674 * layout-tests/fast/js/window-object-cross-frame-calls-expected.txt: updated test because of added Body (see rdar://problem/3758785)
1678 2005-02-11 Darin Adler <darin@apple.com>
1682 - fixed <rdar://problem/3915449> paths are relative to the old src URL after document.open, which is supposed to clear the document, including the URL
1684 * khtml/xml/dom_docimpl.h: Added a new openInternal function for use by KHTMLPart.
1685 * khtml/xml/dom_docimpl.cpp:
1686 (DocumentImpl::open): Changed to do everything we did before, but also clear the URL and set the
1687 base URL based on the enclosing document. This is the basic JavaScript/DOM operation of opening a
1688 document, which is supposed to clear the document, including the URL. In the long run we might want
1689 to do even more document "resetting and clearing" in here, but this URL clearing is what's needed
1690 now to fix the most important problem.
1691 (DocumentImpl::openInternal): Moved the old open code in here, except for the "parsing" check, which
1692 is unnecessary and inappropriate in the one place we call this.
1694 * khtml/khtml_part.cpp: (KHTMLPart::begin): Call openInternal instead of open.
1696 2005-02-10 Ken Kocienda <kocienda@apple.com>
1702 <rdar://problem/3992092> 8A374: Mail crash while pasting - RemoveNodeCommand
1704 * khtml/editing/htmlediting.cpp:
1705 (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in
1706 the document. We try to do a good job of detecting all these cases, and generally do. This
1707 one was missed. Fixed.
1709 2005-02-10 Darin Adler <darin@apple.com>
1711 Reviewed by Harrison.
1713 - added support needed to fix <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined
1715 * kwq/WebCoreBridge.h: Added selectionHasStyle: method.
1716 * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part.
1718 2005-02-10 Darin Adler <darin@apple.com>
1720 Reviewed by Harrison.
1722 - fixed <rdar://problem/3990484> cursor changes to I-beam when moving over text in widgets, even when selection off via CSS
1724 * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent): Changed code to check canSelect when deciding
1725 whether to show an I-beam cursor.
1727 * khtml/rendering/render_object.h: Added canSelect.
1728 * khtml/rendering/render_object.cpp:
1729 (selectStartNode): Added. Helper function with the guts of shouldSelect.
1730 (RenderObject::canSelect): Added. Like shouldSelect, but does not call the "start selecting" event handler.
1731 (RenderObject::shouldSelect): Refactored to use selectStartNode.
1733 * khtml/css/cssvalues.c: Regnerated with newer gperf.
1735 2005-02-10 David Hyatt <hyatt@apple.com>
1737 Fix for 3867759, .mac regression where scrollers don't show up. Make sure you can set the .width and
1738 .height properties on the Image object.
1740 Reviewed by John Sullivan
1742 * khtml/ecma/kjs_html.cpp:
1743 (ImageConstructorImp::construct):
1744 (Image::getValueProperty):
1747 * khtml/ecma/kjs_html.h:
1749 2005-02-10 Ken Kocienda <kocienda@apple.com>
1755 <rdar://problem/3965158> Drag-n-drop within a rich text message sometimes changes the color of the dragged text
1757 This change fixes the bug....and much more. Now, for the first time, the paste code can do "smart merging"
1758 or "smooshing" of styles during its operation. Since this new code is actively, rather than passively
1759 working with styles, it fixes the bug, and lays the groundwork for similar work we need to do to
1760 preserve quote levels in Mail.
1762 * khtml/css/css_valueimpl.cpp:
1763 (DOM::CSSMutableStyleDeclarationImpl::clear): New method.
1764 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
1765 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): Ditto.
1766 (DOM::operator==): Add operator for CSSProperty.
1767 * khtml/css/css_valueimpl.h: Declare new functions.
1768 * khtml/editing/htmlediting.cpp:
1769 (khtml::isEmptyStyleSpan): Improved the test in this function, rolling together the old implementation
1770 with some code that did this work inline elsewhere. Sum of the parts is better than either test was by itself.
1771 (khtml::isStyleSpan): Check for ID_SPAN.
1772 (khtml::ApplyStyleCommand::removeCSSStyle): Call isEmptyStyleSpan. This was the place with an inline implementation before.
1773 (khtml::ReplacementFragment::ReplacementFragment): Now takes a DocumentImpl argument. No longer does a "default style"
1774 check, but rather calls functions which do a similar check to that, and much more.
1775 (khtml::ReplacementFragment::~ReplacementFragment): Deref document, and computed styles.
1776 (khtml::ReplacementFragment::styleForNode): New helper. Looks up and returns computed style for a node.
1777 (khtml::ReplacementFragment::removeNodePreservingChildren): New helper.
1778 (khtml::ReplacementFragment::computeStylesForNodes): New function which computes the "desired" style for
1779 every node in the fragment. This information is used later after paste is done as a reference for testing
1780 what styles need to be added, and which can be removed as redundant, from all the nodes inserted by the
1782 (khtml::ReplacementFragment::removeStyleNodes): Clears out all style nodes from the fragment. They are
1783 no longer needed after the call to computeStylesForNodes(),
1784 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): Add a document to the call to initialize the
1785 command's ReplacementFragment.
1786 (khtml::ReplaceSelectionCommand::doApply): Call applyStyleToInsertedNodes() after inserting nodes to make
1787 styles come out right.
1788 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): This is the "style smooshing" function. It
1789 computes the styles that need to be added to each node inserted, comparing the style it gets from just
1790 being inserted into its correct destination with the computed "desired style" done in the
1791 ReplacementFragment constructor. It then adds in all the necessary styles, and will also remove redundant styles.
1792 * khtml/editing/htmlediting.h: Update declarations and member variables as needed.
1793 * khtml/editing/markup.cpp:
1794 (khtml::startMarkup): Add additional style annotations to the markup we generate, so that paste code can preserve it.
1795 (khtml::markup): Ditto.
1796 (khtml::createMarkup): Ditto.
1798 These test results are subtly better with this change. They no longer have an unneeded empty span.
1799 Visually the same as before.
1801 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
1802 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
1803 * layout-tests/editing/style/remove-underline-expected.txt
1804 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt
1808 * layout-tests/editing/style/smoosh-styles-001-expected.txt
1809 * layout-tests/editing/style/smoosh-styles-002-expected.txt
1810 * layout-tests/editing/style/smoosh-styles-001.html
1811 * layout-tests/editing/style/smoosh-styles-002.html
1813 2005-02-10 Darin Adler <darin@apple.com>
1817 - fixed <rdar://problem/3974988> WebHTMLView drops scroll wheel events when deltas are 0
1819 * kwq/WebCoreScrollView.m: (-[WebCoreScrollView autoforwardsScrollWheelEvents]): Added, for Tiger only.
1820 For Tiger, removed the override of scrollWheel:, which doesn't work quite right because of how the
1821 delta attributes return all 0 for newfangled scrolling events from the new trackpads.
1823 2005-02-10 David Harrison <harrison@apple.com>
1827 <rdar://problem/3991532> REGRESSION (Mail): Triple-click on trailing blank line should select previous line but doesn't
1829 * khtml/css/cssvalues.c:
1832 * khtml/editing/selection.cpp:
1833 (khtml::Selection::validate):
1834 Do moral equiavalent of LeftWordIfOnBoundary for PARAGRAPH.
1836 2005-02-10 David Harrison <harrison@apple.com>
1840 <rdar://problem/3991848> Double-click on first character selects wrong item
1842 * khtml/editing/selection.cpp:
1843 (khtml::Selection::validate):
1844 Honor the fact that clicking on a character positions the cursor on the left side of the character.
1846 2005-02-10 David Hyatt <hyatt@apple.com>
1848 Fix for 3980778, repro crash in RootInlineBox::paint. Make sure that when merging blocks we dirty them for layout
1849 up front. That way as we do the merge, we dont attempt to examine the lines in dirtyLinesForChangedChild.
1853 * khtml/rendering/render_block.cpp:
1854 (khtml::RenderBlock::removeChild):
1856 2005-02-10 David Hyatt <hyatt@apple.com>
1858 Fix for 3987010, fix a bug that caused the self-collapsing-block-cleared-float bit to never get set correctly.
1862 * khtml/rendering/render_block.h:
1863 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
1865 2005-02-10 David Hyatt <hyatt@apple.com>
1867 Fix for 3992440, text not wrapping correctly on half moon bay web site. Refine an incorrect optimization I
1868 added to be less restrictive.
1872 * khtml/rendering/render_block.cpp:
1873 (khtml::RenderBlock::layoutBlockChildren):
1875 2005-02-08 Maciej Stachowiak <mjs@apple.com>
1879 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
1881 I fixed this by removing all event listeners for a document, it's
1882 children, and any disconnected nodes that used to be in the
1883 document at document detach time. Mozilla temporarily disables
1884 event listeners on such nodes, but re-enables them if you
1885 re-parant a node into a new document. However, in WebCore, you
1886 can't re-parent a node into another document, so there is no
1887 observable change in behavior.
1889 We have to do this to break the possible reference cycles between
1890 event listeners and the dom nodes they are attached to (e.g. via
1891 scope chain, as in this case).
1893 * khtml/xml/dom_docimpl.cpp:
1894 (DocumentImpl::detach):
1895 (DocumentImpl::removeAllEventListenersFromAllNodesx):
1896 (DocumentImpl::registerDisconnectedNodeWithEventListeners):
1897 (DocumentImpl::unregisterDisconnectedNodeWithEventListeners):
1898 (DocumentImpl::removeAllDisconnectedNodeEventListeners):
1899 * khtml/xml/dom_docimpl.h:
1900 * khtml/xml/dom_nodeimpl.cpp:
1901 (NodeImpl::~NodeImpl):
1902 (NodeImpl::addEventListener):
1903 (NodeImpl::removeEventListener):
1904 (NodeImpl::removeAllEventListeners):
1905 (NodeImpl::removeHTMLEventListener):
1906 (NodeImpl::insertedIntoDocument):
1907 (NodeImpl::removedFromDocument):
1908 * khtml/xml/dom_nodeimpl.h:
1910 2005-02-09 Chris Blumenberg <cblu@apple.com>
1912 Fixed: <rdar://problem/3999213> Sometimes 2 Windows Media Player plugin instances are loaded
1916 * khtml/html/html_objectimpl.cpp:
1917 (HTMLObjectElementImpl::attach): Set needWidgetUpdate to false before calling updateWidget because updateWidget may cause this method or another method (which also calls updateWidget) to be called.
1918 (HTMLObjectElementImpl::recalcStyle): ditto
1920 2005-02-09 David Harrison <harrison@apple.com>
1924 <rdar://problem/3937447> Mail-689: Arrow key navigation in new message body stops working when a line ends with a bold word
1926 Added affinity to VisiblePosition. Changed Selection code to use affinity more.
1928 (Partial) <rdar://problem/3982096> editing/pasteboard/paste-text-007 is failing
1930 Changed ReplaceSelectionCommand to also pay attention to the top children of the incoming fragment, not just the very last node inserted, when deciding whether to insert a paragraph for the Apple interchange newline.
1932 * khtml/ecma/kjs_window.cpp:
1933 (SelectionFunc::tryCall):
1934 * khtml/editing/htmlediting.cpp:
1935 (khtml::EditCommandPtr::setStartingSelection):
1936 (khtml::EditCommandPtr::setEndingSelection):
1937 (khtml::EditCommand::setStartingSelection):
1938 (khtml::EditCommand::setEndingSelection):
1939 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream):
1940 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
1941 (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
1942 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
1943 (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
1944 (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
1945 (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
1946 (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
1947 (khtml::ApplyStyleCommand::joinChildTextNodes):
1948 (khtml::DeleteSelectionCommand::initializePositionData):
1949 (khtml::DeleteSelectionCommand::handleGeneralDelete):
1950 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
1951 (khtml::DeleteSelectionCommand::doApply):
1952 (khtml::InsertLineBreakCommand::doApply):
1953 (khtml::InsertParagraphSeparatorCommand::doApply):
1954 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1955 (khtml::InsertTextCommand::input):
1956 (khtml::MoveSelectionCommand::doApply):
1957 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
1958 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
1959 (khtml::ReplaceSelectionCommand::doApply):
1960 (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
1961 (khtml::ReplaceSelectionCommand::updateNodesInserted):
1962 (khtml::TypingCommand::deleteKeyPressed):
1963 (khtml::TypingCommand::forwardDeleteKeyPressed):
1964 (khtml::TypingCommand::markMisspellingsAfterTyping):
1965 * khtml/editing/htmlediting.h:
1966 * khtml/editing/selection.cpp:
1967 (khtml::Selection::Selection):
1968 (khtml::Selection::init):
1969 (khtml::Selection::moveTo):
1970 (khtml::Selection::modifyExtendingRightForward):
1971 (khtml::Selection::modifyMovingRightForward):
1972 (khtml::Selection::modifyExtendingLeftBackward):
1973 (khtml::Selection::modifyMovingLeftBackward):
1974 (khtml::Selection::modify):
1975 (khtml::Selection::xPosForVerticalArrowNavigation):
1976 (khtml::Selection::clear):
1977 (khtml::Selection::setBase):
1978 (khtml::Selection::setExtent):
1979 (khtml::Selection::setBaseAndExtent):
1980 (khtml::Selection::layout):
1981 (khtml::Selection::validate):
1982 * khtml/editing/selection.h:
1983 (khtml::Selection::startAffinity):
1984 (khtml::Selection::endAffinity):
1985 (khtml::Selection::baseAffinity):
1986 (khtml::Selection::extentAffinity):
1987 (khtml::operator==):
1988 * khtml/editing/text_affinity.h:
1990 * khtml/editing/visible_position.cpp:
1991 (khtml::VisiblePosition::VisiblePosition):
1992 (khtml::VisiblePosition::init):
1993 (khtml::VisiblePosition::initUpstream):
1994 (khtml::VisiblePosition::initDownstream):
1995 (khtml::VisiblePosition::next):
1996 (khtml::VisiblePosition::previous):
1997 (khtml::startVisiblePosition):
1998 (khtml::endVisiblePosition):
1999 * khtml/editing/visible_position.h:
2000 (khtml::VisiblePosition::):
2001 (khtml::VisiblePosition::VisiblePosition):
2002 (khtml::VisiblePosition::affinity):
2003 (khtml::VisiblePosition::setAffinity):
2004 (khtml::operator==):
2005 * khtml/editing/visible_units.cpp:
2006 (khtml::previousBoundary):
2007 (khtml::nextBoundary):
2008 (khtml::startOfLine):
2010 (khtml::previousLinePosition):
2011 (khtml::nextLinePosition):
2012 (khtml::startOfParagraph):
2013 (khtml::endOfParagraph):
2014 (khtml::previousParagraphPosition):
2015 (khtml::nextParagraphPosition):
2016 (khtml::startOfBlock):
2017 (khtml::endOfBlock):
2018 (khtml::startOfDocument):
2019 (khtml::endOfDocument):
2020 * khtml/editing/visible_units.h:
2021 * khtml/khtml_part.cpp:
2022 (KHTMLPart::findTextNext):
2023 (KHTMLPart::selectClosestWordFromMouseEvent):
2024 (KHTMLPart::handleMousePressEventTripleClick):
2025 (KHTMLPart::handleMousePressEventSingleClick):
2026 (KHTMLPart::handleMouseMoveEventSelection):
2027 (KHTMLPart::khtmlMouseReleaseEvent):
2028 (KHTMLPart::selectAll):
2029 (KHTMLPart::computeAndSetTypingStyle):
2030 (KHTMLPart::selectionComputedStyle):
2031 * khtml/rendering/render_br.cpp:
2032 (RenderBR::positionForCoordinates):
2033 * khtml/xml/dom_docimpl.cpp:
2034 (DocumentImpl::updateSelection):
2035 * khtml/xml/dom_nodeimpl.cpp:
2036 (NodeBaseImpl::setFocus):
2037 * khtml/xml/dom_position.cpp:
2038 (DOM::Position::previousCharacterPosition):
2039 (DOM::Position::nextCharacterPosition):
2040 * khtml/xml/dom_position.h:
2041 * kwq/KWQAccObject.mm:
2042 (-[KWQAccObject value]):
2043 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
2044 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
2045 (-[KWQAccObject accessibilityAttributeValue:]):
2046 (-[KWQAccObject doAXLineForTextMarker:]):
2047 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
2048 (-[KWQAccObject doAXTextMarkerForPosition:]):
2049 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
2050 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2051 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
2052 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
2053 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2054 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
2055 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
2056 * kwq/KWQAccObjectCache.mm:
2057 (KWQAccObjectCache::textMarkerForVisiblePosition):
2058 (KWQAccObjectCache::visiblePositionForTextMarker):
2059 * kwq/KWQKHTMLPart.mm:
2060 (KWQKHTMLPart::findString):
2061 (KWQKHTMLPart::advanceToNextMisspelling):
2062 (KWQKHTMLPart::styleForSelectionStart):
2063 (KWQKHTMLPart::baseWritingDirectionForSelectionStart):
2064 (KWQKHTMLPart::setSelectionFromNone):
2065 (KWQKHTMLPart::respondToChangedSelection):
2066 * kwq/WebCoreBridge.mm:
2067 (-[WebCoreBridge setSelectedDOMRange:affinity:]):
2068 (-[WebCoreBridge selectionAffinity]):
2069 (-[WebCoreBridge setMarkDOMRange:]):
2070 (-[WebCoreBridge _visiblePositionForPoint:]):
2071 (-[WebCoreBridge moveDragCaretToPoint:]):
2072 (-[WebCoreBridge editableDOMRangeForPoint:]):
2073 (-[WebCoreBridge ensureSelectionVisible]):
2074 (-[WebCoreBridge rangeOfCharactersAroundCaret]):
2076 2005-02-09 Chris Blumenberg <cblu@apple.com>
2078 Fixed: <rdar://problem/3985211> Seed: Mail: Drag-and-drop destination indicator / insertion point disappears
2080 Reviewed by kocienda.
2082 * khtml/rendering/render_block.cpp:
2083 (khtml::RenderBlock::paintCaret): new
2084 (khtml::RenderBlock::paintObject): call paintCaret for the cursor caret and the drag caret
2085 * khtml/rendering/render_block.h:
2089 2005-02-08 Ken Kocienda <kocienda@apple.com>
2095 <rdar://problem/3996344> Entire document content is deleted when only the first paragraph was supposed to be
2097 Problem stems from my attempt to fix this bug: <rdar://problem/3986155> Insertion point goes
2098 to beginning of doc after deleting.
2100 I added an "optimization" that proved to do more harm than good. So, basically, the fix is to remove code.
2102 * khtml/editing/htmlediting.cpp:
2103 (khtml::DeleteSelectionCommand::handleGeneralDelete)
2105 2005-02-07 Darin Adler <darin@apple.com>
2109 - fixed <rdar://problem/3890352> REGRESSION (125-170, Panther-only): pasted textarea contents disappear (exception in NSText)
2111 * kwq/KWQTextArea.mm: (-[KWQTextArea tile]): Don't resize the text view immediately here.
2112 Use performWithDelay to defer it to avoid the re-entrancy that bothers the Panther version
2113 of NSTextView. On Tiger, leave the code alone.
2115 2005-02-07 Adele Amchan <adele@apple.com>
2119 Fix for <rdar://problem/3993628> REGRESSION (180-181): Logitelnet bank's website doesn't work
2121 This fixes an oversight in the fix for <rdar://problem/3964286>.
2122 We're now making sure there is a document before calling checkCompleted in slotLoaderRequestDone.
2123 That function is called even when other parts finish loads of their subresources, so we could end
2124 up calling checkCompleted before we had a document. We also looked over all the other calls to
2125 checkCompleted to convince ourselves no other call sites had a similar issue.
2127 * khtml/khtml_part.cpp: (KHTMLPart::slotLoaderRequestDone): Check if doc is nil before calling
2130 2005-02-07 Ken Kocienda <kocienda@apple.com>
2136 <rdar://problem/3953302> Replacing quoted text ends up with blue-colored text that is not quoted
2138 * khtml/editing/htmlediting.cpp:
2139 (khtml::DeleteSelectionCommand::doApply): Removed special case delete code for select all. It was
2140 causing as many bugs as it fixed. What's more, the design concept is a bit shaky. By removing
2141 this special case, the bug goes away.
2142 * khtml/editing/htmlediting.h: Remove declaration.
2144 Test results using selectAll() updated to reflect changed behavior.
2146 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
2147 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
2148 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
2149 * layout-tests/editing/inserting/insert-3654864-fix-expected.txt:
2150 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
2151 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt:
2152 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt:
2153 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
2155 2005-02-06 Darin Adler <darin@apple.com>
2159 - fixed <rdar://problem/3994164> setting a new style attribute with setAttribute("style") doesn't blow away the old style
2161 * khtml/css/css_valueimpl.h: Renamed parseProperty to parseDeclaration, since it's used to parse
2162 an entire style declaration, not a single property.
2163 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::parseDeclaration): Renamed,
2164 and added code to clear m_values.
2165 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Call function by its
2166 new name, and remove some unnecessary comments.
2168 2005-02-06 Darin Adler <darin@apple.com>
2172 - fixed <rdar://problem/3993722> need oncut and onpaste handlers implemented for <textarea> (needed for widgets)
2174 * kwq/KWQTextArea.mm:
2175 (-[KWQTextAreaTextView dispatchHTMLEvent:]): Added.
2176 (-[KWQTextAreaTextView cut:]): Dispatch "before cut" and "cut" events.
2177 (-[KWQTextAreaTextView copy:]): Dispatch "before copy" and "copy" events.
2178 (-[KWQTextAreaTextView paste:]): Dispatch "before paste" and "paste" events.
2179 (-[KWQTextAreaTextView pasteAsPlainText:]): Ditto.
2180 (-[KWQTextAreaTextView pasteAsRichText:]): Ditto.
2182 2005-02-06 Darin Adler <darin@apple.com>
2186 - fixed <rdar://problem/3943038> <input type=search> that is focused in onload handler doesn't have a visible editor
2188 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setFocusNode): Always update layout before giving focus to a widget.
2189 This prevents the bad case where we give a widget focus before it has been positioned or sized, causing us to
2190 exercise edge cases AppKit doesn't handle well.
2192 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Remove workaround code I added
2193 to fix bug 3943049. Updating the layout fixes the same problem in a cleaner, safer way, and solves another problem,
2194 with the way the clip view is set up.
2196 2005-02-06 Darin Adler <darin@apple.com>
2200 - fixed <rdar://problem/3425232> textarea won't trigger onchange action when clicking to new field
2202 * khtml/rendering/render_form.h: Added new m_dirty data member.
2203 * khtml/rendering/render_form.cpp:
2204 (RenderTextArea::RenderTextArea): Initialize m_dirty to false.
2205 (RenderTextArea::detach): Call value() on the DOM element to cause it to fetch the value from this object.
2206 (RenderTextArea::handleFocusOut): Ditto. Also send the onchange event based only on the m_dirty flag.
2207 (RenderTextArea::updateFromElement): Clear the m_dirty flag if the edited value is blown away by a value
2208 that comes from the DOM element. Remove code to clear the element's m_dirtyvalue flag; that's an unnecessary
2209 optimization, and ideally we'll stop having code in the render object that knows about that flag later.
2210 (RenderTextArea::slotTextChanged): Set the m_dirty flag.
2212 2005-02-06 Darin Adler <darin@apple.com>
2216 - re-fixed <rdar://problem/3760910> please add support for custom tag names in HTML
2218 * khtml/xml/dom_docimpl.cpp:
2219 (DocumentImpl::tagId): Use ID_LAST_TAG + 1 for the ID of the first assigned tag ID. Before we'd use ID_LAST_TAG,
2220 which resulted in the same number being used for ID_COMMENT and the first custom tag.
2221 (DocumentImpl::tagName): Use ID_LAST_TAG + 1, as above.
2222 (DocumentImpl::namespaceURI): Change a < ID_LAST_TAG to <= ID_LAST_TAG in the same spirit as above.
2224 2005-02-06 Darin Adler <darin@apple.com>
2228 - fixed <rdar://problem/3986639> Crash occurs after choosing Undo Typing from the Edit menu
2230 * kwq/KWQTextArea.mm: (-[KWQTextArea viewWillMoveToWindow:]): Remove actions from undo manager when the view is
2231 removed from the window. Unfortunately, to do this the code has to know that the target of NSTextView actions
2232 will be the text storage object, but given the NSText architecture, that's pretty clear.
2234 2005-02-05 Chris Blumenberg <cblu@apple.com>
2236 Fixed: <rdar://problem/3991974> REGRESSION: www.jabra.com world location screen does not work
2240 * kwq/KWQKJavaAppletWidget.mm:
2241 (KJavaAppletWidget::KJavaAppletWidget): fallback to the document's base URL if there is no baseURL attribute
2242 * kwq/WebCoreBridge.h:
2243 * kwq/WebCoreBridge.mm:
2244 (-[WebCoreBridge baseURL]): new
2246 2005-02-04 David Harrison <harrison@apple.com>
2250 Rolled out Ken's accidental checkin when committing <rdar://problem/3986155> fix yesterday.
2252 * khtml/editing/selection.cpp:
2253 (khtml::Selection::validate):
2255 2005-02-04 Adele Amchan <adele@apple.com>
2259 Fix for <rdar://problem/3758785> Safari no longer works at BankOfAmerica online banking for military users
2261 When closing the document, if a body doesn't exist we now create one. This bug was preventing the onload handler from
2262 firing in cases where there wasn't a body. In the BankOfAmerica case, the page was just a bit of script where the onload
2263 handler redirected to the correct page.
2265 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
2267 2005-02-03 Ken Kocienda <kocienda@apple.com>
2273 <rdar://problem/3986155> Insertion point goes to beginning of doc after deleting
2275 * khtml/editing/htmlediting.cpp:
2276 (khtml::DeleteSelectionCommand::setStartNode): New convenience to handle reference counting when setting.
2277 (khtml::DeleteSelectionCommand::handleGeneralDelete): This contains the crux of the bug fix. Improve tests
2278 that detect when a selected node needs to be retained, rather than deleted, to preserve the intent of the user.
2279 This has the side effect of causing the insertion point placement code to succeed rather than fail. Before
2280 this fix, the failure of the insertion point placement code caused the insertion point to jump to the start
2281 of the document, which is the symptom that can be perceived by users when editing.
2282 * khtml/editing/htmlediting.h: Add setStartNode declaration.
2283 * khtml/editing/visible_units.cpp:
2284 (khtml::startOfBlock): This function had a stubbed-in non-tested implementation. Implement and
2285 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001-expected.txt: Added.
2286 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001.html: Added.
2287 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt: Added.
2288 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002.html: Added.
2289 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt: Added.
2290 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003.html: Added.
2291 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt: Added.
2292 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004.html: Added.
2293 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005-expected.txt: Added.
2294 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005.html: Added.
2295 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006-expected.txt: Added.
2296 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006.html: Added.
2300 2005-02-03 Richard Williamson <rjw@apple.com>
2302 Fixed <rdar://problem/3987419> Stocks and Weather leak what appears to XMLHTTPRequest results
2304 XMLHTTPRequests were causing massive leaks. _webcore_initWithHeaderString: did funky things with
2305 self replacement. Re-wrote to use more traditional factory constructor avoiding self replacement.
2307 Reviewed by David Harrison.
2310 (+[NSDictionary _webcore_dictionaryWithHeaderString:]):
2312 (KWQServeSynchronousRequest):
2314 2005-02-03 Chris Blumenberg <cblu@apple.com>
2316 Fixed: <rdar://problem/3938763> Cannot view Windows Media Player videos (soundtrack is played twice with delay)
2320 * khtml/html/html_objectimpl.cpp:
2321 (HTMLObjectElementImpl::attach): set needWidgetUpdate to false right after calling updateWidget because dispatchHTMLEvent can end up calling this method again
2322 (HTMLObjectElementImpl::recalcStyle): ditto
2324 2005-02-02 John Sullivan <sullivan@apple.com>
2328 - WebCore part of fix for <rdar://problem/3980651> REGRESSION (125-180): Huge number of pages printed from certain page,
2331 This also fixes the problems with printing from GMail, yay!
2333 * khtml/rendering/render_flow.cpp:
2334 (RenderFlow::paintLines):
2335 If the current line is taller than the entire page height (e.g. tall iFrame), don't try
2336 to avoid splitting it across pages.
2338 * kwq/WebCoreBridge.mm:
2339 (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
2340 Handle error cases in a more obvious manner; this will cause future problems like this
2341 to print a blank page and complain to the console on debug builds, rather than print a
2342 zillionty mostly-blank pages.
2344 2005-02-02 Chris Blumenberg <cblu@apple.com>
2346 Fixed: <rdar://problem/3960304> can't load a particular applet (at www.escape.de) unless it's the first applet to be loaded
2350 * khtml/rendering/render_frames.cpp:
2351 (RenderPartObject::updateWidget): when getting the MIME type from the PARAM tag, make sure the MIME type is the text from the left of the semi-colon if there is one. We do this elsewhere as well.
2353 2005-02-02 Chris Blumenberg <cblu@apple.com>
2355 Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)
2359 * kwq/KWQKHTMLPart.mm:
2360 (KWQKHTMLPart::sendContextMenuEvent): check if SPI to always enable selecting closest word is enabled
2361 * kwq/WebCoreBridge.h:
2363 2005-02-02 Ken Kocienda <kocienda@apple.com>
2367 * khtml/editing/markup.cpp:
2368 (khtml::createMarkup): Removed debug spam I committed earlier in error.
2370 2005-02-02 Ken Kocienda <kocienda@apple.com>
2376 <rdar://problem/3823109> WebKit should support -toggleBaseWritingDirection: (bidi editing support)
2378 Since base writing direction is a paragraph-level property in AppKit, and we use the CSS direction
2379 property in WebCore, which can be applied to inline elements as well as blocks, a new notion has
2380 been added to the WebCore apply style logic. It is now possible to force all properties in a
2381 style declaration to be applied as though they were block properties.
2383 * khtml/editing/htmlediting.cpp:
2384 (khtml::ApplyStyleCommand::ApplyStyleCommand): Add an enum and a flag to this command that controls whether to force all
2385 properties in the style to be applied as block styles. Default is "no", retaining previous behavior.
2386 (khtml::ApplyStyleCommand::doApply): Switch on new flag to apply styles as before, or force all preoperties to be applied
2388 * khtml/editing/htmlediting.h:
2389 (khtml::ApplyStyleCommand::): Add an enum and a flag, as above.
2390 * khtml/khtml_part.cpp:
2391 (KHTMLPart::applyParagraphStyle): New method to force application of all style properties as block styles.
2392 * khtml/khtml_part.h: Update header declarations.
2393 * kwq/KWQKHTMLPart.h: Update header declarations.
2394 * kwq/KWQKHTMLPart.mm:
2395 (KWQKHTMLPart::baseWritingDirectionForSelectionStart): Accessor to help WebKit do a toggle operation on
2397 * kwq/WebCoreBridge.h: Update header declarations.
2398 * kwq/WebCoreBridge.mm:
2399 (-[WebCoreBridge applyParagraphStyle:withUndoAction:]): New method to force application of all style properties as block styles.
2400 (-[WebCoreBridge baseWritingDirectionForSelectionStart]): Accessor to help WebKit do a toggle operation on
2405 <rdar://problem/3985035> REGRESSION (Mail): Text copied from wrapped line contains extra character when pasted
2407 * khtml/editing/markup.cpp:
2408 (khtml::renderedText): Add an enum and a flag to this command that controls whether to force all
2409 This is the result of an error in the code that computes the rendered text that is selected
2410 when copying. Since spaces collapse at the end of lines, and these spaces need to be copied
2411 when the selection spans line endings, code runs to compute this text. However, this code
2412 was also running incorrectly in cases where lines wrapped. I have now added the missing
2413 test to check that the selection does indeed extend to the end of the line.
2416 2005-02-02 Ken Kocienda <kocienda@apple.com>
2422 <rdar://problem/3984894> REGRESSION (Mail): Command-right-arrow in reply does the wrong thing (two ways)
2423 <rdar://problem/3985130> REGRESSION (Mail): command-right-arrow in pasted RTF selects only up to tab
2425 * khtml/editing/visible_units.cpp:
2426 (khtml::endOfLine): Two separate problems in this new function recently added to take the place of
2427 selectionForLine. In the first, endOfLine did not stop at BR elements, and returned the position
2428 beyond them. In the second, the VisiblePosition constructor gives the wrong answer in certain cases.
2429 Darin is going to work on a solution for that problem. In the meantime, I can fix the symptom of this
2430 bug by going down to the last leaf child of the root line box; a one line change we will roll out when
2433 2005-02-01 Richard Williamson <rjw@apple.com>
2435 Fixed <rdar://problem/3985535> QT Plug-in JavaScript support now fails in <embed> tag only case
2439 * khtml/ecma/kjs_html.cpp:
2440 (KJS::HTMLDocument::tryGet):
2442 2005-02-01 John Sullivan <sullivan@apple.com>
2444 Written by Darin, reviewed and tested by me
2446 - fixed <rdar://problem/3969684> Panther-only: extra blank lines between
2447 pasted content from Blot
2449 * kwq/KWQKHTMLPart.mm:
2450 (KWQKHTMLPart::attributedString):
2451 don't emit paragraph breaks if the margins are tiny; matches what
2452 we do for plain-text conversion
2456 2005-02-01 Ken Kocienda <kocienda@apple.com>
2462 <rdar://problem/3985160> Deficiencies in pasting architecture blocking progress on other bugs
2464 * khtml/editing/html_interchange.h: Move style span text used to mark element added to
2465 add style to this header.
2466 * khtml/editing/htmlediting.cpp:
2467 (khtml::styleSpanClassString): Change to use constant moved to html_interchange.h.
2468 (khtml::isStyleSpan): New helper function. Checks if this is a span we added to apply style.
2469 (khtml::CompositeEditCommand::insertNodeBefore): Added an assert to check that the node
2470 we are inserting before is not the body.
2471 (khtml::CompositeEditCommand::insertNodeAfter): Ditto, but check is for after.
2472 (khtml::ReplacementFragment::ReplacementFragment): Added code to process the "default style"
2473 that is added by the copy code.
2474 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): first and last nodes inserted are
2475 now member variables instead of function locals. Initialize them here.
2476 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): Deref first and last nodes inserted
2478 (khtml::ReplaceSelectionCommand::doApply): Change design to fix the bug. Major change is to
2479 separate out the code that inserts nodes into the tree so additional styling checks can
2480 be done in a centralized way. Also got rid of the notion of "merging into the end block." That
2481 concept was just wrong.
2482 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Tweak interface now that first and
2483 last nodes inserted are member variables.
2484 (khtml::ReplaceSelectionCommand::insertNodeAfterAndUpdateNodesInserted): New helper used
2485 by replace code to do the stated DOM operation and update state internal to the command.
2486 This will also be a catch point to handle the kinds of additional style checks needed to
2487 make paste work right.
2488 (khtml::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted): Ditto.
2489 (khtml::ReplaceSelectionCommand::insertNodeBeforeAndUpdateNodesInserted): Ditto.
2490 (khtml::ReplaceSelectionCommand::updateNodesInserted): Ditto.
2491 * khtml/editing/htmlediting.h: Update declarations as needed.
2492 * khtml/editing/markup.cpp:
2493 (khtml::createMarkup): Adds a "default style" span to the content written to the pasteboard.
2494 This will help us to fix some of the bugs blocked by the bug above.
2495 * khtml/xml/dom_nodeimpl.cpp:
2496 (NodeImpl::lastDescendent): New helper.
2497 * khtml/xml/dom_nodeimpl.h: Ditto.
2498 * khtml/xml/dom_position.cpp:
2499 (DOM::Position::upstream): Fixed a bug which would allow the upstream position returned to be
2500 in unrendered content.
2501 (DOM::Position::downstream): Ditto.
2503 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Ending positions tweaked due to
2504 changes in upstream() and downstream() functions.
2505 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Ditto
2506 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Ditto
2507 * layout-tests/editing/selection/extend-by-character-006-expected.txt: Ditto
2509 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Changed what we expect, given
2510 new behavior of paste code.
2512 2005-01-31 John Sullivan <sullivan@apple.com>
2514 Reviewed by Dave Hyatt.
2516 - fixed <rdar://problem/3983097> Tabbing on RSS pages gets stuck in search field
2517 with "full keyboard navigation" off
2521 (QSlider::focusPolicy):
2522 Implemented this method for KWQSlider. It is needed for our widget subclasses that
2523 can become focused in some situations. I missed this when fixing 3949203 because
2524 it only comes into play when tab-to-controls is on, and because the other relevant
2525 methods are objective-C methods.
2527 2005-01-31 David Harrison <harrison@apple.com>
2531 <rdar://problem/3964164> AXWebArea needs to unregister on going invisible
2533 * khtml/xml/dom_docimpl.cpp:
2534 (DocumentImpl::detach):
2535 Detach the AX UIElement for the AXWebArea.
2537 2005-01-31 David Harrison <harrison@apple.com>
2541 <rdar://problem/3850876> AX: button exposed as only an AXImage at http://appleseed.apple.com/ site (<input type=image>)
2543 * khtml/rendering/render_form.h:
2544 (khtml::RenderImageButton::isImageButton):
2546 * khtml/rendering/render_image.h:
2547 (khtml::RenderImage::isImageButton):
2549 * kwq/KWQAccObject.mm:
2550 (-[KWQAccObject isImageButton]):
2551 (-[KWQAccObject actionElement]):
2552 (-[KWQAccObject role]):
2553 (-[KWQAccObject accessibilityActionNames]):
2554 (-[KWQAccObject accessibilityPerformAction:]):
2555 Represent RenderImageButton elements as buttons instead of images.
2557 2005-01-31 David Harrison <harrison@apple.com>
2559 Prevent nil dereference in debug code.
2561 * khtml/xml/dom_nodeimpl.cpp:
2562 (NodeImpl::displayTree):
2563 Stop when parent is 0, too.
2565 2005-01-31 John Sullivan <sullivan@apple.com>
2567 Reviewed by Dave Hyatt.
2569 - fixed <rdar://problem/3949203> cannot tab to, within, or out of the RSS sidebar
2572 (-[KWQSlider becomeFirstResponder]):
2573 (-[KWQSlider resignFirstResponder]):
2574 (-[KWQSlider nextKeyView]):
2575 (-[KWQSlider previousKeyView]):
2576 (-[KWQSlider canBecomeKeyView]):
2577 (-[KWQSlider nextValidKeyView]):
2578 (-[KWQSlider previousValidKeyView]):
2579 Copied these methods from KWQButton. The lack of special handling for first-responder-ness
2580 here was causing the focus to get "stuck" on the RSS page's slider widget. Added FIXME
2581 about how it would be nice to share more of this code rather than replicating it in each
2582 KWQ widget subclass.
2584 2005-01-31 Darin Adler <darin@apple.com>
2586 Reviewed by Harrison.
2588 - fixed <rdar://problem/3980066> Double-click on single character moves insertion point to previous line
2590 * khtml/khtml_part.cpp:
2591 (KHTMLPart::selectClosestWordFromMouseEvent): Set affinity too.
2592 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2593 (KHTMLPart::handleMouseMoveEventSelection): Ditto.
2594 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
2596 * khtml/editing/selection.cpp:
2597 (khtml::Selection::modifyExtendingRightForward): Use endOfLine and endOfDocument.
2598 (khtml::Selection::modifyMovingRightForward): Ditto.
2599 (khtml::Selection::modifyExtendingLeftBackward): Use startOfLine and startOfDocument.
2600 (khtml::Selection::modifyMovingLeftBackward): Ditto.
2601 (khtml::Selection::validate): Rewrote the section that handles double-click. Two main fixes: 1) use isStartOfLine to
2602 check for another case where we want to select the word to the right, and 2) use isEndOfParagraph, which seems
2603 to work correctly in cases where isLastVisiblePositionInParagraph is giving the wrong answer. Also changed the line
2604 code to use startOfLine/endOfLine and the document code to use startOfDocument/endOfDocument.
2606 2005-01-31 Darin Adler <darin@apple.com>
2608 Reviewed by Harrison.
2610 - fixed <rdar://problem/3935275> unexpected quit scrolling over link; last.fm (works in IE and Firefox)
2612 * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): By using the correct document, fix the crash reported here.
2613 The page still crashes when you close the browser window, but it's not trivial to fix so I'll file a new bug after that.
2615 2005-01-31 Darin Adler <darin@apple.com>
2617 Reviewed by Ken and Harrison.
2619 - fixed <rdar://problem/3947901> REGRESSION (Mail): Pasting paragraph of rich text leaves insertion point before pasted text
2620 - fixed <rdar://problem/3949790> hitting return after underlined line results in too much or too little underlined
2621 - fixed <rdar://problem/3981759> nil-deref and crash when pasting just a paragraph break
2622 - fixed a couple problems I discovered while working with bug 3949790
2624 * khtml/editing/htmlediting.cpp:
2625 (khtml::ApplyStyleCommand::applyInlineStyle): Pass StayInBlock to upstream. Without this, we end up going too far
2626 upstream in the test case in bug 3949790.
2627 (khtml::ApplyStyleCommand::removeInlineStyle): Pass StayInBlock to upstream and downstream. Same reason as above.
2628 (khtml::ReplaceSelectionCommand::doApply): Update endPos if inserting a new node and endPos is using that node's
2629 parent and an offset past the node being inserted. That change fixes a problem with the position of the insertion point
2630 after pasting into the top level of a document (from test cases in 3947901 and 3949790). When setting insertionPos, use
2631 code that works when lastNodeInserted is a block rather than a text node. That change fixes a problem where a newline is
2632 not added when pasting an entire paragraph into the end of a document (from test case in 3949790). Added nil check before
2633 checking if lastNodeInserted is a <br> element, which fixes the crash when pasting just a paragraph break.
2635 * khtml/editing/visible_units.h: Filled out the set of calls to add some boolean checks for lines (needed for the
2636 bug fix), and calls for blocks (not yet implemented), and documents. The document checks may need refinement to
2637 properly handle documents with a mix of editable and non-editable content, but for now they just refactor code
2638 and make things a little clearer. Also removed the "include line break" parameter from endOfSentence.
2639 * khtml/editing/visible_units.cpp:
2640 (khtml::rootBoxForLine): Added.
2641 (khtml::startOfLine): Added. Algorithm taken from selectionForLine in selection.cpp.
2642 (khtml::endOfLine): Ditto.
2643 (khtml::inSameLine): Added.
2644 (khtml::isStartOfLine): Added.
2645 (khtml::isEndOfLine): Added.
2646 (khtml::endOfSentence): Removed "include line break" parameter.
2647 (khtml::inSameParagraph): Added a null check.
2648 (khtml::isStartOfParagraph): Ditto.
2649 (khtml::isEndOfParagraph): Ditto.
2650 (khtml::startOfBlock): Added.
2651 (khtml::endOfBlock): Added.
2652 (khtml::inSameBlock): Added.
2653 (khtml::isStartOfBlock): Added.
2654 (khtml::isEndOfBlock): Added.
2655 (khtml::startOfDocument): Added.
2656 (khtml::endOfDocument): Added.
2657 (khtml::inSameDocument): Added.
2658 (khtml::isStartOfDocument): Added.
2659 (khtml::isEndOfDocument): Added.
2661 2005-01-30 Darin Adler <darin@apple.com>
2665 - fixed <rdar://problem/3977000> form data set posted for <input type="image" ...> omits name/value pair
2667 * khtml/html/html_formimpl.cpp:
2668 (DOM::HTMLInputElementImpl::appendFormData): Append a name/value pair for type IMAGE in addition to the X/Y
2671 2005-01-30 Darin Adler <darin@apple.com>
2675 - fixed <rdar://problem/3974246> REGRESSION (125-180): popup menus are missing item text on Harmony Remote web site
2677 * khtml/html/html_formimpl.cpp: (DOM::HTMLOptionElementImpl::text): Change this function to traverse the entire tree
2678 and gather all the text rather than just looking at immediate children.
2680 * khtml/xml/dom_nodeimpl.h: Added const.
2681 * khtml/xml/dom_nodeimpl.cpp:
2682 (NodeImpl::traverseNextNode): Added const.
2683 (NodeImpl::traverseNextSibling): Ditto.
2684 (NodeImpl::traversePreviousNodePostOrder): Ditto.
2685 (NodeImpl::detach): Add a missing nil check.
2687 2005-01-30 Darin Adler <darin@apple.com>
2691 - fixed <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
2693 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Added missing ref/deref of newly created element.
2695 2005-01-28 Darin Adler <darin@apple.com>
2697 * khtml/css/cssproperties.c: Regenerated with newer gperf.
2699 2005-01-28 David Harrison <harrison@apple.com>
2701 Reviewed by John Sullivan.
2703 <rdar://problem/3968144> AX need to be able to focus an AXLink by setting AXFocused to true
2705 * kwq/KWQAccObject.mm:
2706 (-[KWQAccObject accessibilityPerformAction:]):
2707 (-[KWQAccObject accessibilityIsAttributeSettable:]):
2708 Add AXFocused for AXLinks.
2710 2005-01-28 David Harrison <harrison@apple.com>
2714 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
2716 Use AppKit SPI _accessibilityParentForSubview to return KWQAccObject parent of AppKit AX object.
2718 * kwq/KWQAccObject.mm:
2719 (-[KWQAccObject _accessibilityParentForSubview:]):
2722 2005-01-27 Adele Amchan <adele@apple.com>
2724 fixed by Darin, reviewed by me.
2726 <rdar://problem/3976314> REGRESSION (180-TOT): submitting password fields fail on Panther
2728 * kwq/KWQTextField.mm: (-[KWQTextFieldController string]): on panther, the secure text field's editor
2729 does not contain the real string, so now we just call stringValue on the field in that case.
2731 2005-01-26 Maciej Stachowiak <mjs@apple.com>
2733 Reviewed by Darin, Hyatt and Ken.
2735 <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
2737 * khtml/css/css_computedstyle.cpp:
2738 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support
2739 for -khtml-text-decorations-in-effect property. This works like text-docration
2740 but follows proper inline semantics, that is, if a parent is causing text
2741 decoration then -khtml-text-decorations-in-effect on this element will reflect that.
2742 * khtml/css/cssproperties.in: Add -khtml-text-decorations-in-effect property.
2743 * khtml/css/cssproperties.h: regenerated
2744 * khtml/css/cssvalues.c: regenerated
2745 * khtml/css/cssparser.cpp: regenerated
2746 * khtml/css/cssproperties.c: regenerated
2748 * khtml/css/css_valueimpl.h: Made copyPropertiesInSet public.
2750 * khtml/editing/htmlediting.cpp:
2751 (khtml::StyleChange::init): Handle -khtml-text-decorations-in-effect
2752 specially, translate to text-decoration
2753 (khtml::ApplyStyleCommand::applyInlineStyle): Fix a comment.
2754 (khtml::ApplyStyleCommand::removeInlineStyle): Add new way of pushing down
2755 text-decoration styles around the edges of the selected range.
2756 (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAroundNode): Helper for this.
2757 (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): ditto
2758 (khtml::ApplyStyleCommand::nodeFullyUnselected): ditto
2759 (khtml::hasTextDecorationProperty): ditto
2760 (khtml::highestAncestorWithTextDecoration): ditto
2761 (khtml::ApplyStyleCommand::extractTextDecorationStyle): ditto
2762 (khtml::ApplyStyleCommand::extractAndNegateTextDecorationStyle): ditto
2763 (khtml::ApplyStyleCommand::applyTextDecorationStyle): ditto
2764 * khtml/editing/htmlediting.h: Prototype new methods.
2765 * khtml/editing/jsediting.cpp: Make underline execCommand use the new CSS property.
2767 - as a necessary part of the fix, fixed the longstanding problem
2768 that mutating an element's inlineStyleDecl would not property
2769 update its style attribute. now it does.
2771 * khtml/css/css_valueimpl.cpp:
2772 (DOM::CSSMutableStyleDeclarationImpl::setChanged): If this is an inline style
2773 declaration, tell the element it's style attribute needs updating.
2774 * khtml/html/html_elementimpl.cpp:
2775 (HTMLElementImpl::invalidateStyleAttribute): New method, just calls down
2777 (HTMLElementImpl::updateStyleAttribute): Regenerate style attribute from
2778 inline style declaration.
2779 * khtml/html/html_elementimpl.h: Prototype new stuff.
2780 * khtml/xml/dom_elementimpl.cpp:
2781 (ElementImpl::ElementImpl): Initialize new attribute.
2782 (ElementImpl::updateStyleAttributeIfNeeded): New method to check if the style
2783 is dirty and this is an html element, and if so call the html element to
2784 regenerate the style attribute.
2785 (ElementImpl::attributes): update style if needed
2786 (ElementImpl::getAttribute): ditto
2787 (ElementImpl::hasAttributes): ditto
2788 (ElementImpl::dump): ditto
2789 (XMLElementImpl::cloneNode): ditto
2790 * khtml/xml/dom_elementimpl.h:
2791 (DOM::ElementImpl::isStyleAttributeValid): new method to manage style attr
2793 (DOM::ElementImpl::setStyleAttributeValid): ditto
2795 - added new layout tests for underlining:
2797 * layout-tests/editing/editing.js:
2798 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt: Added.
2799 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt: Added.
2800 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold.html: Added.
2801 * layout-tests/editing/style/remove-underline-across-paragraph.html: Added.
2802 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt: Added.
2803 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt: Added.
2804 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold.html: Added.
2805 * layout-tests/editing/style/remove-underline-after-paragraph.html: Added.
2806 * layout-tests/editing/style/remove-underline-expected.txt: Added.
2807 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt: Added.
2808 * layout-tests/editing/style/remove-underline-from-stylesheet.html: Added.
2809 * layout-tests/editing/style/remove-underline-in-bold-expected.txt: Added.
2810 * layout-tests/editing/style/remove-underline-in-bold.html: Added.
2811 * layout-tests/editing/style/remove-underline.html: Added.
2812 * layout-tests/editing/style/underline-expected.txt: Added.
2813 * layout-tests/editing/style/underline.html: Added.
2815 2005-01-27 David Hyatt <hyatt@apple.com>
2817 Fix for 3875199, search field needs to be able to show a magnifying glass without a dropdown menu.
2819 Reviewed by kocienda
2821 * khtml/html/html_formimpl.cpp:
2822 (DOM::HTMLInputElementImpl::HTMLInputElementImpl):
2823 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
2824 * kwq/KWQLineEdit.mm:
2825 (QLineEdit::setMaxResults):
2827 2005-01-27 Ken Kocienda <kocienda@apple.com>
2833 <rdar://problem/3973254> Deletions of ranges does not coalesce correctly with subsequent typing
2835 * khtml/editing/htmlediting.cpp:
2836 (khtml::InsertTextCommand::deleteCharacter): Remove this dead code.
2837 (khtml::ReplaceSelectionCommand::editingAction): Moved this code to a better place in the file.
2838 It was in with unrelated functions.
2839 (khtml::TypingCommand::TypingCommand): Reorganize initialization list so it is easier to read.
2840 (khtml::TypingCommand::issueCommandForDeleteKey): Remove dead code. Roll in remaining code into deleteKeyPressed.
2841 (khtml::TypingCommand::deleteKeyPressed): Add in support for carrying along smart delete flag.
2842 (khtml::TypingCommand::forwardDeleteKeyPressed): New function. Makes forward delete work like
2843 "regular" delete in terms of coalescing typing.
2844 (khtml::TypingCommand::doApply): Add case for ForwardDeleteKey.
2845 (khtml::TypingCommand::preservesTypingStyle): Ditto.
2846 * khtml/editing/htmlediting.h:
2847 (khtml::TypingCommand::): Add ForwardDeleteKey constant. Remove a couple declarations for now-dead code.
2848 (khtml::TypingCommand::smartDelete): New accessor.
2849 (khtml::TypingCommand::setSmartDelete): Ditto.
2850 * kwq/WebCoreBridge.h:
2851 * kwq/WebCoreBridge.mm:
2852 (-[WebCoreBridge deleteKeyPressedWithSmartDelete:]): Add smart delete flag.
2853 (-[WebCoreBridge forwardDeleteKeyPressedWithSmartDelete:]): New method.
2854 * khtml/editing/jsediting.cpp: Add supprt for ForwardDelete command
2855 * layout-tests/editing/editing.js: Ditto.
2856 * layout-tests/editing/deleting/delete-and-undo-expected.txt: Added.
2857 * layout-tests/editing/deleting/delete-and-undo.html: Added.
2858 * layout-tests/editing/deleting/forward-delete-expected.txt: Added.
2859 * layout-tests/editing/deleting/forward-delete.html: Added.
2863 2005-01-27 David Harrison <harrison@apple.com>
2867 <rdar://problem/3962214> AX: AXLeftLineTextMarkerRangeForTextMarker returns incorrect range
2869 * kwq/KWQAccObject.mm:
2870 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2871 Allowed for selection to end of line including the linebreak.
2873 2005-01-27 David Harrison <harrison@apple.com>
2875 Reviewed by Darin, Ken.
2877 <rdar://problem/3964470> AX: Include attachments in AXAttributedStringForTextMarkerRange
2879 * kwq/KWQAccObject.mm:
2880 (-[KWQAccObject isAttachment]):
2881 (-[KWQAccObject attachmentView]):
2882 (-[KWQAccObject role]):
2883 (-[KWQAccObject subrole]):
2884 (-[KWQAccObject roleDescription]):
2885 (-[KWQAccObject value]):
2886 (-[KWQAccObject title]):
2887 (-[KWQAccObject accessibilityDescription]):
2888 (-[KWQAccObject accessibilityIsIgnored]):
2889 (-[KWQAccObject accessibilityAttributeNames]):
2890 (-[KWQAccObject accessibilityAttributeValue:]):
2891 Make attachments accessible.
2893 (CreateCGColorIfDifferent):
2894 (AXAttributeStringSetColor):
2895 (AXAttributeStringSetNumber):
2896 (AXAttributeStringSetFont):
2897 (AXAttributeStringSetStyle):
2898 (AXAttributeStringSetElement):
2899 (AXLinkElementForNode):
2900 (AXAttributedStringAppendText):
2901 (AXAttributedStringAppendReplaced):
2902 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
2903 Add attachments and more text attributes to AXAttributedStringForTextMarkerRange.
2905 2005-01-27 Darin Adler <darin@apple.com>
2909 - fixed <rdar://problem/3807935> DOM CSS computed style line-height is wrong in two ways
2911 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2912 Use specified size rather than computed size when dealing with a percentage for line height.
2914 2005-01-27 Darin Adler <darin@apple.com>
2918 - fixed <rdar://problem/3971372> SWB: template function DOM_cast() won't compile with gcc 4.0
2919 - fixed other gcc 4.0 compiling problems Patrick Beard pointed out on the phone
2921 * kwq/DOMInternal.h: (DOM_cast): Change the "failToCompile()" trick to use a dependent name.
2922 Nowadays, if a name is not dependent, it is checked at template definition time. But we want
2923 a failure only at template instantiation time.
2925 * ForwardingHeaders/editing/text_granularity.h: Added. Needed but a bug in the 3.3 compiler made
2926 it compile anyway without this.
2930 * khtml/html/html_miscimpl.h: For clarity, mark these functions virtual too. They are automatically
2931 virtual because the base class ones are virtual, but it's ugly to leave it this way.
2933 2005-01-26 Ken Kocienda <kocienda@apple.com>
2939 <rdar://problem/3971609> REGRESSION (Mail): up/down arrow navigation broken after rewrapping text by resizing window
2940 <rdar://problem/3975661> REGRESSION (Mail): left/right arrow navigation can place insertion point after last character on line
2942 * khtml/editing/selection.cpp:
2943 (khtml::Selection::modifyAffinity): PARAGRAPH and LINE movements should not alter affinity. This was
2944 just a mistake before when it reset to upstream in some cases.
2945 * khtml/rendering/render_line.cpp:
2946 (khtml::RootInlineBox::closestLeafChildForXPos): Move this function down from InlineBox, and
2947 rework the implementation. This fixes 3971609.
2948 * khtml/rendering/render_line.h:
2949 * khtml/rendering/render_text.cpp:
2950 (RenderText::caretRect): Rework the algorithm to fix 3975661. This regressed when we began placing
2951 the spaces on the end of lines in text boxes when lines wrap.
2953 2005-01-26 Richard Williamson <rjw@apple.com>
2955 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
2957 I added a member variable to ObjectImp. This changed it's size and consequently
2958 hampered the optimizations built into the garbage collector. Objects no longer
2959 fit within the allocators cell size, and thus allocation fell back to a slower
2962 As a result of this fix I also dramatically cleaned up how runtime objects are
2963 accessed. The path mostly *removes* code.
2967 * khtml/ecma/kjs_dom.cpp:
2968 (DOMDocumentProtoFunc::tryCall):
2969 (DOMElementProtoFunc::tryCall):
2970 (KJS::getRuntimeObject):
2971 * khtml/ecma/kjs_dom.h:
2972 * khtml/ecma/kjs_html.cpp:
2973 (KJS::HTMLDocument::tryGet):
2974 (KJS::HTMLElement::tryGet):
2975 (KJS::HTMLElement::implementsCall):
2976 (KJS::HTMLElement::call):
2977 (KJS::HTMLElement::tryPut):
2978 (KJS::HTMLCollection::tryGet):
2979 (KJS::HTMLCollection::getNamedItems):
2980 * khtml/ecma/kjs_html.h:
2981 * khtml/ecma/kjs_window.cpp:
2984 2005-01-26 Richard Williamson <rjw@apple.com>
2986 Fixed <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
2988 For now we are using ICU UBreakIterator to determine grapheme boundaries for
2989 cursor and deletion. This does not match what Cocoa does exactly, but does match
2990 what Carbon does. The areas are difference are obscure, but, according to
2991 Deborah Goldsmith, using the UBreakIterator is the reasonable approach.
2995 * khtml/rendering/render_text.cpp:
2996 (RenderText::previousOffset):
2997 (RenderText::nextOffset):
2999 2005-01-25 David Harrison <harrison@apple.com>
3001 Reviewed by Maciej and Richard.
3003 <rdar://problem/3963731> AX VO: Changing window sizes causes a crash using with Voice Over - KWQPtrDictImpl::clear
3005 * khtml/html/html_miscimpl.cpp:
3006 (HTMLCollectionImpl::HTMLCollectionImpl):
3007 Ensure that isHTMLDocument before calling HTMLDocument-only method.
3009 2005-01-25 Richard Williamson <rjw@apple.com>
3011 Part one of fix for <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
3013 This patch changes the semantics of next() and previous() on
3014 VisiblePosition to move a grapheme (character cluster) at a
3015 time. This means that cursor navigation with correctly move
3016 over an entire cluster.
3018 However, the expected behavior for deleting a grapheme is to
3019 delete individual code points, thus decomposing the grapheme
3020 into it constituent parts. That will be addressed in the next
3025 * khtml/editing/visible_position.cpp:
3026 (khtml::VisiblePosition::previousPosition):
3027 (khtml::VisiblePosition::nextPosition):
3028 * khtml/editing/visible_position.h:
3029 * khtml/rendering/render_object.cpp:
3030 (RenderObject::previousOffset):
3031 (RenderObject::nextOffset):
3032 * khtml/rendering/render_object.h:
3033 * khtml/rendering/render_text.cpp:
3034 (RenderText::previousOffset):
3035 (RenderText::nextOffset):
3036 (RenderText::findNextInlineTextBox):
3037 * khtml/rendering/render_text.h:
3038 * khtml/xml/dom_nodeimpl.cpp:
3039 (NodeImpl::previousOffset):
3040 (NodeImpl::nextOffset):
3041 * khtml/xml/dom_nodeimpl.h:
3043 2005-01-25 David Harrison <harrison@apple.com>
3047 <rdar://problem/3973067> AXWebArea for http://apple.netscape.com/ has an empty AXLinkUIElements
3049 * kwq/KWQAccObject.mm:
3050 (-[KWQAccObject accessibilityAttributeValue:]):
3051 Omit ignored AXLinks from AXLinkUIElements result
3053 2005-01-25 Ken Kocienda <kocienda@apple.com>
3059 <rdar://problem/3972851> REGRESSION (179-180+): Repro crash in ApplyStyleCommand::cleanUpEmptyStyleSpans
3061 * khtml/editing/htmlediting.cpp:
3062 (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans): Added two null checks.
3064 2005-01-25 Ken Kocienda <kocienda@apple.com>
3070 <rdar://problem/3954710> Mail crashed while editing signatures - NodeImpl::isBlockFlow
3072 The fix is more general than for this one bug, and may work to fix many crashers. The problem
3073 is that the ReplaceSelectionCommand never checked whether its starting selection is empty. If
3074 it is, then we need to bail before doing the work of the command, which we need to deref the
3075 start and end points of the selection in order to do its work. I think you can see the crash
3078 * khtml/editing/htmlediting.cpp:
3079 (khtml::ReplaceSelectionCommand::doApply): Assert selection is not empty.
3080 * kwq/WebCoreBridge.mm:
3081 (partHasSelection): New helper function to test that bridge has a part with a selection.
3083 Use new helper function to test part and selection; return from these function if this test fails.
3085 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:])
3086 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:])
3087 (-[WebCoreBridge alterCurrentSelection:direction:granularity:])
3088 (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:])
3089 (-[WebCoreBridge alterCurrentSelection:verticalDistance:])
3090 (-[WebCoreBridge documentFragmentWithText:])
3091 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
3092 (-[WebCoreBridge insertLineBreak])
3093 (-[WebCoreBridge insertParagraphSeparator])
3094 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent])
3095 (-[WebCoreBridge insertText:selectInsertedText:])
3096 (-[WebCoreBridge deleteSelectionWithSmartDelete:])
3097 (-[WebCoreBridge ensureSelectionVisible])
3099 2005-01-24 Kevin Decker <kdecker@apple.com>
3103 Fixed <rdar://problem/3932374> REGRESSION: 'ReferenceError - Can't find variable' JavaScript error at webxpress.fidelity.com
3105 * khtml/html/html_miscimpl.h: Missing virtual identifiers for namedItem() and nextNamedItem() exposed a flaw that prevented finding variables in form [HTMLFormCollectionImpl] scopes.
3108 2005-01-24 Vicki Murley <vicki@apple.com>
3110 Reviewed by kocienda.
3112 - fix <rdar://problem/3810661> computed style not handled for Apple extensions
3114 * khtml/css/css_computedstyle.cpp: (DOM::):
3115 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): add -apple-line-clamp and -apple-text-size-adjust
3117 2005-01-24 Darin Adler <darin@apple.com>
3121 - fixed <rdar://problem/3969884> REGRESSION (179-180): Typing password not echoed as "bullets" at paypal.com when field is first focused
3123 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]):
3124 Sizing up the form editor, which fixes things for normal fields and search fields,
3125 screws things up for password fields. Eventually, I'll need to figure out why this is
3126 and file a bug so that the AppKit team fixes it. In the mean time, just check for the
3127 case of the secure text field, and don't size up in that case.
3129 2005-01-24 Ken Kocienda <kocienda@apple.com>
3135 <rdar://problem/3963560> 8A354: Inserting Japanese text to the line head causes line break
3137 * khtml/editing/htmlediting.cpp:
3138 (khtml::ReplaceSelectionCommand::doApply): Add one more case where we merge content into the
3139 existing line. This covers the situation see using the steps to reproduce this bug.
3141 2005-01-21 Maciej Stachowiak <mjs@apple.com>
3145 <rdar://problem/3967572> Editing should split elements before removing style
3147 * khtml/editing/htmlediting.cpp:
3148 (khtml::CompositeEditCommand::splitElement):
3149 (khtml::CompositeEditCommand::mergeIdenticalElements):
3150 (khtml::CompositeEditCommand::wrapContentsInDummySpan):
3151 (khtml::CompositeEditCommand::splitTextNodeContainingElement):
3152 (khtml::ApplyStyleCommand::applyInlineStyle):
3153 (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
3154 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
3155 (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
3156 (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
3157 (khtml::areIdenticalElements):
3158 (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
3159 (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
3160 (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans):
3161 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
3162 (khtml::InsertParagraphSeparatorCommand::doApply):
3163 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
3164 (khtml::InsertTextCommand::prepareForTextInsertion):
3165 (khtml::SplitTextNodeCommand::doUnapply):
3166 (khtml::SplitElementCommand::SplitElementCommand):
3167 (khtml::SplitElementCommand::~SplitElementCommand):
3168 (khtml::SplitElementCommand::doApply):
3169 (khtml::SplitElementCommand::doUnapply):
3170 (khtml::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand):
3171 (khtml::MergeIdenticalElementsCommand::~MergeIdenticalElementsCommand):
3172 (khtml::MergeIdenticalElementsCommand::doApply):
3173 (khtml::MergeIdenticalElementsCommand::doUnapply):
3174 (khtml::WrapContentsInDummySpanCommand::WrapContentsInDummySpanCommand):
3175 (khtml::WrapContentsInDummySpanCommand::~WrapContentsInDummySpanCommand):
3176 (khtml::WrapContentsInDummySpanCommand::doApply):
3177 (khtml::WrapContentsInDummySpanCommand::doUnapply):
3178 (khtml::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand):
3179 (khtml::SplitTextNodeContainingElementCommand::~SplitTextNodeContainingElementCommand):
3180 (khtml::SplitTextNodeContainingElementCommand::doApply):
3181 * khtml/editing/htmlediting.h:
3183 New layout test that shows the side benefit of this.
3185 * layout-tests/editing/style/unbold-in-bold-expected.txt: Added.
3186 * layout-tests/editing/style/unbold-in-bold.html: Added.
3188 2005-01-24 Darin Adler <darin@apple.com>
3192 - fixed <rdar://problem/3933435> -[DOMRange cloneContents] sometimes alters the original DOMRange
3194 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Fixed code that was collapsing
3195 the range after processing the contents. That's right for extract and delete, but not clone.
3197 - fixed <rdar://problem/3714184> inline input works incorrectly when I type Korean slowly in textfield in form on www.google.co.kr
3198 - fixed <rdar://problem/3193848> Can't enter SSN to sign up for Chase visa online account (changing focus inside key press handler)
3199 - fixed <rdar://problem/3874683> REGRESSION (161-162): Crash after typing command-Z to undo after pasting text with newline in it into a text field <input type=text>
3201 * kwq/KWQLineEdit.mm:
3202 (QLineEdit::text): Changed to call a new string method on the controller instead of calling
3203 stringValue, since stringValue has a bad side effect of ending inline input.
3204 (QLineEdit::selectAll): Changed to only call selectText: when the field is already selected.
3205 When you are giving the field focus, it automatically gets all selected, and this change
3206 is required in the case where we defer the focus change.
3208 * kwq/KWQTextField.h: Added a new string method to the controller.
3209 * kwq/KWQTextField.mm:
3210 (-[KWQTextFieldController setMaximumLength:]): Call the new string method instead of using stringValue.
3211 (-[KWQTextFieldController controlTextDidChange:]): Removed the code to truncate at the first CR or LF.
3212 That's now handled in the shouldChangeTextInRange method instead.
3213 (-[KWQTextFieldController textView:shouldHandleEvent:]): Add new logic to defer responder changes until
3214 after the event is handled. This makes sure the key gets into the field that's already handling it at
3215 rather than ending up in the newly-focused field if the key press handler focuses a different element.
3216 (-[KWQTextFieldController textView:didHandleEvent:]): Turn off deferral here, now that the key press
3218 (-[KWQTextFieldController string]): Added. Calls stringValue only if there's no editor. If there is
3219 an editor, calls string on that instead.
3220 (-[KWQTextFieldController textView:shouldChangeTextInRange:replacementString:]): Added. Called by
3221 the three field subclasses. Truncates incoming strings at the first CR or LF character. This works
3222 properly with Undo, and the old technique did not.
3223 (-[KWQTextFieldController preprocessString:]): Added. Helper used for all the setStringValue methods
3224 so they all truncate at the first CR or LF as well as truncating to the appropriate length.
3225 (-[KWQTextField setStringValue:]): Changed to call the controller.
3226 (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): Added. Calls the controller.
3227 (-[KWQSecureTextField setStringValue:]): More of the same.
3228 (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
3229 (-[KWQSearchField setStringValue:]): Ditto.
3230 (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
3232 * kwq/KWQWidget.h: Added the new setDeferFirstResponderChanges function.
3234 (QWidget::~QWidget): Clear out the deferredFirstResponder global just in case we are destroyed
3235 while we "have the ball".
3236 (QWidget::hasFocus): If we are in the deferred mode, use the global to decide who to say is focused.
3237 (QWidget::setFocus): If we are in the deferred mode, set the global instead of making something be
3238 the first responder.
3239 (QWidget::setDeferFirstResponderChanges): Set the boolean. If the boolean is being cleared, then
3240 get the deferred first responder and call setFocus on it again, which will do the work we didn't
3243 2005-01-24 Ken Kocienda <kocienda@apple.com>
3249 <rdar://problem/3964350> Deleting all content and typing in a message gets one letter, then beeps
3251 This is a problem with the way we turn key events, when a user starts typing, into editing commands.
3252 Right now, that initial delete key in an empty window is turned into an editing command, and much
3253 editing code runs that need not run. What's more, this is confusing the selection machinery. The
3254 solution is to detect the "delete in an empty window" case and don't turn this into an editing
3257 * khtml/editing/htmlediting.cpp:
3258 (khtml::TypingCommand::deleteKeyPressed)
3260 2005-01-23 Adele Amchan <adele@apple.com>
3262 Fixed <rdar://problem/3964286> REGRESSION (178-179): menus and "go to old site" link at Ameritrade's new site don't work
3264 Removed check for document from checkCompleted. In this case, WebCore never knew that a WebImageView was complete because
3265 it fell into this document check case in checkCompleted.
3266 Added check for document to tokenizerProcessedData (see <rdar://problem/3807144>)
3270 * khtml/khtml_part.cpp:
3272 (KHTMLPart::checkCompleted):
3273 * khtml/khtml_part.h:
3274 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::tokenizerProcessedData):
3276 2005-01-21 Richard Williamson <rjw@apple.com>
3278 Fixed <rdar://problem/3759399> Javascript / Liveconnect problems ((event handler):Undefined value)
3280 Java applets specified with <object> or <embed> weren't scriptable. Now they are.
3284 * khtml/html/html_objectimpl.cpp:
3285 (HTMLEmbedElementImpl::getEmbedInstance):
3286 (HTMLObjectElementImpl::getObjectInstance):
3288 2005-01-21 Ken Kocienda <kocienda@apple.com>
3294 <rdar://problem/3959464> REGRESSION (Mail): Insertion point goes back to beginning of document after deleting
3296 * khtml/editing/htmlediting.cpp:
3297 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add special case to handle retaining a fully-selected block.
3299 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt: Added.
3300 * layout-tests/editing/deleting/delete-3959464-fix.html: Added.
3302 2005-01-21 Richard Williamson <rjw@apple.com>