1 2005-03-01 Maciej Stachowiak <mjs@apple.com>
5 <rdar://problem/4003774> REGRESSION(125-181): JavaScript problems @ Yankee/Dixie quiz
7 Reworked how scopes are set up for event handlers to match other
8 browser. This includes the following changes:
10 - Special scope entries are set up at the time the event handler
11 is created, not at the time it fires.
13 - Special scope is only set up for event handlers set in the html
14 source through an html attribute, not for handlers set using
15 addEventHandler or setting JS properties like onclick through
18 - Special scope is based on the DOM node on which the handler is
19 an attribute, not the event target.
21 This fixes the regression while allowing the fix to
22 <rdar://problem/3798453> (DIG: getting variable with same name as
23 DOM element attribute gets attribute value instead) to keep
26 * khtml/ecma/kjs_events.cpp:
27 (JSEventListener::handleEvent):
28 (JSLazyEventListener::JSLazyEventListener):
29 (JSLazyEventListener::parseCode):
30 * khtml/ecma/kjs_events.h:
31 * khtml/ecma/kjs_proxy.cpp:
32 (KJSProxyImpl::createHTMLEventHandler):
33 * khtml/ecma/kjs_proxy.h:
34 * khtml/ecma/kjs_window.cpp:
35 (Window::getJSLazyEventListener):
36 * khtml/ecma/kjs_window.h:
37 * khtml/html/html_baseimpl.cpp:
38 (HTMLBodyElementImpl::parseHTMLAttribute):
39 (HTMLFrameElementImpl::parseHTMLAttribute):
40 (HTMLFrameSetElementImpl::parseHTMLAttribute):
41 * khtml/html/html_elementimpl.cpp:
42 (HTMLElementImpl::parseHTMLAttribute):
43 * khtml/html/html_formimpl.cpp:
44 (DOM::HTMLFormElementImpl::parseHTMLAttribute):
45 (DOM::HTMLButtonElementImpl::parseHTMLAttribute):
46 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
47 (DOM::HTMLLabelElementImpl::parseHTMLAttribute):
48 (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
49 (DOM::HTMLTextAreaElementImpl::parseHTMLAttribute):
50 * khtml/html/html_imageimpl.cpp:
51 (HTMLImageElementImpl::parseHTMLAttribute):
52 * khtml/html/html_objectimpl.cpp:
53 (HTMLObjectElementImpl::parseHTMLAttribute):
54 * khtml/khtml_part.cpp:
55 (KHTMLPart::createHTMLEventListener):
57 * khtml/xml/dom_docimpl.cpp:
58 (DocumentImpl::createHTMLEventListener):
59 * khtml/xml/dom_docimpl.h:
61 2005-03-01 David Harrison <harrison@apple.com>
65 <rdar://problem/3915560> Mail would like an SPI to enable "smart" text paste/drop
67 * kwq/WebCoreBridge.h:
68 * kwq/WebCoreBridge.mm:
69 (-[WebCoreBridge smartDeleteRangeForProposedRange:]):
70 (-[WebCoreBridge smartInsertForString:replacingRange:beforeString:afterString:]):
73 2005-03-01 Chris Blumenberg <cblu@apple.com>
75 Fixed: <rdar://problem/4030404> selection granularity should be set when extending selection via JS
79 * khtml/ecma/kjs_window.cpp:
80 (SelectionFunc::tryCall): set the granularity on the part. This will allow us to write smart paste layout tests.
81 * layout-tests/editing/pasteboard/smart-paste-001-expected.txt: Added.
82 * layout-tests/editing/pasteboard/smart-paste-001.html: Added.
83 * layout-tests/editing/pasteboard/smart-paste-002-expected.txt: Added.
84 * layout-tests/editing/pasteboard/smart-paste-002.html: Added.
85 * layout-tests/editing/pasteboard/smart-paste-003-expected.txt: Added.
86 * layout-tests/editing/pasteboard/smart-paste-003.html: Added.
87 * layout-tests/editing/pasteboard/smart-paste-004-expected.txt: Added.
88 * layout-tests/editing/pasteboard/smart-paste-004.html: Added.
89 * layout-tests/editing/pasteboard/smart-paste-005-expected.txt: Added.
90 * layout-tests/editing/pasteboard/smart-paste-005.html: Added.
91 * layout-tests/editing/pasteboard/smart-paste-006-expected.txt: Added.
92 * layout-tests/editing/pasteboard/smart-paste-006.html: Added.
93 * layout-tests/editing/pasteboard/smart-paste-007-expected.txt: Added.
94 * layout-tests/editing/pasteboard/smart-paste-007.html: Added.
96 2005-03-01 Chris Blumenberg <cblu@apple.com>
98 Fixed: <rdar://problem/4029934> smart paste with plain text can add too many spaces
100 Reviewed by kocienda.
102 * khtml/editing/htmlediting.cpp:
103 (khtml::ReplaceSelectionCommand::doApply): pass true for treatNBSPAsWhitespace to leadingWhitespacePosition and trailingWhitespacePosition
104 * khtml/xml/dom_position.cpp:
105 (DOM::isWS): take treatNBSPAsWhitespace param
106 (DOM::Position::leadingWhitespacePosition): ditto
107 (DOM::Position::trailingWhitespacePosition): ditto
108 * khtml/xml/dom_position.h:
110 2005-03-01 Ken Kocienda <kocienda@apple.com>
116 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
118 * khtml/editing/htmlediting.cpp:
119 (khtml::InsertParagraphSeparatorCommand::doApply): Look for the upstream-most block to insert after
120 when at the visible end of a block. This helps to avoid some undesirable sequences of markup which
121 Dave says will be vary hard to render. Changing the command in this way avoids the "limitations"
122 of the render tree by not asking it to render markup we do not want to make anyway.
124 All these tests change, but either in insignificant ways, or for the better.
126 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt:
127 * layout-tests/editing/inserting/insert-div-001-expected.txt:
128 * layout-tests/editing/inserting/insert-div-002-expected.txt:
129 * layout-tests/editing/inserting/insert-div-004-expected.txt:
130 * layout-tests/editing/inserting/insert-div-005-expected.txt:
131 * layout-tests/editing/inserting/insert-div-009-expected.txt:
132 * layout-tests/editing/inserting/insert-div-024-expected.txt:
133 * layout-tests/editing/pasteboard/paste-text-011-expected.txt:
134 * layout-tests/editing/pasteboard/paste-text-013-expected.txt:
135 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
136 * layout-tests/editing/style/block-style-004-expected.txt:
137 * layout-tests/editing/style/block-style-005-expected.txt:
138 * layout-tests/editing/style/block-style-006-expected.txt:
139 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
140 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
141 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
142 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
144 New test to check specific problem mentioned in the bug.
146 * layout-tests/editing/inserting/insert-div-026-expected.txt: Added.
147 * layout-tests/editing/inserting/insert-div-026.html: Added.
149 2005-02-28 Maciej Stachowiak <mjs@apple.com>
153 <rdar://problem/4002864> REGRESSION(125-146) getElementById in onload fails in a test case involving external resources
155 Moved management of elementById hashtable from attach/detach to
156 insertedIntoDocument/removedFromDocument, to avoid being thrown
157 off by temporary detaches due to style recalcs.
159 * khtml/xml/dom_elementimpl.cpp:
160 (ElementImpl::insertedIntoDocument):
161 (ElementImpl::removedFromDocument):
162 (ElementImpl::attach):
163 (ElementImpl::updateId):
164 * khtml/xml/dom_elementimpl.h:
166 Make sure that insertedIntoDocument is called before firing any
169 * khtml/xml/dom_nodeimpl.cpp:
170 (NodeBaseImpl::dispatchChildInsertedEvents):
172 2005-02-28 David Hyatt <hyatt@apple.com>
174 Fix for 4028999, safari crashes when resetting if mallocsribble is on. Clip rects were being cleared using dead
175 render objects. Change the ordering.
179 * khtml/rendering/render_box.cpp:
181 * khtml/rendering/render_layer.cpp:
182 (RenderLayer::~RenderLayer):
184 2005-02-28 Chris Blumenberg <cblu@apple.com>
186 Fixed: <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
188 Reviewed by kocienda.
190 * khtml/editing/htmlediting.cpp:
191 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Call updateLayout so caretMinOffset and caretMaxOffset return correct values.
193 2005-02-28 John Sullivan <sullivan@apple.com>
197 - WebCore part of fix for <rdar://problem/4023490> REGRESSION (125-185): Tabbing through links
198 on frameset page gets stuck at end (tivofaq.com)
200 * kwq/WebCoreBridge.h:
201 add nextValidKeyViewOutsideWebFrameViews (code is in WebKit)
203 2005-02-28 Ken Kocienda <kocienda@apple.com>
209 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
211 * khtml/css/css_computedstyle.cpp: inheritableProperties array now defined in css_valueimpl.cpp.
212 * khtml/css/css_valueimpl.cpp: Define inheritableProperties array here.
213 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Use new name for blockProperties, and use the new
214 constant for the number of items in the array.
215 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
216 (DOM::CSSMutableStyleDeclarationImpl::removeInheritableProperties): New function.
217 * khtml/css/css_valueimpl.h: Declare inheritableProperties array and numInheritableProperties extern so they
218 can be defined in css_valueimpl.cpp and used in css_computedstyle.cpp.
219 * khtml/editing/htmlediting.cpp:
220 (khtml::ReplacementFragment::removeStyleNodes): This code was misguided, and removed too much style from HTML
221 elements. Now, it removes from HTML elements only the styles that we replace later with a call to applyStyle().
222 Also, add ID_B to list of inline "style" nodes we are willing to remove. Leaving it off was an oversight.
224 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: ID_B fix made this result change, without any
225 visible change in the test.
229 * layout-tests/editing/style/smoosh-styles-003.html
230 * layout-tests/editing/style/smoosh-styles-003-expected.txt
232 2005-02-28 Richard Williamson <rjw@apple.com>
234 Fixed <rdar://problem/4026985> CrashTracer: ...14 crashes at com.apple.WebCore: -[KWQPageState invalidate] + 32
236 Added more nil checking and ASSERTS.
237 Without a reproducible case this is hard to definitively resolve.
239 Reviewed by John Sullivan.
241 * kwq/KWQPageState.mm:
242 (-[KWQPageState invalidate]):
244 2005-02-28 Richard Williamson <rjw@apple.com>
246 Fixed <rdar://problem/4027702> 3.5% performance regression btwn Safari-188 and Safari-400
248 I inadvertently checked in some debugging code that disabled
249 style sharing. Backed out that change.
251 * khtml/css/cssstyleselector.cpp:
252 (khtml::CSSStyleSelector::styleForElement):
254 2005-02-28 Chris Blumenberg <cblu@apple.com>
256 Fixed: <rdar://problem/4026639> www.bmw.ca configurator does not work with Safari
260 * khtml/ecma/kjs_html.cpp:
261 (KJS::HTMLElement::tryGet): when frameset.<name of frame child> is called, return the window object of the frame child
263 2005-02-28 Ken Kocienda <kocienda@apple.com>
269 <rdar://problem/4026906> Paste of HTML table content can break table structure
271 * khtml/editing/htmlediting.cpp:
272 (khtml::ReplacementFragment::pruneEmptyNodes): Call new isProbablyTableStructureNode() function to prevent
273 removal of empty table structure nodes.
274 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
275 (khtml::isProbablyTableStructureNode): New helper function.
276 * khtml/editing/htmlediting.h: Declare new helper.
278 2005-02-28 Chris Blumenberg <cblu@apple.com>
280 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
282 Reviewed by kocienda.
284 * khtml/editing/htmlediting.cpp:
285 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): ref and deref the element while it is "floating"
286 (khtml::ReplacementFragment::insertFragmentForTestRendering): ditto
287 (khtml::floatRefdElement): new, keeps an element alive while its ref count is 0
288 (khtml::createDefaultParagraphElement): removed commented out code
289 (khtml::createBlockPlaceholderElement): ref the element and return it as "floating"
290 (khtml::createFontElement): ditto
291 (khtml::createStyleSpanElement): ditto
292 * khtml/editing/htmlediting.h:
294 2005-02-27 Maciej Stachowiak <mjs@apple.com>
298 <rdar://problem/3993557> REGRESSION (125-180-ish): getElementsByTagName no longer works with namespace designations
300 * khtml/xml/dom_nodeimpl.cpp:
301 (NodeBaseImpl::getElementsByTagNameNS): When no namespace is specified, find elements
302 of the specified name in any namespace to match Mozilla and earlier Safari behavior.
304 2005-02-25 Darin Adler <darin@apple.com>
308 - fixed <rdar://problem/4025618> Crash while searching at hollywoodvideo.com
310 * khtml/html/html_formimpl.h: Added valueWithDefault.
311 * khtml/html/html_formimpl.cpp:
312 (DOM::HTMLInputElementImpl::appendFormData): Call valueWithDefault instead of going at the render object
313 to try to get the default value; there may be no render object if this is display:none.
314 (DOM::HTMLInputElementImpl::valueWithDefault): Added. Knows about the defaults for "submit" and "reset"
315 buttons; otherwise just returns the value as-is.
317 * khtml/rendering/render_form.h: Removed the defaultLabel member functions.
318 * khtml/rendering/render_form.cpp:
319 (RenderSubmitButton::rawText): Call valueWithDefault instead of using defaultLabel function here on
320 the render side. The DOM needs to know how to deal with the default anyway for form submission.
321 (RenderSubmitButton::defaultLabel): Removed.
322 (RenderResetButton::defaultLabel): Removed.
323 (RenderPushButton::defaultLabel): Removed.
325 2005-02-25 Darin Adler <darin@apple.com>
329 - fixed <rdar://problem/4025088> window onblur and onfocus don't fire when text field has focus
331 * kwq/KWQKHTMLPart.h: Added setWindowHasFocus function and m_windowHasFocus data member.
332 * kwq/KWQKHTMLPart.mm:
333 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Took out the code that sends the focus and blur events.
334 (KWQKHTMLPart::setWindowHasFocus): Put that code here instead.
336 * kwq/WebCoreBridge.h: Added setWindowHasFocus: method to the bridge.
337 * kwq/WebCoreBridge.mm: (-[WebCoreBridge setWindowHasFocus:]): Added. Calls method on the part.
339 2005-02-25 Darin Adler <darin@apple.com>
343 - re-fixed <rdar://problem/3665430> horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode
345 * kwq/KWQTextArea.mm: (-[KWQTextArea _updateTextViewWidth]): Don't change the text view width
346 to match the text area's width in the "wrap" case.
348 2005-02-25 Ken Kocienda <kocienda@apple.com>
354 <rdar://problem/4021518> 8A394 Mail crashes during paste: khtml::RootInlineBox::closestLeafChildForXPos
356 * khtml/editing/visible_units.cpp:
357 (khtml::previousLinePosition): Adding an updateLayout call at the start of the function fixes the crash, since
358 we caught line boxes in a not-completely-updated state.
359 (khtml::nextLinePosition): Ditto.
361 2005-02-25 David Hyatt <hyatt@apple.com>
363 Fix for 4010774, make sure to avoid an O(N^2) algorithm in nextRenderer() that is triggered when large
364 DOM subtrees are inserted into documents via one insert/append call.
368 * khtml/xml/dom_nodeimpl.cpp:
369 (NodeImpl::nextRenderer):
371 2005-02-25 Richard Williamson <rjw@apple.com>
373 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
375 Second pass at fixing 3382926 w/o causing layout regressions. Same concept:
376 if directionality of text's element is RTL and first character has neutral directionality
377 then set the initial directionality to RTL.
381 * khtml/rendering/bidi.cpp:
382 (khtml::RenderBlock::bidiReorderLine):
383 (khtml::RenderBlock::determineStartPosition):
387 2005-02-25 Ken Kocienda <kocienda@apple.com>
391 Roll out Chris' change to fix this bug:
393 <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
395 That code change is responsible for all these new crashers:
397 <rdar://problem/4025177> crash copying safari.apple.com into Blot document
398 <rdar://problem/4025184> crash in DOM::NodeImpl::parentNode copying "New!" from google.com to Blot
399 <rdar://problem/4025214> crash in DOM::NodeImpl::getRect loading paste-match-style-001.html
401 Since we wish to close the tree for a build right now, I am rolling out rather than investigating.
403 * khtml/editing/htmlediting.cpp:
404 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded)
405 (khtml::ReplacementFragment::insertFragmentForTestRendering)
406 (khtml::createDefaultParagraphElement)
407 (khtml::createBlockPlaceholderElement)
408 (khtml::createFontElement)
409 (khtml::createStyleSpanElement)
410 * khtml/editing/htmlediting.h
412 2005-02-25 Ken Kocienda <kocienda@apple.com>
418 <rdar://problem/4020108> Pasting text into message makes Mail crash reproducibly
420 Note that, even with this fix, development build will crash until this bug is fixed:
421 <rdar://problem/4024996> Applying block styles can cause assertion failure in inline style removal
423 This will not crash deployment builds, so I am going to land.
425 * khtml/editing/htmlediting.cpp:
426 (khtml::ApplyStyleCommand::applyBlockStyle): Applying block styles can make the loop to reach beyondEnd
427 fail since the structure of the document can change. Cache the next node first before operating on it,
430 2005-02-25 Vicki Murley <vicki@apple.com>
432 - recommit this change, since rolling it out did NOT fix the performance regression!
434 2005-02-23 Darin Adler <darin@apple.com>
438 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
440 The key was to change things around so that we don't push text from the DOM to the widget
441 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
442 during the blur process.
444 * khtml/html/html_formimpl.cpp:
445 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
446 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
447 new value is set here.
448 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
450 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
451 to true, and also sends out the input event. It's better to have this here than in the renderer code.
452 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
453 m_dirtyvalue) and m_valueMatchesRenderer as false.
454 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
455 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
456 where the value came from.
457 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
458 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
459 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
461 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
462 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
463 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
465 * khtml/rendering/render_form.cpp:
466 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
468 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
470 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
471 (RenderTextArea::handleFocusOut): Ditto.
472 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
473 DOM if valueMatchesRenderer is true.
474 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
476 2005-02-25 Chris Blumenberg <cblu@apple.com>
478 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
482 * khtml/editing/htmlediting.cpp:
483 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
484 (khtml::ReplacementFragment::insertFragmentForTestRendering):
485 (khtml::floatRefdElement):
486 (khtml::createDefaultParagraphElement):
487 (khtml::createBlockPlaceholderElement):
488 (khtml::createFontElement):
489 (khtml::createStyleSpanElement):
490 * khtml/editing/htmlediting.h:
492 2005-02-25 Darin Adler <darin@apple.com>
494 * kwq/character-sets.txt: Checked in updated file. This new file has no effect, because none of the
495 changes affect character sets that we support, but it's good to have the latest file in here, and
496 completely safe because I checked that the generated files have not changed.
498 2005-02-25 Vicki Murley <vicki@apple.com>
502 - back out this change, since it causes a 3.5% performance regression
504 2005-02-23 Darin Adler <darin@apple.com>
508 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
510 The key was to change things around so that we don't push text from the DOM to the widget
511 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
512 during the blur process.
514 * khtml/html/html_formimpl.cpp:
515 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
516 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
517 new value is set here.
518 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
520 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
521 to true, and also sends out the input event. It's better to have this here than in the renderer code.
522 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
523 m_dirtyvalue) and m_valueMatchesRenderer as false.
524 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
525 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
526 where the value came from.
527 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
528 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
529 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
531 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
532 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
533 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
535 * khtml/rendering/render_form.cpp:
536 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
538 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
540 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
541 (RenderTextArea::handleFocusOut): Ditto.
542 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
543 DOM if valueMatchesRenderer is true.
544 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
546 2005-02-25 Darin Adler <darin@apple.com>
550 - fixed <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
552 * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply):
553 Use the insertNodeAfterAndUpdateNodesInserted and insertNodeBeforeAndUpdateNodesInserted
554 functions to add the leading and trailing spaces for smart paste.
556 2005-02-25 David Hyatt <hyatt@apple.com>
558 Back out fix for 3382926, since it breaks LTR text inside RTL contexts.
562 * khtml/rendering/bidi.cpp:
563 (khtml::BidiIterator::direction):
565 2005-02-25 David Hyatt <hyatt@apple.com>
567 Fix for 3975039, scrolling is slow in huge RSS views. Optimize the calculation of clip rects for overflow:hidden
568 layers. Also optimize layer movement when scrolling overflow sections.
572 * khtml/rendering/render_layer.cpp:
574 (ClipRects::operator delete):
576 (RenderLayer::RenderLayer):
577 (RenderLayer::~RenderLayer):
578 (RenderLayer::updateLayerPosition):
579 (RenderLayer::removeOnlyThisLayer):
580 (RenderLayer::insertOnlyThisLayer):
581 (RenderLayer::scrollToOffset):
582 (RenderLayer::hitTest):
583 (RenderLayer::calculateClipRects):
584 (RenderLayer::calculateRects):
585 (RenderLayer::containsPoint):
586 (RenderLayer::clearClipRects):
587 (RenderLayer::clearClipRect):
588 * khtml/rendering/render_layer.h:
589 (khtml::ClipRects::m_refCnt):
590 (khtml::ClipRects::overflowClipRect):
591 (khtml::ClipRects::fixedClipRect):
592 (khtml::ClipRects::posClipRect):
593 (khtml::ClipRects::ref):
594 (khtml::ClipRects::deref):
595 (khtml::RenderLayer::clipRects):
596 * khtml/rendering/render_object.cpp:
597 (RenderObject::setStyle):
599 2005-02-24 Maciej Stachowiak <mjs@apple.com>
601 Reviewed by Darin and Dave a while ago.
603 <rdar://problem/3996685> REGRESSION: Crash in KWQVectorImpl::at loading http://maps.google.com/mapfiles/homepanel.xsl
605 * kwq/WebCoreBridge.mm:
606 (formElementFromDOMElement): Check for isHTMLElement() as well as
607 id() == ID_FORM. This seems like an impossible situation, but
608 papering over it seems more expedient for the time being.
610 2005-02-24 Richard Williamson <rjw@apple.com>
612 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
614 Use mirror characters correctly when rendering with RTL directionality.
618 * khtml/rendering/bidi.cpp:
619 (khtml::BidiIterator::direction):
621 2005-02-24 Richard Williamson <rjw@apple.com>
623 Fixed <rdar://problem/3985889> REGRESSION (125-180): setting <img> src to GIF that already animated does not animate; just shows final frame
627 * WebCore.pbproj/project.pbxproj:
628 * khtml/html/html_imageimpl.cpp:
629 (HTMLImageLoader::updateFromElement):
630 * khtml/rendering/render_image.cpp:
631 (RenderImage::resetAnimation):
632 * khtml/rendering/render_image.h:
633 * khtml/rendering/render_list.cpp:
634 (RenderListMarker::setStyle):
635 (RenderListMarker::paint):
636 * khtml/rendering/render_list.h:
640 (QPixmap::resetAnimation):
641 * kwq/WebCoreImageRenderer.h:
643 2005-02-24 Chris Blumenberg <cblu@apple.com>
645 Fixed: <rdar://problem/4020110> Safari crashes in setAllData while taking a www.zoomerang.com survey
649 * kwq/KWQResourceLoader.mm:
650 (-[KWQResourceLoader finishJobAndHandle:]): clear the job after we've deleted to avoid reentrancy
652 2005-02-24 Darin Adler <darin@apple.com>
656 - fixed <rdar://problem/4023360> REGRESSION (186-187): image file upload is broken at pep.apple.com
658 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::appendFormData): Return true after
659 setting up the form data for an uploaded file. The old code would fall through to the ISINDEX
660 case and send double form data (the filename instead of the file contents the second time).
662 2005-02-24 David Harrison <harrison@apple.com>
666 <rdar://problem/3990849> AX: textMarkerRange for an AXUIElement within an AXWebArea
668 * kwq/KWQAccObject.mm:
669 (-[KWQAccObject textMarkerRange]):
670 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
671 (-[KWQAccObject doAXTextMarkerRangeForUIElement:]):
672 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
673 Added AXTextMarkerRangeForUIElement, or you can send textMarkerRange to the UIElement itself.
675 2005-02-24 David Harrison <harrison@apple.com>
679 <rdar://problem/4004279> 3 AXSelectedTextChanged notifications are firing each time I type a character
681 * khtml/xml/dom_docimpl.cpp:
682 (DocumentImpl::updateSelection):
683 Send notification only if the selection is not null. This safely ignores transitory selections set during editing.
685 2005-02-24 Darin Adler <darin@apple.com>
689 - fixed <rdar://problem/3987619> in some cases, text doesn't resize with Format->Style->Bigger/Smaller
691 * khtml/editing/htmlediting.cpp:
692 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): Only call nodeFullySelected for non-text nodes.
693 Text nodes are already split so they're either in the range and full selected or out of the range.
694 And nodeFullySelected doesn't work for text nodes.
695 (khtml::ApplyStyleCommand::nodeFullySelected): Add an assertion, since this function only works for elements,
697 (khtml::ApplyStyleCommand::nodeFullyUnselected): Ditto.
699 - make big improvement in <rdar://problem/3953636> Mail hung for ~10sec changing font of 84328 characters: khtml::ApplyStyleCommand::nodeFullySelected
701 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints): Improve algorithm based on suggestion
704 - fixed <rdar://problem/4020305> REGRESSION (185-186): loading image in new window using document.write fails
706 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::open): If there is no parent document, don't blow away the base URL.
708 - fixed <rdar://problem/4021701> REGRESSION (188-188+): form not submitted after pressing <return> at http://hrweb.apple.com
710 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchMouseEvent): Send activate event in the case where the event
711 sent is a KHTML_CLICK_EVENT, not CLICK_EVENT.
713 2005-02-23 Kevin Decker <kdecker@apple.com>
717 Fixed <rdar://problem/4020747> REGRESSION: stray </applet> tags crash Safari
719 * khtml/html/htmlparser.cpp:
720 (KHTMLParser::processCloseTag): Made a typesafe check that prevents crashes
721 whenever there is a closing applet tag without an actual <applet> in the first place.
722 Now verifies the current token is ID_APPLET before casting it to an HTMLAppletElementImpl.
725 2005-02-23 Ken Kocienda <kocienda@apple.com>
731 <rdar://problem/3977962> font loses bold style after pasting next to existing text and pressing return
733 * khtml/editing/htmlediting.cpp:
734 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Problem here was
735 that we were doing work in cases where we should not, and content whose style would have
736 been correct if we had done nothing was getting clobbered. It turns out that extra work
737 to apply style to the new paragraph added in this command only needs to be done if we're
738 at the boundaries of a paragraph. Otherwise, content that is moved as part of the work
739 of the command will lend their styles to the new paragraph without any extra work needed.
740 So, make this position check and return unless at a paragraph boundary.
744 * layout-tests/editing/style/block-styles-007-expected.txt
745 * layout-tests/editing/style/block-styles-007.html
747 2005-02-23 Ken Kocienda <kocienda@apple.com>
753 <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a selection starting from end of line once
755 Problem is with the way we figure out whether to add or remove a style based on
756 the current selection. In this case, the code is looking at the end of the
757 previous line, which is not bold, and deduces incorrectly that the operation is
758 a "make bold". Then the style code runs to make bold, but there is nothing on
759 the end of the previous line to embolden, so we get into a cycle where the same
760 thing happens each time cmd-b is hit.
762 * khtml/khtml_part.cpp:
763 (KHTMLPart::selectionComputedStyle): Call editingStartPosition() to get the right position for the font determination.
764 * khtml/xml/dom2_rangeimpl.cpp:
765 (DOM::RangeImpl::editingStartPosition): New helper function that "does the right thing" based on whether the
766 selection is a caret or a range, moving upstream for the former, and downstream for the latter.
767 * khtml/xml/dom2_rangeimpl.h:
768 * kwq/KWQKHTMLPart.mm:
769 (KWQKHTMLPart::fontForSelection): Call editingStartPosition() to get the right position for the font determination.
773 * layout-tests/editing/style/style-boundary-001-expected.txt
774 * layout-tests/editing/style/style-boundary-001.html
775 * layout-tests/editing/style/style-boundary-002-expected.txt
776 * layout-tests/editing/style/style-boundary-002.html
777 * layout-tests/editing/style/style-boundary-003-expected.txt
778 * layout-tests/editing/style/style-boundary-003.html
779 * layout-tests/editing/style/style-boundary-004-expected.txt
780 * layout-tests/editing/style/style-boundary-004.html
782 2005-02-23 Richard Williamson <rjw@apple.com>
784 Fixed <rdar://problem/3985579> 8A367: Dashboard: Stock widget not visible when click remove to remove single char ticker symbol
786 Explicitly remove scroll bar views when removing them from
789 Don't paint synchronously when the scroll position changes,
790 this caused funky clip problems.
794 * khtml/rendering/render_layer.cpp:
795 (RenderLayer::scrollToOffset):
796 (RenderLayer::setHasHorizontalScrollbar):
797 (RenderLayer::setHasVerticalScrollbar):
798 (RenderLayer::updateScrollInfoAfterLayout):
800 2005-02-23 Ken Kocienda <kocienda@apple.com>
806 <rdar://problem/3959996> REGRESSION (Mail): cursor moves to beginning of document when click is past end
808 * khtml/rendering/render_block.cpp:
809 (khtml::RenderBlock::positionForCoordinates): Skip blocks that are invisible or have no height when
810 looking for a child to pass off to. And save away the last visible block with a height to pass off
811 to if there is no child at the right y-coordinate.
813 2005-02-23 David Harrison <harrison@apple.com>
817 <rdar://problem/4010059> BoundsForTextMarkerRange does not update with scrolled web area
819 * kwq/KWQAccObject.mm:
820 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
821 Adjust for scrolling.
823 2005-02-22 Maciej Stachowiak <mjs@apple.com>
827 <rdar://problem/3949790> hitting return after pasted styled line results in extra content getting the style
829 * khtml/editing/htmlediting.cpp:
830 (khtml::InsertParagraphSeparatorCommand::doApply): In the case
831 where the start block is the root, insert the newly created DIV at
832 the end of the root block instead of after the last sibling in the
833 start node, since the start node could be inside other
834 style-affecting nodes and we don't want to reparent its cousins
837 2005-02-23 David Harrison <harrison@apple.com>
841 <rdar://problem/4014691> switch to correctly spelled NSAccessibilityForegroundColorTextAttribute constant
843 Also removed two older, now unneeded, wrappers.
845 * kwq/KWQAccObject.mm:
846 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
847 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
848 Removed these older, now unneeded, wrappers.
850 (NSAccessibilityForegroundColorTextAttributeWrapper):
851 New wrapper for NSAccessibilityForegroundColorTextAttribute.
853 (AXAttributeStringSetStyle):
854 Use NSAccessibilityForegroundColorTextAttributeWrapper.
856 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
857 Remove uses of visiblePositionForStartOfTextMarkerRange and visiblePositionForEndOfTextMarkerRange.
859 2005-02-23 David Harrison <harrison@apple.com>
863 <rdar://problem/3524784> AX hit test doesn't return info when done in empty space of content area
865 * kwq/KWQAccObject.mm:
866 (-[KWQAccObject accessibilityHitTest:]):
867 Return unignored object.
869 2005-02-23 Darin Adler <darin@apple.com>
873 - fixed <rdar://problem/4006509> REGRESSION (171-172): Setting CSS -khtml-user-modify property triggers crash
875 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyProperty):
876 Removed the code that changes the style of the element. This was never needed, and caused the
877 style to be modified while we were iterating it.
879 2005-02-23 Ken Kocienda <kocienda@apple.com>
885 <rdar://problem/3980209> Mail crashed when I pressed Cmd-Shift-[ (nil-deref in ApplyStyleCommand::addBlockStyleIfNeeded)
887 * khtml/editing/htmlediting.cpp:
888 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Reordered the new block
889 insertion so that it come before the move. The logic stays exactly the same, however, with the old
890 ordering, the new block could want to become a child of itself come insertion time. I considered
891 making a more complicated code change to fix this problem, but the simple reordering works just
892 as well, and seems less risky.
894 These all changed in an insignificant way. It seems that with the new code, some empty text nodes
895 got reordered in the document. This has no effect on anything visible to the user.
897 * layout-tests/editing/style/create-block-for-style-003-expected.txt
898 * layout-tests/editing/style/create-block-for-style-004-expected.txt
899 * layout-tests/editing/style/create-block-for-style-009-expected.txt
900 * layout-tests/editing/style/create-block-for-style-011-expected.txt
901 * layout-tests/editing/style/create-block-for-style-013-expected.txt
903 2005-02-23 Darin Adler <darin@apple.com>
907 - fixed <rdar://problem/4013986> REGRESSION (173-174): onclick event not sent when mouse click on checkbox is double-click
909 We need to send an onclick event *and* an ondblclick event when we process a double click.
911 * khtml/khtmlview.cpp: (KHTMLView::dispatchMouseEvent): In the case where we're sending a CLICK_EVENT,
912 follow it by a KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT when handling a double click, and a DOMACTIVATE_EVENT.
913 We no longer do the DOMACTIVATE_EVENT in dispatchGenericEvent.
914 * khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked): send only CLICK_EVENT here, and
915 lets dispatchMouseEvent deal with the other subsequent events.
916 * khtml/xml/dom_nodeimpl.cpp:
917 (NodeImpl::dispatchGenericEvent): Remove the code that sends a DOMACTIVATE_EVENT, since there's no longer
918 a good way to figure out if this is the last event that should be sent before it is.
919 (NodeImpl::dispatchMouseEvent): Set the meta key modifier here (as it already is set elsewhere), and
920 follow up a CLICK_EVENT with KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT, and DOMACTIVATE_EVENT as above.
922 2005-02-23 Darin Adler <darin@apple.com>
926 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
928 The key was to change things around so that we don't push text from the DOM to the widget
929 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
930 during the blur process.
932 * khtml/html/html_formimpl.cpp:
933 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
934 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
935 new value is set here.
936 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
938 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
939 to true, and also sends out the input event. It's better to have this here than in the renderer code.
940 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
941 m_dirtyvalue) and m_valueMatchesRenderer as false.
942 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
943 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
944 where the value came from.
945 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
946 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
947 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
949 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
950 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
951 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
953 * khtml/rendering/render_form.cpp:
954 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
956 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
958 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
959 (RenderTextArea::handleFocusOut): Ditto.
960 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
961 DOM if valueMatchesRenderer is true.
962 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
964 2005-02-22 Richard Williamson <rjw@apple.com>
966 Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions
968 Just set dashboard dirty bit when overflow scrolling changes.
970 Don't do comparison of regions in before scroll regions are
971 added, instead do it in WebKit after automatic scroll regions
976 * khtml/css/cssparser.cpp:
977 (CSSParser::parseDashboardRegions): Cleaned up comments
978 * khtml/css/cssstyleselector.cpp:
979 (khtml::CSSStyleSelector::styleForElement): Cleaned up comments
981 * khtml/khtmlview.cpp:
982 (KHTMLView::updateDashboardRegions):
983 * khtml/rendering/render_layer.cpp:
984 (RenderLayer::updateScrollInfoAfterLayout):
985 * kwq/WebDashboardRegion.m:
986 (-[WebDashboardRegion isEqual:]):
988 2005-02-22 Chris Blumenberg <cblu@apple.com>
990 Fixed: <rdar://problem/3976872> Pasted plain text doesn't get the proper style if pasted into newlines
994 * khtml/editing/htmlediting.cpp:
995 (khtml::ReplaceSelectionCommand::doApply): don't clear the typing style when matching style
996 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply the typing style when matching style
997 * khtml/editing/jsediting.cpp:
998 * khtml/khtml_part.cpp:
999 (KHTMLPart::pasteAndMatchStyle): new
1000 * khtml/khtml_part.h:
1001 * kwq/KWQKHTMLPart.h:
1002 * kwq/KWQKHTMLPart.mm:
1003 (KWQKHTMLPart::issuePasteAndMatchStyleCommand): new
1004 * kwq/WebCoreBridge.h:
1005 * layout-tests/editing/editing.js:
1007 2005-02-22 Darin Adler <darin@apple.com>
1011 - fixed <rdar://problem/4006596> REGRESSION (183-184): crash in DOM::DocumentImpl::setFocusNode(DOM::NodeImpl*)
1013 * khtml/xml/dom_docimpl.cpp:
1014 (widgetForNode): Added helper.
1015 (DocumentImpl::setFocusNode): Re-get the widget for the node after calling updateLayout.
1016 The updateLayout can destroy the old widget, so we can't keep a stale widget pointer around.
1018 2005-02-22 Ken Kocienda <kocienda@apple.com>
1024 <rdar://problem/4003463> Mail.app HTML uses inline styling markup not understood by Entourage and Eudora
1026 * khtml/editing/htmlediting.cpp:
1027 (khtml::isEmptyFontTag): Helper for removing <font> tags.
1028 (khtml::StyleChange::styleModeForParseMode): Helper to map a document parse mode to a use/don't use
1029 legacy-html-styles value.
1030 (khtml::StyleChange::checkForLegacyHTMLStyleChange): Add support for colors, font faces, and font sizes.
1031 (khtml::ApplyStyleCommand::isHTMLStyleNode):
1032 (khtml::ApplyStyleCommand::removeHTMLFontStyle):
1033 (khtml::ApplyStyleCommand::applyTextDecorationStyle): Now call styleModeForParseMode to determine
1034 whether to use legacy html styles or not.
1035 (khtml::ApplyStyleCommand::removeInlineStyle): Now properly removes <font> styles.
1036 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
1037 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
1038 (khtml::createFontElement): Helper for applying <font> elements.
1039 * khtml/editing/htmlediting.h: All the following support the new bits of data we need to store.
1040 (khtml::StyleChange::applyFontColor)
1041 (khtml::StyleChange::applyFontFace)
1042 (khtml::StyleChange::applyFontSize)
1043 (khtml::StyleChange::fontColor)
1044 (khtml::StyleChange::fontFace)
1045 (khtml::StyleChange::fontSize)
1047 Test results updated now that we will write out <font> tags for quirks mode documents.
1049 * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt
1050 * layout-tests/editing/style/block-style-004-expected.txt
1051 * layout-tests/editing/editing/pasteboard/paste-text-011-expected.txt
1052 * layout-tests/editing/style/block-style-005-expected.txt
1053 * layout-tests/editing/style/block-style-006-expected.txt
1054 * layout-tests/editing/style/smoosh-styles-001-expected.txt
1055 * layout-tests/editing/style/smoosh-styles-002-expected.txt
1057 2005-02-22 Maciej Stachowiak <mjs@apple.com>
1061 <rdar://problem/4017066> crash in KJS::ValueImp::dispatchType() every time I load www.nytimes.com/pages/automobiles
1063 When creating option elements, use lowercase "option" instead of
1064 uppercase "OPTION" to create option elements, because only
1065 lowercase works for XHTML.
1067 * khtml/ecma/kjs_html.cpp:
1068 (KJS::HTMLSelectCollection::tryPut):
1069 (OptionConstructorImp::construct):
1071 2005-02-22 Chris Blumenberg <cblu@apple.com>
1073 WebCore fix for: <rdar://problem/3918056> Mail not line breaking my <pre> formatted emails on replies
1075 Mail must 4018993 to fully address the problem.
1077 Reviewed by kocienda.
1079 * khtml/editing/markup.cpp:
1080 (khtml::startMarkup): don't compute style for text in PRE tags
1081 (khtml::createMarkup): include PRE if it is an ancestor of the nodes in the range
1083 2005-02-21 Richard Williamson <rjw@apple.com>
1085 Fixed <rdar://problem/4008338> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
1087 There was a long standing bug in cssText(). Double value were always cast int! So,
1088 opacity values values were incorrectly converted to text, i.e. 0.75 became 0.
1090 The problem was newly triggered because we parse the css for opacity *TWICE*. This is a result of
1091 incorrectly "invalidating" the style attribute (from fix for 3790449). The second parse was from
1092 the cssText() of the style.
1096 * khtml/css/css_valueimpl.cpp:
1097 (DOM::CSSPrimitiveValueImpl::cssText):
1099 2005-02-21 David Hyatt <hyatt@apple.com>
1101 Fix for 4017204, apply the same fix to the base class nodeAtPoint that was already applied to RenderBlock.
1102 Skip elements with layers and inline flows. Demoted <form>s can end up causing trouble otherwise.
1104 Reviewed by Richard Williamson
1106 * khtml/rendering/render_box.cpp:
1107 (RenderBox::nodeAtPoint):
1109 2005-02-21 David Hyatt <hyatt@apple.com>
1111 Fix for 4017033, CSS is being parsed twice. Make sure to always validate the style attribute when it is
1112 initially parsed. Add code to clean up decls when the style attribute is completely removed. Add a new
1113 synchronizing boolean that avoids reparsing the style declaration when the attribute is simply
1114 being synced up to the declaration.
1118 * khtml/css/css_valueimpl.cpp:
1119 (DOM::CSSMutableStyleDeclarationImpl::setChanged):
1120 * khtml/html/html_elementimpl.cpp:
1121 (HTMLElementImpl::invalidateStyleAttribute):
1122 (HTMLElementImpl::updateStyleAttributeIfNeeded):
1123 (HTMLElementImpl::HTMLElementImpl):
1124 (HTMLElementImpl::~HTMLElementImpl):
1125 (HTMLElementImpl::destroyInlineStyleDecl):
1126 (HTMLElementImpl::mapToEntry):
1127 (HTMLElementImpl::parseHTMLAttribute):
1128 * khtml/html/html_elementimpl.h:
1129 * khtml/xml/dom_elementimpl.cpp:
1130 (ElementImpl::ElementImpl):
1131 (ElementImpl::setAttribute):
1132 * khtml/xml/dom_elementimpl.h:
1133 (DOM::ElementImpl::updateStyleAttributeIfNeeded):
1137 2005-02-21 Darin Adler <darin@apple.com>
1139 - fixed Panther deployment build
1141 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Put more stuff inside #if.
1143 2005-02-21 David Harrison <harrison@apple.com>
1147 <rdar://problem/3943090> REGRESSION (Mail): Spelling underline incompletely erased following certain steps
1149 * khtml/rendering/render_text.cpp:
1150 (InlineTextBox::paintMarker):
1151 Make sure underline is placed within the text bounds.
1154 * kwq/KWQPainter.mm:
1155 (QPainter::misspellingLineThickness):
1156 * kwq/WebCoreTextRenderer.h:
1157 Add misspellingLineThickness for use by InlineTextBox::paintMarker.
1159 2005-02-21 Darin Adler <darin@apple.com>
1163 - fixed <rdar://problem/4012978> -[DOMRange markupString] crashes when range contains only a text node with a single space
1165 * khtml/editing/markup.cpp: (khtml::createMarkup): Added updateLayout calls, and added a missing
1168 2005-02-21 Darin Adler <darin@apple.com>
1172 - fixed <rdar://problem/4005435> Safari hung while pasting text into a <textarea> (Panther-only)
1174 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Don't setAutohidesScrollers:YES on Panther.
1176 2005-02-21 Ken Kocienda <kocienda@apple.com>
1182 <rdar://problem/4015499> REGRESSION (186-187): pasted quoted text starting with a blank line increases quote level of pasted text when pasted
1184 * khtml/editing/markup.cpp:
1185 (khtml::markup): Changed over to ASSERT instead of assert.
1186 (khtml::createMarkup): The issue was that the code to add parents all the way back to the common ancestor
1187 block did not check for blocks whose markup had already been added, and could result in adding markup for
1188 nodes twice (hence the additional and erroneous quote level). Now there is a new check that will
1189 only add markup for those nodes before the start of the selection range. This fixes the bug.
1190 (khtml::createFragmentFromMarkup): Changed over to ASSERT instead of assert.
1191 (khtml::createFragmentFromText): Ditto.
1193 2005-02-21 Ken Kocienda <kocienda@apple.com>
1199 <rdar://problem/4015494> REGRESSION (186-187) <cr> removed if quoted word is copy/pasted on line immediately above quoted text
1201 * khtml/editing/htmlediting.cpp:
1202 (khtml::ReplaceSelectionCommand::doApply): Relatively new check designed to remove a <br> element when
1203 that element was on a line by itself did not do an adequate check for this condition, causing the
1204 failure described in the bug. Fixed.
1206 2005-02-19 Ken Kocienda <kocienda@apple.com>
1210 * khtml/editing/htmlediting.cpp:
1211 (khtml::matchNearestBlockquoteColorString): New function which abstracts away the CSS property we use
1212 for this pseudo-color.
1213 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Set the new nearestBlockquoteColorString
1214 psuedo-color here, rather than removing colors as was done before.
1215 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): Check for the pseudo-color in the desired
1216 style, and determine the real color based on the nearest blockquote (or none) to the node.
1217 (khtml::nearestMailBlockquote): Name change from closestMailBlockquote to match new property better.
1219 All the rest of this change is the mechanical coding you need to do to add a new CSS property, in this
1220 case, -khtml-match-nearest-mail-blockquote-color.
1222 * khtml/css/css_computedstyle.cpp:
1223 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue)
1224 * khtml/css/cssparser.cpp:
1225 (CSSParser::parseValue):
1226 * khtml/css/cssproperties.c:
1229 * khtml/css/cssproperties.h:
1230 * khtml/css/cssproperties.in:
1231 * khtml/css/cssstyleselector.cpp:
1232 (khtml::CSSStyleSelector::applyProperty)
1233 * khtml/css/cssvalues.c:
1235 * khtml/css/cssvalues.h:
1236 * khtml/css/cssvalues.in:
1237 * khtml/rendering/render_style.h:
1238 (khtml::RenderStyle::matchNearestMailBlockquoteColor)
1239 (khtml::RenderStyle::setMatchNearestMailBlockquoteColor)
1240 (khtml::RenderStyle::initialMatchNearestMailBlockquoteColor)
1242 2005-02-19 Ken Kocienda <kocienda@apple.com>
1248 <rdar://problem/4014228> REGRESSION (186-187) extra, uneditable lines inserted above and below a line of pasted quoted text
1249 <rdar://problem/4014393> REGRESSION (186-187) pasted quoted text gets extra <cr>s when pasted at top of document
1251 * khtml/editing/htmlediting.cpp:
1252 (khtml::ReplacementFragment::ReplacementFragment): Part of a general refactoring of how
1253 the fragment is inserted into the document, rendered, and then tested for certain
1254 important pieces of information that are required for pasting.
1255 (khtml::ReplacementFragment::insertFragmentForTestRendering): New helper. Handles inserting
1256 the fragment nodes into the document.
1257 (khtml::ReplacementFragment::restoreTestRenderingNodesToFragment): Removes nodes from the
1258 document, and restores them to the fragment.
1259 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Factored out code that
1260 did this before into its own function.
1261 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
1262 (khtml::ReplacementFragment::countRenderedBlocks): This is a real improvement, as it
1263 eliminates a major use of the isProbablyBlock() function. Now, the blocks that are
1264 counted are real, rendered blocks.
1265 (khtml::ReplacementFragment::removeStyleNodes): Made this function retain margin-zeroing
1266 CSS properties on paragraphs. This does two things: 1) It helps us to maintain good behavior
1267 in the short term while there are still versions of Mail out there that use <p> elements
1268 instead of <div> elements for new paragraphs; and 2) It will help to maintain the compatibility
1269 with other mail clients that use <p> elements for their paragraphs but render them themselves
1270 with no margins as the result of quirks.
1271 (khtml::ReplaceSelectionCommand::doApply): Do some work to fix up and improve the handling
1272 of blank lines, be they <p> elements or <br> elements, that can be removed after pasting. This,
1273 coupled with the refactoring, fixes 4014393.
1274 * khtml/editing/htmlediting.h: Updated for new functions.
1275 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Updated results, actually improved with this change.
1276 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Ditto.
1278 2005-02-19 Kevin Decker <kdecker@apple.com>
1282 Fixed <rdar://problem/4010765> Flash player can be used to arbitrarily open popup windows without user permission
1284 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.
1286 * kwq/WebCoreBridge.h:
1287 * kwq/WebCoreBridge.mm:
1288 (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Changed this to invoke the new stringByEvaluatingJavaScriptFromString:forceUserGesture method below.
1289 (-[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.
1291 2005-02-18 Chris Blumenberg <cblu@apple.com>
1293 Fixed: <rdar://problem/3951196> REGRESSION (Mail): too many levels of reply quotes after certain steps
1295 Reviewed by kocienda.
1297 * khtml/editing/htmlediting.cpp:
1298 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1299 - 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.
1300 - Build up the list of ancestors after we've determined the actual topBlockquote.
1301 - Don't insert an extra new line if there is a new start node.
1303 2005-02-19 Chris Blumenberg <cblu@apple.com>
1305 Fixed: <rdar://problem/3978461> smart paste is broken
1309 * khtml/editing/htmlediting.cpp:
1310 (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.
1312 2005-02-18 Adele Amchan <adele@apple.com>
1316 Fix for <rdar://problem/3975568> REGRESSION(125-180)Australian Open pages have drawing problem
1318 This patch fixes two problems caused by our added support for custom tags. First, the layout problem at the sites mentioned in the bug
1319 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.
1320 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
1321 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
1322 endTagArray and tagPriorityArray.
1324 * khtml/html/dtd.h: changed all uses of the endTag array to endTagArray for our new wrapper functions
1325 (DOM::tagPriority): added function to check array bounds and to treat custom tags as spans
1326 (DOM::endTagRequirement): added function to check array bounds and to treat custom tags as spans
1327 * khtml/html/dtd.cpp: changed name of endTag and tagPriority arrays to endTagArray and tagPriorityArray
1328 (DOM::checkChild): treat custom tags as spans during this check
1329 * khtml/html/html_elementimpl.cpp: changed all uses of the endTag array to the endTagRequirement function
1330 (HTMLElementImpl::createContextualFragment):
1331 (HTMLElementImpl::setInnerText):
1332 (HTMLElementImpl::setOuterText):
1333 (HTMLElementImpl::toString):
1334 * 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.
1335 (KHTMLParser::parseToken):
1336 (KHTMLParser::insertNode):
1337 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): changed all uses of the endTag array to the endTagRequirement function
1338 * khtml/editing/markup.cpp: changed all uses of the endTag array to the endTagRequirement function
1342 2005-02-18 Jens Alfke <jens@apple.com>
1346 Fixed build: Whoops, setNeedsLayout's parameter is NOT optional.
1348 * khtml/html/html_objectimpl.cpp:
1349 (HTMLAppletElementImpl::setAllParamsAvailable):
1351 2005-02-18 Jens Alfke <jens@apple.com>
1353 Reviewed by cblu, hyatt.
1355 Fixes <rdar://problem/3603191> "REGRESSION: Applets not receiving all of the Applet Parameters in Java 1.4.1/1.4.2"
1356 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.
1358 * khtml/html/html_objectimpl.cpp:
1359 (HTMLAppletElementImpl::HTMLAppletElementImpl):
1360 (HTMLAppletElementImpl::getAppletInstance):
1361 (HTMLAppletElementImpl::setAllParamsAvailable):
1362 (HTMLAppletElementImpl::allParamsAvailable):
1363 * khtml/html/html_objectimpl.h:
1364 * khtml/html/htmlparser.cpp:
1365 (KHTMLParser::processCloseTag):
1366 * khtml/rendering/render_applet.cpp:
1367 (RenderApplet::createWidgetIfNecessary):
1369 2005-02-18 Richard Williamson <rjw@apple.com>
1371 Fixed <rdar://problem/4006161> Tiger8A380: Widgets leak dashboard regions
1373 We were leaking the DashboardRegionImpls.
1377 * khtml/css/css_valueimpl.cpp:
1378 (DOM::CSSPrimitiveValueImpl::cleanup):
1380 2005-02-18 Chris Blumenberg <cblu@apple.com>
1382 Fixed: <rdar://problem/3945271> REGRESSION (Mail): pasted plain text should pick up typing style instead of being unstyled
1384 Reviewed by kocienda.
1386 * khtml/editing/htmlediting.cpp:
1387 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): don't set class on element returned by createStyleSpanElement since that's already done
1388 (khtml::ReplacementFragment::ReplacementFragment): take matchStyle param, don't call computeStylesAndRemoveUnrendered() if !matchStyle
1389 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take matchStyle param
1390 (khtml::ReplaceSelectionCommand::doApply): if m_matchStyle, use selection.start() as the insertion position and don't call applyStyleToInsertedNodes()
1391 * khtml/editing/htmlediting.h:
1392 * kwq/WebCoreBridge.h:
1393 * kwq/WebCoreBridge.mm:
1394 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): take matchStyle param and pass it
1395 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): pass NO for matchStyle
1396 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): pass NO for matchStyle
1397 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): pass YES for matchStyle
1399 2005-02-18 Ken Kocienda <kocienda@apple.com>
1405 <rdar://problem/4013025> Copy/Paste of quoted word results in removal of any following <cr>
1406 <rdar://problem/4013100> Copy/Paste quoted text and then decrease quote level does not change text color
1408 For the most part, these bugs were caused by errors and lack of foresight on my part when
1409 I added the better paste code. Chalk these fixes up to the result of bake time.
1411 * khtml/editing/htmlediting.cpp:
1412 (khtml::ReplacementFragment::ReplacementFragment): Need to move count of number of blocks in
1413 fragment after the call to remove unrendered nodes. Meant to do this before, but forgot to.
1414 (khtml::ReplacementFragment::removeStyleNodes): Need to remove inline styles from elements!
1415 Terrible omission now fixed.
1416 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Remove blockquote colors for now.
1417 Code has a more extensive comment in it now to explain the difficulty, and the need for more
1419 (khtml::ReplaceSelectionCommand::doApply): Need to call applyStyleToInsertedNodes() in the
1420 m_fragment.hasInterchangeNewline() case. This was just missed before.
1421 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Updated results, subtly different, but OK.
1422 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Updated for <p> to <div> change in test content.
1423 * layout-tests/editing/pasteboard/paste-text-017.html: Needed to change <p> to <div> to
1424 make this test go with the new design of using <div> tags for default paragraphs.
1426 2005-02-18 David Hyatt <hyatt@apple.com>
1428 Fix for 3974263 (and possibly others). Don't let fixed tables use maxint as their maxwidth when some
1429 cells have percentage values.
1431 Reviewed by kocienda
1433 * khtml/misc/arena.cpp:
1435 * khtml/rendering/table_layout.cpp:
1436 (FixedTableLayout::calcWidthArray):
1437 (FixedTableLayout::calcMinMaxWidth):
1438 (AutoTableLayout::layout):
1440 2005-02-17 Darin Adler <darin@apple.com>
1444 - fixed <rdar://problem/3998627> WebKit crashes when deleting text in a modified div
1446 * khtml/khtml_part.cpp: (KHTMLPart::selectionComputedStyle): Add a ref and deref to keep
1447 the element alive until it's added to the DOM tree.
1448 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::styleForSelectionStart): Ditto.
1450 2005-02-17 Richard Williamson <rjw@apple.com>
1452 Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead
1454 Fixed w/o introducing a performance regression. Add early
1455 check for Osaka-Mono to avoid expensive call into WebKit.
1460 (QFont::isFixedPitch):
1462 2005-02-17 Darin Adler <darin@apple.com>
1466 - fixed <rdar://problem/4011210> REGRESSION (180-181): Maxlength property for INPUT object not working
1468 * kwq/KWQTextField.mm:
1469 (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): If controller returns
1470 YES, go on to call super, since super does the text formatter handling, which we need.
1471 (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
1472 (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
1476 2005-02-17 Ken Kocienda <kocienda@apple.com>
1482 <rdar://problem/4012058> Copy from quoted text and paste results in blue text
1484 The relatively-new paste code tries hard to retain style of the content from the
1485 source location. However, in the case of quoted material in mail messages, we do
1486 not want to carry the quoting color along. This fixes the problem by factoring
1489 * khtml/editing/htmlediting.cpp:
1490 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Now calls removeBlockquoteColorsIfNeeded()
1492 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): New function. Factors out colors that are
1493 the result of text being quoted.
1494 (khtml::isNodeRendered): Function moved in file. No other change.
1495 (khtml::isProbablyBlock): Function moved in file. No other change.
1496 (khtml::closestMailBlockquote): New function. Helps fix bug.
1497 (khtml::isMailBlockquote): Function moved to be free-floating instead of being a
1498 member of CompositeEditCommand. No other change.
1499 * khtml/editing/htmlediting.h: Moved around some functions. Added removeBlockquoteColorsIfNeeded().
1500 * khtml/editing/markup.cpp: Remove redundant static implementation of isMailBlockquote.
1502 2005-02-17 Richard Williamson <rjw@apple.com>
1504 Fixed <rdar://problem/4008163> dynamic support for -apple-dashboard-region is flakey
1506 Style operator== wasn't including regions.
1510 * khtml/rendering/render_style.cpp:
1511 (StyleCSS3NonInheritedData::operator==):
1513 2005-02-17 Adele Amchan <adele@apple.com>
1517 fix for <rdar://problem/4010028> 8A383: Safari v185 crash loading united.com multi city fare finder page.
1519 * khtml/dom/dom_string.cpp: (DOM::DOMString::operator += ): prevent nil dereference when DOMString being added is nil
1521 2005-02-17 Jens Alfke <jens@apple.com>
1525 Fix for rdar://3963151 "Mail only pasted ~950 of 1407 text lines into my message!"
1526 Force tokenizer to run synchronously while parsing document fragments, so it doesn't stop halfway through and cause truncated content.
1528 * khtml/html/html_elementimpl.cpp:
1529 (HTMLElementImpl::createContextualFragment):
1530 * khtml/html/htmltokenizer.cpp:
1531 (khtml::HTMLTokenizer::reset):
1532 (khtml::HTMLTokenizer::begin):
1533 (khtml::HTMLTokenizer::setForceSynchronous):
1534 (khtml::HTMLTokenizer::continueProcessing):
1535 * khtml/html/htmltokenizer.h:
1537 2005-02-17 Ken Kocienda <kocienda@apple.com>
1543 <rdar://problem/3982183> Mail's HTML paragraphs appear with unintended margins in Entourage and Eudora
1545 * khtml/editing/htmlediting.cpp:
1546 (khtml::createDefaultParagraphElement): Change element we make from <p> to <div>.
1547 This fixes the problem, as these other mailers show <div> elements without margins.
1549 Some test files needed to change to preserve the ability to "eyeball" the results.
1550 Many others changed just because their <p> elements changed to <div> elements.
1552 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt
1553 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt
1554 * layout-tests/editing/inserting/insert-div-013-expected.txt
1555 * layout-tests/editing/inserting/insert-div-013.html
1556 * layout-tests/editing/inserting/insert-div-014-expected.txt
1557 * layout-tests/editing/inserting/insert-div-014.html
1558 * layout-tests/editing/inserting/insert-div-018-expected.txt
1559 * layout-tests/editing/inserting/insert-div-018.html
1560 * layout-tests/editing/inserting/insert-div-019-expected.txt
1561 * layout-tests/editing/inserting/insert-div-019.html
1562 * layout-tests/editing/inserting/insert-div-020-expected.txt
1563 * layout-tests/editing/inserting/insert-div-020.html
1564 * layout-tests/editing/inserting/insert-div-021-expected.txt
1565 * layout-tests/editing/inserting/insert-div-021.html
1566 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
1567 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
1568 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt
1569 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt
1571 2005-02-17 Ken Kocienda <kocienda@apple.com>
1577 <rdar://problem/3996737> REGRESSION (Mail): Copy/paste in Mail inserts returns
1579 The root cause of the problem is that a couple of pieces of code in AppKit and Mail
1580 insert newlines into markup as it is generated, and the paste code in WebCore was
1581 not smart about nodes that do not render (as is the case with these added newlines).
1582 So, the solution is to remove these unrendered nodes in the paste code in a pre-pass.
1583 Fortunately, my recent addition of such a pass to the paste code to handle styles
1584 gave me a convenient place to put this new logic.
1586 * khtml/editing/htmlediting.cpp:
1587 (khtml::ReplacementFragment::ReplacementFragment): Use new name for function below.
1588 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Name change from computeStylesForNodes().
1589 Now does the additional work of removing unrendered nodes, as mentioned above.
1590 (khtml::isNodeRendered): New helper function.
1591 * khtml/editing/htmlediting.h: Updated as necessary.
1593 2005-02-17 Ken Kocienda <kocienda@apple.com>
1599 <rdar://problem/3998892> REGRESSION (Mail): bolding a selection from end of line changes unselected text on starting line.
1601 The styling code did not move to the next node when the starting position was
1602 at the last offset of a node. Instead, it styled it. Clearly wrong. Solution
1603 is to borrow a check from the delete algorithm. Though I call caretMaxOffset(),
1604 which I consider deprecated, it is still the simplest and most strightforward
1605 way to ask the right question for this kind of problem.
1607 * khtml/editing/htmlediting.cpp:
1608 (khtml::ApplyStyleCommand::applyInlineStyle): Fixed, as described above.
1609 * layout-tests/editing/style/style-3998892-fix-expected.txt: Added.
1610 * layout-tests/editing/style/style-3998892-fix.html: Added.
1612 2005-02-16 Chris Blumenberg <cblu@apple.com>
1614 Fixed: <rdar://problem/3954842> Forward/reply to an HTML email can result in nothing (in cases with <link> tags for CSS)
1618 * khtml/xml/dom_nodeimpl.cpp:
1619 (NodeBaseImpl::addChild): don't call insertedIntoDocument on the added child if "this" itself is not in the document.
1621 2005-02-16 John Sullivan <sullivan@apple.com>
1623 Written by Darin, reviewed by Maciej and me
1625 - change required to make previous checkin work with English language RSS pages
1628 new private method isHierarchical
1631 add hierarchical base URL check when determining whether the URL is absolute
1632 (KURL::isHierarchical):
1633 new method, returns true if this is a valid URL with a slash just past the scheme's trailing colon
1635 2005-02-16 John Sullivan <sullivan@apple.com>
1637 Written by Darin, reviewed by me.
1639 - WebCore part of fix for <rdar://problem/4007384>
1640 FILTER: Bookmark of RSS with Japanese search word & multiple RSS pages loses filter
1643 (-[DOMElement _getURLAttribute:]):
1644 new SPI method, uses parseURL and completeURL to get valid URL from attribute value
1647 declare new SPI method
1649 2005-02-15 Maciej Stachowiak <mjs@apple.com>
1653 <rdar://problem/3942428> reproducible crash loading cbs.sportsline.com
1655 This change reverts the fix for <rdar://problem/3805311>, and
1656 re-fixes it in a different (better) way. Instead of preventing
1657 programmatic open from setting the parsing flag, instead make sure
1658 that programmatic close resets it.
1660 * khtml/khtml_part.cpp:
1661 (KHTMLPart::openURL):
1662 (KHTMLPart::didExplicitOpen):
1663 (KHTMLPart::closeURL):
1666 (KHTMLPart::endIfNotLoading):
1667 (KHTMLPart::slotFinishedParsing):
1668 (KHTMLPart::checkEmitLoadEvent):
1669 * khtml/khtml_part.h:
1670 * khtml/khtmlpart_p.h:
1671 (KHTMLPartPrivate::KHTMLPartPrivate):
1672 * khtml/xml/dom_docimpl.cpp:
1673 (DocumentImpl::open):
1674 (DocumentImpl::implicitOpen):
1675 (DocumentImpl::close):
1676 (DocumentImpl::implicitClose):
1677 * khtml/xml/dom_docimpl.h:
1679 2005-02-15 David Harrison <harrison@apple.com>
1683 <rdar://problem/3933665> smart delete seems to delete too much after expanding selection with arrow keys
1685 Fixed by updating the selection granularity. Only byWord granularity enables smart delete, but in this
1686 case the granularity changed from byWord to byCharacter.
1688 * khtml/khtml_part.cpp:
1689 (KHTMLPart::setSelectionGranularity):
1690 * khtml/khtml_part.h:
1691 * kwq/WebCoreBridge.mm:
1692 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
1693 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
1694 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
1696 2005-02-15 David Harrison <harrison@apple.com>
1700 (continued) <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
1702 This was supposed have been committed yesterday with the other part of the fix, but was not.
1704 * khtml/editing/visible_units.cpp:
1707 2005-02-15 Ken Kocienda <kocienda@apple.com>
1713 <rdar://problem/3951178> REGRESSION (Mail): blank line lost after pasting as quotation
1715 Problem was that the blank line after the selection was getting deleted incorrectly since the
1716 paste code thought this was an unneeded placeholder rather than a placeholder outside of the
1719 * khtml/editing/htmlediting.cpp:
1720 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now calls findBlockPlaceholder.
1721 (khtml::CompositeEditCommand::findBlockPlaceholder): Moved finding code formerly in
1722 removeBlockPlaceholderIfNeeded to this new helper.
1723 (khtml::ReplaceSelectionCommand::doApply): Do not delete placeholder up front. Call
1724 findBlockPlaceholder, and delete it later if needed in the already-existing cleanup step.
1725 * khtml/editing/htmlediting.h: Add new function.
1729 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Added.
1730 * layout-tests/editing/pasteboard/paste-text-017.html: Added.
1732 Result changed for the better.
1734 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
1736 2005-02-14 David Harrison <harrison@apple.com>
1740 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
1744 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
1746 * khtml/editing/visible_text.cpp:
1747 (khtml::SimplifiedBackwardsTextIterator::advance):
1748 Add BR in for <rdar://problem/3917929> fix only if leaving a visible text node.
1750 * khtml/editing/visible_units.cpp:
1752 Do not move left over a paragraph boundary.
1754 2005-02-14 Darin Adler <darin@apple.com>
1758 - fixed <rdar://problem/3686434> Safari uses too much RAM on file upload, leading to malloc errors and crashes (HP printers)
1760 * khtml/html/html_formimpl.cpp:
1761 (DOM::FormDataList::begin): Updated to use a list of FormDataListItem instead of QCString.
1762 (DOM::FormDataList::end): Ditto.
1763 (DOM::HTMLFormElementImpl::formData): Same here, and also use appendFile rather than appendData
1764 when we encounter a path name rather than data.
1765 (DOM::HTMLInputElementImpl::appendFormData): Use appendFile here rather than reading the file
1766 in; the reading now happens inside WebKit.
1767 (DOM::FormDataList::appendString): Updated for FormDataListItem.
1768 (DOM::FormDataList::appendFile): Added.
1770 * ForwardingHeaders/kfileitem.h: Emptied out the file; no longer includes KWQKFileItem.h.
1771 * ForwardingHeaders/netaccess.h: Emptied out the file; no longer includes KWQKIONetAccess.h.
1772 * kwq/KWQKFileItem.h: Removed.
1773 * kwq/KWQKFileItem.mm: Removed.
1774 * kwq/KWQKIONetAccess.h: Removed.
1775 * kwq/KWQKIONetAccess.mm: Removed.
1776 * WebCore.pbproj/project.pbxproj: Removed the 4 files above.
1778 - small unrelated fix (not reviewed by John)
1780 * khtml/ecma/kjs_window.cpp: (Window::isSafeScript): Put some logging code outside if statements so it works all the time.
1782 2005-02-14 David Harrison <harrison@apple.com>
1786 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
1788 Fixed nextLinePosition to calculate affinity rather than take it as a parameter. Propagated the parameter change out to related methods.
1790 * khtml/editing/htmlediting.cpp:
1791 (khtml::DeleteSelectionCommand::initializePositionData):
1792 (khtml::InsertLineBreakCommand::doApply):
1793 (khtml::InsertParagraphSeparatorCommand::doApply):
1794 (khtml::InsertTextCommand::input):
1795 (khtml::ReplaceSelectionCommand::doApply):
1796 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes):
1797 * khtml/editing/selection.cpp:
1798 (khtml::Selection::modifyExtendingRightForward):
1799 (khtml::Selection::modifyMovingRightForward):
1800 (khtml::Selection::modifyExtendingLeftBackward):
1801 (khtml::Selection::modifyMovingLeftBackward):
1802 (khtml::Selection::modify):
1803 (khtml::Selection::validate):
1804 * khtml/editing/visible_position.cpp:
1805 (khtml::visiblePositionsOnDifferentLines):
1806 * khtml/editing/visible_units.cpp:
1807 (khtml::rootBoxForLine):
1808 (khtml::startOfLine):
1810 (khtml::inSameLine):
1811 (khtml::isStartOfLine):
1812 (khtml::isEndOfLine):
1813 (khtml::previousLinePosition):
1814 (khtml::nextLinePosition):
1815 (khtml::previousSentencePosition):
1816 (khtml::nextSentencePosition):
1817 (khtml::previousParagraphPosition):
1818 (khtml::nextParagraphPosition):
1819 * khtml/editing/visible_units.h:
1820 * khtml/khtml_events.cpp:
1821 (khtml::MouseEvent::offset):
1822 * khtml/khtml_part.cpp:
1823 (KHTMLPart::isPointInsideSelection):
1824 (KHTMLPart::selectClosestWordFromMouseEvent):
1825 (KHTMLPart::handleMousePressEventTripleClick):
1826 (KHTMLPart::handleMousePressEventSingleClick):
1827 (KHTMLPart::handleMouseMoveEventSelection):
1828 (KHTMLPart::khtmlMouseReleaseEvent):
1829 * khtml/rendering/render_block.cpp:
1830 (khtml::RenderBlock::positionForCoordinates):
1831 * khtml/rendering/render_block.h:
1832 * khtml/rendering/render_br.cpp:
1833 (RenderBR::positionForCoordinates):
1834 * khtml/rendering/render_br.h:
1835 * khtml/rendering/render_container.cpp:
1836 (RenderContainer::positionForCoordinates):
1837 * khtml/rendering/render_container.h:
1838 * khtml/rendering/render_inline.cpp:
1839 (RenderInline::positionForCoordinates):
1840 * khtml/rendering/render_inline.h:
1841 * khtml/rendering/render_object.cpp:
1842 (RenderObject::caretRect):
1843 (RenderObject::positionForCoordinates):
1844 * khtml/rendering/render_object.h:
1845 * khtml/rendering/render_replaced.cpp:
1846 (RenderReplaced::positionForCoordinates):
1847 * khtml/rendering/render_replaced.h:
1848 * khtml/rendering/render_text.cpp:
1849 (RenderText::positionForCoordinates):
1850 * khtml/rendering/render_text.h:
1851 * khtml/xml/dom_position.cpp:
1852 (DOM::Position::previousCharacterPosition):
1853 (DOM::Position::nextCharacterPosition):
1854 (DOM::Position::leadingWhitespacePosition):
1855 (DOM::Position::trailingWhitespacePosition):
1856 * khtml/xml/dom_position.h:
1857 * kwq/KWQAccObject.mm:
1858 (-[KWQAccObject value]):
1859 (-[KWQAccObject accessibilityAttributeValue:]):
1860 (-[KWQAccObject doAXLineForTextMarker:]):
1861 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
1862 (-[KWQAccObject doAXTextMarkerForPosition:]):
1863 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
1864 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
1865 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
1866 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
1867 * kwq/KWQKHTMLPart.mm:
1868 * kwq/WebCoreBridge.mm:
1869 (-[WebCoreBridge _visiblePositionForPoint:]):
1871 05-02-07 Maciej Stachowiak <mjs@apple.com>
1873 Reviewed by Ken and John.
1875 Re-fixed a specific case of the following:
1877 <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
1879 Oddly, Cmd-B, Cmd-U, type some text, return, Cmd-U, Cmd-B, type
1880 some text, worked fine. But hitting the second Cmd-B before the
1881 second Cmd-U still failed to remove underlining. The reason for
1882 this is that our code to compute the style of the current position
1883 did not work when you had a typing style and were positioned right
1884 at a <br> element. For various reasons, this did not show up for
1885 bold and italic, since those are handled through the font manager.
1887 The following change fixes this - for elements that can't have
1888 children, we add the dummy span after the element of interest,
1889 rather than as a child of it.
1891 * khtml/khtml_part.cpp:
1892 (KHTMLPart::selectionComputedStyle):
1894 2005-02-11 David Harrison <harrison@apple.com>
1898 <rdar://problem/3978980> Double Clicking on a line in Mail selected the entire body
1900 * khtml/editing/visible_units.cpp:
1901 (khtml::startOfWord):
1903 Pay attention to being at the end of a paragraph.
1905 (khtml::previousLinePosition):
1906 (khtml::nextLinePosition):
1907 (khtml::endOfParagraph):
1908 Use DOWNSTREAM per recent affinity changes.
1910 2005-02-11 Richard Williamson <rjw@apple.com>
1912 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
1914 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
1915 creates these wrappers. The WebCore subclass of the interpreter now overrides
1916 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
1918 * WebCore.pbproj/project.pbxproj:
1919 * khtml/ecma/kjs_binding.cpp:
1920 (ScriptInterpreter::createLanguageInstanceForValue):
1921 * khtml/ecma/kjs_binding.h:
1922 * kwq/DOMUtility.mm: Added.
1923 (KJS::ScriptInterpreter::createObjcInstanceForValue):
1924 * kwq/KWQKHTMLPart.mm:
1925 (KWQKHTMLPart::getAppletInstanceForView):
1926 (getInstanceForView):
1927 (KWQKHTMLPart::getEmbedInstanceForView):
1928 (KWQKHTMLPart::getObjectInstanceForView):
1930 2005-02-11 Chris Blumenberg <cblu@apple.com>
1932 Fixed: <rdar://problem/3937352> Quote level not maintained when copied and pasted within a Mail message
1934 Reviewed by harrison.
1936 * khtml/editing/markup.cpp:
1937 (khtml::isMailBlockquote): new
1938 (khtml::createMarkup): retain the Mail quote level by including all ancestor mail block quotes
1939 * khtml/rendering/render_block.cpp:
1940 (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
1941 * khtml/rendering/render_text.cpp:
1942 (RenderText::positionForCoordinates): ditto
1944 2005-02-11 Adele Amchan <adele@apple.com>
1948 fix for <rdar://problem/4004004> no need to add body element for xml documents
1950 In the fix for <rdar://problem/3758785> we decided to add a body element when closing a document
1951 to ensure that the onload handler would fire. This is unnecessary for xml documents,
1952 so now we also check to see if we're dealing with an html document before adding the body element.
1954 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
1956 2005-02-11 Adele Amchan <adele@apple.com>
1960 * layout-tests/apple-only/base/www.excite.com/index-expected.txt: updates tests because of custom tag change.
1961 * layout-tests/apple-only/base/www.msnbc.com/index-expected.txt:
1962 * layout-tests/apple-only/base/www.time.com/index-expected.txt:
1963 * layout-tests/apple-only/base/www.travelocity.com/index-expected.txt:
1964 * layout-tests/apple-only/base/www.zdnet.com/index-expected.txt:
1965 * layout-tests/fast/overflow/003-expected.txt:
1967 * layout-tests/fast/js/window-object-cross-frame-calls-expected.txt: updated test because of added Body (see rdar://problem/3758785)
1971 2005-02-11 Darin Adler <darin@apple.com>
1975 - 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
1977 * khtml/xml/dom_docimpl.h: Added a new openInternal function for use by KHTMLPart.
1978 * khtml/xml/dom_docimpl.cpp:
1979 (DocumentImpl::open): Changed to do everything we did before, but also clear the URL and set the
1980 base URL based on the enclosing document. This is the basic JavaScript/DOM operation of opening a
1981 document, which is supposed to clear the document, including the URL. In the long run we might want
1982 to do even more document "resetting and clearing" in here, but this URL clearing is what's needed
1983 now to fix the most important problem.
1984 (DocumentImpl::openInternal): Moved the old open code in here, except for the "parsing" check, which
1985 is unnecessary and inappropriate in the one place we call this.
1987 * khtml/khtml_part.cpp: (KHTMLPart::begin): Call openInternal instead of open.
1989 2005-02-10 Ken Kocienda <kocienda@apple.com>
1995 <rdar://problem/3992092> 8A374: Mail crash while pasting - RemoveNodeCommand
1997 * khtml/editing/htmlediting.cpp:
1998 (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in
1999 the document. We try to do a good job of detecting all these cases, and generally do. This
2000 one was missed. Fixed.
2002 2005-02-10 Darin Adler <darin@apple.com>
2004 Reviewed by Harrison.
2006 - added support needed to fix <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined
2008 * kwq/WebCoreBridge.h: Added selectionHasStyle: method.
2009 * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part.
2011 2005-02-10 Darin Adler <darin@apple.com>
2013 Reviewed by Harrison.
2015 - fixed <rdar://problem/3990484> cursor changes to I-beam when moving over text in widgets, even when selection off via CSS
2017 * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent): Changed code to check canSelect when deciding
2018 whether to show an I-beam cursor.
2020 * khtml/rendering/render_object.h: Added canSelect.
2021 * khtml/rendering/render_object.cpp:
2022 (selectStartNode): Added. Helper function with the guts of shouldSelect.
2023 (RenderObject::canSelect): Added. Like shouldSelect, but does not call the "start selecting" event handler.
2024 (RenderObject::shouldSelect): Refactored to use selectStartNode.
2026 * khtml/css/cssvalues.c: Regnerated with newer gperf.
2028 2005-02-10 David Hyatt <hyatt@apple.com>
2030 Fix for 3867759, .mac regression where scrollers don't show up. Make sure you can set the .width and
2031 .height properties on the Image object.
2033 Reviewed by John Sullivan
2035 * khtml/ecma/kjs_html.cpp:
2036 (ImageConstructorImp::construct):
2037 (Image::getValueProperty):
2040 * khtml/ecma/kjs_html.h:
2042 2005-02-10 Ken Kocienda <kocienda@apple.com>
2048 <rdar://problem/3965158> Drag-n-drop within a rich text message sometimes changes the color of the dragged text
2050 This change fixes the bug....and much more. Now, for the first time, the paste code can do "smart merging"
2051 or "smooshing" of styles during its operation. Since this new code is actively, rather than passively
2052 working with styles, it fixes the bug, and lays the groundwork for similar work we need to do to
2053 preserve quote levels in Mail.
2055 * khtml/css/css_valueimpl.cpp:
2056 (DOM::CSSMutableStyleDeclarationImpl::clear): New method.
2057 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
2058 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): Ditto.
2059 (DOM::operator==): Add operator for CSSProperty.
2060 * khtml/css/css_valueimpl.h: Declare new functions.
2061 * khtml/editing/htmlediting.cpp:
2062 (khtml::isEmptyStyleSpan): Improved the test in this function, rolling together the old implementation
2063 with some code that did this work inline elsewhere. Sum of the parts is better than either test was by itself.
2064 (khtml::isStyleSpan): Check for ID_SPAN.
2065 (khtml::ApplyStyleCommand::removeCSSStyle): Call isEmptyStyleSpan. This was the place with an inline implementation before.
2066 (khtml::ReplacementFragment::ReplacementFragment): Now takes a DocumentImpl argument. No longer does a "default style"
2067 check, but rather calls functions which do a similar check to that, and much more.
2068 (khtml::ReplacementFragment::~ReplacementFragment): Deref document, and computed styles.
2069 (khtml::ReplacementFragment::styleForNode): New helper. Looks up and returns computed style for a node.
2070 (khtml::ReplacementFragment::removeNodePreservingChildren): New helper.
2071 (khtml::ReplacementFragment::computeStylesForNodes): New function which computes the "desired" style for
2072 every node in the fragment. This information is used later after paste is done as a reference for testing
2073 what styles need to be added, and which can be removed as redundant, from all the nodes inserted by the
2075 (khtml::ReplacementFragment::removeStyleNodes): Clears out all style nodes from the fragment. They are
2076 no longer needed after the call to computeStylesForNodes(),
2077 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): Add a document to the call to initialize the
2078 command's ReplacementFragment.
2079 (khtml::ReplaceSelectionCommand::doApply): Call applyStyleToInsertedNodes() after inserting nodes to make
2080 styles come out right.
2081 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): This is the "style smooshing" function. It
2082 computes the styles that need to be added to each node inserted, comparing the style it gets from just
2083 being inserted into its correct destination with the computed "desired style" done in the
2084 ReplacementFragment constructor. It then adds in all the necessary styles, and will also remove redundant styles.
2085 * khtml/editing/htmlediting.h: Update declarations and member variables as needed.
2086 * khtml/editing/markup.cpp:
2087 (khtml::startMarkup): Add additional style annotations to the markup we generate, so that paste code can preserve it.
2088 (khtml::markup): Ditto.
2089 (khtml::createMarkup): Ditto.
2091 These test results are subtly better with this change. They no longer have an unneeded empty span.
2092 Visually the same as before.
2094 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
2095 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
2096 * layout-tests/editing/style/remove-underline-expected.txt
2097 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt
2101 * layout-tests/editing/style/smoosh-styles-001-expected.txt
2102 * layout-tests/editing/style/smoosh-styles-002-expected.txt
2103 * layout-tests/editing/style/smoosh-styles-001.html
2104 * layout-tests/editing/style/smoosh-styles-002.html
2106 2005-02-10 Darin Adler <darin@apple.com>
2110 - fixed <rdar://problem/3974988> WebHTMLView drops scroll wheel events when deltas are 0
2112 * kwq/WebCoreScrollView.m: (-[WebCoreScrollView autoforwardsScrollWheelEvents]): Added, for Tiger only.
2113 For Tiger, removed the override of scrollWheel:, which doesn't work quite right because of how the
2114 delta attributes return all 0 for newfangled scrolling events from the new trackpads.
2116 2005-02-10 David Harrison <harrison@apple.com>
2120 <rdar://problem/3991532> REGRESSION (Mail): Triple-click on trailing blank line should select previous line but doesn't
2122 * khtml/css/cssvalues.c:
2125 * khtml/editing/selection.cpp:
2126 (khtml::Selection::validate):
2127 Do moral equiavalent of LeftWordIfOnBoundary for PARAGRAPH.
2129 2005-02-10 David Harrison <harrison@apple.com>
2133 <rdar://problem/3991848> Double-click on first character selects wrong item
2135 * khtml/editing/selection.cpp:
2136 (khtml::Selection::validate):
2137 Honor the fact that clicking on a character positions the cursor on the left side of the character.
2139 2005-02-10 David Hyatt <hyatt@apple.com>
2141 Fix for 3980778, repro crash in RootInlineBox::paint. Make sure that when merging blocks we dirty them for layout
2142 up front. That way as we do the merge, we dont attempt to examine the lines in dirtyLinesForChangedChild.
2146 * khtml/rendering/render_block.cpp:
2147 (khtml::RenderBlock::removeChild):
2149 2005-02-10 David Hyatt <hyatt@apple.com>
2151 Fix for 3987010, fix a bug that caused the self-collapsing-block-cleared-float bit to never get set correctly.
2155 * khtml/rendering/render_block.h:
2156 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
2158 2005-02-10 David Hyatt <hyatt@apple.com>
2160 Fix for 3992440, text not wrapping correctly on half moon bay web site. Refine an incorrect optimization I
2161 added to be less restrictive.
2165 * khtml/rendering/render_block.cpp:
2166 (khtml::RenderBlock::layoutBlockChildren):
2168 2005-02-08 Maciej Stachowiak <mjs@apple.com>
2172 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
2174 I fixed this by removing all event listeners for a document, it's
2175 children, and any disconnected nodes that used to be in the
2176 document at document detach time. Mozilla temporarily disables
2177 event listeners on such nodes, but re-enables them if you
2178 re-parant a node into a new document. However, in WebCore, you
2179 can't re-parent a node into another document, so there is no
2180 observable change in behavior.
2182 We have to do this to break the possible reference cycles between
2183 event listeners and the dom nodes they are attached to (e.g. via
2184 scope chain, as in this case).
2186 * khtml/xml/dom_docimpl.cpp:
2187 (DocumentImpl::detach):
2188 (DocumentImpl::removeAllEventListenersFromAllNodesx):
2189 (DocumentImpl::registerDisconnectedNodeWithEventListeners):
2190 (DocumentImpl::unregisterDisconnectedNodeWithEventListeners):
2191 (DocumentImpl::removeAllDisconnectedNodeEventListeners):
2192 * khtml/xml/dom_docimpl.h:
2193 * khtml/xml/dom_nodeimpl.cpp:
2194 (NodeImpl::~NodeImpl):
2195 (NodeImpl::addEventListener):
2196 (NodeImpl::removeEventListener):
2197 (NodeImpl::removeAllEventListeners):
2198 (NodeImpl::removeHTMLEventListener):
2199 (NodeImpl::insertedIntoDocument):
2200 (NodeImpl::removedFromDocument):
2201 * khtml/xml/dom_nodeimpl.h:
2203 2005-02-09 Chris Blumenberg <cblu@apple.com>
2205 Fixed: <rdar://problem/3999213> Sometimes 2 Windows Media Player plugin instances are loaded
2209 * khtml/html/html_objectimpl.cpp:
2210 (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.
2211 (HTMLObjectElementImpl::recalcStyle): ditto
2213 2005-02-09 David Harrison <harrison@apple.com>
2217 <rdar://problem/3937447> Mail-689: Arrow key navigation in new message body stops working when a line ends with a bold word
2219 Added affinity to VisiblePosition. Changed Selection code to use affinity more.
2221 (Partial) <rdar://problem/3982096> editing/pasteboard/paste-text-007 is failing
2223 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.
2225 * khtml/ecma/kjs_window.cpp:
2226 (SelectionFunc::tryCall):
2227 * khtml/editing/htmlediting.cpp:
2228 (khtml::EditCommandPtr::setStartingSelection):
2229 (khtml::EditCommandPtr::setEndingSelection):
2230 (khtml::EditCommand::setStartingSelection):
2231 (khtml::EditCommand::setEndingSelection):
2232 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream):
2233 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
2234 (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
2235 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
2236 (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
2237 (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
2238 (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
2239 (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
2240 (khtml::ApplyStyleCommand::joinChildTextNodes):
2241 (khtml::DeleteSelectionCommand::initializePositionData):
2242 (khtml::DeleteSelectionCommand::handleGeneralDelete):
2243 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
2244 (khtml::DeleteSelectionCommand::doApply):
2245 (khtml::InsertLineBreakCommand::doApply):
2246 (khtml::InsertParagraphSeparatorCommand::doApply):
2247 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
2248 (khtml::InsertTextCommand::input):
2249 (khtml::MoveSelectionCommand::doApply):
2250 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
2251 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
2252 (khtml::ReplaceSelectionCommand::doApply):
2253 (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
2254 (khtml::ReplaceSelectionCommand::updateNodesInserted):
2255 (khtml::TypingCommand::deleteKeyPressed):
2256 (khtml::TypingCommand::forwardDeleteKeyPressed):
2257 (khtml::TypingCommand::markMisspellingsAfterTyping):
2258 * khtml/editing/htmlediting.h:
2259 * khtml/editing/selection.cpp:
2260 (khtml::Selection::Selection):
2261 (khtml::Selection::init):
2262 (khtml::Selection::moveTo):
2263 (khtml::Selection::modifyExtendingRightForward):
2264 (khtml::Selection::modifyMovingRightForward):
2265 (khtml::Selection::modifyExtendingLeftBackward):
2266 (khtml::Selection::modifyMovingLeftBackward):
2267 (khtml::Selection::modify):
2268 (khtml::Selection::xPosForVerticalArrowNavigation):
2269 (khtml::Selection::clear):
2270 (khtml::Selection::setBase):
2271 (khtml::Selection::setExtent):
2272 (khtml::Selection::setBaseAndExtent):
2273 (khtml::Selection::layout):
2274 (khtml::Selection::validate):
2275 * khtml/editing/selection.h:
2276 (khtml::Selection::startAffinity):
2277 (khtml::Selection::endAffinity):
2278 (khtml::Selection::baseAffinity):
2279 (khtml::Selection::extentAffinity):
2280 (khtml::operator==):
2281 * khtml/editing/text_affinity.h:
2283 * khtml/editing/visible_position.cpp:
2284 (khtml::VisiblePosition::VisiblePosition):
2285 (khtml::VisiblePosition::init):
2286 (khtml::VisiblePosition::initUpstream):
2287 (khtml::VisiblePosition::initDownstream):
2288 (khtml::VisiblePosition::next):
2289 (khtml::VisiblePosition::previous):
2290 (khtml::startVisiblePosition):
2291 (khtml::endVisiblePosition):
2292 * khtml/editing/visible_position.h:
2293 (khtml::VisiblePosition::):
2294 (khtml::VisiblePosition::VisiblePosition):
2295 (khtml::VisiblePosition::affinity):
2296 (khtml::VisiblePosition::setAffinity):
2297 (khtml::operator==):
2298 * khtml/editing/visible_units.cpp:
2299 (khtml::previousBoundary):
2300 (khtml::nextBoundary):
2301 (khtml::startOfLine):
2303 (khtml::previousLinePosition):
2304 (khtml::nextLinePosition):
2305 (khtml::startOfParagraph):
2306 (khtml::endOfParagraph):
2307 (khtml::previousParagraphPosition):
2308 (khtml::nextParagraphPosition):
2309 (khtml::startOfBlock):
2310 (khtml::endOfBlock):
2311 (khtml::startOfDocument):
2312 (khtml::endOfDocument):
2313 * khtml/editing/visible_units.h:
2314 * khtml/khtml_part.cpp:
2315 (KHTMLPart::findTextNext):
2316 (KHTMLPart::selectClosestWordFromMouseEvent):
2317 (KHTMLPart::handleMousePressEventTripleClick):
2318 (KHTMLPart::handleMousePressEventSingleClick):
2319 (KHTMLPart::handleMouseMoveEventSelection):
2320 (KHTMLPart::khtmlMouseReleaseEvent):
2321 (KHTMLPart::selectAll):
2322 (KHTMLPart::computeAndSetTypingStyle):
2323 (KHTMLPart::selectionComputedStyle):
2324 * khtml/rendering/render_br.cpp:
2325 (RenderBR::positionForCoordinates):
2326 * khtml/xml/dom_docimpl.cpp:
2327 (DocumentImpl::updateSelection):
2328 * khtml/xml/dom_nodeimpl.cpp:
2329 (NodeBaseImpl::setFocus):
2330 * khtml/xml/dom_position.cpp:
2331 (DOM::Position::previousCharacterPosition):
2332 (DOM::Position::nextCharacterPosition):
2333 * khtml/xml/dom_position.h:
2334 * kwq/KWQAccObject.mm:
2335 (-[KWQAccObject value]):
2336 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
2337 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
2338 (-[KWQAccObject accessibilityAttributeValue:]):
2339 (-[KWQAccObject doAXLineForTextMarker:]):
2340 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
2341 (-[KWQAccObject doAXTextMarkerForPosition:]):
2342 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
2343 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2344 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
2345 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
2346 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2347 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
2348 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
2349 * kwq/KWQAccObjectCache.mm:
2350 (KWQAccObjectCache::textMarkerForVisiblePosition):
2351 (KWQAccObjectCache::visiblePositionForTextMarker):
2352 * kwq/KWQKHTMLPart.mm:
2353 (KWQKHTMLPart::findString):
2354 (KWQKHTMLPart::advanceToNextMisspelling):
2355 (KWQKHTMLPart::styleForSelectionStart):
2356 (KWQKHTMLPart::baseWritingDirectionForSelectionStart):
2357 (KWQKHTMLPart::setSelectionFromNone):
2358 (KWQKHTMLPart::respondToChangedSelection):
2359 * kwq/WebCoreBridge.mm:
2360 (-[WebCoreBridge setSelectedDOMRange:affinity:]):
2361 (-[WebCoreBridge selectionAffinity]):
2362 (-[WebCoreBridge setMarkDOMRange:]):
2363 (-[WebCoreBridge _visiblePositionForPoint:]):
2364 (-[WebCoreBridge moveDragCaretToPoint:]):
2365 (-[WebCoreBridge editableDOMRangeForPoint:]):
2366 (-[WebCoreBridge ensureSelectionVisible]):
2367 (-[WebCoreBridge rangeOfCharactersAroundCaret]):
2369 2005-02-09 Chris Blumenberg <cblu@apple.com>
2371 Fixed: <rdar://problem/3985211> Seed: Mail: Drag-and-drop destination indicator / insertion point disappears
2373 Reviewed by kocienda.
2375 * khtml/rendering/render_block.cpp:
2376 (khtml::RenderBlock::paintCaret): new
2377 (khtml::RenderBlock::paintObject): call paintCaret for the cursor caret and the drag caret
2378 * khtml/rendering/render_block.h:
2382 2005-02-08 Ken Kocienda <kocienda@apple.com>
2388 <rdar://problem/3996344> Entire document content is deleted when only the first paragraph was supposed to be
2390 Problem stems from my attempt to fix this bug: <rdar://problem/3986155> Insertion point goes
2391 to beginning of doc after deleting.
2393 I added an "optimization" that proved to do more harm than good. So, basically, the fix is to remove code.
2395 * khtml/editing/htmlediting.cpp:
2396 (khtml::DeleteSelectionCommand::handleGeneralDelete)
2398 2005-02-07 Darin Adler <darin@apple.com>
2402 - fixed <rdar://problem/3890352> REGRESSION (125-170, Panther-only): pasted textarea contents disappear (exception in NSText)
2404 * kwq/KWQTextArea.mm: (-[KWQTextArea tile]): Don't resize the text view immediately here.
2405 Use performWithDelay to defer it to avoid the re-entrancy that bothers the Panther version
2406 of NSTextView. On Tiger, leave the code alone.
2408 2005-02-07 Adele Amchan <adele@apple.com>
2412 Fix for <rdar://problem/3993628> REGRESSION (180-181): Logitelnet bank's website doesn't work
2414 This fixes an oversight in the fix for <rdar://problem/3964286>.
2415 We're now making sure there is a document before calling checkCompleted in slotLoaderRequestDone.
2416 That function is called even when other parts finish loads of their subresources, so we could end
2417 up calling checkCompleted before we had a document. We also looked over all the other calls to
2418 checkCompleted to convince ourselves no other call sites had a similar issue.
2420 * khtml/khtml_part.cpp: (KHTMLPart::slotLoaderRequestDone): Check if doc is nil before calling
2423 2005-02-07 Ken Kocienda <kocienda@apple.com>
2429 <rdar://problem/3953302> Replacing quoted text ends up with blue-colored text that is not quoted
2431 * khtml/editing/htmlediting.cpp:
2432 (khtml::DeleteSelectionCommand::doApply): Removed special case delete code for select all. It was
2433 causing as many bugs as it fixed. What's more, the design concept is a bit shaky. By removing
2434 this special case, the bug goes away.
2435 * khtml/editing/htmlediting.h: Remove declaration.
2437 Test results using selectAll() updated to reflect changed behavior.
2439 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
2440 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
2441 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
2442 * layout-tests/editing/inserting/insert-3654864-fix-expected.txt:
2443 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
2444 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt:
2445 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt:
2446 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
2448 2005-02-06 Darin Adler <darin@apple.com>
2452 - fixed <rdar://problem/3994164> setting a new style attribute with setAttribute("style") doesn't blow away the old style
2454 * khtml/css/css_valueimpl.h: Renamed parseProperty to parseDeclaration, since it's used to parse
2455 an entire style declaration, not a single property.
2456 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::parseDeclaration): Renamed,
2457 and added code to clear m_values.
2458 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Call function by its
2459 new name, and remove some unnecessary comments.
2461 2005-02-06 Darin Adler <darin@apple.com>
2465 - fixed <rdar://problem/3993722> need oncut and onpaste handlers implemented for <textarea> (needed for widgets)
2467 * kwq/KWQTextArea.mm:
2468 (-[KWQTextAreaTextView dispatchHTMLEvent:]): Added.
2469 (-[KWQTextAreaTextView cut:]): Dispatch "before cut" and "cut" events.
2470 (-[KWQTextAreaTextView copy:]): Dispatch "before copy" and "copy" events.
2471 (-[KWQTextAreaTextView paste:]): Dispatch "before paste" and "paste" events.
2472 (-[KWQTextAreaTextView pasteAsPlainText:]): Ditto.
2473 (-[KWQTextAreaTextView pasteAsRichText:]): Ditto.
2475 2005-02-06 Darin Adler <darin@apple.com>
2479 - fixed <rdar://problem/3943038> <input type=search> that is focused in onload handler doesn't have a visible editor
2481 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setFocusNode): Always update layout before giving focus to a widget.
2482 This prevents the bad case where we give a widget focus before it has been positioned or sized, causing us to
2483 exercise edge cases AppKit doesn't handle well.
2485 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Remove workaround code I added
2486 to fix bug 3943049. Updating the layout fixes the same problem in a cleaner, safer way, and solves another problem,
2487 with the way the clip view is set up.
2489 2005-02-06 Darin Adler <darin@apple.com>
2493 - fixed <rdar://problem/3425232> textarea won't trigger onchange action when clicking to new field
2495 * khtml/rendering/render_form.h: Added new m_dirty data member.
2496 * khtml/rendering/render_form.cpp:
2497 (RenderTextArea::RenderTextArea): Initialize m_dirty to false.
2498 (RenderTextArea::detach): Call value() on the DOM element to cause it to fetch the value from this object.
2499 (RenderTextArea::handleFocusOut): Ditto. Also send the onchange event based only on the m_dirty flag.
2500 (RenderTextArea::updateFromElement): Clear the m_dirty flag if the edited value is blown away by a value
2501 that comes from the DOM element. Remove code to clear the element's m_dirtyvalue flag; that's an unnecessary
2502 optimization, and ideally we'll stop having code in the render object that knows about that flag later.
2503 (RenderTextArea::slotTextChanged): Set the m_dirty flag.
2505 2005-02-06 Darin Adler <darin@apple.com>
2509 - re-fixed <rdar://problem/3760910> please add support for custom tag names in HTML
2511 * khtml/xml/dom_docimpl.cpp:
2512 (DocumentImpl::tagId): Use ID_LAST_TAG + 1 for the ID of the first assigned tag ID. Before we'd use ID_LAST_TAG,
2513 which resulted in the same number being used for ID_COMMENT and the first custom tag.
2514 (DocumentImpl::tagName): Use ID_LAST_TAG + 1, as above.
2515 (DocumentImpl::namespaceURI): Change a < ID_LAST_TAG to <= ID_LAST_TAG in the same spirit as above.
2517 2005-02-06 Darin Adler <darin@apple.com>
2521 - fixed <rdar://problem/3986639> Crash occurs after choosing Undo Typing from the Edit menu
2523 * kwq/KWQTextArea.mm: (-[KWQTextArea viewWillMoveToWindow:]): Remove actions from undo manager when the view is
2524 removed from the window. Unfortunately, to do this the code has to know that the target of NSTextView actions
2525 will be the text storage object, but given the NSText architecture, that's pretty clear.
2527 2005-02-05 Chris Blumenberg <cblu@apple.com>
2529 Fixed: <rdar://problem/3991974> REGRESSION: www.jabra.com world location screen does not work
2533 * kwq/KWQKJavaAppletWidget.mm:
2534 (KJavaAppletWidget::KJavaAppletWidget): fallback to the document's base URL if there is no baseURL attribute
2535 * kwq/WebCoreBridge.h:
2536 * kwq/WebCoreBridge.mm:
2537 (-[WebCoreBridge baseURL]): new
2539 2005-02-04 David Harrison <harrison@apple.com>
2543 Rolled out Ken's accidental checkin when committing <rdar://problem/3986155> fix yesterday.
2545 * khtml/editing/selection.cpp:
2546 (khtml::Selection::validate):
2548 2005-02-04 Adele Amchan <adele@apple.com>
2552 Fix for <rdar://problem/3758785> Safari no longer works at BankOfAmerica online banking for military users
2554 When closing the document, if a body doesn't exist we now create one. This bug was preventing the onload handler from
2555 firing in cases where there wasn't a body. In the BankOfAmerica case, the page was just a bit of script where the onload
2556 handler redirected to the correct page.
2558 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
2560 2005-02-03 Ken Kocienda <kocienda@apple.com>
2566 <rdar://problem/3986155> Insertion point goes to beginning of doc after deleting
2568 * khtml/editing/htmlediting.cpp:
2569 (khtml::DeleteSelectionCommand::setStartNode): New convenience to handle reference counting when setting.
2570 (khtml::DeleteSelectionCommand::handleGeneralDelete): This contains the crux of the bug fix. Improve tests
2571 that detect when a selected node needs to be retained, rather than deleted, to preserve the intent of the user.
2572 This has the side effect of causing the insertion point placement code to succeed rather than fail. Before
2573 this fix, the failure of the insertion point placement code caused the insertion point to jump to the start
2574 of the document, which is the symptom that can be perceived by users when editing.
2575 * khtml/editing/htmlediting.h: Add setStartNode declaration.
2576 * khtml/editing/visible_units.cpp:
2577 (khtml::startOfBlock): This function had a stubbed-in non-tested implementation. Implement and
2578 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001-expected.txt: Added.
2579 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001.html: Added.
2580 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt: Added.
2581 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002.html: Added.
2582 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt: Added.
2583 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003.html: Added.
2584 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt: Added.
2585 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004.html: Added.
2586 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005-expected.txt: Added.
2587 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005.html: Added.
2588 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006-expected.txt: Added.
2589 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006.html: Added.
2593 2005-02-03 Richard Williamson <rjw@apple.com>
2595 Fixed <rdar://problem/3987419> Stocks and Weather leak what appears to XMLHTTPRequest results
2597 XMLHTTPRequests were causing massive leaks. _webcore_initWithHeaderString: did funky things with
2598 self replacement. Re-wrote to use more traditional factory constructor avoiding self replacement.
2600 Reviewed by David Harrison.
2603 (+[NSDictionary _webcore_dictionaryWithHeaderString:]):
2605 (KWQServeSynchronousRequest):
2607 2005-02-03 Chris Blumenberg <cblu@apple.com>
2609 Fixed: <rdar://problem/3938763> Cannot view Windows Media Player videos (soundtrack is played twice with delay)
2613 * khtml/html/html_objectimpl.cpp:
2614 (HTMLObjectElementImpl::attach): set needWidgetUpdate to false right after calling updateWidget because dispatchHTMLEvent can end up calling this method again
2615 (HTMLObjectElementImpl::recalcStyle): ditto
2617 2005-02-02 John Sullivan <sullivan@apple.com>
2621 - WebCore part of fix for <rdar://problem/3980651> REGRESSION (125-180): Huge number of pages printed from certain page,
2624 This also fixes the problems with printing from GMail, yay!
2626 * khtml/rendering/render_flow.cpp:
2627 (RenderFlow::paintLines):
2628 If the current line is taller than the entire page height (e.g. tall iFrame), don't try
2629 to avoid splitting it across pages.
2631 * kwq/WebCoreBridge.mm:
2632 (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
2633 Handle error cases in a more obvious manner; this will cause future problems like this
2634 to print a blank page and complain to the console on debug builds, rather than print a
2635 zillionty mostly-blank pages.
2637 2005-02-02 Chris Blumenberg <cblu@apple.com>
2639 Fixed: <rdar://problem/3960304> can't load a particular applet (at www.escape.de) unless it's the first applet to be loaded
2643 * khtml/rendering/render_frames.cpp:
2644 (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.
2646 2005-02-02 Chris Blumenberg <cblu@apple.com>
2648 Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)
2652 * kwq/KWQKHTMLPart.mm:
2653 (KWQKHTMLPart::sendContextMenuEvent): check if SPI to always enable selecting closest word is enabled
2654 * kwq/WebCoreBridge.h:
2656 2005-02-02 Ken Kocienda <kocienda@apple.com>
2660 * khtml/editing/markup.cpp:
2661 (khtml::createMarkup): Removed debug spam I committed earlier in error.
2663 2005-02-02 Ken Kocienda <kocienda@apple.com>
2669 <rdar://problem/3823109> WebKit should support -toggleBaseWritingDirection: (bidi editing support)
2671 Since base writing direction is a paragraph-level property in AppKit, and we use the CSS direction
2672 property in WebCore, which can be applied to inline elements as well as blocks, a new notion has
2673 been added to the WebCore apply style logic. It is now possible to force all properties in a
2674 style declaration to be applied as though they were block properties.
2676 * khtml/editing/htmlediting.cpp:
2677 (khtml::ApplyStyleCommand::ApplyStyleCommand): Add an enum and a flag to this command that controls whether to force all
2678 properties in the style to be applied as block styles. Default is "no", retaining previous behavior.
2679 (khtml::ApplyStyleCommand::doApply): Switch on new flag to apply styles as before, or force all preoperties to be applied
2681 * khtml/editing/htmlediting.h:
2682 (khtml::ApplyStyleCommand::): Add an enum and a flag, as above.
2683 * khtml/khtml_part.cpp:
2684 (KHTMLPart::applyParagraphStyle): New method to force application of all style properties as block styles.
2685 * khtml/khtml_part.h: Update header declarations.
2686 * kwq/KWQKHTMLPart.h: Update header declarations.
2687 * kwq/KWQKHTMLPart.mm:
2688 (KWQKHTMLPart::baseWritingDirectionForSelectionStart): Accessor to help WebKit do a toggle operation on
2690 * kwq/WebCoreBridge.h: Update header declarations.
2691 * kwq/WebCoreBridge.mm:
2692 (-[WebCoreBridge applyParagraphStyle:withUndoAction:]): New method to force application of all style properties as block styles.
2693 (-[WebCoreBridge baseWritingDirectionForSelectionStart]): Accessor to help WebKit do a toggle operation on
2698 <rdar://problem/3985035> REGRESSION (Mail): Text copied from wrapped line contains extra character when pasted
2700 * khtml/editing/markup.cpp:
2701 (khtml::renderedText): Add an enum and a flag to this command that controls whether to force all
2702 This is the result of an error in the code that computes the rendered text that is selected
2703 when copying. Since spaces collapse at the end of lines, and these spaces need to be copied
2704 when the selection spans line endings, code runs to compute this text. However, this code
2705 was also running incorrectly in cases where lines wrapped. I have now added the missing
2706 test to check that the selection does indeed extend to the end of the line.
2709 2005-02-02 Ken Kocienda <kocienda@apple.com>
2715 <rdar://problem/3984894> REGRESSION (Mail): Command-right-arrow in reply does the wrong thing (two ways)
2716 <rdar://problem/3985130> REGRESSION (Mail): command-right-arrow in pasted RTF selects only up to tab
2718 * khtml/editing/visible_units.cpp:
2719 (khtml::endOfLine): Two separate problems in this new function recently added to take the place of
2720 selectionForLine. In the first, endOfLine did not stop at BR elements, and returned the position
2721 beyond them. In the second, the VisiblePosition constructor gives the wrong answer in certain cases.
2722 Darin is going to work on a solution for that problem. In the meantime, I can fix the symptom of this
2723 bug by going down to the last leaf child of the root line box; a one line change we will roll out when
2726 2005-02-01 Richard Williamson <rjw@apple.com>
2728 Fixed <rdar://problem/3985535> QT Plug-in JavaScript support now fails in <embed> tag only case
2732 * khtml/ecma/kjs_html.cpp:
2733 (KJS::HTMLDocument::tryGet):
2735 2005-02-01 John Sullivan <sullivan@apple.com>
2737 Written by Darin, reviewed and tested by me
2739 - fixed <rdar://problem/3969684> Panther-only: extra blank lines between
2740 pasted content from Blot
2742 * kwq/KWQKHTMLPart.mm:
2743 (KWQKHTMLPart::attributedString):
2744 don't emit paragraph breaks if the margins are tiny; matches what
2745 we do for plain-text conversion
2749 2005-02-01 Ken Kocienda <kocienda@apple.com>
2755 <rdar://problem/3985160> Deficiencies in pasting architecture blocking progress on other bugs
2757 * khtml/editing/html_interchange.h: Move style span text used to mark element added to
2758 add style to this header.
2759 * khtml/editing/htmlediting.cpp:
2760 (khtml::styleSpanClassString): Change to use constant moved to html_interchange.h.
2761 (khtml::isStyleSpan): New helper function. Checks if this is a span we added to apply style.
2762 (khtml::CompositeEditCommand::insertNodeBefore): Added an assert to check that the node
2763 we are inserting before is not the body.
2764 (khtml::CompositeEditCommand::insertNodeAfter): Ditto, but check is for after.
2765 (khtml::ReplacementFragment::ReplacementFragment): Added code to process the "default style"
2766 that is added by the copy code.
2767 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): first and last nodes inserted are
2768 now member variables instead of function locals. Initialize them here.
2769 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): Deref first and last nodes inserted
2771 (khtml::ReplaceSelectionCommand::doApply): Change design to fix the bug. Major change is to
2772 separate out the code that inserts nodes into the tree so additional styling checks can
2773 be done in a centralized way. Also got rid of the notion of "merging into the end block." That
2774 concept was just wrong.
2775 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Tweak interface now that first and
2776 last nodes inserted are member variables.
2777 (khtml::ReplaceSelectionCommand::insertNodeAfterAndUpdateNodesInserted): New helper used
2778 by replace code to do the stated DOM operation and update state internal to the command.
2779 This will also be a catch point to handle the kinds of additional style checks needed to
2780 make paste work right.
2781 (khtml::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted): Ditto.
2782 (khtml::ReplaceSelectionCommand::insertNodeBeforeAndUpdateNodesInserted): Ditto.
2783 (khtml::ReplaceSelectionCommand::updateNodesInserted): Ditto.
2784 * khtml/editing/htmlediting.h: Update declarations as needed.
2785 * khtml/editing/markup.cpp:
2786 (khtml::createMarkup): Adds a "default style" span to the content written to the pasteboard.
2787 This will help us to fix some of the bugs blocked by the bug above.
2788 * khtml/xml/dom_nodeimpl.cpp:
2789 (NodeImpl::lastDescendent): New helper.
2790 * khtml/xml/dom_nodeimpl.h: Ditto.
2791 * khtml/xml/dom_position.cpp:
2792 (DOM::Position::upstream): Fixed a bug which would allow the upstream position returned to be
2793 in unrendered content.
2794 (DOM::Position::downstream): Ditto.
2796 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Ending positions tweaked due to
2797 changes in upstream() and downstream() functions.
2798 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Ditto
2799 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Ditto
2800 * layout-tests/editing/selection/extend-by-character-006-expected.txt: Ditto
2802 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Changed what we expect, given
2803 new behavior of paste code.
2805 2005-01-31 John Sullivan <sullivan@apple.com>
2807 Reviewed by Dave Hyatt.
2809 - fixed <rdar://problem/3983097> Tabbing on RSS pages gets stuck in search field
2810 with "full keyboard navigation" off
2814 (QSlider::focusPolicy):
2815 Implemented this method for KWQSlider. It is needed for our widget subclasses that
2816 can become focused in some situations. I missed this when fixing 3949203 because
2817 it only comes into play when tab-to-controls is on, and because the other relevant
2818 methods are objective-C methods.
2820 2005-01-31 David Harrison <harrison@apple.com>
2824 <rdar://problem/3964164> AXWebArea needs to unregister on going invisible
2826 * khtml/xml/dom_docimpl.cpp:
2827 (DocumentImpl::detach):
2828 Detach the AX UIElement for the AXWebArea.
2830 2005-01-31 David Harrison <harrison@apple.com>
2834 <rdar://problem/3850876> AX: button exposed as only an AXImage at http://appleseed.apple.com/ site (<input type=image>)
2836 * khtml/rendering/render_form.h:
2837 (khtml::RenderImageButton::isImageButton):
2839 * khtml/rendering/render_image.h:
2840 (khtml::RenderImage::isImageButton):
2842 * kwq/KWQAccObject.mm:
2843 (-[KWQAccObject isImageButton]):
2844 (-[KWQAccObject actionElement]):
2845 (-[KWQAccObject role]):
2846 (-[KWQAccObject accessibilityActionNames]):
2847 (-[KWQAccObject accessibilityPerformAction:]):
2848 Represent RenderImageButton elements as buttons instead of images.
2850 2005-01-31 David Harrison <harrison@apple.com>
2852 Prevent nil dereference in debug code.
2854 * khtml/xml/dom_nodeimpl.cpp:
2855 (NodeImpl::displayTree):
2856 Stop when parent is 0, too.
2858 2005-01-31 John Sullivan <sullivan@apple.com>
2860 Reviewed by Dave Hyatt.
2862 - fixed <rdar://problem/3949203> cannot tab to, within, or out of the RSS sidebar
2865 (-[KWQSlider becomeFirstResponder]):
2866 (-[KWQSlider resignFirstResponder]):
2867 (-[KWQSlider nextKeyView]):
2868 (-[KWQSlider previousKeyView]):
2869 (-[KWQSlider canBecomeKeyView]):
2870 (-[KWQSlider nextValidKeyView]):
2871 (-[KWQSlider previousValidKeyView]):
2872 Copied these methods from KWQButton. The lack of special handling for first-responder-ness
2873 here was causing the focus to get "stuck" on the RSS page's slider widget. Added FIXME
2874 about how it would be nice to share more of this code rather than replicating it in each
2875 KWQ widget subclass.
2877 2005-01-31 Darin Adler <darin@apple.com>
2879 Reviewed by Harrison.
2881 - fixed <rdar://problem/3980066> Double-click on single character moves insertion point to previous line
2883 * khtml/khtml_part.cpp:
2884 (KHTMLPart::selectClosestWordFromMouseEvent): Set affinity too.
2885 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2886 (KHTMLPart::handleMouseMoveEventSelection): Ditto.
2887 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
2889 * khtml/editing/selection.cpp:
2890 (khtml::Selection::modifyExtendingRightForward): Use endOfLine and endOfDocument.
2891 (khtml::Selection::modifyMovingRightForward): Ditto.
2892 (khtml::Selection::modifyExtendingLeftBackward): Use startOfLine and startOfDocument.
2893 (khtml::Selection::modifyMovingLeftBackward): Ditto.
2894 (khtml::Selection::validate): Rewrote the section that handles double-click. Two main fixes: 1) use isStartOfLine to
2895 check for another case where we want to select the word to the right, and 2) use isEndOfParagraph, which seems
2896 to work correctly in cases where isLastVisiblePositionInParagraph is giving the wrong answer. Also changed the line
2897 code to use startOfLine/endOfLine and the document code to use startOfDocument/endOfDocument.
2899 2005-01-31 Darin Adler <darin@apple.com>
2901 Reviewed by Harrison.
2903 - fixed <rdar://problem/3935275> unexpected quit scrolling over link; last.fm (works in IE and Firefox)
2905 * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): By using the correct document, fix the crash reported here.
2906 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.
2908 2005-01-31 Darin Adler <darin@apple.com>
2910 Reviewed by Ken and Harrison.
2912 - fixed <rdar://problem/3947901> REGRESSION (Mail): Pasting paragraph of rich text leaves insertion point before pasted text
2913 - fixed <rdar://problem/3949790> hitting return after underlined line results in too much or too little underlined
2914 - fixed <rdar://problem/3981759> nil-deref and crash when pasting just a paragraph break
2915 - fixed a couple problems I discovered while working with bug 3949790
2917 * khtml/editing/htmlediting.cpp:
2918 (khtml::ApplyStyleCommand::applyInlineStyle): Pass StayInBlock to upstream. Without this, we end up going too far
2919 upstream in the test case in bug 3949790.
2920 (khtml::ApplyStyleCommand::removeInlineStyle): Pass StayInBlock to upstream and downstream. Same reason as above.
2921 (khtml::ReplaceSelectionCommand::doApply): Update endPos if inserting a new node and endPos is using that node's
2922 parent and an offset past the node being inserted. That change fixes a problem with the position of the insertion point
2923 after pasting into the top level of a document (from test cases in 3947901 and 3949790). When setting insertionPos, use
2924 code that works when lastNodeInserted is a block rather than a text node. That change fixes a problem where a newline is
2925 not added when pasting an entire paragraph into the end of a document (from test case in 3949790). Added nil check before
2926 checking if lastNodeInserted is a <br> element, which fixes the crash when pasting just a paragraph break.
2928 * khtml/editing/visible_units.h: Filled out the set of calls to add some boolean checks for lines (needed for the
2929 bug fix), and calls for blocks (not yet implemented), and documents. The document checks may need refinement to
2930 properly handle documents with a mix of editable and non-editable content, but for now they just refactor code
2931 and make things a little clearer. Also removed the "include line break" parameter from endOfSentence.
2932 * khtml/editing/visible_units.cpp:
2933 (khtml::rootBoxForLine): Added.
2934 (khtml::startOfLine): Added. Algorithm taken from selectionForLine in selection.cpp.
2935 (khtml::endOfLine): Ditto.
2936 (khtml::inSameLine): Added.
2937 (khtml::isStartOfLine): Added.
2938 (khtml::isEndOfLine): Added.
2939 (khtml::endOfSentence): Removed "include line break" parameter.
2940 (khtml::inSameParagraph): Added a null check.
2941 (khtml::isStartOfParagraph): Ditto.
2942 (khtml::isEndOfParagraph): Ditto.
2943 (khtml::startOfBlock): Added.
2944 (khtml::endOfBlock): Added.
2945 (khtml::inSameBlock): Added.
2946 (khtml::isStartOfBlock): Added.
2947 (khtml::isEndOfBlock): Added.
2948 (khtml::startOfDocument): Added.
2949 (khtml::endOfDocument): Added.
2950 (khtml::inSameDocument): Added.
2951 (khtml::isStartOfDocument): Added.
2952 (khtml::isEndOfDocument): Added.
2954 2005-01-30 Darin Adler <darin@apple.com>
2958 - fixed <rdar://problem/3977000> form data set posted for <input type="image" ...> omits name/value pair
2960 * khtml/html/html_formimpl.cpp:
2961 (DOM::HTMLInputElementImpl::appendFormData): Append a name/value pair for type IMAGE in addition to the X/Y
2964 2005-01-30 Darin Adler <darin@apple.com>
2968 - fixed <rdar://problem/3974246> REGRESSION (125-180): popup menus are missing item text on Harmony Remote web site
2970 * khtml/html/html_formimpl.cpp: (DOM::HTMLOptionElementImpl::text): Change this function to traverse the entire tree
2971 and gather all the text rather than just looking at immediate children.
2973 * khtml/xml/dom_nodeimpl.h: Added const.
2974 * khtml/xml/dom_nodeimpl.cpp:
2975 (NodeImpl::traverseNextNode): Added const.
2976 (NodeImpl::traverseNextSibling): Ditto.
2977 (NodeImpl::traversePreviousNodePostOrder): Ditto.
2978 (NodeImpl::detach): Add a missing nil check.
2980 2005-01-30 Darin Adler <darin@apple.com>
2984 - fixed <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
2986 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Added missing ref/deref of newly created element.
2988 2005-01-28 Darin Adler <darin@apple.com>
2990 * khtml/css/cssproperties.c: Regenerated with newer gperf.
2992 2005-01-28 David Harrison <harrison@apple.com>
2994 Reviewed by John Sullivan.
2996 <rdar://problem/3968144> AX need to be able to focus an AXLink by setting AXFocused to true
2998 * kwq/KWQAccObject.mm:
2999 (-[KWQAccObject accessibilityPerformAction:]):
3000 (-[KWQAccObject accessibilityIsAttributeSettable:]):
3001 Add AXFocused for AXLinks.
3003 2005-01-28 David Harrison <harrison@apple.com>
3007 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
3009 Use AppKit SPI _accessibilityParentForSubview to return KWQAccObject parent of AppKit AX object.
3011 * kwq/KWQAccObject.mm:
3012 (-[KWQAccObject _accessibilityParentForSubview:]):
3015 2005-01-27 Adele Amchan <adele@apple.com>
3017 fixed by Darin, reviewed by me.
3019 <rdar://problem/3976314> REGRESSION (180-TOT): submitting password fields fail on Panther
3021 * kwq/KWQTextField.mm: (-[KWQTextFieldController string]): on panther, the secure text field's editor
3022 does not contain the real string, so now we just call stringValue on the field in that case.
3024 2005-01-26 Maciej Stachowiak <mjs@apple.com>
3026 Reviewed by Darin, Hyatt and Ken.
3028 <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
3030 * khtml/css/css_computedstyle.cpp:
3031 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support
3032 for -khtml-text-decorations-in-effect property. This works like text-docration
3033 but follows proper inline semantics, that is, if a parent is causing text
3034 decoration then -khtml-text-decorations-in-effect on this element will reflect that.
3035 * khtml/css/cssproperties.in: Add -khtml-text-decorations-in-effect property.
3036 * khtml/css/cssproperties.h: regenerated
3037 * khtml/css/cssvalues.c: regenerated
3038 * khtml/css/cssparser.cpp: regenerated
3039 * khtml/css/cssproperties.c: regenerated
3041 * khtml/css/css_valueimpl.h: Made copyPropertiesInSet public.
3043 * khtml/editing/htmlediting.cpp:
3044 (khtml::StyleChange::init): Handle -khtml-text-decorations-in-effect
3045 specially, translate to text-decoration
3046 (khtml::ApplyStyleCommand::applyInlineStyle): Fix a comment.
3047 (khtml::ApplyStyleCommand::removeInlineStyle): Add new way of pushing down
3048 text-decoration styles around the edges of the selected range.
3049 (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAroundNode): Helper for this.
3050 (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): ditto
3051 (khtml::ApplyStyleCommand::nodeFullyUnselected): ditto
3052 (khtml::hasTextDecorationProperty): ditto
3053 (khtml::highestAncestorWithTextDecoration): ditto
3054 (khtml::ApplyStyleCommand::extractTextDecorationStyle): ditto
3055 (khtml::ApplyStyleCommand::extractAndNegateTextDecorationStyle): ditto
3056 (khtml::ApplyStyleCommand::applyTextDecorationStyle): ditto
3057 * khtml/editing/htmlediting.h: Prototype new methods.
3058 * khtml/editing/jsediting.cpp: Make underline execCommand use the new CSS property.
3060 - as a necessary part of the fix, fixed the longstanding problem
3061 that mutating an element's inlineStyleDecl would not property
3062 update its style attribute. now it does.
3064 * khtml/css/css_valueimpl.cpp:
3065 (DOM::CSSMutableStyleDeclarationImpl::setChanged): If this is an inline style
3066 declaration, tell the element it's style attribute needs updating.
3067 * khtml/html/html_elementimpl.cpp:
3068 (HTMLElementImpl::invalidateStyleAttribute): New method, just calls down
3070 (HTMLElementImpl::updateStyleAttribute): Regenerate style attribute from
3071 inline style declaration.
3072 * khtml/html/html_elementimpl.h: Prototype new stuff.
3073 * khtml/xml/dom_elementimpl.cpp:
3074 (ElementImpl::ElementImpl): Initialize new attribute.
3075 (ElementImpl::updateStyleAttributeIfNeeded): New method to check if the style
3076 is dirty and this is an html element, and if so call the html element to
3077 regenerate the style attribute.
3078 (ElementImpl::attributes): update style if needed
3079 (ElementImpl::getAttribute): ditto
3080 (ElementImpl::hasAttributes): ditto
3081 (ElementImpl::dump): ditto
3082 (XMLElementImpl::cloneNode): ditto
3083 * khtml/xml/dom_elementimpl.h:
3084 (DOM::ElementImpl::isStyleAttributeValid): new method to manage style attr
3086 (DOM::ElementImpl::setStyleAttributeValid): ditto
3088 - added new layout tests for underlining:
3090 * layout-tests/editing/editing.js:
3091 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt: Added.
3092 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt: Added.
3093 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold.html: Added.
3094 * layout-tests/editing/style/remove-underline-across-paragraph.html: Added.
3095 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt: Added.
3096 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt: Added.
3097 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold.html: Added.
3098 * layout-tests/editing/style/remove-underline-after-paragraph.html: Added.
3099 * layout-tests/editing/style/remove-underline-expected.txt: Added.
3100 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt: Added.
3101 * layout-tests/editing/style/remove-underline-from-stylesheet.html: Added.
3102 * layout-tests/editing/style/remove-underline-in-bold-expected.txt: Added.
3103 * layout-tests/editing/style/remove-underline-in-bold.html: Added.
3104 * layout-tests/editing/style/remove-underline.html: Added.
3105 * layout-tests/editing/style/underline-expected.txt: Added.
3106 * layout-tests/editing/style/underline.html: Added.
3108 2005-01-27 David Hyatt <hyatt@apple.com>
3110 Fix for 3875199, search field needs to be able to show a magnifying glass without a dropdown menu.
3112 Reviewed by kocienda
3114 * khtml/html/html_formimpl.cpp:
3115 (DOM::HTMLInputElementImpl::HTMLInputElementImpl):
3116 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
3117 * kwq/KWQLineEdit.mm:
3118 (QLineEdit::setMaxResults):
3120 2005-01-27 Ken Kocienda <kocienda@apple.com>
3126 <rdar://problem/3973254> Deletions of ranges does not coalesce correctly with subsequent typing
3128 * khtml/editing/htmlediting.cpp:
3129 (khtml::InsertTextCommand::deleteCharacter): Remove this dead code.
3130 (khtml::ReplaceSelectionCommand::editingAction): Moved this code to a better place in the file.
3131 It was in with unrelated functions.
3132 (khtml::TypingCommand::TypingCommand): Reorganize initialization list so it is easier to read.
3133 (khtml::TypingCommand::issueCommandForDeleteKey): Remove dead code. Roll in remaining code into deleteKeyPressed.
3134 (khtml::TypingCommand::deleteKeyPressed): Add in support for carrying along smart delete flag.
3135 (khtml::TypingCommand::forwardDeleteKeyPressed): New function. Makes forward delete work like
3136 "regular" delete in terms of coalescing typing.
3137 (khtml::TypingCommand::doApply): Add case for ForwardDeleteKey.
3138 (khtml::TypingCommand::preservesTypingStyle): Ditto.
3139 * khtml/editing/htmlediting.h:
3140 (khtml::TypingCommand::): Add ForwardDeleteKey constant. Remove a couple declarations for now-dead code.
3141 (khtml::TypingCommand::smartDelete): New accessor.
3142 (khtml::TypingCommand::setSmartDelete): Ditto.
3143 * kwq/WebCoreBridge.h:
3144 * kwq/WebCoreBridge.mm:
3145 (-[WebCoreBridge deleteKeyPressedWithSmartDelete:]): Add smart delete flag.
3146 (-[WebCoreBridge forwardDeleteKeyPressedWithSmartDelete:]): New method.
3147 * khtml/editing/jsediting.cpp: Add supprt for ForwardDelete command
3148 * layout-tests/editing/editing.js: Ditto.
3149 * layout-tests/editing/deleting/delete-and-undo-expected.txt: Added.
3150 * layout-tests/editing/deleting/delete-and-undo.html: Added.
3151 * layout-tests/editing/deleting/forward-delete-expected.txt: Added.
3152 * layout-tests/editing/deleting/forward-delete.html: Added.
3156 2005-01-27 David Harrison <harrison@apple.com>
3160 <rdar://problem/3962214> AX: AXLeftLineTextMarkerRangeForTextMarker returns incorrect range
3162 * kwq/KWQAccObject.mm:
3163 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
3164 Allowed for selection to end of line including the linebreak.
3166 2005-01-27 David Harrison <harrison@apple.com>
3168 Reviewed by Darin, Ken.
3170 <rdar://problem/3964470> AX: Include attachments in AXAttributedStringForTextMarkerRange
3172 * kwq/KWQAccObject.mm:
3173 (-[KWQAccObject isAttachment]):
3174 (-[KWQAccObject attachmentView]):
3175 (-[KWQAccObject role]):
3176 (-[KWQAccObject subrole]):
3177 (-[KWQAccObject roleDescription]):
3178 (-[KWQAccObject value]):
3179 (-[KWQAccObject title]):
3180 (-[KWQAccObject accessibilityDescription]):
3181 (-[KWQAccObject accessibilityIsIgnored]):
3182 (-[KWQAccObject accessibilityAttributeNames]):
3183 (-[KWQAccObject accessibilityAttributeValue:]):
3184 Make attachments accessible.
3186 (CreateCGColorIfDifferent):
3187 (AXAttributeStringSetColor):
3188 (AXAttributeStringSetNumber):
3189 (AXAttributeStringSetFont):
3190 (AXAttributeStringSetStyle):
3191 (AXAttributeStringSetElement):
3192 (AXLinkElementForNode):
3193 (AXAttributedStringAppendText):
3194 (AXAttributedStringAppendReplaced):
3195 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
3196 Add attachments and more text attributes to AXAttributedStringForTextMarkerRange.
3198 2005-01-27 Darin Adler <darin@apple.com>
3202 - fixed <rdar://problem/3807935> DOM CSS computed style line-height is wrong in two ways
3204 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3205 Use specified size rather than computed size when dealing with a percentage for line height.
3207 2005-01-27 Darin Adler <darin@apple.com>
3211 - fixed <rdar://problem/3971372> SWB: template function DOM_cast() won't compile with gcc 4.0
3212 - fixed other gcc 4.0 compiling problems Patrick Beard pointed out on the phone
3214 * kwq/DOMInternal.h: (DOM_cast): Change the "failToCompile()" trick to use a dependent name.
3215 Nowadays, if a name is not dependent, it is checked at template definition time. But we want
3216 a failure only at template instantiation time.
3218 * ForwardingHeaders/editing/text_granularity.h: Added. Needed but a bug in the 3.3 compiler made
3219 it compile anyway without this.
3223 * khtml/html/html_miscimpl.h: For clarity, mark these functions virtual too. They are automatically
3224 virtual because the base class ones are virtual, but it's ugly to leave it this way.
3226 2005-01-26 Ken Kocienda <kocienda@apple.com>
3232 <rdar://problem/3971609> REGRESSION (Mail): up/down arrow navigation broken after rewrapping text by resizing window
3233 <rdar://problem/3975661> REGRESSION (Mail): left/right arrow navigation can place insertion point after last character on line
3235 * khtml/editing/selection.cpp:
3236 (khtml::Selection::modifyAffinity): PARAGRAPH and LINE movements should not alter affinity. This was
3237 just a mistake before when it reset to upstream in some cases.
3238 * khtml/rendering/render_line.cpp:
3239 (khtml::RootInlineBox::closestLeafChildForXPos): Move this function down from InlineBox, and
3240 rework the implementation. This fixes 3971609.
3241 * khtml/rendering/render_line.h:
3242 * khtml/rendering/render_text.cpp:
3243 (RenderText::caretRect): Rework the algorithm to fix 3975661. This regressed when we began placing
3244 the spaces on the end of lines in text boxes when lines wrap.
3246 2005-01-26 Richard Williamson <rjw@apple.com>
3248 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
3250 I added a member variable to ObjectImp. This changed it's size and consequently
3251 hampered the optimizations built into the garbage collector. Objects no longer
3252 fit within the allocators cell size, and thus allocation fell back to a slower
3255 As a result of this fix I also dramatically cleaned up how runtime objects are
3256 accessed. The path mostly *removes* code.
3260 * khtml/ecma/kjs_dom.cpp:
3261 (DOMDocumentProtoFunc::tryCall):
3262 (DOMElementProtoFunc::tryCall):
3263 (KJS::getRuntimeObject):
3264 * khtml/ecma/kjs_dom.h:
3265 * khtml/ecma/kjs_html.cpp:
3266 (KJS::HTMLDocument::tryGet):
3267 (KJS::HTMLElement::tryGet):
3268 (KJS::HTMLElement::implementsCall):
3269 (KJS::HTMLElement::call):
3270 (KJS::HTMLElement::tryPut):
3271 (KJS::HTMLCollection::tryGet):
3272 (KJS::HTMLCollection::getNamedItems):
3273 * khtml/ecma/kjs_html.h:
3274 * khtml/ecma/kjs_window.cpp:
3277 2005-01-26 Richard Williamson <rjw@apple.com>
3279 Fixed <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
3281 For now we are using ICU UBreakIterator to determine grapheme boundaries for
3282 cursor and deletion. This does not match what Cocoa does exactly, but does match
3283 what Carbon does. The areas are difference are obscure, but, according to
3284 Deborah Goldsmith, using the UBreakIterator is the reasonable approach.
3288 * khtml/rendering/render_text.cpp:
3289 (RenderText::previousOffset):
3290 (RenderText::nextOffset):
3292 2005-01-25 David Harrison <harrison@apple.com>
3294 Reviewed by Maciej and Richard.
3296 <rdar://problem/3963731> AX VO: Changing window sizes causes a crash using with Voice Over - KWQPtrDictImpl::clear
3298 * khtml/html/html_miscimpl.cpp:
3299 (HTMLCollectionImpl::HTMLCollectionImpl):
3300 Ensure that isHTMLDocument before calling HTMLDocument-only method.
3302 2005-01-25 Richard Williamson <rjw@apple.com>
3304 Part one of fix for <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
3306 This patch changes the semantics of next() and previous() on
3307 VisiblePosition to move a grapheme (character cluster) at a
3308 time. This means that cursor navigation with correctly move
3309 over an entire cluster.
3311 However, the expected behavior for deleting a grapheme is to
3312 delete individual code points, thus decomposing the grapheme