1 2005-02-28 David Hyatt <hyatt@apple.com>
3 Fix for 4028999, safari crashes when resetting if mallocsribble is on. Clip rects were being cleared using dead
4 render objects. Change the ordering.
8 * khtml/rendering/render_box.cpp:
10 * khtml/rendering/render_layer.cpp:
11 (RenderLayer::~RenderLayer):
13 2005-02-28 Chris Blumenberg <cblu@apple.com>
15 Fixed: <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
19 * khtml/editing/htmlediting.cpp:
20 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Call updateLayout so caretMinOffset and caretMaxOffset return correct values.
22 2005-02-28 John Sullivan <sullivan@apple.com>
26 - WebCore part of fix for <rdar://problem/4023490> REGRESSION (125-185): Tabbing through links
27 on frameset page gets stuck at end (tivofaq.com)
29 * kwq/WebCoreBridge.h:
30 add nextValidKeyViewOutsideWebFrameViews (code is in WebKit)
32 2005-02-28 Ken Kocienda <kocienda@apple.com>
38 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
40 * khtml/css/css_computedstyle.cpp: inheritableProperties array now defined in css_valueimpl.cpp.
41 * khtml/css/css_valueimpl.cpp: Define inheritableProperties array here.
42 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Use new name for blockProperties, and use the new
43 constant for the number of items in the array.
44 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
45 (DOM::CSSMutableStyleDeclarationImpl::removeInheritableProperties): New function.
46 * khtml/css/css_valueimpl.h: Declare inheritableProperties array and numInheritableProperties extern so they
47 can be defined in css_valueimpl.cpp and used in css_computedstyle.cpp.
48 * khtml/editing/htmlediting.cpp:
49 (khtml::ReplacementFragment::removeStyleNodes): This code was misguided, and removed too much style from HTML
50 elements. Now, it removes from HTML elements only the styles that we replace later with a call to applyStyle().
51 Also, add ID_B to list of inline "style" nodes we are willing to remove. Leaving it off was an oversight.
53 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: ID_B fix made this result change, without any
54 visible change in the test.
58 * layout-tests/editing/style/smoosh-styles-003.html
59 * layout-tests/editing/style/smoosh-styles-003-expected.txt
61 2005-02-28 Richard Williamson <rjw@apple.com>
63 Fixed <rdar://problem/4026985> CrashTracer: ...14 crashes at com.apple.WebCore: -[KWQPageState invalidate] + 32
65 Added more nil checking and ASSERTS.
66 Without a reproducible case this is hard to definitively resolve.
68 Reviewed by John Sullivan.
70 * kwq/KWQPageState.mm:
71 (-[KWQPageState invalidate]):
73 2005-02-28 Richard Williamson <rjw@apple.com>
75 Fixed <rdar://problem/4027702> 3.5% performance regression btwn Safari-188 and Safari-400
77 I inadvertently checked in some debugging code that disabled
78 style sharing. Backed out that change.
80 * khtml/css/cssstyleselector.cpp:
81 (khtml::CSSStyleSelector::styleForElement):
83 2005-02-28 Chris Blumenberg <cblu@apple.com>
85 Fixed: <rdar://problem/4026639> www.bmw.ca configurator does not work with Safari
89 * khtml/ecma/kjs_html.cpp:
90 (KJS::HTMLElement::tryGet): when frameset.<name of frame child> is called, return the window object of the frame child
92 2005-02-28 Ken Kocienda <kocienda@apple.com>
98 <rdar://problem/4026906> Paste of HTML table content can break table structure
100 * khtml/editing/htmlediting.cpp:
101 (khtml::ReplacementFragment::pruneEmptyNodes): Call new isProbablyTableStructureNode() function to prevent
102 removal of empty table structure nodes.
103 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
104 (khtml::isProbablyTableStructureNode): New helper function.
105 * khtml/editing/htmlediting.h: Declare new helper.
107 2005-02-28 Chris Blumenberg <cblu@apple.com>
109 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
111 Reviewed by kocienda.
113 * khtml/editing/htmlediting.cpp:
114 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): ref and deref the element while it is "floating"
115 (khtml::ReplacementFragment::insertFragmentForTestRendering): ditto
116 (khtml::floatRefdElement): new, keeps an element alive while its ref count is 0
117 (khtml::createDefaultParagraphElement): removed commented out code
118 (khtml::createBlockPlaceholderElement): ref the element and return it as "floating"
119 (khtml::createFontElement): ditto
120 (khtml::createStyleSpanElement): ditto
121 * khtml/editing/htmlediting.h:
123 2005-02-27 Maciej Stachowiak <mjs@apple.com>
127 <rdar://problem/3993557> REGRESSION (125-180-ish): getElementsByTagName no longer works with namespace designations
129 * khtml/xml/dom_nodeimpl.cpp:
130 (NodeBaseImpl::getElementsByTagNameNS): When no namespace is specified, find elements
131 of the specified name in any namespace to match Mozilla and earlier Safari behavior.
133 2005-02-25 Darin Adler <darin@apple.com>
137 - fixed <rdar://problem/4025618> Crash while searching at hollywoodvideo.com
139 * khtml/html/html_formimpl.h: Added valueWithDefault.
140 * khtml/html/html_formimpl.cpp:
141 (DOM::HTMLInputElementImpl::appendFormData): Call valueWithDefault instead of going at the render object
142 to try to get the default value; there may be no render object if this is display:none.
143 (DOM::HTMLInputElementImpl::valueWithDefault): Added. Knows about the defaults for "submit" and "reset"
144 buttons; otherwise just returns the value as-is.
146 * khtml/rendering/render_form.h: Removed the defaultLabel member functions.
147 * khtml/rendering/render_form.cpp:
148 (RenderSubmitButton::rawText): Call valueWithDefault instead of using defaultLabel function here on
149 the render side. The DOM needs to know how to deal with the default anyway for form submission.
150 (RenderSubmitButton::defaultLabel): Removed.
151 (RenderResetButton::defaultLabel): Removed.
152 (RenderPushButton::defaultLabel): Removed.
154 2005-02-25 Darin Adler <darin@apple.com>
158 - fixed <rdar://problem/4025088> window onblur and onfocus don't fire when text field has focus
160 * kwq/KWQKHTMLPart.h: Added setWindowHasFocus function and m_windowHasFocus data member.
161 * kwq/KWQKHTMLPart.mm:
162 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Took out the code that sends the focus and blur events.
163 (KWQKHTMLPart::setWindowHasFocus): Put that code here instead.
165 * kwq/WebCoreBridge.h: Added setWindowHasFocus: method to the bridge.
166 * kwq/WebCoreBridge.mm: (-[WebCoreBridge setWindowHasFocus:]): Added. Calls method on the part.
168 2005-02-25 Darin Adler <darin@apple.com>
172 - re-fixed <rdar://problem/3665430> horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode
174 * kwq/KWQTextArea.mm: (-[KWQTextArea _updateTextViewWidth]): Don't change the text view width
175 to match the text area's width in the "wrap" case.
177 2005-02-25 Ken Kocienda <kocienda@apple.com>
183 <rdar://problem/4021518> 8A394 Mail crashes during paste: khtml::RootInlineBox::closestLeafChildForXPos
185 * khtml/editing/visible_units.cpp:
186 (khtml::previousLinePosition): Adding an updateLayout call at the start of the function fixes the crash, since
187 we caught line boxes in a not-completely-updated state.
188 (khtml::nextLinePosition): Ditto.
190 2005-02-25 David Hyatt <hyatt@apple.com>
192 Fix for 4010774, make sure to avoid an O(N^2) algorithm in nextRenderer() that is triggered when large
193 DOM subtrees are inserted into documents via one insert/append call.
197 * khtml/xml/dom_nodeimpl.cpp:
198 (NodeImpl::nextRenderer):
200 2005-02-25 Richard Williamson <rjw@apple.com>
202 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
204 Second pass at fixing 3382926 w/o causing layout regressions. Same concept:
205 if directionality of text's element is RTL and first character has neutral directionality
206 then set the initial directionality to RTL.
210 * khtml/rendering/bidi.cpp:
211 (khtml::RenderBlock::bidiReorderLine):
212 (khtml::RenderBlock::determineStartPosition):
216 2005-02-25 Ken Kocienda <kocienda@apple.com>
220 Roll out Chris' change to fix this bug:
222 <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
224 That code change is responsible for all these new crashers:
226 <rdar://problem/4025177> crash copying safari.apple.com into Blot document
227 <rdar://problem/4025184> crash in DOM::NodeImpl::parentNode copying "New!" from google.com to Blot
228 <rdar://problem/4025214> crash in DOM::NodeImpl::getRect loading paste-match-style-001.html
230 Since we wish to close the tree for a build right now, I am rolling out rather than investigating.
232 * khtml/editing/htmlediting.cpp:
233 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded)
234 (khtml::ReplacementFragment::insertFragmentForTestRendering)
235 (khtml::createDefaultParagraphElement)
236 (khtml::createBlockPlaceholderElement)
237 (khtml::createFontElement)
238 (khtml::createStyleSpanElement)
239 * khtml/editing/htmlediting.h
241 2005-02-25 Ken Kocienda <kocienda@apple.com>
247 <rdar://problem/4020108> Pasting text into message makes Mail crash reproducibly
249 Note that, even with this fix, development build will crash until this bug is fixed:
250 <rdar://problem/4024996> Applying block styles can cause assertion failure in inline style removal
252 This will not crash deployment builds, so I am going to land.
254 * khtml/editing/htmlediting.cpp:
255 (khtml::ApplyStyleCommand::applyBlockStyle): Applying block styles can make the loop to reach beyondEnd
256 fail since the structure of the document can change. Cache the next node first before operating on it,
259 2005-02-25 Vicki Murley <vicki@apple.com>
261 - recommit this change, since rolling it out did NOT fix the performance regression!
263 2005-02-23 Darin Adler <darin@apple.com>
267 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
269 The key was to change things around so that we don't push text from the DOM to the widget
270 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
271 during the blur process.
273 * khtml/html/html_formimpl.cpp:
274 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
275 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
276 new value is set here.
277 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
279 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
280 to true, and also sends out the input event. It's better to have this here than in the renderer code.
281 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
282 m_dirtyvalue) and m_valueMatchesRenderer as false.
283 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
284 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
285 where the value came from.
286 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
287 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
288 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
290 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
291 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
292 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
294 * khtml/rendering/render_form.cpp:
295 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
297 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
299 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
300 (RenderTextArea::handleFocusOut): Ditto.
301 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
302 DOM if valueMatchesRenderer is true.
303 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
305 2005-02-25 Chris Blumenberg <cblu@apple.com>
307 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
311 * khtml/editing/htmlediting.cpp:
312 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
313 (khtml::ReplacementFragment::insertFragmentForTestRendering):
314 (khtml::floatRefdElement):
315 (khtml::createDefaultParagraphElement):
316 (khtml::createBlockPlaceholderElement):
317 (khtml::createFontElement):
318 (khtml::createStyleSpanElement):
319 * khtml/editing/htmlediting.h:
321 2005-02-25 Darin Adler <darin@apple.com>
323 * kwq/character-sets.txt: Checked in updated file. This new file has no effect, because none of the
324 changes affect character sets that we support, but it's good to have the latest file in here, and
325 completely safe because I checked that the generated files have not changed.
327 2005-02-25 Vicki Murley <vicki@apple.com>
331 - back out this change, since it causes a 3.5% performance regression
333 2005-02-23 Darin Adler <darin@apple.com>
337 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
339 The key was to change things around so that we don't push text from the DOM to the widget
340 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
341 during the blur process.
343 * khtml/html/html_formimpl.cpp:
344 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
345 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
346 new value is set here.
347 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
349 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
350 to true, and also sends out the input event. It's better to have this here than in the renderer code.
351 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
352 m_dirtyvalue) and m_valueMatchesRenderer as false.
353 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
354 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
355 where the value came from.
356 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
357 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
358 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
360 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
361 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
362 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
364 * khtml/rendering/render_form.cpp:
365 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
367 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
369 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
370 (RenderTextArea::handleFocusOut): Ditto.
371 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
372 DOM if valueMatchesRenderer is true.
373 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
375 2005-02-25 Darin Adler <darin@apple.com>
379 - fixed <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
381 * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply):
382 Use the insertNodeAfterAndUpdateNodesInserted and insertNodeBeforeAndUpdateNodesInserted
383 functions to add the leading and trailing spaces for smart paste.
385 2005-02-25 David Hyatt <hyatt@apple.com>
387 Back out fix for 3382926, since it breaks LTR text inside RTL contexts.
391 * khtml/rendering/bidi.cpp:
392 (khtml::BidiIterator::direction):
394 2005-02-25 David Hyatt <hyatt@apple.com>
396 Fix for 3975039, scrolling is slow in huge RSS views. Optimize the calculation of clip rects for overflow:hidden
397 layers. Also optimize layer movement when scrolling overflow sections.
401 * khtml/rendering/render_layer.cpp:
403 (ClipRects::operator delete):
405 (RenderLayer::RenderLayer):
406 (RenderLayer::~RenderLayer):
407 (RenderLayer::updateLayerPosition):
408 (RenderLayer::removeOnlyThisLayer):
409 (RenderLayer::insertOnlyThisLayer):
410 (RenderLayer::scrollToOffset):
411 (RenderLayer::hitTest):
412 (RenderLayer::calculateClipRects):
413 (RenderLayer::calculateRects):
414 (RenderLayer::containsPoint):
415 (RenderLayer::clearClipRects):
416 (RenderLayer::clearClipRect):
417 * khtml/rendering/render_layer.h:
418 (khtml::ClipRects::m_refCnt):
419 (khtml::ClipRects::overflowClipRect):
420 (khtml::ClipRects::fixedClipRect):
421 (khtml::ClipRects::posClipRect):
422 (khtml::ClipRects::ref):
423 (khtml::ClipRects::deref):
424 (khtml::RenderLayer::clipRects):
425 * khtml/rendering/render_object.cpp:
426 (RenderObject::setStyle):
428 2005-02-24 Maciej Stachowiak <mjs@apple.com>
430 Reviewed by Darin and Dave a while ago.
432 <rdar://problem/3996685> REGRESSION: Crash in KWQVectorImpl::at loading http://maps.google.com/mapfiles/homepanel.xsl
434 * kwq/WebCoreBridge.mm:
435 (formElementFromDOMElement): Check for isHTMLElement() as well as
436 id() == ID_FORM. This seems like an impossible situation, but
437 papering over it seems more expedient for the time being.
439 2005-02-24 Richard Williamson <rjw@apple.com>
441 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
443 Use mirror characters correctly when rendering with RTL directionality.
447 * khtml/rendering/bidi.cpp:
448 (khtml::BidiIterator::direction):
450 2005-02-24 Richard Williamson <rjw@apple.com>
452 Fixed <rdar://problem/3985889> REGRESSION (125-180): setting <img> src to GIF that already animated does not animate; just shows final frame
456 * WebCore.pbproj/project.pbxproj:
457 * khtml/html/html_imageimpl.cpp:
458 (HTMLImageLoader::updateFromElement):
459 * khtml/rendering/render_image.cpp:
460 (RenderImage::resetAnimation):
461 * khtml/rendering/render_image.h:
462 * khtml/rendering/render_list.cpp:
463 (RenderListMarker::setStyle):
464 (RenderListMarker::paint):
465 * khtml/rendering/render_list.h:
469 (QPixmap::resetAnimation):
470 * kwq/WebCoreImageRenderer.h:
472 2005-02-24 Chris Blumenberg <cblu@apple.com>
474 Fixed: <rdar://problem/4020110> Safari crashes in setAllData while taking a www.zoomerang.com survey
478 * kwq/KWQResourceLoader.mm:
479 (-[KWQResourceLoader finishJobAndHandle:]): clear the job after we've deleted to avoid reentrancy
481 2005-02-24 Darin Adler <darin@apple.com>
485 - fixed <rdar://problem/4023360> REGRESSION (186-187): image file upload is broken at pep.apple.com
487 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::appendFormData): Return true after
488 setting up the form data for an uploaded file. The old code would fall through to the ISINDEX
489 case and send double form data (the filename instead of the file contents the second time).
491 2005-02-24 David Harrison <harrison@apple.com>
495 <rdar://problem/3990849> AX: textMarkerRange for an AXUIElement within an AXWebArea
497 * kwq/KWQAccObject.mm:
498 (-[KWQAccObject textMarkerRange]):
499 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
500 (-[KWQAccObject doAXTextMarkerRangeForUIElement:]):
501 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
502 Added AXTextMarkerRangeForUIElement, or you can send textMarkerRange to the UIElement itself.
504 2005-02-24 David Harrison <harrison@apple.com>
508 <rdar://problem/4004279> 3 AXSelectedTextChanged notifications are firing each time I type a character
510 * khtml/xml/dom_docimpl.cpp:
511 (DocumentImpl::updateSelection):
512 Send notification only if the selection is not null. This safely ignores transitory selections set during editing.
514 2005-02-24 Darin Adler <darin@apple.com>
518 - fixed <rdar://problem/3987619> in some cases, text doesn't resize with Format->Style->Bigger/Smaller
520 * khtml/editing/htmlediting.cpp:
521 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): Only call nodeFullySelected for non-text nodes.
522 Text nodes are already split so they're either in the range and full selected or out of the range.
523 And nodeFullySelected doesn't work for text nodes.
524 (khtml::ApplyStyleCommand::nodeFullySelected): Add an assertion, since this function only works for elements,
526 (khtml::ApplyStyleCommand::nodeFullyUnselected): Ditto.
528 - make big improvement in <rdar://problem/3953636> Mail hung for ~10sec changing font of 84328 characters: khtml::ApplyStyleCommand::nodeFullySelected
530 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints): Improve algorithm based on suggestion
533 - fixed <rdar://problem/4020305> REGRESSION (185-186): loading image in new window using document.write fails
535 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::open): If there is no parent document, don't blow away the base URL.
537 - fixed <rdar://problem/4021701> REGRESSION (188-188+): form not submitted after pressing <return> at http://hrweb.apple.com
539 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchMouseEvent): Send activate event in the case where the event
540 sent is a KHTML_CLICK_EVENT, not CLICK_EVENT.
542 2005-02-23 Kevin Decker <kdecker@apple.com>
546 Fixed <rdar://problem/4020747> REGRESSION: stray </applet> tags crash Safari
548 * khtml/html/htmlparser.cpp:
549 (KHTMLParser::processCloseTag): Made a typesafe check that prevents crashes
550 whenever there is a closing applet tag without an actual <applet> in the first place.
551 Now verifies the current token is ID_APPLET before casting it to an HTMLAppletElementImpl.
554 2005-02-23 Ken Kocienda <kocienda@apple.com>
560 <rdar://problem/3977962> font loses bold style after pasting next to existing text and pressing return
562 * khtml/editing/htmlediting.cpp:
563 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Problem here was
564 that we were doing work in cases where we should not, and content whose style would have
565 been correct if we had done nothing was getting clobbered. It turns out that extra work
566 to apply style to the new paragraph added in this command only needs to be done if we're
567 at the boundaries of a paragraph. Otherwise, content that is moved as part of the work
568 of the command will lend their styles to the new paragraph without any extra work needed.
569 So, make this position check and return unless at a paragraph boundary.
573 * layout-tests/editing/style/block-styles-007-expected.txt
574 * layout-tests/editing/style/block-styles-007.html
576 2005-02-23 Ken Kocienda <kocienda@apple.com>
582 <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a selection starting from end of line once
584 Problem is with the way we figure out whether to add or remove a style based on
585 the current selection. In this case, the code is looking at the end of the
586 previous line, which is not bold, and deduces incorrectly that the operation is
587 a "make bold". Then the style code runs to make bold, but there is nothing on
588 the end of the previous line to embolden, so we get into a cycle where the same
589 thing happens each time cmd-b is hit.
591 * khtml/khtml_part.cpp:
592 (KHTMLPart::selectionComputedStyle): Call editingStartPosition() to get the right position for the font determination.
593 * khtml/xml/dom2_rangeimpl.cpp:
594 (DOM::RangeImpl::editingStartPosition): New helper function that "does the right thing" based on whether the
595 selection is a caret or a range, moving upstream for the former, and downstream for the latter.
596 * khtml/xml/dom2_rangeimpl.h:
597 * kwq/KWQKHTMLPart.mm:
598 (KWQKHTMLPart::fontForSelection): Call editingStartPosition() to get the right position for the font determination.
602 * layout-tests/editing/style/style-boundary-001-expected.txt
603 * layout-tests/editing/style/style-boundary-001.html
604 * layout-tests/editing/style/style-boundary-002-expected.txt
605 * layout-tests/editing/style/style-boundary-002.html
606 * layout-tests/editing/style/style-boundary-003-expected.txt
607 * layout-tests/editing/style/style-boundary-003.html
608 * layout-tests/editing/style/style-boundary-004-expected.txt
609 * layout-tests/editing/style/style-boundary-004.html
611 2005-02-23 Richard Williamson <rjw@apple.com>
613 Fixed <rdar://problem/3985579> 8A367: Dashboard: Stock widget not visible when click remove to remove single char ticker symbol
615 Explicitly remove scroll bar views when removing them from
618 Don't paint synchronously when the scroll position changes,
619 this caused funky clip problems.
623 * khtml/rendering/render_layer.cpp:
624 (RenderLayer::scrollToOffset):
625 (RenderLayer::setHasHorizontalScrollbar):
626 (RenderLayer::setHasVerticalScrollbar):
627 (RenderLayer::updateScrollInfoAfterLayout):
629 2005-02-23 Ken Kocienda <kocienda@apple.com>
635 <rdar://problem/3959996> REGRESSION (Mail): cursor moves to beginning of document when click is past end
637 * khtml/rendering/render_block.cpp:
638 (khtml::RenderBlock::positionForCoordinates): Skip blocks that are invisible or have no height when
639 looking for a child to pass off to. And save away the last visible block with a height to pass off
640 to if there is no child at the right y-coordinate.
642 2005-02-23 David Harrison <harrison@apple.com>
646 <rdar://problem/4010059> BoundsForTextMarkerRange does not update with scrolled web area
648 * kwq/KWQAccObject.mm:
649 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
650 Adjust for scrolling.
652 2005-02-22 Maciej Stachowiak <mjs@apple.com>
656 <rdar://problem/3949790> hitting return after pasted styled line results in extra content getting the style
658 * khtml/editing/htmlediting.cpp:
659 (khtml::InsertParagraphSeparatorCommand::doApply): In the case
660 where the start block is the root, insert the newly created DIV at
661 the end of the root block instead of after the last sibling in the
662 start node, since the start node could be inside other
663 style-affecting nodes and we don't want to reparent its cousins
666 2005-02-23 David Harrison <harrison@apple.com>
670 <rdar://problem/4014691> switch to correctly spelled NSAccessibilityForegroundColorTextAttribute constant
672 Also removed two older, now unneeded, wrappers.
674 * kwq/KWQAccObject.mm:
675 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
676 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
677 Removed these older, now unneeded, wrappers.
679 (NSAccessibilityForegroundColorTextAttributeWrapper):
680 New wrapper for NSAccessibilityForegroundColorTextAttribute.
682 (AXAttributeStringSetStyle):
683 Use NSAccessibilityForegroundColorTextAttributeWrapper.
685 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
686 Remove uses of visiblePositionForStartOfTextMarkerRange and visiblePositionForEndOfTextMarkerRange.
688 2005-02-23 David Harrison <harrison@apple.com>
692 <rdar://problem/3524784> AX hit test doesn't return info when done in empty space of content area
694 * kwq/KWQAccObject.mm:
695 (-[KWQAccObject accessibilityHitTest:]):
696 Return unignored object.
698 2005-02-23 Darin Adler <darin@apple.com>
702 - fixed <rdar://problem/4006509> REGRESSION (171-172): Setting CSS -khtml-user-modify property triggers crash
704 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyProperty):
705 Removed the code that changes the style of the element. This was never needed, and caused the
706 style to be modified while we were iterating it.
708 2005-02-23 Ken Kocienda <kocienda@apple.com>
714 <rdar://problem/3980209> Mail crashed when I pressed Cmd-Shift-[ (nil-deref in ApplyStyleCommand::addBlockStyleIfNeeded)
716 * khtml/editing/htmlediting.cpp:
717 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Reordered the new block
718 insertion so that it come before the move. The logic stays exactly the same, however, with the old
719 ordering, the new block could want to become a child of itself come insertion time. I considered
720 making a more complicated code change to fix this problem, but the simple reordering works just
721 as well, and seems less risky.
723 These all changed in an insignificant way. It seems that with the new code, some empty text nodes
724 got reordered in the document. This has no effect on anything visible to the user.
726 * layout-tests/editing/style/create-block-for-style-003-expected.txt
727 * layout-tests/editing/style/create-block-for-style-004-expected.txt
728 * layout-tests/editing/style/create-block-for-style-009-expected.txt
729 * layout-tests/editing/style/create-block-for-style-011-expected.txt
730 * layout-tests/editing/style/create-block-for-style-013-expected.txt
732 2005-02-23 Darin Adler <darin@apple.com>
736 - fixed <rdar://problem/4013986> REGRESSION (173-174): onclick event not sent when mouse click on checkbox is double-click
738 We need to send an onclick event *and* an ondblclick event when we process a double click.
740 * khtml/khtmlview.cpp: (KHTMLView::dispatchMouseEvent): In the case where we're sending a CLICK_EVENT,
741 follow it by a KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT when handling a double click, and a DOMACTIVATE_EVENT.
742 We no longer do the DOMACTIVATE_EVENT in dispatchGenericEvent.
743 * khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked): send only CLICK_EVENT here, and
744 lets dispatchMouseEvent deal with the other subsequent events.
745 * khtml/xml/dom_nodeimpl.cpp:
746 (NodeImpl::dispatchGenericEvent): Remove the code that sends a DOMACTIVATE_EVENT, since there's no longer
747 a good way to figure out if this is the last event that should be sent before it is.
748 (NodeImpl::dispatchMouseEvent): Set the meta key modifier here (as it already is set elsewhere), and
749 follow up a CLICK_EVENT with KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT, and DOMACTIVATE_EVENT as above.
751 2005-02-23 Darin Adler <darin@apple.com>
755 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
757 The key was to change things around so that we don't push text from the DOM to the widget
758 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
759 during the blur process.
761 * khtml/html/html_formimpl.cpp:
762 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
763 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
764 new value is set here.
765 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
767 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
768 to true, and also sends out the input event. It's better to have this here than in the renderer code.
769 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
770 m_dirtyvalue) and m_valueMatchesRenderer as false.
771 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
772 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
773 where the value came from.
774 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
775 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
776 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
778 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
779 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
780 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
782 * khtml/rendering/render_form.cpp:
783 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
785 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
787 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
788 (RenderTextArea::handleFocusOut): Ditto.
789 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
790 DOM if valueMatchesRenderer is true.
791 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
793 2005-02-22 Richard Williamson <rjw@apple.com>
795 Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions
797 Just set dashboard dirty bit when overflow scrolling changes.
799 Don't do comparison of regions in before scroll regions are
800 added, instead do it in WebKit after automatic scroll regions
805 * khtml/css/cssparser.cpp:
806 (CSSParser::parseDashboardRegions): Cleaned up comments
807 * khtml/css/cssstyleselector.cpp:
808 (khtml::CSSStyleSelector::styleForElement): Cleaned up comments
810 * khtml/khtmlview.cpp:
811 (KHTMLView::updateDashboardRegions):
812 * khtml/rendering/render_layer.cpp:
813 (RenderLayer::updateScrollInfoAfterLayout):
814 * kwq/WebDashboardRegion.m:
815 (-[WebDashboardRegion isEqual:]):
817 2005-02-22 Chris Blumenberg <cblu@apple.com>
819 Fixed: <rdar://problem/3976872> Pasted plain text doesn't get the proper style if pasted into newlines
823 * khtml/editing/htmlediting.cpp:
824 (khtml::ReplaceSelectionCommand::doApply): don't clear the typing style when matching style
825 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply the typing style when matching style
826 * khtml/editing/jsediting.cpp:
827 * khtml/khtml_part.cpp:
828 (KHTMLPart::pasteAndMatchStyle): new
829 * khtml/khtml_part.h:
830 * kwq/KWQKHTMLPart.h:
831 * kwq/KWQKHTMLPart.mm:
832 (KWQKHTMLPart::issuePasteAndMatchStyleCommand): new
833 * kwq/WebCoreBridge.h:
834 * layout-tests/editing/editing.js:
836 2005-02-22 Darin Adler <darin@apple.com>
840 - fixed <rdar://problem/4006596> REGRESSION (183-184): crash in DOM::DocumentImpl::setFocusNode(DOM::NodeImpl*)
842 * khtml/xml/dom_docimpl.cpp:
843 (widgetForNode): Added helper.
844 (DocumentImpl::setFocusNode): Re-get the widget for the node after calling updateLayout.
845 The updateLayout can destroy the old widget, so we can't keep a stale widget pointer around.
847 2005-02-22 Ken Kocienda <kocienda@apple.com>
853 <rdar://problem/4003463> Mail.app HTML uses inline styling markup not understood by Entourage and Eudora
855 * khtml/editing/htmlediting.cpp:
856 (khtml::isEmptyFontTag): Helper for removing <font> tags.
857 (khtml::StyleChange::styleModeForParseMode): Helper to map a document parse mode to a use/don't use
858 legacy-html-styles value.
859 (khtml::StyleChange::checkForLegacyHTMLStyleChange): Add support for colors, font faces, and font sizes.
860 (khtml::ApplyStyleCommand::isHTMLStyleNode):
861 (khtml::ApplyStyleCommand::removeHTMLFontStyle):
862 (khtml::ApplyStyleCommand::applyTextDecorationStyle): Now call styleModeForParseMode to determine
863 whether to use legacy html styles or not.
864 (khtml::ApplyStyleCommand::removeInlineStyle): Now properly removes <font> styles.
865 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
866 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
867 (khtml::createFontElement): Helper for applying <font> elements.
868 * khtml/editing/htmlediting.h: All the following support the new bits of data we need to store.
869 (khtml::StyleChange::applyFontColor)
870 (khtml::StyleChange::applyFontFace)
871 (khtml::StyleChange::applyFontSize)
872 (khtml::StyleChange::fontColor)
873 (khtml::StyleChange::fontFace)
874 (khtml::StyleChange::fontSize)
876 Test results updated now that we will write out <font> tags for quirks mode documents.
878 * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt
879 * layout-tests/editing/style/block-style-004-expected.txt
880 * layout-tests/editing/editing/pasteboard/paste-text-011-expected.txt
881 * layout-tests/editing/style/block-style-005-expected.txt
882 * layout-tests/editing/style/block-style-006-expected.txt
883 * layout-tests/editing/style/smoosh-styles-001-expected.txt
884 * layout-tests/editing/style/smoosh-styles-002-expected.txt
886 2005-02-22 Maciej Stachowiak <mjs@apple.com>
890 <rdar://problem/4017066> crash in KJS::ValueImp::dispatchType() every time I load www.nytimes.com/pages/automobiles
892 When creating option elements, use lowercase "option" instead of
893 uppercase "OPTION" to create option elements, because only
894 lowercase works for XHTML.
896 * khtml/ecma/kjs_html.cpp:
897 (KJS::HTMLSelectCollection::tryPut):
898 (OptionConstructorImp::construct):
900 2005-02-22 Chris Blumenberg <cblu@apple.com>
902 WebCore fix for: <rdar://problem/3918056> Mail not line breaking my <pre> formatted emails on replies
904 Mail must 4018993 to fully address the problem.
906 Reviewed by kocienda.
908 * khtml/editing/markup.cpp:
909 (khtml::startMarkup): don't compute style for text in PRE tags
910 (khtml::createMarkup): include PRE if it is an ancestor of the nodes in the range
912 2005-02-21 Richard Williamson <rjw@apple.com>
914 Fixed <rdar://problem/4008338> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
916 There was a long standing bug in cssText(). Double value were always cast int! So,
917 opacity values values were incorrectly converted to text, i.e. 0.75 became 0.
919 The problem was newly triggered because we parse the css for opacity *TWICE*. This is a result of
920 incorrectly "invalidating" the style attribute (from fix for 3790449). The second parse was from
921 the cssText() of the style.
925 * khtml/css/css_valueimpl.cpp:
926 (DOM::CSSPrimitiveValueImpl::cssText):
928 2005-02-21 David Hyatt <hyatt@apple.com>
930 Fix for 4017204, apply the same fix to the base class nodeAtPoint that was already applied to RenderBlock.
931 Skip elements with layers and inline flows. Demoted <form>s can end up causing trouble otherwise.
933 Reviewed by Richard Williamson
935 * khtml/rendering/render_box.cpp:
936 (RenderBox::nodeAtPoint):
938 2005-02-21 David Hyatt <hyatt@apple.com>
940 Fix for 4017033, CSS is being parsed twice. Make sure to always validate the style attribute when it is
941 initially parsed. Add code to clean up decls when the style attribute is completely removed. Add a new
942 synchronizing boolean that avoids reparsing the style declaration when the attribute is simply
943 being synced up to the declaration.
947 * khtml/css/css_valueimpl.cpp:
948 (DOM::CSSMutableStyleDeclarationImpl::setChanged):
949 * khtml/html/html_elementimpl.cpp:
950 (HTMLElementImpl::invalidateStyleAttribute):
951 (HTMLElementImpl::updateStyleAttributeIfNeeded):
952 (HTMLElementImpl::HTMLElementImpl):
953 (HTMLElementImpl::~HTMLElementImpl):
954 (HTMLElementImpl::destroyInlineStyleDecl):
955 (HTMLElementImpl::mapToEntry):
956 (HTMLElementImpl::parseHTMLAttribute):
957 * khtml/html/html_elementimpl.h:
958 * khtml/xml/dom_elementimpl.cpp:
959 (ElementImpl::ElementImpl):
960 (ElementImpl::setAttribute):
961 * khtml/xml/dom_elementimpl.h:
962 (DOM::ElementImpl::updateStyleAttributeIfNeeded):
966 2005-02-21 Darin Adler <darin@apple.com>
968 - fixed Panther deployment build
970 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Put more stuff inside #if.
972 2005-02-21 David Harrison <harrison@apple.com>
976 <rdar://problem/3943090> REGRESSION (Mail): Spelling underline incompletely erased following certain steps
978 * khtml/rendering/render_text.cpp:
979 (InlineTextBox::paintMarker):
980 Make sure underline is placed within the text bounds.
984 (QPainter::misspellingLineThickness):
985 * kwq/WebCoreTextRenderer.h:
986 Add misspellingLineThickness for use by InlineTextBox::paintMarker.
988 2005-02-21 Darin Adler <darin@apple.com>
992 - fixed <rdar://problem/4012978> -[DOMRange markupString] crashes when range contains only a text node with a single space
994 * khtml/editing/markup.cpp: (khtml::createMarkup): Added updateLayout calls, and added a missing
997 2005-02-21 Darin Adler <darin@apple.com>
1001 - fixed <rdar://problem/4005435> Safari hung while pasting text into a <textarea> (Panther-only)
1003 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Don't setAutohidesScrollers:YES on Panther.
1005 2005-02-21 Ken Kocienda <kocienda@apple.com>
1011 <rdar://problem/4015499> REGRESSION (186-187): pasted quoted text starting with a blank line increases quote level of pasted text when pasted
1013 * khtml/editing/markup.cpp:
1014 (khtml::markup): Changed over to ASSERT instead of assert.
1015 (khtml::createMarkup): The issue was that the code to add parents all the way back to the common ancestor
1016 block did not check for blocks whose markup had already been added, and could result in adding markup for
1017 nodes twice (hence the additional and erroneous quote level). Now there is a new check that will
1018 only add markup for those nodes before the start of the selection range. This fixes the bug.
1019 (khtml::createFragmentFromMarkup): Changed over to ASSERT instead of assert.
1020 (khtml::createFragmentFromText): Ditto.
1022 2005-02-21 Ken Kocienda <kocienda@apple.com>
1028 <rdar://problem/4015494> REGRESSION (186-187) <cr> removed if quoted word is copy/pasted on line immediately above quoted text
1030 * khtml/editing/htmlediting.cpp:
1031 (khtml::ReplaceSelectionCommand::doApply): Relatively new check designed to remove a <br> element when
1032 that element was on a line by itself did not do an adequate check for this condition, causing the
1033 failure described in the bug. Fixed.
1035 2005-02-19 Ken Kocienda <kocienda@apple.com>
1039 * khtml/editing/htmlediting.cpp:
1040 (khtml::matchNearestBlockquoteColorString): New function which abstracts away the CSS property we use
1041 for this pseudo-color.
1042 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Set the new nearestBlockquoteColorString
1043 psuedo-color here, rather than removing colors as was done before.
1044 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): Check for the pseudo-color in the desired
1045 style, and determine the real color based on the nearest blockquote (or none) to the node.
1046 (khtml::nearestMailBlockquote): Name change from closestMailBlockquote to match new property better.
1048 All the rest of this change is the mechanical coding you need to do to add a new CSS property, in this
1049 case, -khtml-match-nearest-mail-blockquote-color.
1051 * khtml/css/css_computedstyle.cpp:
1052 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue)
1053 * khtml/css/cssparser.cpp:
1054 (CSSParser::parseValue):
1055 * khtml/css/cssproperties.c:
1058 * khtml/css/cssproperties.h:
1059 * khtml/css/cssproperties.in:
1060 * khtml/css/cssstyleselector.cpp:
1061 (khtml::CSSStyleSelector::applyProperty)
1062 * khtml/css/cssvalues.c:
1064 * khtml/css/cssvalues.h:
1065 * khtml/css/cssvalues.in:
1066 * khtml/rendering/render_style.h:
1067 (khtml::RenderStyle::matchNearestMailBlockquoteColor)
1068 (khtml::RenderStyle::setMatchNearestMailBlockquoteColor)
1069 (khtml::RenderStyle::initialMatchNearestMailBlockquoteColor)
1071 2005-02-19 Ken Kocienda <kocienda@apple.com>
1077 <rdar://problem/4014228> REGRESSION (186-187) extra, uneditable lines inserted above and below a line of pasted quoted text
1078 <rdar://problem/4014393> REGRESSION (186-187) pasted quoted text gets extra <cr>s when pasted at top of document
1080 * khtml/editing/htmlediting.cpp:
1081 (khtml::ReplacementFragment::ReplacementFragment): Part of a general refactoring of how
1082 the fragment is inserted into the document, rendered, and then tested for certain
1083 important pieces of information that are required for pasting.
1084 (khtml::ReplacementFragment::insertFragmentForTestRendering): New helper. Handles inserting
1085 the fragment nodes into the document.
1086 (khtml::ReplacementFragment::restoreTestRenderingNodesToFragment): Removes nodes from the
1087 document, and restores them to the fragment.
1088 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Factored out code that
1089 did this before into its own function.
1090 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
1091 (khtml::ReplacementFragment::countRenderedBlocks): This is a real improvement, as it
1092 eliminates a major use of the isProbablyBlock() function. Now, the blocks that are
1093 counted are real, rendered blocks.
1094 (khtml::ReplacementFragment::removeStyleNodes): Made this function retain margin-zeroing
1095 CSS properties on paragraphs. This does two things: 1) It helps us to maintain good behavior
1096 in the short term while there are still versions of Mail out there that use <p> elements
1097 instead of <div> elements for new paragraphs; and 2) It will help to maintain the compatibility
1098 with other mail clients that use <p> elements for their paragraphs but render them themselves
1099 with no margins as the result of quirks.
1100 (khtml::ReplaceSelectionCommand::doApply): Do some work to fix up and improve the handling
1101 of blank lines, be they <p> elements or <br> elements, that can be removed after pasting. This,
1102 coupled with the refactoring, fixes 4014393.
1103 * khtml/editing/htmlediting.h: Updated for new functions.
1104 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Updated results, actually improved with this change.
1105 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Ditto.
1107 2005-02-19 Kevin Decker <kdecker@apple.com>
1111 Fixed <rdar://problem/4010765> Flash player can be used to arbitrarily open popup windows without user permission
1113 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.
1115 * kwq/WebCoreBridge.h:
1116 * kwq/WebCoreBridge.mm:
1117 (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Changed this to invoke the new stringByEvaluatingJavaScriptFromString:forceUserGesture method below.
1118 (-[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.
1120 2005-02-18 Chris Blumenberg <cblu@apple.com>
1122 Fixed: <rdar://problem/3951196> REGRESSION (Mail): too many levels of reply quotes after certain steps
1124 Reviewed by kocienda.
1126 * khtml/editing/htmlediting.cpp:
1127 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1128 - 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.
1129 - Build up the list of ancestors after we've determined the actual topBlockquote.
1130 - Don't insert an extra new line if there is a new start node.
1132 2005-02-19 Chris Blumenberg <cblu@apple.com>
1134 Fixed: <rdar://problem/3978461> smart paste is broken
1138 * khtml/editing/htmlediting.cpp:
1139 (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.
1141 2005-02-18 Adele Amchan <adele@apple.com>
1145 Fix for <rdar://problem/3975568> REGRESSION(125-180)Australian Open pages have drawing problem
1147 This patch fixes two problems caused by our added support for custom tags. First, the layout problem at the sites mentioned in the bug
1148 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.
1149 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
1150 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
1151 endTagArray and tagPriorityArray.
1153 * khtml/html/dtd.h: changed all uses of the endTag array to endTagArray for our new wrapper functions
1154 (DOM::tagPriority): added function to check array bounds and to treat custom tags as spans
1155 (DOM::endTagRequirement): added function to check array bounds and to treat custom tags as spans
1156 * khtml/html/dtd.cpp: changed name of endTag and tagPriority arrays to endTagArray and tagPriorityArray
1157 (DOM::checkChild): treat custom tags as spans during this check
1158 * khtml/html/html_elementimpl.cpp: changed all uses of the endTag array to the endTagRequirement function
1159 (HTMLElementImpl::createContextualFragment):
1160 (HTMLElementImpl::setInnerText):
1161 (HTMLElementImpl::setOuterText):
1162 (HTMLElementImpl::toString):
1163 * 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.
1164 (KHTMLParser::parseToken):
1165 (KHTMLParser::insertNode):
1166 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): changed all uses of the endTag array to the endTagRequirement function
1167 * khtml/editing/markup.cpp: changed all uses of the endTag array to the endTagRequirement function
1171 2005-02-18 Jens Alfke <jens@apple.com>
1175 Fixed build: Whoops, setNeedsLayout's parameter is NOT optional.
1177 * khtml/html/html_objectimpl.cpp:
1178 (HTMLAppletElementImpl::setAllParamsAvailable):
1180 2005-02-18 Jens Alfke <jens@apple.com>
1182 Reviewed by cblu, hyatt.
1184 Fixes <rdar://problem/3603191> "REGRESSION: Applets not receiving all of the Applet Parameters in Java 1.4.1/1.4.2"
1185 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.
1187 * khtml/html/html_objectimpl.cpp:
1188 (HTMLAppletElementImpl::HTMLAppletElementImpl):
1189 (HTMLAppletElementImpl::getAppletInstance):
1190 (HTMLAppletElementImpl::setAllParamsAvailable):
1191 (HTMLAppletElementImpl::allParamsAvailable):
1192 * khtml/html/html_objectimpl.h:
1193 * khtml/html/htmlparser.cpp:
1194 (KHTMLParser::processCloseTag):
1195 * khtml/rendering/render_applet.cpp:
1196 (RenderApplet::createWidgetIfNecessary):
1198 2005-02-18 Richard Williamson <rjw@apple.com>
1200 Fixed <rdar://problem/4006161> Tiger8A380: Widgets leak dashboard regions
1202 We were leaking the DashboardRegionImpls.
1206 * khtml/css/css_valueimpl.cpp:
1207 (DOM::CSSPrimitiveValueImpl::cleanup):
1209 2005-02-18 Chris Blumenberg <cblu@apple.com>
1211 Fixed: <rdar://problem/3945271> REGRESSION (Mail): pasted plain text should pick up typing style instead of being unstyled
1213 Reviewed by kocienda.
1215 * khtml/editing/htmlediting.cpp:
1216 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): don't set class on element returned by createStyleSpanElement since that's already done
1217 (khtml::ReplacementFragment::ReplacementFragment): take matchStyle param, don't call computeStylesAndRemoveUnrendered() if !matchStyle
1218 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take matchStyle param
1219 (khtml::ReplaceSelectionCommand::doApply): if m_matchStyle, use selection.start() as the insertion position and don't call applyStyleToInsertedNodes()
1220 * khtml/editing/htmlediting.h:
1221 * kwq/WebCoreBridge.h:
1222 * kwq/WebCoreBridge.mm:
1223 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): take matchStyle param and pass it
1224 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): pass NO for matchStyle
1225 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): pass NO for matchStyle
1226 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): pass YES for matchStyle
1228 2005-02-18 Ken Kocienda <kocienda@apple.com>
1234 <rdar://problem/4013025> Copy/Paste of quoted word results in removal of any following <cr>
1235 <rdar://problem/4013100> Copy/Paste quoted text and then decrease quote level does not change text color
1237 For the most part, these bugs were caused by errors and lack of foresight on my part when
1238 I added the better paste code. Chalk these fixes up to the result of bake time.
1240 * khtml/editing/htmlediting.cpp:
1241 (khtml::ReplacementFragment::ReplacementFragment): Need to move count of number of blocks in
1242 fragment after the call to remove unrendered nodes. Meant to do this before, but forgot to.
1243 (khtml::ReplacementFragment::removeStyleNodes): Need to remove inline styles from elements!
1244 Terrible omission now fixed.
1245 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Remove blockquote colors for now.
1246 Code has a more extensive comment in it now to explain the difficulty, and the need for more
1248 (khtml::ReplaceSelectionCommand::doApply): Need to call applyStyleToInsertedNodes() in the
1249 m_fragment.hasInterchangeNewline() case. This was just missed before.
1250 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Updated results, subtly different, but OK.
1251 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Updated for <p> to <div> change in test content.
1252 * layout-tests/editing/pasteboard/paste-text-017.html: Needed to change <p> to <div> to
1253 make this test go with the new design of using <div> tags for default paragraphs.
1255 2005-02-18 David Hyatt <hyatt@apple.com>
1257 Fix for 3974263 (and possibly others). Don't let fixed tables use maxint as their maxwidth when some
1258 cells have percentage values.
1260 Reviewed by kocienda
1262 * khtml/misc/arena.cpp:
1264 * khtml/rendering/table_layout.cpp:
1265 (FixedTableLayout::calcWidthArray):
1266 (FixedTableLayout::calcMinMaxWidth):
1267 (AutoTableLayout::layout):
1269 2005-02-17 Darin Adler <darin@apple.com>
1273 - fixed <rdar://problem/3998627> WebKit crashes when deleting text in a modified div
1275 * khtml/khtml_part.cpp: (KHTMLPart::selectionComputedStyle): Add a ref and deref to keep
1276 the element alive until it's added to the DOM tree.
1277 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::styleForSelectionStart): Ditto.
1279 2005-02-17 Richard Williamson <rjw@apple.com>
1281 Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead
1283 Fixed w/o introducing a performance regression. Add early
1284 check for Osaka-Mono to avoid expensive call into WebKit.
1289 (QFont::isFixedPitch):
1291 2005-02-17 Darin Adler <darin@apple.com>
1295 - fixed <rdar://problem/4011210> REGRESSION (180-181): Maxlength property for INPUT object not working
1297 * kwq/KWQTextField.mm:
1298 (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): If controller returns
1299 YES, go on to call super, since super does the text formatter handling, which we need.
1300 (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
1301 (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
1305 2005-02-17 Ken Kocienda <kocienda@apple.com>
1311 <rdar://problem/4012058> Copy from quoted text and paste results in blue text
1313 The relatively-new paste code tries hard to retain style of the content from the
1314 source location. However, in the case of quoted material in mail messages, we do
1315 not want to carry the quoting color along. This fixes the problem by factoring
1318 * khtml/editing/htmlediting.cpp:
1319 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Now calls removeBlockquoteColorsIfNeeded()
1321 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): New function. Factors out colors that are
1322 the result of text being quoted.
1323 (khtml::isNodeRendered): Function moved in file. No other change.
1324 (khtml::isProbablyBlock): Function moved in file. No other change.
1325 (khtml::closestMailBlockquote): New function. Helps fix bug.
1326 (khtml::isMailBlockquote): Function moved to be free-floating instead of being a
1327 member of CompositeEditCommand. No other change.
1328 * khtml/editing/htmlediting.h: Moved around some functions. Added removeBlockquoteColorsIfNeeded().
1329 * khtml/editing/markup.cpp: Remove redundant static implementation of isMailBlockquote.
1331 2005-02-17 Richard Williamson <rjw@apple.com>
1333 Fixed <rdar://problem/4008163> dynamic support for -apple-dashboard-region is flakey
1335 Style operator== wasn't including regions.
1339 * khtml/rendering/render_style.cpp:
1340 (StyleCSS3NonInheritedData::operator==):
1342 2005-02-17 Adele Amchan <adele@apple.com>
1346 fix for <rdar://problem/4010028> 8A383: Safari v185 crash loading united.com multi city fare finder page.
1348 * khtml/dom/dom_string.cpp: (DOM::DOMString::operator += ): prevent nil dereference when DOMString being added is nil
1350 2005-02-17 Jens Alfke <jens@apple.com>
1354 Fix for rdar://3963151 "Mail only pasted ~950 of 1407 text lines into my message!"
1355 Force tokenizer to run synchronously while parsing document fragments, so it doesn't stop halfway through and cause truncated content.
1357 * khtml/html/html_elementimpl.cpp:
1358 (HTMLElementImpl::createContextualFragment):
1359 * khtml/html/htmltokenizer.cpp:
1360 (khtml::HTMLTokenizer::reset):
1361 (khtml::HTMLTokenizer::begin):
1362 (khtml::HTMLTokenizer::setForceSynchronous):
1363 (khtml::HTMLTokenizer::continueProcessing):
1364 * khtml/html/htmltokenizer.h:
1366 2005-02-17 Ken Kocienda <kocienda@apple.com>
1372 <rdar://problem/3982183> Mail's HTML paragraphs appear with unintended margins in Entourage and Eudora
1374 * khtml/editing/htmlediting.cpp:
1375 (khtml::createDefaultParagraphElement): Change element we make from <p> to <div>.
1376 This fixes the problem, as these other mailers show <div> elements without margins.
1378 Some test files needed to change to preserve the ability to "eyeball" the results.
1379 Many others changed just because their <p> elements changed to <div> elements.
1381 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt
1382 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt
1383 * layout-tests/editing/inserting/insert-div-013-expected.txt
1384 * layout-tests/editing/inserting/insert-div-013.html
1385 * layout-tests/editing/inserting/insert-div-014-expected.txt
1386 * layout-tests/editing/inserting/insert-div-014.html
1387 * layout-tests/editing/inserting/insert-div-018-expected.txt
1388 * layout-tests/editing/inserting/insert-div-018.html
1389 * layout-tests/editing/inserting/insert-div-019-expected.txt
1390 * layout-tests/editing/inserting/insert-div-019.html
1391 * layout-tests/editing/inserting/insert-div-020-expected.txt
1392 * layout-tests/editing/inserting/insert-div-020.html
1393 * layout-tests/editing/inserting/insert-div-021-expected.txt
1394 * layout-tests/editing/inserting/insert-div-021.html
1395 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
1396 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
1397 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt
1398 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt
1400 2005-02-17 Ken Kocienda <kocienda@apple.com>
1406 <rdar://problem/3996737> REGRESSION (Mail): Copy/paste in Mail inserts returns
1408 The root cause of the problem is that a couple of pieces of code in AppKit and Mail
1409 insert newlines into markup as it is generated, and the paste code in WebCore was
1410 not smart about nodes that do not render (as is the case with these added newlines).
1411 So, the solution is to remove these unrendered nodes in the paste code in a pre-pass.
1412 Fortunately, my recent addition of such a pass to the paste code to handle styles
1413 gave me a convenient place to put this new logic.
1415 * khtml/editing/htmlediting.cpp:
1416 (khtml::ReplacementFragment::ReplacementFragment): Use new name for function below.
1417 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Name change from computeStylesForNodes().
1418 Now does the additional work of removing unrendered nodes, as mentioned above.
1419 (khtml::isNodeRendered): New helper function.
1420 * khtml/editing/htmlediting.h: Updated as necessary.
1422 2005-02-17 Ken Kocienda <kocienda@apple.com>
1428 <rdar://problem/3998892> REGRESSION (Mail): bolding a selection from end of line changes unselected text on starting line.
1430 The styling code did not move to the next node when the starting position was
1431 at the last offset of a node. Instead, it styled it. Clearly wrong. Solution
1432 is to borrow a check from the delete algorithm. Though I call caretMaxOffset(),
1433 which I consider deprecated, it is still the simplest and most strightforward
1434 way to ask the right question for this kind of problem.
1436 * khtml/editing/htmlediting.cpp:
1437 (khtml::ApplyStyleCommand::applyInlineStyle): Fixed, as described above.
1438 * layout-tests/editing/style/style-3998892-fix-expected.txt: Added.
1439 * layout-tests/editing/style/style-3998892-fix.html: Added.
1441 2005-02-16 Chris Blumenberg <cblu@apple.com>
1443 Fixed: <rdar://problem/3954842> Forward/reply to an HTML email can result in nothing (in cases with <link> tags for CSS)
1447 * khtml/xml/dom_nodeimpl.cpp:
1448 (NodeBaseImpl::addChild): don't call insertedIntoDocument on the added child if "this" itself is not in the document.
1450 2005-02-16 John Sullivan <sullivan@apple.com>
1452 Written by Darin, reviewed by Maciej and me
1454 - change required to make previous checkin work with English language RSS pages
1457 new private method isHierarchical
1460 add hierarchical base URL check when determining whether the URL is absolute
1461 (KURL::isHierarchical):
1462 new method, returns true if this is a valid URL with a slash just past the scheme's trailing colon
1464 2005-02-16 John Sullivan <sullivan@apple.com>
1466 Written by Darin, reviewed by me.
1468 - WebCore part of fix for <rdar://problem/4007384>
1469 FILTER: Bookmark of RSS with Japanese search word & multiple RSS pages loses filter
1472 (-[DOMElement _getURLAttribute:]):
1473 new SPI method, uses parseURL and completeURL to get valid URL from attribute value
1476 declare new SPI method
1478 2005-02-15 Maciej Stachowiak <mjs@apple.com>
1482 <rdar://problem/3942428> reproducible crash loading cbs.sportsline.com
1484 This change reverts the fix for <rdar://problem/3805311>, and
1485 re-fixes it in a different (better) way. Instead of preventing
1486 programmatic open from setting the parsing flag, instead make sure
1487 that programmatic close resets it.
1489 * khtml/khtml_part.cpp:
1490 (KHTMLPart::openURL):
1491 (KHTMLPart::didExplicitOpen):
1492 (KHTMLPart::closeURL):
1495 (KHTMLPart::endIfNotLoading):
1496 (KHTMLPart::slotFinishedParsing):
1497 (KHTMLPart::checkEmitLoadEvent):
1498 * khtml/khtml_part.h:
1499 * khtml/khtmlpart_p.h:
1500 (KHTMLPartPrivate::KHTMLPartPrivate):
1501 * khtml/xml/dom_docimpl.cpp:
1502 (DocumentImpl::open):
1503 (DocumentImpl::implicitOpen):
1504 (DocumentImpl::close):
1505 (DocumentImpl::implicitClose):
1506 * khtml/xml/dom_docimpl.h:
1508 2005-02-15 David Harrison <harrison@apple.com>
1512 <rdar://problem/3933665> smart delete seems to delete too much after expanding selection with arrow keys
1514 Fixed by updating the selection granularity. Only byWord granularity enables smart delete, but in this
1515 case the granularity changed from byWord to byCharacter.
1517 * khtml/khtml_part.cpp:
1518 (KHTMLPart::setSelectionGranularity):
1519 * khtml/khtml_part.h:
1520 * kwq/WebCoreBridge.mm:
1521 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
1522 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
1523 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
1525 2005-02-15 David Harrison <harrison@apple.com>
1529 (continued) <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
1531 This was supposed have been committed yesterday with the other part of the fix, but was not.
1533 * khtml/editing/visible_units.cpp:
1536 2005-02-15 Ken Kocienda <kocienda@apple.com>
1542 <rdar://problem/3951178> REGRESSION (Mail): blank line lost after pasting as quotation
1544 Problem was that the blank line after the selection was getting deleted incorrectly since the
1545 paste code thought this was an unneeded placeholder rather than a placeholder outside of the
1548 * khtml/editing/htmlediting.cpp:
1549 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now calls findBlockPlaceholder.
1550 (khtml::CompositeEditCommand::findBlockPlaceholder): Moved finding code formerly in
1551 removeBlockPlaceholderIfNeeded to this new helper.
1552 (khtml::ReplaceSelectionCommand::doApply): Do not delete placeholder up front. Call
1553 findBlockPlaceholder, and delete it later if needed in the already-existing cleanup step.
1554 * khtml/editing/htmlediting.h: Add new function.
1558 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Added.
1559 * layout-tests/editing/pasteboard/paste-text-017.html: Added.
1561 Result changed for the better.
1563 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
1565 2005-02-14 David Harrison <harrison@apple.com>
1569 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
1573 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
1575 * khtml/editing/visible_text.cpp:
1576 (khtml::SimplifiedBackwardsTextIterator::advance):
1577 Add BR in for <rdar://problem/3917929> fix only if leaving a visible text node.
1579 * khtml/editing/visible_units.cpp:
1581 Do not move left over a paragraph boundary.
1583 2005-02-14 Darin Adler <darin@apple.com>
1587 - fixed <rdar://problem/3686434> Safari uses too much RAM on file upload, leading to malloc errors and crashes (HP printers)
1589 * khtml/html/html_formimpl.cpp:
1590 (DOM::FormDataList::begin): Updated to use a list of FormDataListItem instead of QCString.
1591 (DOM::FormDataList::end): Ditto.
1592 (DOM::HTMLFormElementImpl::formData): Same here, and also use appendFile rather than appendData
1593 when we encounter a path name rather than data.
1594 (DOM::HTMLInputElementImpl::appendFormData): Use appendFile here rather than reading the file
1595 in; the reading now happens inside WebKit.
1596 (DOM::FormDataList::appendString): Updated for FormDataListItem.
1597 (DOM::FormDataList::appendFile): Added.
1599 * ForwardingHeaders/kfileitem.h: Emptied out the file; no longer includes KWQKFileItem.h.
1600 * ForwardingHeaders/netaccess.h: Emptied out the file; no longer includes KWQKIONetAccess.h.
1601 * kwq/KWQKFileItem.h: Removed.
1602 * kwq/KWQKFileItem.mm: Removed.
1603 * kwq/KWQKIONetAccess.h: Removed.
1604 * kwq/KWQKIONetAccess.mm: Removed.
1605 * WebCore.pbproj/project.pbxproj: Removed the 4 files above.
1607 - small unrelated fix (not reviewed by John)
1609 * khtml/ecma/kjs_window.cpp: (Window::isSafeScript): Put some logging code outside if statements so it works all the time.
1611 2005-02-14 David Harrison <harrison@apple.com>
1615 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
1617 Fixed nextLinePosition to calculate affinity rather than take it as a parameter. Propagated the parameter change out to related methods.
1619 * khtml/editing/htmlediting.cpp:
1620 (khtml::DeleteSelectionCommand::initializePositionData):
1621 (khtml::InsertLineBreakCommand::doApply):
1622 (khtml::InsertParagraphSeparatorCommand::doApply):
1623 (khtml::InsertTextCommand::input):
1624 (khtml::ReplaceSelectionCommand::doApply):
1625 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes):
1626 * khtml/editing/selection.cpp:
1627 (khtml::Selection::modifyExtendingRightForward):
1628 (khtml::Selection::modifyMovingRightForward):
1629 (khtml::Selection::modifyExtendingLeftBackward):
1630 (khtml::Selection::modifyMovingLeftBackward):
1631 (khtml::Selection::modify):
1632 (khtml::Selection::validate):
1633 * khtml/editing/visible_position.cpp:
1634 (khtml::visiblePositionsOnDifferentLines):
1635 * khtml/editing/visible_units.cpp:
1636 (khtml::rootBoxForLine):
1637 (khtml::startOfLine):
1639 (khtml::inSameLine):
1640 (khtml::isStartOfLine):
1641 (khtml::isEndOfLine):
1642 (khtml::previousLinePosition):
1643 (khtml::nextLinePosition):
1644 (khtml::previousSentencePosition):
1645 (khtml::nextSentencePosition):
1646 (khtml::previousParagraphPosition):
1647 (khtml::nextParagraphPosition):
1648 * khtml/editing/visible_units.h:
1649 * khtml/khtml_events.cpp:
1650 (khtml::MouseEvent::offset):
1651 * khtml/khtml_part.cpp:
1652 (KHTMLPart::isPointInsideSelection):
1653 (KHTMLPart::selectClosestWordFromMouseEvent):
1654 (KHTMLPart::handleMousePressEventTripleClick):
1655 (KHTMLPart::handleMousePressEventSingleClick):
1656 (KHTMLPart::handleMouseMoveEventSelection):
1657 (KHTMLPart::khtmlMouseReleaseEvent):
1658 * khtml/rendering/render_block.cpp:
1659 (khtml::RenderBlock::positionForCoordinates):
1660 * khtml/rendering/render_block.h:
1661 * khtml/rendering/render_br.cpp:
1662 (RenderBR::positionForCoordinates):
1663 * khtml/rendering/render_br.h:
1664 * khtml/rendering/render_container.cpp:
1665 (RenderContainer::positionForCoordinates):
1666 * khtml/rendering/render_container.h:
1667 * khtml/rendering/render_inline.cpp:
1668 (RenderInline::positionForCoordinates):
1669 * khtml/rendering/render_inline.h:
1670 * khtml/rendering/render_object.cpp:
1671 (RenderObject::caretRect):
1672 (RenderObject::positionForCoordinates):
1673 * khtml/rendering/render_object.h:
1674 * khtml/rendering/render_replaced.cpp:
1675 (RenderReplaced::positionForCoordinates):
1676 * khtml/rendering/render_replaced.h:
1677 * khtml/rendering/render_text.cpp:
1678 (RenderText::positionForCoordinates):
1679 * khtml/rendering/render_text.h:
1680 * khtml/xml/dom_position.cpp:
1681 (DOM::Position::previousCharacterPosition):
1682 (DOM::Position::nextCharacterPosition):
1683 (DOM::Position::leadingWhitespacePosition):
1684 (DOM::Position::trailingWhitespacePosition):
1685 * khtml/xml/dom_position.h:
1686 * kwq/KWQAccObject.mm:
1687 (-[KWQAccObject value]):
1688 (-[KWQAccObject accessibilityAttributeValue:]):
1689 (-[KWQAccObject doAXLineForTextMarker:]):
1690 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
1691 (-[KWQAccObject doAXTextMarkerForPosition:]):
1692 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
1693 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
1694 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
1695 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
1696 * kwq/KWQKHTMLPart.mm:
1697 * kwq/WebCoreBridge.mm:
1698 (-[WebCoreBridge _visiblePositionForPoint:]):
1700 05-02-07 Maciej Stachowiak <mjs@apple.com>
1702 Reviewed by Ken and John.
1704 Re-fixed a specific case of the following:
1706 <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
1708 Oddly, Cmd-B, Cmd-U, type some text, return, Cmd-U, Cmd-B, type
1709 some text, worked fine. But hitting the second Cmd-B before the
1710 second Cmd-U still failed to remove underlining. The reason for
1711 this is that our code to compute the style of the current position
1712 did not work when you had a typing style and were positioned right
1713 at a <br> element. For various reasons, this did not show up for
1714 bold and italic, since those are handled through the font manager.
1716 The following change fixes this - for elements that can't have
1717 children, we add the dummy span after the element of interest,
1718 rather than as a child of it.
1720 * khtml/khtml_part.cpp:
1721 (KHTMLPart::selectionComputedStyle):
1723 2005-02-11 David Harrison <harrison@apple.com>
1727 <rdar://problem/3978980> Double Clicking on a line in Mail selected the entire body
1729 * khtml/editing/visible_units.cpp:
1730 (khtml::startOfWord):
1732 Pay attention to being at the end of a paragraph.
1734 (khtml::previousLinePosition):
1735 (khtml::nextLinePosition):
1736 (khtml::endOfParagraph):
1737 Use DOWNSTREAM per recent affinity changes.
1739 2005-02-11 Richard Williamson <rjw@apple.com>
1741 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
1743 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
1744 creates these wrappers. The WebCore subclass of the interpreter now overrides
1745 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
1747 * WebCore.pbproj/project.pbxproj:
1748 * khtml/ecma/kjs_binding.cpp:
1749 (ScriptInterpreter::createLanguageInstanceForValue):
1750 * khtml/ecma/kjs_binding.h:
1751 * kwq/DOMUtility.mm: Added.
1752 (KJS::ScriptInterpreter::createObjcInstanceForValue):
1753 * kwq/KWQKHTMLPart.mm:
1754 (KWQKHTMLPart::getAppletInstanceForView):
1755 (getInstanceForView):
1756 (KWQKHTMLPart::getEmbedInstanceForView):
1757 (KWQKHTMLPart::getObjectInstanceForView):
1759 2005-02-11 Chris Blumenberg <cblu@apple.com>
1761 Fixed: <rdar://problem/3937352> Quote level not maintained when copied and pasted within a Mail message
1763 Reviewed by harrison.
1765 * khtml/editing/markup.cpp:
1766 (khtml::isMailBlockquote): new
1767 (khtml::createMarkup): retain the Mail quote level by including all ancestor mail block quotes
1768 * khtml/rendering/render_block.cpp:
1769 (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
1770 * khtml/rendering/render_text.cpp:
1771 (RenderText::positionForCoordinates): ditto
1773 2005-02-11 Adele Amchan <adele@apple.com>
1777 fix for <rdar://problem/4004004> no need to add body element for xml documents
1779 In the fix for <rdar://problem/3758785> we decided to add a body element when closing a document
1780 to ensure that the onload handler would fire. This is unnecessary for xml documents,
1781 so now we also check to see if we're dealing with an html document before adding the body element.
1783 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
1785 2005-02-11 Adele Amchan <adele@apple.com>
1789 * layout-tests/apple-only/base/www.excite.com/index-expected.txt: updates tests because of custom tag change.
1790 * layout-tests/apple-only/base/www.msnbc.com/index-expected.txt:
1791 * layout-tests/apple-only/base/www.time.com/index-expected.txt:
1792 * layout-tests/apple-only/base/www.travelocity.com/index-expected.txt:
1793 * layout-tests/apple-only/base/www.zdnet.com/index-expected.txt:
1794 * layout-tests/fast/overflow/003-expected.txt:
1796 * layout-tests/fast/js/window-object-cross-frame-calls-expected.txt: updated test because of added Body (see rdar://problem/3758785)
1800 2005-02-11 Darin Adler <darin@apple.com>
1804 - 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
1806 * khtml/xml/dom_docimpl.h: Added a new openInternal function for use by KHTMLPart.
1807 * khtml/xml/dom_docimpl.cpp:
1808 (DocumentImpl::open): Changed to do everything we did before, but also clear the URL and set the
1809 base URL based on the enclosing document. This is the basic JavaScript/DOM operation of opening a
1810 document, which is supposed to clear the document, including the URL. In the long run we might want
1811 to do even more document "resetting and clearing" in here, but this URL clearing is what's needed
1812 now to fix the most important problem.
1813 (DocumentImpl::openInternal): Moved the old open code in here, except for the "parsing" check, which
1814 is unnecessary and inappropriate in the one place we call this.
1816 * khtml/khtml_part.cpp: (KHTMLPart::begin): Call openInternal instead of open.
1818 2005-02-10 Ken Kocienda <kocienda@apple.com>
1824 <rdar://problem/3992092> 8A374: Mail crash while pasting - RemoveNodeCommand
1826 * khtml/editing/htmlediting.cpp:
1827 (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in
1828 the document. We try to do a good job of detecting all these cases, and generally do. This
1829 one was missed. Fixed.
1831 2005-02-10 Darin Adler <darin@apple.com>
1833 Reviewed by Harrison.
1835 - added support needed to fix <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined
1837 * kwq/WebCoreBridge.h: Added selectionHasStyle: method.
1838 * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part.
1840 2005-02-10 Darin Adler <darin@apple.com>
1842 Reviewed by Harrison.
1844 - fixed <rdar://problem/3990484> cursor changes to I-beam when moving over text in widgets, even when selection off via CSS
1846 * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent): Changed code to check canSelect when deciding
1847 whether to show an I-beam cursor.
1849 * khtml/rendering/render_object.h: Added canSelect.
1850 * khtml/rendering/render_object.cpp:
1851 (selectStartNode): Added. Helper function with the guts of shouldSelect.
1852 (RenderObject::canSelect): Added. Like shouldSelect, but does not call the "start selecting" event handler.
1853 (RenderObject::shouldSelect): Refactored to use selectStartNode.
1855 * khtml/css/cssvalues.c: Regnerated with newer gperf.
1857 2005-02-10 David Hyatt <hyatt@apple.com>
1859 Fix for 3867759, .mac regression where scrollers don't show up. Make sure you can set the .width and
1860 .height properties on the Image object.
1862 Reviewed by John Sullivan
1864 * khtml/ecma/kjs_html.cpp:
1865 (ImageConstructorImp::construct):
1866 (Image::getValueProperty):
1869 * khtml/ecma/kjs_html.h:
1871 2005-02-10 Ken Kocienda <kocienda@apple.com>
1877 <rdar://problem/3965158> Drag-n-drop within a rich text message sometimes changes the color of the dragged text
1879 This change fixes the bug....and much more. Now, for the first time, the paste code can do "smart merging"
1880 or "smooshing" of styles during its operation. Since this new code is actively, rather than passively
1881 working with styles, it fixes the bug, and lays the groundwork for similar work we need to do to
1882 preserve quote levels in Mail.
1884 * khtml/css/css_valueimpl.cpp:
1885 (DOM::CSSMutableStyleDeclarationImpl::clear): New method.
1886 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
1887 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): Ditto.
1888 (DOM::operator==): Add operator for CSSProperty.
1889 * khtml/css/css_valueimpl.h: Declare new functions.
1890 * khtml/editing/htmlediting.cpp:
1891 (khtml::isEmptyStyleSpan): Improved the test in this function, rolling together the old implementation
1892 with some code that did this work inline elsewhere. Sum of the parts is better than either test was by itself.
1893 (khtml::isStyleSpan): Check for ID_SPAN.
1894 (khtml::ApplyStyleCommand::removeCSSStyle): Call isEmptyStyleSpan. This was the place with an inline implementation before.
1895 (khtml::ReplacementFragment::ReplacementFragment): Now takes a DocumentImpl argument. No longer does a "default style"
1896 check, but rather calls functions which do a similar check to that, and much more.
1897 (khtml::ReplacementFragment::~ReplacementFragment): Deref document, and computed styles.
1898 (khtml::ReplacementFragment::styleForNode): New helper. Looks up and returns computed style for a node.
1899 (khtml::ReplacementFragment::removeNodePreservingChildren): New helper.
1900 (khtml::ReplacementFragment::computeStylesForNodes): New function which computes the "desired" style for
1901 every node in the fragment. This information is used later after paste is done as a reference for testing
1902 what styles need to be added, and which can be removed as redundant, from all the nodes inserted by the
1904 (khtml::ReplacementFragment::removeStyleNodes): Clears out all style nodes from the fragment. They are
1905 no longer needed after the call to computeStylesForNodes(),
1906 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): Add a document to the call to initialize the
1907 command's ReplacementFragment.
1908 (khtml::ReplaceSelectionCommand::doApply): Call applyStyleToInsertedNodes() after inserting nodes to make
1909 styles come out right.
1910 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): This is the "style smooshing" function. It
1911 computes the styles that need to be added to each node inserted, comparing the style it gets from just
1912 being inserted into its correct destination with the computed "desired style" done in the
1913 ReplacementFragment constructor. It then adds in all the necessary styles, and will also remove redundant styles.
1914 * khtml/editing/htmlediting.h: Update declarations and member variables as needed.
1915 * khtml/editing/markup.cpp:
1916 (khtml::startMarkup): Add additional style annotations to the markup we generate, so that paste code can preserve it.
1917 (khtml::markup): Ditto.
1918 (khtml::createMarkup): Ditto.
1920 These test results are subtly better with this change. They no longer have an unneeded empty span.
1921 Visually the same as before.
1923 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
1924 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
1925 * layout-tests/editing/style/remove-underline-expected.txt
1926 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt
1930 * layout-tests/editing/style/smoosh-styles-001-expected.txt
1931 * layout-tests/editing/style/smoosh-styles-002-expected.txt
1932 * layout-tests/editing/style/smoosh-styles-001.html
1933 * layout-tests/editing/style/smoosh-styles-002.html
1935 2005-02-10 Darin Adler <darin@apple.com>
1939 - fixed <rdar://problem/3974988> WebHTMLView drops scroll wheel events when deltas are 0
1941 * kwq/WebCoreScrollView.m: (-[WebCoreScrollView autoforwardsScrollWheelEvents]): Added, for Tiger only.
1942 For Tiger, removed the override of scrollWheel:, which doesn't work quite right because of how the
1943 delta attributes return all 0 for newfangled scrolling events from the new trackpads.
1945 2005-02-10 David Harrison <harrison@apple.com>
1949 <rdar://problem/3991532> REGRESSION (Mail): Triple-click on trailing blank line should select previous line but doesn't
1951 * khtml/css/cssvalues.c:
1954 * khtml/editing/selection.cpp:
1955 (khtml::Selection::validate):
1956 Do moral equiavalent of LeftWordIfOnBoundary for PARAGRAPH.
1958 2005-02-10 David Harrison <harrison@apple.com>
1962 <rdar://problem/3991848> Double-click on first character selects wrong item
1964 * khtml/editing/selection.cpp:
1965 (khtml::Selection::validate):
1966 Honor the fact that clicking on a character positions the cursor on the left side of the character.
1968 2005-02-10 David Hyatt <hyatt@apple.com>
1970 Fix for 3980778, repro crash in RootInlineBox::paint. Make sure that when merging blocks we dirty them for layout
1971 up front. That way as we do the merge, we dont attempt to examine the lines in dirtyLinesForChangedChild.
1975 * khtml/rendering/render_block.cpp:
1976 (khtml::RenderBlock::removeChild):
1978 2005-02-10 David Hyatt <hyatt@apple.com>
1980 Fix for 3987010, fix a bug that caused the self-collapsing-block-cleared-float bit to never get set correctly.
1984 * khtml/rendering/render_block.h:
1985 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
1987 2005-02-10 David Hyatt <hyatt@apple.com>
1989 Fix for 3992440, text not wrapping correctly on half moon bay web site. Refine an incorrect optimization I
1990 added to be less restrictive.
1994 * khtml/rendering/render_block.cpp:
1995 (khtml::RenderBlock::layoutBlockChildren):
1997 2005-02-08 Maciej Stachowiak <mjs@apple.com>
2001 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
2003 I fixed this by removing all event listeners for a document, it's
2004 children, and any disconnected nodes that used to be in the
2005 document at document detach time. Mozilla temporarily disables
2006 event listeners on such nodes, but re-enables them if you
2007 re-parant a node into a new document. However, in WebCore, you
2008 can't re-parent a node into another document, so there is no
2009 observable change in behavior.
2011 We have to do this to break the possible reference cycles between
2012 event listeners and the dom nodes they are attached to (e.g. via
2013 scope chain, as in this case).
2015 * khtml/xml/dom_docimpl.cpp:
2016 (DocumentImpl::detach):
2017 (DocumentImpl::removeAllEventListenersFromAllNodesx):
2018 (DocumentImpl::registerDisconnectedNodeWithEventListeners):
2019 (DocumentImpl::unregisterDisconnectedNodeWithEventListeners):
2020 (DocumentImpl::removeAllDisconnectedNodeEventListeners):
2021 * khtml/xml/dom_docimpl.h:
2022 * khtml/xml/dom_nodeimpl.cpp:
2023 (NodeImpl::~NodeImpl):
2024 (NodeImpl::addEventListener):
2025 (NodeImpl::removeEventListener):
2026 (NodeImpl::removeAllEventListeners):
2027 (NodeImpl::removeHTMLEventListener):
2028 (NodeImpl::insertedIntoDocument):
2029 (NodeImpl::removedFromDocument):
2030 * khtml/xml/dom_nodeimpl.h:
2032 2005-02-09 Chris Blumenberg <cblu@apple.com>
2034 Fixed: <rdar://problem/3999213> Sometimes 2 Windows Media Player plugin instances are loaded
2038 * khtml/html/html_objectimpl.cpp:
2039 (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.
2040 (HTMLObjectElementImpl::recalcStyle): ditto
2042 2005-02-09 David Harrison <harrison@apple.com>
2046 <rdar://problem/3937447> Mail-689: Arrow key navigation in new message body stops working when a line ends with a bold word
2048 Added affinity to VisiblePosition. Changed Selection code to use affinity more.
2050 (Partial) <rdar://problem/3982096> editing/pasteboard/paste-text-007 is failing
2052 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.
2054 * khtml/ecma/kjs_window.cpp:
2055 (SelectionFunc::tryCall):
2056 * khtml/editing/htmlediting.cpp:
2057 (khtml::EditCommandPtr::setStartingSelection):
2058 (khtml::EditCommandPtr::setEndingSelection):
2059 (khtml::EditCommand::setStartingSelection):
2060 (khtml::EditCommand::setEndingSelection):
2061 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream):
2062 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
2063 (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
2064 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
2065 (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
2066 (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
2067 (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
2068 (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
2069 (khtml::ApplyStyleCommand::joinChildTextNodes):
2070 (khtml::DeleteSelectionCommand::initializePositionData):
2071 (khtml::DeleteSelectionCommand::handleGeneralDelete):
2072 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
2073 (khtml::DeleteSelectionCommand::doApply):
2074 (khtml::InsertLineBreakCommand::doApply):
2075 (khtml::InsertParagraphSeparatorCommand::doApply):
2076 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
2077 (khtml::InsertTextCommand::input):
2078 (khtml::MoveSelectionCommand::doApply):
2079 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
2080 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
2081 (khtml::ReplaceSelectionCommand::doApply):
2082 (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
2083 (khtml::ReplaceSelectionCommand::updateNodesInserted):
2084 (khtml::TypingCommand::deleteKeyPressed):
2085 (khtml::TypingCommand::forwardDeleteKeyPressed):
2086 (khtml::TypingCommand::markMisspellingsAfterTyping):
2087 * khtml/editing/htmlediting.h:
2088 * khtml/editing/selection.cpp:
2089 (khtml::Selection::Selection):
2090 (khtml::Selection::init):
2091 (khtml::Selection::moveTo):
2092 (khtml::Selection::modifyExtendingRightForward):
2093 (khtml::Selection::modifyMovingRightForward):
2094 (khtml::Selection::modifyExtendingLeftBackward):
2095 (khtml::Selection::modifyMovingLeftBackward):
2096 (khtml::Selection::modify):
2097 (khtml::Selection::xPosForVerticalArrowNavigation):
2098 (khtml::Selection::clear):
2099 (khtml::Selection::setBase):
2100 (khtml::Selection::setExtent):
2101 (khtml::Selection::setBaseAndExtent):
2102 (khtml::Selection::layout):
2103 (khtml::Selection::validate):
2104 * khtml/editing/selection.h:
2105 (khtml::Selection::startAffinity):
2106 (khtml::Selection::endAffinity):
2107 (khtml::Selection::baseAffinity):
2108 (khtml::Selection::extentAffinity):
2109 (khtml::operator==):
2110 * khtml/editing/text_affinity.h:
2112 * khtml/editing/visible_position.cpp:
2113 (khtml::VisiblePosition::VisiblePosition):
2114 (khtml::VisiblePosition::init):
2115 (khtml::VisiblePosition::initUpstream):
2116 (khtml::VisiblePosition::initDownstream):
2117 (khtml::VisiblePosition::next):
2118 (khtml::VisiblePosition::previous):
2119 (khtml::startVisiblePosition):
2120 (khtml::endVisiblePosition):
2121 * khtml/editing/visible_position.h:
2122 (khtml::VisiblePosition::):
2123 (khtml::VisiblePosition::VisiblePosition):
2124 (khtml::VisiblePosition::affinity):
2125 (khtml::VisiblePosition::setAffinity):
2126 (khtml::operator==):
2127 * khtml/editing/visible_units.cpp:
2128 (khtml::previousBoundary):
2129 (khtml::nextBoundary):
2130 (khtml::startOfLine):
2132 (khtml::previousLinePosition):
2133 (khtml::nextLinePosition):
2134 (khtml::startOfParagraph):
2135 (khtml::endOfParagraph):
2136 (khtml::previousParagraphPosition):
2137 (khtml::nextParagraphPosition):
2138 (khtml::startOfBlock):
2139 (khtml::endOfBlock):
2140 (khtml::startOfDocument):
2141 (khtml::endOfDocument):
2142 * khtml/editing/visible_units.h:
2143 * khtml/khtml_part.cpp:
2144 (KHTMLPart::findTextNext):
2145 (KHTMLPart::selectClosestWordFromMouseEvent):
2146 (KHTMLPart::handleMousePressEventTripleClick):
2147 (KHTMLPart::handleMousePressEventSingleClick):
2148 (KHTMLPart::handleMouseMoveEventSelection):
2149 (KHTMLPart::khtmlMouseReleaseEvent):
2150 (KHTMLPart::selectAll):
2151 (KHTMLPart::computeAndSetTypingStyle):
2152 (KHTMLPart::selectionComputedStyle):
2153 * khtml/rendering/render_br.cpp:
2154 (RenderBR::positionForCoordinates):
2155 * khtml/xml/dom_docimpl.cpp:
2156 (DocumentImpl::updateSelection):
2157 * khtml/xml/dom_nodeimpl.cpp:
2158 (NodeBaseImpl::setFocus):
2159 * khtml/xml/dom_position.cpp:
2160 (DOM::Position::previousCharacterPosition):
2161 (DOM::Position::nextCharacterPosition):
2162 * khtml/xml/dom_position.h:
2163 * kwq/KWQAccObject.mm:
2164 (-[KWQAccObject value]):
2165 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
2166 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
2167 (-[KWQAccObject accessibilityAttributeValue:]):
2168 (-[KWQAccObject doAXLineForTextMarker:]):
2169 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
2170 (-[KWQAccObject doAXTextMarkerForPosition:]):
2171 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
2172 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2173 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
2174 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
2175 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2176 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
2177 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
2178 * kwq/KWQAccObjectCache.mm:
2179 (KWQAccObjectCache::textMarkerForVisiblePosition):
2180 (KWQAccObjectCache::visiblePositionForTextMarker):
2181 * kwq/KWQKHTMLPart.mm:
2182 (KWQKHTMLPart::findString):
2183 (KWQKHTMLPart::advanceToNextMisspelling):
2184 (KWQKHTMLPart::styleForSelectionStart):
2185 (KWQKHTMLPart::baseWritingDirectionForSelectionStart):
2186 (KWQKHTMLPart::setSelectionFromNone):
2187 (KWQKHTMLPart::respondToChangedSelection):
2188 * kwq/WebCoreBridge.mm:
2189 (-[WebCoreBridge setSelectedDOMRange:affinity:]):
2190 (-[WebCoreBridge selectionAffinity]):
2191 (-[WebCoreBridge setMarkDOMRange:]):
2192 (-[WebCoreBridge _visiblePositionForPoint:]):
2193 (-[WebCoreBridge moveDragCaretToPoint:]):
2194 (-[WebCoreBridge editableDOMRangeForPoint:]):
2195 (-[WebCoreBridge ensureSelectionVisible]):
2196 (-[WebCoreBridge rangeOfCharactersAroundCaret]):
2198 2005-02-09 Chris Blumenberg <cblu@apple.com>
2200 Fixed: <rdar://problem/3985211> Seed: Mail: Drag-and-drop destination indicator / insertion point disappears
2202 Reviewed by kocienda.
2204 * khtml/rendering/render_block.cpp:
2205 (khtml::RenderBlock::paintCaret): new
2206 (khtml::RenderBlock::paintObject): call paintCaret for the cursor caret and the drag caret
2207 * khtml/rendering/render_block.h:
2211 2005-02-08 Ken Kocienda <kocienda@apple.com>
2217 <rdar://problem/3996344> Entire document content is deleted when only the first paragraph was supposed to be
2219 Problem stems from my attempt to fix this bug: <rdar://problem/3986155> Insertion point goes
2220 to beginning of doc after deleting.
2222 I added an "optimization" that proved to do more harm than good. So, basically, the fix is to remove code.
2224 * khtml/editing/htmlediting.cpp:
2225 (khtml::DeleteSelectionCommand::handleGeneralDelete)
2227 2005-02-07 Darin Adler <darin@apple.com>
2231 - fixed <rdar://problem/3890352> REGRESSION (125-170, Panther-only): pasted textarea contents disappear (exception in NSText)
2233 * kwq/KWQTextArea.mm: (-[KWQTextArea tile]): Don't resize the text view immediately here.
2234 Use performWithDelay to defer it to avoid the re-entrancy that bothers the Panther version
2235 of NSTextView. On Tiger, leave the code alone.
2237 2005-02-07 Adele Amchan <adele@apple.com>
2241 Fix for <rdar://problem/3993628> REGRESSION (180-181): Logitelnet bank's website doesn't work
2243 This fixes an oversight in the fix for <rdar://problem/3964286>.
2244 We're now making sure there is a document before calling checkCompleted in slotLoaderRequestDone.
2245 That function is called even when other parts finish loads of their subresources, so we could end
2246 up calling checkCompleted before we had a document. We also looked over all the other calls to
2247 checkCompleted to convince ourselves no other call sites had a similar issue.
2249 * khtml/khtml_part.cpp: (KHTMLPart::slotLoaderRequestDone): Check if doc is nil before calling
2252 2005-02-07 Ken Kocienda <kocienda@apple.com>
2258 <rdar://problem/3953302> Replacing quoted text ends up with blue-colored text that is not quoted
2260 * khtml/editing/htmlediting.cpp:
2261 (khtml::DeleteSelectionCommand::doApply): Removed special case delete code for select all. It was
2262 causing as many bugs as it fixed. What's more, the design concept is a bit shaky. By removing
2263 this special case, the bug goes away.
2264 * khtml/editing/htmlediting.h: Remove declaration.
2266 Test results using selectAll() updated to reflect changed behavior.
2268 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
2269 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
2270 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
2271 * layout-tests/editing/inserting/insert-3654864-fix-expected.txt:
2272 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
2273 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt:
2274 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt:
2275 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
2277 2005-02-06 Darin Adler <darin@apple.com>
2281 - fixed <rdar://problem/3994164> setting a new style attribute with setAttribute("style") doesn't blow away the old style
2283 * khtml/css/css_valueimpl.h: Renamed parseProperty to parseDeclaration, since it's used to parse
2284 an entire style declaration, not a single property.
2285 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::parseDeclaration): Renamed,
2286 and added code to clear m_values.
2287 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Call function by its
2288 new name, and remove some unnecessary comments.
2290 2005-02-06 Darin Adler <darin@apple.com>
2294 - fixed <rdar://problem/3993722> need oncut and onpaste handlers implemented for <textarea> (needed for widgets)
2296 * kwq/KWQTextArea.mm:
2297 (-[KWQTextAreaTextView dispatchHTMLEvent:]): Added.
2298 (-[KWQTextAreaTextView cut:]): Dispatch "before cut" and "cut" events.
2299 (-[KWQTextAreaTextView copy:]): Dispatch "before copy" and "copy" events.
2300 (-[KWQTextAreaTextView paste:]): Dispatch "before paste" and "paste" events.
2301 (-[KWQTextAreaTextView pasteAsPlainText:]): Ditto.
2302 (-[KWQTextAreaTextView pasteAsRichText:]): Ditto.
2304 2005-02-06 Darin Adler <darin@apple.com>
2308 - fixed <rdar://problem/3943038> <input type=search> that is focused in onload handler doesn't have a visible editor
2310 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setFocusNode): Always update layout before giving focus to a widget.
2311 This prevents the bad case where we give a widget focus before it has been positioned or sized, causing us to
2312 exercise edge cases AppKit doesn't handle well.
2314 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Remove workaround code I added
2315 to fix bug 3943049. Updating the layout fixes the same problem in a cleaner, safer way, and solves another problem,
2316 with the way the clip view is set up.
2318 2005-02-06 Darin Adler <darin@apple.com>
2322 - fixed <rdar://problem/3425232> textarea won't trigger onchange action when clicking to new field
2324 * khtml/rendering/render_form.h: Added new m_dirty data member.
2325 * khtml/rendering/render_form.cpp:
2326 (RenderTextArea::RenderTextArea): Initialize m_dirty to false.
2327 (RenderTextArea::detach): Call value() on the DOM element to cause it to fetch the value from this object.
2328 (RenderTextArea::handleFocusOut): Ditto. Also send the onchange event based only on the m_dirty flag.
2329 (RenderTextArea::updateFromElement): Clear the m_dirty flag if the edited value is blown away by a value
2330 that comes from the DOM element. Remove code to clear the element's m_dirtyvalue flag; that's an unnecessary
2331 optimization, and ideally we'll stop having code in the render object that knows about that flag later.
2332 (RenderTextArea::slotTextChanged): Set the m_dirty flag.
2334 2005-02-06 Darin Adler <darin@apple.com>
2338 - re-fixed <rdar://problem/3760910> please add support for custom tag names in HTML
2340 * khtml/xml/dom_docimpl.cpp:
2341 (DocumentImpl::tagId): Use ID_LAST_TAG + 1 for the ID of the first assigned tag ID. Before we'd use ID_LAST_TAG,
2342 which resulted in the same number being used for ID_COMMENT and the first custom tag.
2343 (DocumentImpl::tagName): Use ID_LAST_TAG + 1, as above.
2344 (DocumentImpl::namespaceURI): Change a < ID_LAST_TAG to <= ID_LAST_TAG in the same spirit as above.
2346 2005-02-06 Darin Adler <darin@apple.com>
2350 - fixed <rdar://problem/3986639> Crash occurs after choosing Undo Typing from the Edit menu
2352 * kwq/KWQTextArea.mm: (-[KWQTextArea viewWillMoveToWindow:]): Remove actions from undo manager when the view is
2353 removed from the window. Unfortunately, to do this the code has to know that the target of NSTextView actions
2354 will be the text storage object, but given the NSText architecture, that's pretty clear.
2356 2005-02-05 Chris Blumenberg <cblu@apple.com>
2358 Fixed: <rdar://problem/3991974> REGRESSION: www.jabra.com world location screen does not work
2362 * kwq/KWQKJavaAppletWidget.mm:
2363 (KJavaAppletWidget::KJavaAppletWidget): fallback to the document's base URL if there is no baseURL attribute
2364 * kwq/WebCoreBridge.h:
2365 * kwq/WebCoreBridge.mm:
2366 (-[WebCoreBridge baseURL]): new
2368 2005-02-04 David Harrison <harrison@apple.com>
2372 Rolled out Ken's accidental checkin when committing <rdar://problem/3986155> fix yesterday.
2374 * khtml/editing/selection.cpp:
2375 (khtml::Selection::validate):
2377 2005-02-04 Adele Amchan <adele@apple.com>
2381 Fix for <rdar://problem/3758785> Safari no longer works at BankOfAmerica online banking for military users
2383 When closing the document, if a body doesn't exist we now create one. This bug was preventing the onload handler from
2384 firing in cases where there wasn't a body. In the BankOfAmerica case, the page was just a bit of script where the onload
2385 handler redirected to the correct page.
2387 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
2389 2005-02-03 Ken Kocienda <kocienda@apple.com>
2395 <rdar://problem/3986155> Insertion point goes to beginning of doc after deleting
2397 * khtml/editing/htmlediting.cpp:
2398 (khtml::DeleteSelectionCommand::setStartNode): New convenience to handle reference counting when setting.
2399 (khtml::DeleteSelectionCommand::handleGeneralDelete): This contains the crux of the bug fix. Improve tests
2400 that detect when a selected node needs to be retained, rather than deleted, to preserve the intent of the user.
2401 This has the side effect of causing the insertion point placement code to succeed rather than fail. Before
2402 this fix, the failure of the insertion point placement code caused the insertion point to jump to the start
2403 of the document, which is the symptom that can be perceived by users when editing.
2404 * khtml/editing/htmlediting.h: Add setStartNode declaration.
2405 * khtml/editing/visible_units.cpp:
2406 (khtml::startOfBlock): This function had a stubbed-in non-tested implementation. Implement and
2407 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001-expected.txt: Added.
2408 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001.html: Added.
2409 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt: Added.
2410 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002.html: Added.
2411 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt: Added.
2412 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003.html: Added.
2413 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt: Added.
2414 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004.html: Added.
2415 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005-expected.txt: Added.
2416 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005.html: Added.
2417 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006-expected.txt: Added.
2418 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006.html: Added.
2422 2005-02-03 Richard Williamson <rjw@apple.com>
2424 Fixed <rdar://problem/3987419> Stocks and Weather leak what appears to XMLHTTPRequest results
2426 XMLHTTPRequests were causing massive leaks. _webcore_initWithHeaderString: did funky things with
2427 self replacement. Re-wrote to use more traditional factory constructor avoiding self replacement.
2429 Reviewed by David Harrison.
2432 (+[NSDictionary _webcore_dictionaryWithHeaderString:]):
2434 (KWQServeSynchronousRequest):
2436 2005-02-03 Chris Blumenberg <cblu@apple.com>
2438 Fixed: <rdar://problem/3938763> Cannot view Windows Media Player videos (soundtrack is played twice with delay)
2442 * khtml/html/html_objectimpl.cpp:
2443 (HTMLObjectElementImpl::attach): set needWidgetUpdate to false right after calling updateWidget because dispatchHTMLEvent can end up calling this method again
2444 (HTMLObjectElementImpl::recalcStyle): ditto
2446 2005-02-02 John Sullivan <sullivan@apple.com>
2450 - WebCore part of fix for <rdar://problem/3980651> REGRESSION (125-180): Huge number of pages printed from certain page,
2453 This also fixes the problems with printing from GMail, yay!
2455 * khtml/rendering/render_flow.cpp:
2456 (RenderFlow::paintLines):
2457 If the current line is taller than the entire page height (e.g. tall iFrame), don't try
2458 to avoid splitting it across pages.
2460 * kwq/WebCoreBridge.mm:
2461 (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
2462 Handle error cases in a more obvious manner; this will cause future problems like this
2463 to print a blank page and complain to the console on debug builds, rather than print a
2464 zillionty mostly-blank pages.
2466 2005-02-02 Chris Blumenberg <cblu@apple.com>
2468 Fixed: <rdar://problem/3960304> can't load a particular applet (at www.escape.de) unless it's the first applet to be loaded
2472 * khtml/rendering/render_frames.cpp:
2473 (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.
2475 2005-02-02 Chris Blumenberg <cblu@apple.com>
2477 Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)
2481 * kwq/KWQKHTMLPart.mm:
2482 (KWQKHTMLPart::sendContextMenuEvent): check if SPI to always enable selecting closest word is enabled
2483 * kwq/WebCoreBridge.h:
2485 2005-02-02 Ken Kocienda <kocienda@apple.com>
2489 * khtml/editing/markup.cpp:
2490 (khtml::createMarkup): Removed debug spam I committed earlier in error.
2492 2005-02-02 Ken Kocienda <kocienda@apple.com>
2498 <rdar://problem/3823109> WebKit should support -toggleBaseWritingDirection: (bidi editing support)
2500 Since base writing direction is a paragraph-level property in AppKit, and we use the CSS direction
2501 property in WebCore, which can be applied to inline elements as well as blocks, a new notion has
2502 been added to the WebCore apply style logic. It is now possible to force all properties in a
2503 style declaration to be applied as though they were block properties.
2505 * khtml/editing/htmlediting.cpp:
2506 (khtml::ApplyStyleCommand::ApplyStyleCommand): Add an enum and a flag to this command that controls whether to force all
2507 properties in the style to be applied as block styles. Default is "no", retaining previous behavior.
2508 (khtml::ApplyStyleCommand::doApply): Switch on new flag to apply styles as before, or force all preoperties to be applied
2510 * khtml/editing/htmlediting.h:
2511 (khtml::ApplyStyleCommand::): Add an enum and a flag, as above.
2512 * khtml/khtml_part.cpp:
2513 (KHTMLPart::applyParagraphStyle): New method to force application of all style properties as block styles.
2514 * khtml/khtml_part.h: Update header declarations.
2515 * kwq/KWQKHTMLPart.h: Update header declarations.
2516 * kwq/KWQKHTMLPart.mm:
2517 (KWQKHTMLPart::baseWritingDirectionForSelectionStart): Accessor to help WebKit do a toggle operation on
2519 * kwq/WebCoreBridge.h: Update header declarations.
2520 * kwq/WebCoreBridge.mm:
2521 (-[WebCoreBridge applyParagraphStyle:withUndoAction:]): New method to force application of all style properties as block styles.
2522 (-[WebCoreBridge baseWritingDirectionForSelectionStart]): Accessor to help WebKit do a toggle operation on
2527 <rdar://problem/3985035> REGRESSION (Mail): Text copied from wrapped line contains extra character when pasted
2529 * khtml/editing/markup.cpp:
2530 (khtml::renderedText): Add an enum and a flag to this command that controls whether to force all
2531 This is the result of an error in the code that computes the rendered text that is selected
2532 when copying. Since spaces collapse at the end of lines, and these spaces need to be copied
2533 when the selection spans line endings, code runs to compute this text. However, this code
2534 was also running incorrectly in cases where lines wrapped. I have now added the missing
2535 test to check that the selection does indeed extend to the end of the line.
2538 2005-02-02 Ken Kocienda <kocienda@apple.com>
2544 <rdar://problem/3984894> REGRESSION (Mail): Command-right-arrow in reply does the wrong thing (two ways)
2545 <rdar://problem/3985130> REGRESSION (Mail): command-right-arrow in pasted RTF selects only up to tab
2547 * khtml/editing/visible_units.cpp:
2548 (khtml::endOfLine): Two separate problems in this new function recently added to take the place of
2549 selectionForLine. In the first, endOfLine did not stop at BR elements, and returned the position
2550 beyond them. In the second, the VisiblePosition constructor gives the wrong answer in certain cases.
2551 Darin is going to work on a solution for that problem. In the meantime, I can fix the symptom of this
2552 bug by going down to the last leaf child of the root line box; a one line change we will roll out when
2555 2005-02-01 Richard Williamson <rjw@apple.com>
2557 Fixed <rdar://problem/3985535> QT Plug-in JavaScript support now fails in <embed> tag only case
2561 * khtml/ecma/kjs_html.cpp:
2562 (KJS::HTMLDocument::tryGet):
2564 2005-02-01 John Sullivan <sullivan@apple.com>
2566 Written by Darin, reviewed and tested by me
2568 - fixed <rdar://problem/3969684> Panther-only: extra blank lines between
2569 pasted content from Blot
2571 * kwq/KWQKHTMLPart.mm:
2572 (KWQKHTMLPart::attributedString):
2573 don't emit paragraph breaks if the margins are tiny; matches what
2574 we do for plain-text conversion
2578 2005-02-01 Ken Kocienda <kocienda@apple.com>
2584 <rdar://problem/3985160> Deficiencies in pasting architecture blocking progress on other bugs
2586 * khtml/editing/html_interchange.h: Move style span text used to mark element added to
2587 add style to this header.
2588 * khtml/editing/htmlediting.cpp:
2589 (khtml::styleSpanClassString): Change to use constant moved to html_interchange.h.
2590 (khtml::isStyleSpan): New helper function. Checks if this is a span we added to apply style.
2591 (khtml::CompositeEditCommand::insertNodeBefore): Added an assert to check that the node
2592 we are inserting before is not the body.
2593 (khtml::CompositeEditCommand::insertNodeAfter): Ditto, but check is for after.
2594 (khtml::ReplacementFragment::ReplacementFragment): Added code to process the "default style"
2595 that is added by the copy code.
2596 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): first and last nodes inserted are
2597 now member variables instead of function locals. Initialize them here.
2598 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): Deref first and last nodes inserted
2600 (khtml::ReplaceSelectionCommand::doApply): Change design to fix the bug. Major change is to
2601 separate out the code that inserts nodes into the tree so additional styling checks can
2602 be done in a centralized way. Also got rid of the notion of "merging into the end block." That
2603 concept was just wrong.
2604 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Tweak interface now that first and
2605 last nodes inserted are member variables.
2606 (khtml::ReplaceSelectionCommand::insertNodeAfterAndUpdateNodesInserted): New helper used
2607 by replace code to do the stated DOM operation and update state internal to the command.
2608 This will also be a catch point to handle the kinds of additional style checks needed to
2609 make paste work right.
2610 (khtml::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted): Ditto.
2611 (khtml::ReplaceSelectionCommand::insertNodeBeforeAndUpdateNodesInserted): Ditto.
2612 (khtml::ReplaceSelectionCommand::updateNodesInserted): Ditto.
2613 * khtml/editing/htmlediting.h: Update declarations as needed.
2614 * khtml/editing/markup.cpp:
2615 (khtml::createMarkup): Adds a "default style" span to the content written to the pasteboard.
2616 This will help us to fix some of the bugs blocked by the bug above.
2617 * khtml/xml/dom_nodeimpl.cpp:
2618 (NodeImpl::lastDescendent): New helper.
2619 * khtml/xml/dom_nodeimpl.h: Ditto.
2620 * khtml/xml/dom_position.cpp:
2621 (DOM::Position::upstream): Fixed a bug which would allow the upstream position returned to be
2622 in unrendered content.
2623 (DOM::Position::downstream): Ditto.
2625 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Ending positions tweaked due to
2626 changes in upstream() and downstream() functions.
2627 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Ditto
2628 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Ditto
2629 * layout-tests/editing/selection/extend-by-character-006-expected.txt: Ditto
2631 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Changed what we expect, given
2632 new behavior of paste code.
2634 2005-01-31 John Sullivan <sullivan@apple.com>
2636 Reviewed by Dave Hyatt.
2638 - fixed <rdar://problem/3983097> Tabbing on RSS pages gets stuck in search field
2639 with "full keyboard navigation" off
2643 (QSlider::focusPolicy):
2644 Implemented this method for KWQSlider. It is needed for our widget subclasses that
2645 can become focused in some situations. I missed this when fixing 3949203 because
2646 it only comes into play when tab-to-controls is on, and because the other relevant
2647 methods are objective-C methods.
2649 2005-01-31 David Harrison <harrison@apple.com>
2653 <rdar://problem/3964164> AXWebArea needs to unregister on going invisible
2655 * khtml/xml/dom_docimpl.cpp:
2656 (DocumentImpl::detach):
2657 Detach the AX UIElement for the AXWebArea.
2659 2005-01-31 David Harrison <harrison@apple.com>
2663 <rdar://problem/3850876> AX: button exposed as only an AXImage at http://appleseed.apple.com/ site (<input type=image>)
2665 * khtml/rendering/render_form.h:
2666 (khtml::RenderImageButton::isImageButton):
2668 * khtml/rendering/render_image.h:
2669 (khtml::RenderImage::isImageButton):
2671 * kwq/KWQAccObject.mm:
2672 (-[KWQAccObject isImageButton]):
2673 (-[KWQAccObject actionElement]):
2674 (-[KWQAccObject role]):
2675 (-[KWQAccObject accessibilityActionNames]):
2676 (-[KWQAccObject accessibilityPerformAction:]):
2677 Represent RenderImageButton elements as buttons instead of images.
2679 2005-01-31 David Harrison <harrison@apple.com>
2681 Prevent nil dereference in debug code.
2683 * khtml/xml/dom_nodeimpl.cpp:
2684 (NodeImpl::displayTree):
2685 Stop when parent is 0, too.
2687 2005-01-31 John Sullivan <sullivan@apple.com>
2689 Reviewed by Dave Hyatt.
2691 - fixed <rdar://problem/3949203> cannot tab to, within, or out of the RSS sidebar
2694 (-[KWQSlider becomeFirstResponder]):
2695 (-[KWQSlider resignFirstResponder]):
2696 (-[KWQSlider nextKeyView]):
2697 (-[KWQSlider previousKeyView]):
2698 (-[KWQSlider canBecomeKeyView]):
2699 (-[KWQSlider nextValidKeyView]):
2700 (-[KWQSlider previousValidKeyView]):
2701 Copied these methods from KWQButton. The lack of special handling for first-responder-ness
2702 here was causing the focus to get "stuck" on the RSS page's slider widget. Added FIXME
2703 about how it would be nice to share more of this code rather than replicating it in each
2704 KWQ widget subclass.
2706 2005-01-31 Darin Adler <darin@apple.com>
2708 Reviewed by Harrison.
2710 - fixed <rdar://problem/3980066> Double-click on single character moves insertion point to previous line
2712 * khtml/khtml_part.cpp:
2713 (KHTMLPart::selectClosestWordFromMouseEvent): Set affinity too.
2714 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2715 (KHTMLPart::handleMouseMoveEventSelection): Ditto.
2716 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
2718 * khtml/editing/selection.cpp:
2719 (khtml::Selection::modifyExtendingRightForward): Use endOfLine and endOfDocument.
2720 (khtml::Selection::modifyMovingRightForward): Ditto.
2721 (khtml::Selection::modifyExtendingLeftBackward): Use startOfLine and startOfDocument.
2722 (khtml::Selection::modifyMovingLeftBackward): Ditto.
2723 (khtml::Selection::validate): Rewrote the section that handles double-click. Two main fixes: 1) use isStartOfLine to
2724 check for another case where we want to select the word to the right, and 2) use isEndOfParagraph, which seems
2725 to work correctly in cases where isLastVisiblePositionInParagraph is giving the wrong answer. Also changed the line
2726 code to use startOfLine/endOfLine and the document code to use startOfDocument/endOfDocument.
2728 2005-01-31 Darin Adler <darin@apple.com>
2730 Reviewed by Harrison.
2732 - fixed <rdar://problem/3935275> unexpected quit scrolling over link; last.fm (works in IE and Firefox)
2734 * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): By using the correct document, fix the crash reported here.
2735 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.
2737 2005-01-31 Darin Adler <darin@apple.com>
2739 Reviewed by Ken and Harrison.
2741 - fixed <rdar://problem/3947901> REGRESSION (Mail): Pasting paragraph of rich text leaves insertion point before pasted text
2742 - fixed <rdar://problem/3949790> hitting return after underlined line results in too much or too little underlined
2743 - fixed <rdar://problem/3981759> nil-deref and crash when pasting just a paragraph break
2744 - fixed a couple problems I discovered while working with bug 3949790
2746 * khtml/editing/htmlediting.cpp:
2747 (khtml::ApplyStyleCommand::applyInlineStyle): Pass StayInBlock to upstream. Without this, we end up going too far
2748 upstream in the test case in bug 3949790.
2749 (khtml::ApplyStyleCommand::removeInlineStyle): Pass StayInBlock to upstream and downstream. Same reason as above.
2750 (khtml::ReplaceSelectionCommand::doApply): Update endPos if inserting a new node and endPos is using that node's
2751 parent and an offset past the node being inserted. That change fixes a problem with the position of the insertion point
2752 after pasting into the top level of a document (from test cases in 3947901 and 3949790). When setting insertionPos, use
2753 code that works when lastNodeInserted is a block rather than a text node. That change fixes a problem where a newline is
2754 not added when pasting an entire paragraph into the end of a document (from test case in 3949790). Added nil check before
2755 checking if lastNodeInserted is a <br> element, which fixes the crash when pasting just a paragraph break.
2757 * khtml/editing/visible_units.h: Filled out the set of calls to add some boolean checks for lines (needed for the
2758 bug fix), and calls for blocks (not yet implemented), and documents. The document checks may need refinement to
2759 properly handle documents with a mix of editable and non-editable content, but for now they just refactor code
2760 and make things a little clearer. Also removed the "include line break" parameter from endOfSentence.
2761 * khtml/editing/visible_units.cpp:
2762 (khtml::rootBoxForLine): Added.
2763 (khtml::startOfLine): Added. Algorithm taken from selectionForLine in selection.cpp.
2764 (khtml::endOfLine): Ditto.
2765 (khtml::inSameLine): Added.
2766 (khtml::isStartOfLine): Added.
2767 (khtml::isEndOfLine): Added.
2768 (khtml::endOfSentence): Removed "include line break" parameter.
2769 (khtml::inSameParagraph): Added a null check.
2770 (khtml::isStartOfParagraph): Ditto.
2771 (khtml::isEndOfParagraph): Ditto.
2772 (khtml::startOfBlock): Added.
2773 (khtml::endOfBlock): Added.
2774 (khtml::inSameBlock): Added.
2775 (khtml::isStartOfBlock): Added.
2776 (khtml::isEndOfBlock): Added.
2777 (khtml::startOfDocument): Added.
2778 (khtml::endOfDocument): Added.
2779 (khtml::inSameDocument): Added.
2780 (khtml::isStartOfDocument): Added.
2781 (khtml::isEndOfDocument): Added.
2783 2005-01-30 Darin Adler <darin@apple.com>
2787 - fixed <rdar://problem/3977000> form data set posted for <input type="image" ...> omits name/value pair
2789 * khtml/html/html_formimpl.cpp:
2790 (DOM::HTMLInputElementImpl::appendFormData): Append a name/value pair for type IMAGE in addition to the X/Y
2793 2005-01-30 Darin Adler <darin@apple.com>
2797 - fixed <rdar://problem/3974246> REGRESSION (125-180): popup menus are missing item text on Harmony Remote web site
2799 * khtml/html/html_formimpl.cpp: (DOM::HTMLOptionElementImpl::text): Change this function to traverse the entire tree
2800 and gather all the text rather than just looking at immediate children.
2802 * khtml/xml/dom_nodeimpl.h: Added const.
2803 * khtml/xml/dom_nodeimpl.cpp:
2804 (NodeImpl::traverseNextNode): Added const.
2805 (NodeImpl::traverseNextSibling): Ditto.
2806 (NodeImpl::traversePreviousNodePostOrder): Ditto.
2807 (NodeImpl::detach): Add a missing nil check.
2809 2005-01-30 Darin Adler <darin@apple.com>
2813 - fixed <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
2815 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Added missing ref/deref of newly created element.
2817 2005-01-28 Darin Adler <darin@apple.com>
2819 * khtml/css/cssproperties.c: Regenerated with newer gperf.
2821 2005-01-28 David Harrison <harrison@apple.com>
2823 Reviewed by John Sullivan.
2825 <rdar://problem/3968144> AX need to be able to focus an AXLink by setting AXFocused to true
2827 * kwq/KWQAccObject.mm:
2828 (-[KWQAccObject accessibilityPerformAction:]):
2829 (-[KWQAccObject accessibilityIsAttributeSettable:]):
2830 Add AXFocused for AXLinks.
2832 2005-01-28 David Harrison <harrison@apple.com>
2836 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
2838 Use AppKit SPI _accessibilityParentForSubview to return KWQAccObject parent of AppKit AX object.
2840 * kwq/KWQAccObject.mm:
2841 (-[KWQAccObject _accessibilityParentForSubview:]):
2844 2005-01-27 Adele Amchan <adele@apple.com>
2846 fixed by Darin, reviewed by me.
2848 <rdar://problem/3976314> REGRESSION (180-TOT): submitting password fields fail on Panther
2850 * kwq/KWQTextField.mm: (-[KWQTextFieldController string]): on panther, the secure text field's editor
2851 does not contain the real string, so now we just call stringValue on the field in that case.
2853 2005-01-26 Maciej Stachowiak <mjs@apple.com>
2855 Reviewed by Darin, Hyatt and Ken.
2857 <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
2859 * khtml/css/css_computedstyle.cpp:
2860 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support
2861 for -khtml-text-decorations-in-effect property. This works like text-docration
2862 but follows proper inline semantics, that is, if a parent is causing text
2863 decoration then -khtml-text-decorations-in-effect on this element will reflect that.
2864 * khtml/css/cssproperties.in: Add -khtml-text-decorations-in-effect property.
2865 * khtml/css/cssproperties.h: regenerated
2866 * khtml/css/cssvalues.c: regenerated
2867 * khtml/css/cssparser.cpp: regenerated
2868 * khtml/css/cssproperties.c: regenerated
2870 * khtml/css/css_valueimpl.h: Made copyPropertiesInSet public.
2872 * khtml/editing/htmlediting.cpp:
2873 (khtml::StyleChange::init): Handle -khtml-text-decorations-in-effect
2874 specially, translate to text-decoration
2875 (khtml::ApplyStyleCommand::applyInlineStyle): Fix a comment.
2876 (khtml::ApplyStyleCommand::removeInlineStyle): Add new way of pushing down
2877 text-decoration styles around the edges of the selected range.
2878 (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAroundNode): Helper for this.
2879 (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): ditto
2880 (khtml::ApplyStyleCommand::nodeFullyUnselected): ditto
2881 (khtml::hasTextDecorationProperty): ditto
2882 (khtml::highestAncestorWithTextDecoration): ditto
2883 (khtml::ApplyStyleCommand::extractTextDecorationStyle): ditto
2884 (khtml::ApplyStyleCommand::extractAndNegateTextDecorationStyle): ditto
2885 (khtml::ApplyStyleCommand::applyTextDecorationStyle): ditto
2886 * khtml/editing/htmlediting.h: Prototype new methods.
2887 * khtml/editing/jsediting.cpp: Make underline execCommand use the new CSS property.
2889 - as a necessary part of the fix, fixed the longstanding problem
2890 that mutating an element's inlineStyleDecl would not property
2891 update its style attribute. now it does.
2893 * khtml/css/css_valueimpl.cpp:
2894 (DOM::CSSMutableStyleDeclarationImpl::setChanged): If this is an inline style
2895 declaration, tell the element it's style attribute needs updating.
2896 * khtml/html/html_elementimpl.cpp:
2897 (HTMLElementImpl::invalidateStyleAttribute): New method, just calls down
2899 (HTMLElementImpl::updateStyleAttribute): Regenerate style attribute from
2900 inline style declaration.
2901 * khtml/html/html_elementimpl.h: Prototype new stuff.
2902 * khtml/xml/dom_elementimpl.cpp:
2903 (ElementImpl::ElementImpl): Initialize new attribute.
2904 (ElementImpl::updateStyleAttributeIfNeeded): New method to check if the style
2905 is dirty and this is an html element, and if so call the html element to
2906 regenerate the style attribute.
2907 (ElementImpl::attributes): update style if needed
2908 (ElementImpl::getAttribute): ditto
2909 (ElementImpl::hasAttributes): ditto
2910 (ElementImpl::dump): ditto
2911 (XMLElementImpl::cloneNode): ditto
2912 * khtml/xml/dom_elementimpl.h:
2913 (DOM::ElementImpl::isStyleAttributeValid): new method to manage style attr
2915 (DOM::ElementImpl::setStyleAttributeValid): ditto
2917 - added new layout tests for underlining:
2919 * layout-tests/editing/editing.js:
2920 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt: Added.
2921 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt: Added.
2922 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold.html: Added.
2923 * layout-tests/editing/style/remove-underline-across-paragraph.html: Added.
2924 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt: Added.
2925 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt: Added.
2926 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold.html: Added.
2927 * layout-tests/editing/style/remove-underline-after-paragraph.html: Added.
2928 * layout-tests/editing/style/remove-underline-expected.txt: Added.
2929 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt: Added.
2930 * layout-tests/editing/style/remove-underline-from-stylesheet.html: Added.
2931 * layout-tests/editing/style/remove-underline-in-bold-expected.txt: Added.
2932 * layout-tests/editing/style/remove-underline-in-bold.html: Added.
2933 * layout-tests/editing/style/remove-underline.html: Added.
2934 * layout-tests/editing/style/underline-expected.txt: Added.
2935 * layout-tests/editing/style/underline.html: Added.
2937 2005-01-27 David Hyatt <hyatt@apple.com>
2939 Fix for 3875199, search field needs to be able to show a magnifying glass without a dropdown menu.
2941 Reviewed by kocienda
2943 * khtml/html/html_formimpl.cpp:
2944 (DOM::HTMLInputElementImpl::HTMLInputElementImpl):
2945 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
2946 * kwq/KWQLineEdit.mm:
2947 (QLineEdit::setMaxResults):
2949 2005-01-27 Ken Kocienda <kocienda@apple.com>
2955 <rdar://problem/3973254> Deletions of ranges does not coalesce correctly with subsequent typing
2957 * khtml/editing/htmlediting.cpp:
2958 (khtml::InsertTextCommand::deleteCharacter): Remove this dead code.
2959 (khtml::ReplaceSelectionCommand::editingAction): Moved this code to a better place in the file.
2960 It was in with unrelated functions.
2961 (khtml::TypingCommand::TypingCommand): Reorganize initialization list so it is easier to read.
2962 (khtml::TypingCommand::issueCommandForDeleteKey): Remove dead code. Roll in remaining code into deleteKeyPressed.
2963 (khtml::TypingCommand::deleteKeyPressed): Add in support for carrying along smart delete flag.
2964 (khtml::TypingCommand::forwardDeleteKeyPressed): New function. Makes forward delete work like
2965 "regular" delete in terms of coalescing typing.
2966 (khtml::TypingCommand::doApply): Add case for ForwardDeleteKey.
2967 (khtml::TypingCommand::preservesTypingStyle): Ditto.
2968 * khtml/editing/htmlediting.h:
2969 (khtml::TypingCommand::): Add ForwardDeleteKey constant. Remove a couple declarations for now-dead code.
2970 (khtml::TypingCommand::smartDelete): New accessor.
2971 (khtml::TypingCommand::setSmartDelete): Ditto.
2972 * kwq/WebCoreBridge.h:
2973 * kwq/WebCoreBridge.mm:
2974 (-[WebCoreBridge deleteKeyPressedWithSmartDelete:]): Add smart delete flag.
2975 (-[WebCoreBridge forwardDeleteKeyPressedWithSmartDelete:]): New method.
2976 * khtml/editing/jsediting.cpp: Add supprt for ForwardDelete command
2977 * layout-tests/editing/editing.js: Ditto.
2978 * layout-tests/editing/deleting/delete-and-undo-expected.txt: Added.
2979 * layout-tests/editing/deleting/delete-and-undo.html: Added.
2980 * layout-tests/editing/deleting/forward-delete-expected.txt: Added.
2981 * layout-tests/editing/deleting/forward-delete.html: Added.
2985 2005-01-27 David Harrison <harrison@apple.com>
2989 <rdar://problem/3962214> AX: AXLeftLineTextMarkerRangeForTextMarker returns incorrect range
2991 * kwq/KWQAccObject.mm:
2992 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2993 Allowed for selection to end of line including the linebreak.
2995 2005-01-27 David Harrison <harrison@apple.com>
2997 Reviewed by Darin, Ken.
2999 <rdar://problem/3964470> AX: Include attachments in AXAttributedStringForTextMarkerRange
3001 * kwq/KWQAccObject.mm:
3002 (-[KWQAccObject isAttachment]):
3003 (-[KWQAccObject attachmentView]):
3004 (-[KWQAccObject role]):
3005 (-[KWQAccObject subrole]):
3006 (-[KWQAccObject roleDescription]):
3007 (-[KWQAccObject value]):
3008 (-[KWQAccObject title]):
3009 (-[KWQAccObject accessibilityDescription]):
3010 (-[KWQAccObject accessibilityIsIgnored]):
3011 (-[KWQAccObject accessibilityAttributeNames]):
3012 (-[KWQAccObject accessibilityAttributeValue:]):
3013 Make attachments accessible.
3015 (CreateCGColorIfDifferent):
3016 (AXAttributeStringSetColor):
3017 (AXAttributeStringSetNumber):
3018 (AXAttributeStringSetFont):
3019 (AXAttributeStringSetStyle):
3020 (AXAttributeStringSetElement):
3021 (AXLinkElementForNode):
3022 (AXAttributedStringAppendText):
3023 (AXAttributedStringAppendReplaced):
3024 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
3025 Add attachments and more text attributes to AXAttributedStringForTextMarkerRange.
3027 2005-01-27 Darin Adler <darin@apple.com>
3031 - fixed <rdar://problem/3807935> DOM CSS computed style line-height is wrong in two ways
3033 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3034 Use specified size rather than computed size when dealing with a percentage for line height.
3036 2005-01-27 Darin Adler <darin@apple.com>
3040 - fixed <rdar://problem/3971372> SWB: template function DOM_cast() won't compile with gcc 4.0
3041 - fixed other gcc 4.0 compiling problems Patrick Beard pointed out on the phone
3043 * kwq/DOMInternal.h: (DOM_cast): Change the "failToCompile()" trick to use a dependent name.
3044 Nowadays, if a name is not dependent, it is checked at template definition time. But we want
3045 a failure only at template instantiation time.
3047 * ForwardingHeaders/editing/text_granularity.h: Added. Needed but a bug in the 3.3 compiler made
3048 it compile anyway without this.
3052 * khtml/html/html_miscimpl.h: For clarity, mark these functions virtual too. They are automatically
3053 virtual because the base class ones are virtual, but it's ugly to leave it this way.
3055 2005-01-26 Ken Kocienda <kocienda@apple.com>
3061 <rdar://problem/3971609> REGRESSION (Mail): up/down arrow navigation broken after rewrapping text by resizing window
3062 <rdar://problem/3975661> REGRESSION (Mail): left/right arrow navigation can place insertion point after last character on line
3064 * khtml/editing/selection.cpp:
3065 (khtml::Selection::modifyAffinity): PARAGRAPH and LINE movements should not alter affinity. This was
3066 just a mistake before when it reset to upstream in some cases.
3067 * khtml/rendering/render_line.cpp:
3068 (khtml::RootInlineBox::closestLeafChildForXPos): Move this function down from InlineBox, and
3069 rework the implementation. This fixes 3971609.
3070 * khtml/rendering/render_line.h:
3071 * khtml/rendering/render_text.cpp:
3072 (RenderText::caretRect): Rework the algorithm to fix 3975661. This regressed when we began placing
3073 the spaces on the end of lines in text boxes when lines wrap.
3075 2005-01-26 Richard Williamson <rjw@apple.com>
3077 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
3079 I added a member variable to ObjectImp. This changed it's size and consequently
3080 hampered the optimizations built into the garbage collector. Objects no longer
3081 fit within the allocators cell size, and thus allocation fell back to a slower
3084 As a result of this fix I also dramatically cleaned up how runtime objects are
3085 accessed. The path mostly *removes* code.
3089 * khtml/ecma/kjs_dom.cpp:
3090 (DOMDocumentProtoFunc::tryCall):
3091 (DOMElementProtoFunc::tryCall):
3092 (KJS::getRuntimeObject):
3093 * khtml/ecma/kjs_dom.h:
3094 * khtml/ecma/kjs_html.cpp:
3095 (KJS::HTMLDocument::tryGet):
3096 (KJS::HTMLElement::tryGet):
3097 (KJS::HTMLElement::implementsCall):
3098 (KJS::HTMLElement::call):
3099 (KJS::HTMLElement::tryPut):
3100 (KJS::HTMLCollection::tryGet):
3101 (KJS::HTMLCollection::getNamedItems):
3102 * khtml/ecma/kjs_html.h:
3103 * khtml/ecma/kjs_window.cpp:
3106 2005-01-26 Richard Williamson <rjw@apple.com>
3108 Fixed <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
3110 For now we are using ICU UBreakIterator to determine grapheme boundaries for
3111 cursor and deletion. This does not match what Cocoa does exactly, but does match
3112 what Carbon does. The areas are difference are obscure, but, according to
3113 Deborah Goldsmith, using the UBreakIterator is the reasonable approach.
3117 * khtml/rendering/render_text.cpp:
3118 (RenderText::previousOffset):
3119 (RenderText::nextOffset):
3121 2005-01-25 David Harrison <harrison@apple.com>
3123 Reviewed by Maciej and Richard.
3125 <rdar://problem/3963731> AX VO: Changing window sizes causes a crash using with Voice Over - KWQPtrDictImpl::clear
3127 * khtml/html/html_miscimpl.cpp:
3128 (HTMLCollectionImpl::HTMLCollectionImpl):
3129 Ensure that isHTMLDocument before calling HTMLDocument-only method.
3131 2005-01-25 Richard Williamson <rjw@apple.com>
3133 Part one of fix for <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
3135 This patch changes the semantics of next() and previous() on
3136 VisiblePosition to move a grapheme (character cluster) at a
3137 time. This means that cursor navigation with correctly move
3138 over an entire cluster.
3140 However, the expected behavior for deleting a grapheme is to
3141 delete individual code points, thus decomposing the grapheme
3142 into it constituent parts. That will be addressed in the next
3147 * khtml/editing/visible_position.cpp:
3148 (khtml::VisiblePosition::previousPosition):
3149 (khtml::VisiblePosition::nextPosition):
3150 * khtml/editing/visible_position.h:
3151 * khtml/rendering/render_object.cpp:
3152 (RenderObject::previousOffset):
3153 (RenderObject::nextOffset):
3154 * khtml/rendering/render_object.h:
3155 * khtml/rendering/render_text.cpp:
3156 (RenderText::previousOffset):
3157 (RenderText::nextOffset):
3158 (RenderText::findNextInlineTextBox):
3159 * khtml/rendering/render_text.h:
3160 * khtml/xml/dom_nodeimpl.cpp:
3161 (NodeImpl::previousOffset):
3162 (NodeImpl::nextOffset):
3163 * khtml/xml/dom_nodeimpl.h:
3165 2005-01-25 David Harrison <harrison@apple.com>
3169 <rdar://problem/3973067> AXWebArea for http://apple.netscape.com/ has an empty AXLinkUIElements
3171 * kwq/KWQAccObject.mm:
3172 (-[KWQAccObject accessibilityAttributeValue:]):
3173 Omit ignored AXLinks from AXLinkUIElements result
3175 2005-01-25 Ken Kocienda <kocienda@apple.com>
3181 <rdar://problem/3972851> REGRESSION (179-180+): Repro crash in ApplyStyleCommand::cleanUpEmptyStyleSpans
3183 * khtml/editing/htmlediting.cpp:
3184 (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans): Added two null checks.
3186 2005-01-25 Ken Kocienda <kocienda@apple.com>
3192 <rdar://problem/3954710> Mail crashed while editing signatures - NodeImpl::isBlockFlow
3194 The fix is more general than for this one bug, and may work to fix many crashers. The problem
3195 is that the ReplaceSelectionCommand never checked whether its starting selection is empty. If
3196 it is, then we need to bail before doing the work of the command, which we need to deref the
3197 start and end points of the selection in order to do its work. I think you can see the crash
3200 * khtml/editing/htmlediting.cpp:
3201 (khtml::ReplaceSelectionCommand::doApply): Assert selection is not empty.
3202 * kwq/WebCoreBridge.mm:
3203 (partHasSelection): New helper function to test that bridge has a part with a selection.
3205 Use new helper function to test part and selection; return from these function if this test fails.
3207 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:])
3208 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:])
3209 (-[WebCoreBridge alterCurrentSelection:direction:granularity:])
3210 (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:])
3211 (-[WebCoreBridge alterCurrentSelection:verticalDistance:])
3212 (-[WebCoreBridge documentFragmentWithText:])
3213 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
3214 (-[WebCoreBridge insertLineBreak])
3215 (-[WebCoreBridge insertParagraphSeparator])
3216 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent])
3217 (-[WebCoreBridge insertText:selectInsertedText:])
3218 (-[WebCoreBridge deleteSelectionWithSmartDelete:])
3219 (-[WebCoreBridge ensureSelectionVisible])
3221 2005-01-24 Kevin Decker <kdecker@apple.com>
3225 Fixed <rdar://problem/3932374> REGRESSION: 'ReferenceError - Can't find variable' JavaScript error at webxpress.fidelity.com
3227 * khtml/html/html_miscimpl.h: Missing virtual identifiers for namedItem() and nextNamedItem() exposed a flaw that prevented finding variables in form [HTMLFormCollectionImpl] scopes.
3230 2005-01-24 Vicki Murley <vicki@apple.com>
3232 Reviewed by kocienda.
3234 - fix <rdar://problem/3810661> computed style not handled for Apple extensions
3236 * khtml/css/css_computedstyle.cpp: (DOM::):
3237 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): add -apple-line-clamp and -apple-text-size-adjust
3239 2005-01-24 Darin Adler <darin@apple.com>
3243 - fixed <rdar://problem/3969884> REGRESSION (179-180): Typing password not echoed as "bullets" at paypal.com when field is first focused
3245 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]):
3246 Sizing up the form editor, which fixes things for normal fields and search fields,
3247 screws things up for password fields. Eventually, I'll need to figure out why this is
3248 and file a bug so that the AppKit team fixes it. In the mean time, just check for the
3249 case of the secure text field, and don't size up in that case.
3251 2005-01-24 Ken Kocienda <kocienda@apple.com>
3257 <rdar://problem/3963560> 8A354: Inserting Japanese text to the line head causes line break
3259 * khtml/editing/htmlediting.cpp:
3260 (khtml::ReplaceSelectionCommand::doApply): Add one more case where we merge content into the
3261 existing line. This covers the situation see using the steps to reproduce this bug.
3263 2005-01-21 Maciej Stachowiak <mjs@apple.com>
3267 <rdar://problem/3967572> Editing should split elements before removing style
3269 * khtml/editing/htmlediting.cpp:
3270 (khtml::CompositeEditCommand::splitElement):
3271 (khtml::CompositeEditCommand::mergeIdenticalElements):
3272 (khtml::CompositeEditCommand::wrapContentsInDummySpan):
3273 (khtml::CompositeEditCommand::splitTextNodeContainingElement):
3274 (khtml::ApplyStyleCommand::applyInlineStyle):
3275 (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
3276 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
3277 (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
3278 (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
3279 (khtml::areIdenticalElements):
3280 (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
3281 (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
3282 (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans):
3283 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
3284 (khtml::InsertParagraphSeparatorCommand::doApply):
3285 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
3286 (khtml::InsertTextCommand::prepareForTextInsertion):
3287 (khtml::SplitTextNodeCommand::doUnapply):
3288 (khtml::SplitElementCommand::SplitElementCommand):
3289 (khtml::SplitElementCommand::~SplitElementCommand):
3290 (khtml::SplitElementCommand::doApply):
3291 (khtml::SplitElementCommand::doUnapply):
3292 (khtml::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand):
3293 (khtml::MergeIdenticalElementsCommand::~MergeIdenticalElementsCommand):
3294 (khtml::MergeIdenticalElementsCommand::doApply):
3295 (khtml::MergeIdenticalElementsCommand::doUnapply):
3296 (khtml::WrapContentsInDummySpanCommand::WrapContentsInDummySpanCommand):
3297 (khtml::WrapContentsInDummySpanCommand::~WrapContentsInDummySpanCommand):
3298 (khtml::WrapContentsInDummySpanCommand::doApply):
3299 (khtml::WrapContentsInDummySpanCommand::doUnapply):
3300 (khtml::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand):
3301 (khtml::SplitTextNodeContainingElementCommand::~SplitTextNodeContainingElementCommand):
3302 (khtml::SplitTextNodeContainingElementCommand::doApply):
3303 * khtml/editing/htmlediting.h:
3305 New layout test that shows the side benefit of this.
3307 * layout-tests/editing/style/unbold-in-bold-expected.txt: Added.
3308 * layout-tests/editing/style/unbold-in-bold.html: Added.
3310 2005-01-24 Darin Adler <darin@apple.com>
3314 - fixed <rdar://problem/3933435> -[DOMRange cloneContents] sometimes alters the original DOMRange
3316 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Fixed code that was collapsing
3317 the range after processing the contents. That's right for extract and delete, but not clone.
3319 - fixed <rdar://problem/3714184> inline input works incorrectly when I type Korean slowly in textfield in form on www.google.co.kr
3320 - fixed <rdar://problem/3193848> Can't enter SSN to sign up for Chase visa online account (changing focus inside key press handler)
3321 - 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>
3323 * kwq/KWQLineEdit.mm:
3324 (QLineEdit::text): Changed to call a new string method on the controller instead of calling
3325 stringValue, since stringValue has a bad side effect of ending inline input.
3326 (QLineEdit::selectAll): Changed to only call selectText: when the field is already selected.
3327 When you are giving the field focus, it automatically gets all selected, and this change
3328 is required in the case where we defer the focus change.
3330 * kwq/KWQTextField.h: Added a new string method to the controller.
3331 * kwq/KWQTextField.mm:
3332 (-[KWQTextFieldController setMaximumLength:]): Call the new string method instead of using stringValue.
3333 (-[KWQTextFieldController controlTextDidChange:]): Removed the code to truncate at the first CR or LF.
3334 That's now handled in the shouldChangeTextInRange method instead.
3335 (-[KWQTextFieldController textView:shouldHandleEvent:]): Add new logic to defer responder changes until
3336 after the event is handled. This makes sure the key gets into the field that's already handling it at
3337 rather than ending up in the newly-focused field if the key press handler focuses a different element.
3338 (-[KWQTextFieldController textView:didHandleEvent:]): Turn off deferral here, now that the key press
3340 (-[KWQTextFieldController string]): Added. Calls stringValue only if there's no editor. If there is
3341 an editor, calls string on that instead.
3342 (-[KWQTextFieldController textView:shouldChangeTextInRange:replacementString:]): Added. Called by
3343 the three field subclasses. Truncates incoming strings at the first CR or LF character. This works
3344 properly with Undo, and the old technique did not.
3345 (-[KWQTextFieldController preprocessString:]): Added. Helper used for all the setStringValue methods
3346 so they all truncate at the first CR or LF as well as truncating to the appropriate length.
3347 (-[KWQTextField setStringValue:]): Changed to call the controller.
3348 (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): Added. Calls the controller.
3349 (-[KWQSecureTextField setStringValue:]): More of the same.
3350 (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
3351 (-[KWQSearchField setStringValue:]): Ditto.
3352 (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
3354 * kwq/KWQWidget.h: Added the new setDeferFirstResponderChanges function.
3356 (QWidget::~QWidget): Clear out the deferredFirstResponder global just in case we are destroyed
3357 while we "have the ball".
3358 (QWidget::hasFocus): If we are in the deferred mode, use the global to decide who to say is focused.
3359 (QWidget::setFocus): If we are in the deferred mode, set the global instead of making something be
3360 the first responder.
3361 (QWidget::setDeferFirstResponderChanges): Set the boolean. If the boolean is being cleared, then
3362 get the deferred first responder and call setFocus on it again, which will do the work we didn't
3365 2005-01-24 Ken Kocienda <kocienda@apple.com>
3371 <rdar://problem/3964350> Deleting all content and typing in a message gets one letter, then beeps
3373 This is a problem with the way we turn key events, when a user starts typing, into editing commands.
3374 Right now, that initial delete key in an empty window is turned into an editing command, and much
3375 editing code runs that need not run. What's more, this is confusing the selection machinery. The
3376 solution is to detect the "delete in an empty window" case and don't turn this into an editing
3379 * khtml/editing/htmlediting.cpp:
3380 (khtml::TypingCommand::deleteKeyPressed)
3382 2005-01-23 Adele Amchan <adele@apple.com>
3384 Fixed <rdar://problem/3964286> REGRESSION (178-179): menus and "go to old site" link at Ameritrade's new site don't work
3386 Removed check for document from checkCompleted. In this case, WebCore never knew that a WebImageView was complete because
3387 it fell into this document check case in checkCompleted.
3388 Added check for document to tokenizerProcessedData (see <rdar://problem/3807144>)
3392 * khtml/khtml_part.cpp:
3394 (KHTMLPart::checkCompleted):
3395 * khtml/khtml_part.h:
3396 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::tokenizerProcessedData):
3398 2005-01-21 Richard Williamson <rjw@apple.com>
3400 Fixed <rdar://problem/3759399> Javascript / Liveconnect problems ((event handler):Undefined value)
3402 Java applets specified with <object> or <embed> weren't scriptable. Now they are.
3406 * khtml/html/html_objectimpl.cpp:
3407 (HTMLEmbedElementImpl::getEmbedInstance):
3408 (HTMLObjectElementImpl::getObjectInstance):
3410 2005-01-21 Ken Kocienda <kocienda@apple.com>
3416 <rdar://problem/3959464> REGRESSION (Mail): Insertion point goes back to beginning of document after deleting
3418 * khtml/editing/htmlediting.cpp:
3419 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add special case to handle retaining a fully-selected block.
3421 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt: Added.
3422 * layout-tests/editing/deleting/delete-3959464-fix.html: Added.
3424 2005-01-21 Richard Williamson <rjw@apple.com>
3426 Fixed <rdar://problem/3966998> REGRESSION(179-TOT) clicking on gmail message brings me to blank screen
3428 getElementById() sometimes returns Undefined() instead of Null().
3432 * khtml/ecma/kjs_dom.cpp:
3433 (DOMDocumentProtoFunc::tryCall):
3435 2005-01-21 David Hyatt <hyatt@apple.com>
3437 Fix for 3773809, make sure that overflow regions never end up at an invalid scroll offset because of a layout change.
3439 Reviewed by kocienda
3441 * khtml/rendering/render_layer.cpp:
3442 (RenderLayer::updateScrollInfoAfterLayout):
3444 2005-01-21 David Hyatt <hyatt@apple.com>
3446 Fix for 3966349, hang loading page. Make sure that loops using popOneBlock properly check for a null
3447 blockStack to avoid an infinite loop.
3449 Reviewed by kocienda
3451 * khtml/html/htmlparser.cpp:
3452 (KHTMLParser::parseToken):
3453 (KHTMLParser::insertNode):
3454 (KHTMLParser::popInlineBlocks):
3456 2005-01-21 Ken Kocienda <kocienda@apple.com>
3462 <rdar://problem/3957204> Mail crashed when sending a message in ~InsertParagraphSeparatorInQuotedContentCommand
3464 * khtml/editing/htmlediting.cpp:
3465 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
3466 InsertParagraphSeparatorInQuotedContentCommand has this member variable: DOM::ElementImpl *m_breakNode;
3467 I failed to initialize this variable to null in the constructor, and there is an uncommonly-traveled
3468 code path which does not set this variable to something good. In the destructor, we check for null,
3469 and deref if non-null. Obvious "BOOM" potential. Fixed.
3471 2005-01-21 Ken Kocienda <kocienda@apple.com>
3477 <rdar://problem/3966311> REGRESSION (Mail): Hitting return makes space character disappear
3479 * khtml/editing/htmlediting.cpp:
3480 (khtml::InsertParagraphSeparatorCommand::doApply): When writing the code to insert a block
3481 in response to the return key, I did not write code to cover the case described in the bug.
3483 * layout-tests/editing/inserting/insert-div-025-expected.txt: Added.
3484 * layout-tests/editing/inserting/insert-div-025.html: Added.
3486 2005-01-20 Maciej Stachowiak <mjs@apple.com>
3490 <rdar://problem/3965196> security fix for javascript: exploit missed one case (already fixed in updates)
3492 * khtml/ecma/kjs_window.cpp:
3493 (WindowFunc::tryCall): correct mistake in earlier fix for the following bug, caught by Adele:
3495 2005-01-20 Maciej Stachowiak <mjs@apple.com>
3499 <rdar://problem/3965466> editing needs to insert text before applying typing style
3501 * khtml/editing/htmlediting.cpp:
3502 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Remove a FIXME comment.
3503 (khtml::InsertLineBreakCommand::doApply): Apply style to the BR
3504 node after inserting it.
3505 (khtml::InsertTextCommand::prepareForTextInsertion): Don't try to
3506 apply style to any new nodes created before inserting.
3507 (khtml::InsertTextCommand::input): Apply style to the inserted range
3508 after doing the text insert.
3509 * khtml/editing/htmlediting.h:
3511 This change leads to improved results on one of the layout tests:
3513 * layout-tests/editing/inserting/insert-div-024-expected.txt:
3517 2005-01-20 Ken Kocienda <kocienda@apple.com>
3523 <rdar://problem/3964646> REGRESSION (179-180): Typing space at end of line makes following paragraph disappear
3525 * khtml/editing/htmlediting.cpp:
3526 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Recent change to block placeholder removal code
3527 caused this regression. The code became too aggressive in removing block placeholders, and would remove them
3528 from blocks other than the block containing the selection.
3529 * layout-tests/editing/inserting/insert-div-023-expected.txt: This file had a spurious BR element in it that
3530 I did not notice earlier.
3531 * layout-tests/editing/inserting/insert-div-024-expected.txt: Ditto.
3533 2005-01-20 David Hyatt <hyatt@apple.com>
3535 Fix for oddness on albertsons.com. Make sure not to crash when setting/removing style properties on a node
3536 with no document. The bug # is 3813900.
3540 2005-01-20 David Harrison <harrison@apple.com>
3544 PARTIAL fix for following bug. Create attributed string with fonts and links. Still need to add attachments.
3545 <rdar://problem/3942606> AX: Support kAXAttributedStringForTextMarkerRangeParameterizedAttribute
3547 * kwq/KWQAccObject.mm:
3548 (-[KWQAccObject textUnderElement]):
3549 Touched up previous checkin to match code review comments.
3551 (-[KWQAccObject value]):
3552 Use plainText for this one instead of obsolete attributedString.
3554 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
3555 Advertise AXAttributedStringForTextMarkerRange.
3557 (AXAttributeStringAddFont):
3558 (AXAttributeStringAddElement):
3559 (-[KWQAccObject linkUIElementForNode:]):
3560 (-[KWQAccObject _addAttachmentForElement:URL:needsParagraph:usePlaceholder:]):
3561 (-[KWQAccObject accessibilityAttributedStringForRange:]):
3562 New routines to support AXAttributedStringForTextMarkerRange.
3564 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
3565 Use new routines instead of obsolete attributedString.
3567 2005-01-20 David Harrison <harrison@apple.com>
3571 <rdar://problem/3960196> AX Crash in DOM::Range::setStartBefore
3573 * khtml/xml/dom_docimpl.cpp:
3574 (DocumentImpl::getAccObjectCache):
3575 Adjust when detecting cache in non-top level WebArea.
3576 * kwq/KWQAccObject.mm:
3577 (-[KWQAccObject textUnderElement]):
3578 (-[KWQAccObject accessibilityAttributeValue:]):
3579 Make sure the elements document is the current one for the part.
3581 2005-01-20 Darin Adler <darin@apple.com>
3585 - fixed <rdar://problem/3922980> Mail not crashing, just quitting itself suddenly in -[WebHTMLView(MailExtras) findString:options:]
3587 * khtml/dom/dom2_range.cpp: (DOM::operator==): Handle null and detached ranges without raising exceptions.
3588 The uncaught exception would make the entire program terminate.
3590 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
3592 * kwq/DOM-CSS.mm: (-[DOMCSSStyleDeclaration setProperty:::]): Uncommented this code which I had to disable
3593 back in November because Mail was stumbling over it.
3595 - fixed <rdar://problem/3943049> focus() called during onload handler results in square text field on <input type=search>
3597 * kwq/KWQLineEdit.mm: (QLineEdit::baselinePosition): Change computation so it will work even for fields
3598 that position their text in a way that depends on vertical size. In the case of a search field, the text
3599 is centered, so the old logic was broken.
3600 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Set the frame size to
3601 something large enough to accomodate the field editor. If we start the frame at size 0,0 we run into
3602 AppKit trouble when it insets the frame to figure out the frame for the field editor. In the case of this
3603 bug this happens because we become first responder before being sized and positioned by the HTML layout code.
3605 - improved debugging output when using "po" from gdb with Objective-C DOM
3608 (-[DOMNode description]): Added. Includes node name ("<tr>") and node value (e.g., string for text node).
3609 (-[DOMRange description]): Tweaked format.
3611 2005-01-19 Richard Williamson <rjw@apple.com>
3613 After further discussion with Real we have decided to NOT include the
3614 additional CLSID for the real plugin. See 3958601.
3618 * khtml/rendering/render_frames.cpp:
3619 (RenderPartObject::updateWidget):
3621 2005-01-19 David Harrison <harrison@apple.com>
3625 <rdar://problem/3949429> AX: word marker routines returns incorrect data for empty line
3627 Previous checkin for this bug was missing some of the patch. Editing snafu with multiple changes in tree.
3629 * kwq/KWQAccObject.mm:
3630 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
3631 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
3632 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
3633 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
3634 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
3635 (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
3636 (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
3638 2005-01-19 Ken Kocienda <kocienda@apple.com>
3642 * khtml/editing/htmlediting.cpp:
3643 (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Small, cosmetic change John and I decided
3644 to do on my last checkin, but I forgot to do before landing.
3646 2005-01-19 Ken Kocienda <kocienda@apple.com>
3652 <rdar://problem/3959727> REGRESSION (Mail): Style not preserved on blank lines
3654 * khtml/editing/htmlediting.cpp:
3655 (khtml::CompositeEditCommand::applyStyle):
3656 (khtml::CompositeEditCommand::insertBlockPlaceholder): New function that unconditionally adds a block placeholder.
3657 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Now returns bool based on whether
3658 placeholder was added or not.
3659 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now searches all the descendents of a block
3660 looking for a placeholder. The old code, which just looked at the last child of a node, started missing
3661 once block placeholders became styled (which started happening with this patch).
3662 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Now handles applying typing style
3663 to a block placeholder at call time, rather than setting the typing style as a latent style that
3664 might be applied later. This is an important part of the bug fix.
3665 (khtml::DeleteSelectionCommand::doApply): Now uses bool return value from insertBlockPlaceholderIfNeeded()
3666 and passes it along to calculateStyleBeforeInsertion, so the case where a block placeholder needs to
3667 be styled can be detected.
3668 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Changed the way this class
3669 managed style. Before it would calculate and set typing style for the block added. This is not
3670 sufficient. Added blocks need to styled immediately. Some name changes to instance variables in
3671 this class due to the change to accommodate this change.
3672 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Name changes, as above.
3673 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Ditto.
3674 (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Ditto.
3675 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
3676 (khtml::ReplaceSelectionCommand::doApply): Improve check for testing when a placeholder
3677 block can be removed in its entirety after the insertion.
3678 * khtml/editing/htmlediting.h: Update header accordingly.
3679 * khtml/khtml_part.cpp:
3680 (KHTMLPart::selectionComputedStyle): Move position for computed style check downstream before
3681 doing check when the position is in an empty block (this makes sure any style on any block
3682 placeholder is accounted for).
3684 New layout tests to check bug fix.
3686 * layout-tests/editing/style/block-style-004-expected.txt: Added.
3687 * layout-tests/editing/style/block-style-004.html: Added.
3688 * layout-tests/editing/style/block-style-005-expected.txt: Added.
3689 * layout-tests/editing/style/block-style-005.html: Added.
3690 * layout-tests/editing/style/block-style-006-expected.txt: Added.
3691 * layout-tests/editing/style/block-style-006.html: Added.
3693 Results updated to reflect new block placeholder code.
3695 * layout-tests/editing/inserting/insert-div-004-expected.txt
3696 * layout-tests/editing/inserting/insert-div-005-expected.txt
3697 * layout-tests/editing/inserting/insert-div-006-expected.txt
3698 * layout-tests/editing/inserting/insert-div-008-expected.txt
3699 * layout-tests/editing/inserting/insert-div-011-expected.txt
3700 * layout-tests/editing/inserting/insert-div-012-expected.txt
3701 * layout-tests/editing/inserting/insert-div-013-expected.txt
3702 * layout-tests/editing/inserting/insert-div-014-expected.txt
3703 * layout-tests/editing/inserting/insert-div-015-expected.txt
3704 * layout-tests/editing/inserting/insert-div-016-expected.txt
3705 * layout-tests/editing/inserting/insert-div-017-expected.txt
3706 * layout-tests/editing/inserting/insert-div-018-expected.txt
3707 * layout-tests/editing/inserting/insert-div-019-expected.txt
3708 * layout-tests/editing/inserting/insert-div-021-expected.txt
3709 * layout-tests/editing/inserting/insert-div-022-expected.txt
3710 * layout-tests/editing/inserting/insert-div-023-expected.txt
3711 * layout-tests/editing/inserting/insert-div-024-expected.txt
3713 2005-01-19 David Hyatt <hyatt@apple.com>
3715 Dont null-check the renderer before submitting, since a script can set it to display:none and still expect the
3716 submission to occur. Fixes bug #3477282.
3720 (DOM::HTMLInputElementImpl::defaultEventHandler):
3722 2005-01-18 Richard Williamson <rjw@apple.com>
3724 Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
3726 Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
3727 Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
3728 Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
3729 Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
3731 We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
3732 tags. Also, if any of these elements are named they can be accessed from the document or window objects.
3733 Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
3737 * khtml/dom/html_document.cpp:
3738 (HTMLDocument::objects):
3739 * khtml/dom/html_document.h:
3740 * khtml/ecma/kjs_dom.cpp:
3741 (DOMDocumentProtoFunc::tryCall):
3742 (DOMElementProtoFunc::tryCall):
3743 (KJS::getRuntimeObject):
3744 * khtml/ecma/kjs_dom.h:
3745 * khtml/ecma/kjs_html.cpp:
3746 (KJS::HTMLDocument::tryGet):
3747 (KJS::HTMLElement::tryGet):
3748 (KJS::HTMLCollection::tryGet):
3749 (KJS::HTMLCollection::getNamedItems):
3750 * khtml/ecma/kjs_window.cpp:
3752 * khtml/html/html_miscimpl.cpp:
3753 (HTMLCollectionImpl::traverseNextItem):
3754 * khtml/html/html_miscimpl.h:
3755 (DOM::HTMLCollectionImpl::):
3756 * khtml/html/html_objectimpl.cpp:
3757 (HTMLAppletElementImpl::getAppletInstance):
3758 (HTMLObjectElementImpl::HTMLObjectElementImpl):
3759 (HTMLObjectElementImpl::getObjectInstance):
3760 * khtml/html/html_objectimpl.h:
3761 * khtml/rendering/render_frames.cpp:
3762 (RenderPartObject::updateWidget):
3763 * kwq/KWQKHTMLPart.h:
3764 * kwq/KWQKHTMLPart.mm:
3765 (KWQKHTMLPart::getObjectInstanceForView):
3767 2005-01-18 David Hyatt <hyatt@apple.com>
3769 Fix for 3948123, rolling over link erases nearby text. The repaint rect check for lines was wrong whenever
3770 two lines overlapped.
3772 Reviewed by kocienda
3774 * khtml/rendering/render_flow.cpp:
3775 (RenderFlow::paintLines):
3777 2005-01-18 Ken Kocienda <kocienda@apple.com>
3783 <rdar://problem/3960116> Focus rings paint incorrectly for contenteditable blocks in web pages
3785 * khtml/rendering/render_flow.cpp:
3786 (RenderFlow::addFocusRingRects): Fix painting of focus rings so that ring only paints around
3787 outermost contenteditable elements.
3789 2005-01-18 David Harrison <harrison@apple.com>
3793 <rdar://problem/3959668> accessibilityFocusedUIElement sometimes returns an ignored element; it must not
3795 * kwq/KWQAccObject.mm:
3796 (-[KWQAccObject accessibilityFocusedUIElement]):
3797 Return parentObjectUnignored if focused object is ignored.
3799 2005-01-18 Ken Kocienda <kocienda@apple.com>
3805 <rdar://problem/3952877> REGRESSION (Mail): Command-left/right-arrows don't work with file attachment
3807 * khtml/editing/selection.cpp:
3808 (khtml::nodeForInlineBox): New helper function used in reimplementation of function below.
3809 (khtml::selectionForLine): Reimplemented using line box smarts. I originally wrote this code when
3810 I had a less than full understanding of line layout. I can do better now, and my new version no
3811 longer fails to notice attachments when doing the kind of navigation mentioned in the bug.
3813 2005-01-17 David Harrison <harrison@apple.com>
3815 Reviewed by John Sullivan.
3817 <rdar://problem/3949429> AX: word marker routines returns incorrect data for empty line
3818 <rdar://problem/3949848> AX: paragraph marker routines do not work when given a paragraph end marker
3820 Also fixed sentence support in the same way.
3822 * kwq/KWQAccObject.mm:
3823 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
3824 (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
3825 (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
3826 (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
3827 (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
3828 Move one position in desired direction before calling visible_units.cpp code.
3830 2005-01-17 David Harrison <harrison@apple.com>
3832 Updated expected test results.
3834 <rdar://problem/3945880> line-ending space seems not to be present
3836 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt:
3837 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt:
3838 * layout-tests/editing/inserting/insert-div-020-expected.txt:
3839 * layout-tests/editing/inserting/insert-div-021-expected.txt:
3840 * layout-tests/editing/inserting/insert-div-022-expected.txt:
3841 * layout-tests/editing/inserting/insert-div-023-expected.txt:
3842 * layout-tests/editing/inserting/insert-div-024-expected.txt:
3844 2005-01-17 David Harrison <harrison@apple.com>
3846 Reviewed by Dave Hyatt (bidi.cpp) and Darin Adler (selection.cpp).
3848 <rdar://problem/3945880> line-ending space seems not to be present
3850 * khtml/editing/selection.cpp: