3 2005-03-07 Ken Kocienda <kocienda@apple.com>
9 <rdar://problem/4040136> Expose SPI for WebCore's functions to create document fragments from plain text and markup strings
11 * kwq/DOMHTML.mm: Add two new SPI functions.
12 (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:])
13 (-[DOMHTMLDocument _createDocumentFragmentWithText:])
14 * kwq/DOMPrivate.h: Declare the new SPI here, a privately-exported header, so Mail can make use of it.
16 2005-03-07 Ken Kocienda <kocienda@apple.com>
22 <rdar://problem/4039676> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date
24 * khtml/editing/htmlediting.cpp:
25 (khtml::ReplaceSelectionCommand::doApply): Code to "eat" a <br> element, that was creating an otherwise empty line, was running
26 when it should not. If the content being pasted in does not end in a "logical" newline itself, then the <br> already
27 in the content needs to be preserved. A simple one-line change now sees to this.
29 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: This test now has an extra, but harmless,
30 <br> at the end of a paragraph. This makes sense given the code change.
33 * layout-tests/editing/pasteboard/paste-text-018-expected.txt: Added.
34 * layout-tests/editing/pasteboard/paste-text-018.html: Added.
36 2005-03-07 Ken Kocienda <kocienda@apple.com>
42 <rdar://problem/4035648> REGRESSION (Mail): line feed in source HTML file causes bad copy/paste behavior
44 The createMarkup() function in markup.cpp iterates over the nodes in a range,
45 and does some bookkeeping to figure out when to add close tags to the markup.
46 Some code added at the start of the loop to prevent markup from being written
47 for unrendered nodes short-circuited the rest of the loop, and so prevented
48 the close-tag-writing code from running when it should.
50 This is why the "plain" text wound up inside of the bold tag in the example
51 above. The addition of the unrendered return character caused an incorrect
52 delay in the close tag for the bold element from being written out, with the
53 result being that it wound up including additional content.
55 The fix is to add checks for node renderers throughout the loop at the points
56 where markup is written out for each node. This allows the additional close
57 tag logic to run as needed.
59 All layout tests pass with this change.
61 * khtml/editing/markup.cpp:
66 * layout-tests/editing/pasteboard/paste-4035648-fix-expected.txt: Added.
67 * layout-tests/editing/pasteboard/paste-4035648-fix.html: Added.
69 2005-03-06 Christy Warren kali@appple.com
73 * khtml/rendering/render_text.cpp:
74 (lastRendererOnPrevLine): helper for RenderText::caretRect
75 (RenderText::caretRect): added code to properly handle bidi ordered text boxes
77 2005-03-06 Christy Warren <set EMAIL_ADDRESS environment variable>
81 * khtml/editing/visible_position.cpp: Eliminated code that cuts off searching through the text boxes based on an assumption that breaks under bidi
82 (khtml::VisiblePosition::isCandidate):
83 * kwq/KWQFontMetrics.mm:
84 (QFontMetrics::checkSelectionPoint): Made the initialization of the WebCoreStyle honor the reversed flag
86 2005-03-05 John Sullivan <sullivan@apple.com>
90 - fixed <rdar://problem/4038417> Mail crashed in StyleChange::checkForLegacyHTMLStyleChange
91 when composing a reply
93 * khtml/editing/htmlediting.cpp:
94 (khtml::StyleChange::checkForLegacyHTMLStyleChange):
95 Added missing nil check.
97 2005-03-05 Darin Adler <darin@apple.com>
101 - fixed <rdar://problem/4038478> Crash in renderer viewing RSS feed at feed://wvs.topleftpixel.com/index.rdf
103 * khtml/xml/dom_docimpl.cpp: (widgetForNode): Check for nil before going from node to renderer.
105 2005-03-05 Darin Adler <darin@apple.com>
109 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
111 * khtml/rendering/render_text.cpp:
112 (getCharacterBreakIterator): Added. Helper that sets up an iterator for the passed-in text.
113 Shares a single global iterator (fast, albeit not thread-safe).
114 (RenderText::previousOffset): Changed to call getCharacterBreakIterator.
115 (RenderText::nextOffset): Ditto.
117 2005-03-05 Ken Kocienda <kocienda@apple.com>
123 <rdar://problem/4038267> REGRESSION (Mail): Crash copying and pasting end of paragraph
125 Code to handle content that has a "logical" newline at the end of the pasted content, and the code
126 to adjust the selection at the end of the paste operation made an assumption that at least one
127 node had been inserted by the paste command. This is not necessarily true in the case where the sole content
128 in the pasted content is one of these "logical" newlines. Adjust some code around so that we don't deref
129 null, but still adjust the selection correctly for this case. In each of the two functions below, some
130 null checks have been added, and some code has been rearranged a little bit to continue on through
131 the end of completeHTMLReplacement, even if no nodes have been inserted. The patch looks bigger and more
132 complicated than the conceptual change.
134 * khtml/editing/htmlediting.cpp:
135 (khtml::ReplaceSelectionCommand::doApply)
136 (khtml::ReplaceSelectionCommand::completeHTMLReplacement)
138 * layout-tests/editing/pasteboard/paste-4038267-fix-expected.txt: Added.
139 * layout-tests/editing/pasteboard/paste-4038267-fix.html: Added.
141 2005-03-05 Darin Adler <darin@apple.com>
145 - fixed <rdar://problem/4025918> images copied from Safari with relative src URLs aren't pasted into Mail messages (KURL resolves base URLs incorrectly)
147 * kwq/KWQKURL.mm: (KURL::KURL): Add a slash at the start of the path if a relative part is adding
148 a path onto a URL that has "pre-path" bits like host name, but no path yet. This doesn't come up
149 for http because in that case we add a trailing "/" as part of canonicalization.
151 2005-03-04 John Sullivan <sullivan@apple.com>
155 - fixed <rdar://problem/4033705> REGRESSION (Mail): Copy/Paste from Excel
156 crashes Mail in KWQKHTMLPart::fontForSelection(bool*) const + 232
158 * kwq/KWQKHTMLPart.mm:
159 (KWQKHTMLPart::fontForSelection):
160 Check for nil startNode, not just nil renderer.
162 2005-03-04 David Harrison <harrison@apple.com>
164 Reviewed by Ken, Richard.
166 <rdar://problem/3996383> REGRESSION (Mail): Deleting all of first line also deletes line ending
168 Problem was the placeholder check was based on 0 height block, but the block in this
169 case is the BODY, which has other content even though the paragraph is gone.
171 * khtml/editing/htmlediting.cpp:
172 (khtml::CompositeEditCommand::insertBlockPlaceholder):
173 Now does insert instead of append!
175 (khtml::CompositeEditCommand::appendBlockPlaceholder):
176 New. Actually does append.
178 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
179 Renamed from insertBlockPlaceholderIfNeeded because it can insert or append. Also accepts "force insert" flag.
181 (khtml::CompositeEditCommand::removeBlockPlaceholder):
182 Renamed for succinctness from removeBlockPlaceholderIfNeeded.
184 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
185 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
188 (khtml::DeleteSelectionCommand::doApply):
189 Use addBlockPlaceholderIfNeeded "force insert" flag if deleting whole paragraphs did not leave an empty one.
191 (khtml::InsertParagraphSeparatorCommand::doApply):
192 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
193 (khtml::InsertTextCommand::input):
196 * khtml/editing/htmlediting.h:
197 Renamed and new methods per above.
200 2005-03-04 Chris Blumenberg <cblu@apple.com>
202 Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after pasting attachment at end of message
206 * khtml/editing/visible_units.cpp:
207 (khtml::endOfParagraph): don't consider text nodes that have no rendered characters
209 2005-03-04 Richard Williamson <rjw@apple.com>
211 Fixed <rdar://problem/4034764> REGRESSION(125-188)Viewing text/plain page and going back/forward corrupts HTML pages (google.com)
213 The parse mode wasn't be restored to the document when going
218 * kwq/KWQKHTMLPart.mm:
219 (KWQKHTMLPart::openURLFromPageCache):
220 * kwq/KWQPageState.h:
221 * kwq/KWQPageState.mm:
222 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]):
224 2005-03-04 Ken Kocienda <kocienda@apple.com>
228 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Shame on me!
229 I landed my last fix without running layout tests. This one changes in a subtle, but
232 2005-03-04 Ken Kocienda <kocienda@apple.com>
238 <rdar://problem/4032543> REGRESSION (Mail): Mail hangs when quoted text is pasted twice
240 This code change fixes the bug in a non-obvious way. The root cause of the problem was
241 that a VisiblePosition created using an affinity originating in Mail code caused
242 two VisiblePosition objects that should have been equal to differ only in their
243 affinities, which in turn caused us to run a code path that should not have run.
245 * khtml/editing/visible_position.cpp:
246 (khtml::VisiblePosition::VisiblePosition): Added copy constructor.
247 (khtml::VisiblePosition::next): Factored out inline code that used to be here into new
248 setAffinityUsingLinePosition() function.
249 (khtml::isEqualIgnoringAffinity): New helper to handle cases when affinity in equality check does
250 not matter. However, we want to know about such cases where a VisiblePosition differs only by affinity,
251 and the code will assert in development when this happens.
252 (khtml::isNotEqualIgnoringAffinity): Ditto, but not. :)
253 (khtml::setAffinityUsingLinePosition): New helper function mentioned above. This will "correct"
254 upstream affinity to downstream if the affinity does not make a difference for the position.
255 * khtml/editing/visible_position.h:
256 * khtml/editing/visible_range.h: Wacky bug. The operator== for this class took VisiblePosition classes!
257 * khtml/editing/visible_units.cpp:
258 (khtml::isStartOfParagraph): Now performs equality check without regard to affinity.
259 (khtml::isEndOfParagraph): Ditto.
260 (khtml::isStartOfBlock): Ditto.
261 (khtml::isEndOfBlock): Ditto.
262 * kwq/WebCoreBridge.mm:
263 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Adjusts the affinity using setAffinityUsingLinePosition()
266 2005-03-04 Darin Adler <darin@apple.com>
270 - fixed <rdar://problem/4036817> REGRESSION: ctrl-y broken when a line + carriage return cut
272 * khtml/editing/htmlediting.h: Added insertTextRunWithoutNewlines.
273 * khtml/editing/htmlediting.cpp:
274 (khtml::InsertTextCommand::input): Added assertion to make sure strings with newlines don't get
276 (khtml::TypingCommand::insertText): Added. Takes the name of the old function, but is a new
277 level that breaks runs into lines and inserts each one separately.
278 (khtml::TypingCommand::insertTextRunWithoutNewlines): Renamed old insertText to this.
280 * khtml/dom/dom_string.h: Made substring be a const member function.
281 * khtml/dom/dom_string.cpp: (DOM::DOMString::substring): Made this const.
283 2005-03-04 Darin Adler <darin@apple.com>
287 - fixed <rdar://problem/4020413> REGRESSION (Mail): can't use fonts with names that start with "#" in Mail (Korean fonts)
289 * khtml/css/css_valueimpl.cpp:
290 (DOM::isLegalIdentifier): Added. Commented out and not used.
291 (DOM::quoteStringIfNeeded): Quotes the string if needed. For now only if it starts with "#".
292 (DOM::CSSPrimitiveValueImpl::cssText): Call quoteStringIfNeeded when asked for cssText for an arbitrary string, since we
293 need text you can re-parse.
294 (DOM::FontFamilyValueImpl::cssText): Ditto.
296 * khtml/editing/markup.cpp:
297 (khtml::startMarkup): Added comments about lack of quoting for attributes.
298 (khtml::createMarkup): Ditto.
300 2005-03-04 Adele Amchan <adele@apple.com>
304 Fix for <rdar://problem/4021711> REGRESSION(125-188) blank pages when browsing forum at cooperativeresearch.org - cached external script problem
306 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::scriptHandler): set flag needToRefCachedScript so we can make sure
307 notifyFinished is called after pendingSrc is set up with the right data from the cached script
309 2005-03-04 Ken Kocienda <kocienda@apple.com>
315 <rdar://problem/4029632> Tiger 8A398:- Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
317 * khtml/editing/htmlediting.cpp:
318 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): VisiblePosition constructor
319 was failing to yield a position for a node just pasted into the document since a layout was needed
320 for the calculation to come out right. Layout added. Crash gone.
324 2005-03-03 Chris Blumenberg <cblu@apple.com>
326 Fixed: <rdar://problem/3992803> Cannot navigate through list items with the keyboard, you're stuck in the same <li> block unless you click out
328 Reviewed by harrison.
330 * khtml/rendering/render_line.cpp:
331 (khtml::RootInlineBox::closestLeafChildForXPos): avoid returning list markers when possible. Also improved heuristic for returning the best InlineBox given the passed X position.
334 2005-03-03 Ken Kocienda <kocienda@apple.com>
340 <rdar://problem/4035198> Pasting text with different styles does not get reproducible results
342 I had a good idea yesterday to improve the way we "fixup" styles after
343 pasting, but i chose a poor data structure to do it, a map of
344 nodes-to-styles. In the fixup step, I iterated over the map elements and
345 did the fixup. However, since the order in which the items would come
346 out of the map is indeterminate, we got unpredictable results.
348 So, the concept was good, but the implementation was flawed. I have
349 fixed this mapping to be a list instead, so the order that nodes are
350 evaluated in the fixup step is document order. This works nicely.
352 * khtml/editing/htmlediting.cpp:
353 (khtml::ReplacementFragment::~ReplacementFragment): No longer need to explicity deref nodes and
354 styles saved away for later fixup. This is now handled by the new NodeDesiredStyle class.
355 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls computeAndStoreNodeDesiredStyle,
356 function renamed from mapDesiredStyleForNode.
357 Now accepts a QValueList<NodeDesiredStyle> in place of the old map.
358 (khtml::NodeDesiredStyle::NodeDesiredStyle): New class that represents a node-to-style mapping.
359 (khtml::NodeDesiredStyle::~NodeDesiredStyle): Ditto.
360 (khtml::NodeDesiredStyle::operator=): Ditto.
361 (khtml::ReplaceSelectionCommand::doApply): Now calls computeAndStoreNodeDesiredStyle,
362 function renamed from mapDesiredStyleForNode.
363 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Now operates on a QValueList<NodeDesiredStyle> in
364 place of the old map.
365 (khtml::computeAndStoreNodeDesiredStyle): Renamed from mapDesiredStyleForNode. Now operates on a
366 QValueList<NodeDesiredStyle> in place of the old map.
367 * khtml/editing/htmlediting.h:
368 (khtml::NodeDesiredStyle): New class that represents a node-to-style mapping.
369 (khtml::ReplacementFragment::desiredStyles): Now returns a QValueList<NodeDesiredStyle> in place of the old map.
371 * layout-tests/editing/style/typing-style-003-expected.txt: Results changed in an acceptable way.
373 2005-03-02 Darin Adler <darin@apple.com>
377 - fixed <rdar://problem/4029741> REGRESSION (188-189): <input type=text> are cleared when you hide/show them
379 * khtml/html/html_formimpl.h: Added detach functions for both input and text area elements, since
380 both have m_valueMatchesRenderer flags.
381 * khtml/html/html_formimpl.cpp:
382 (DOM::HTMLInputElementImpl::detach): Set m_valueMatchesRenderer to false, since the renderer is going away.
383 (DOM::HTMLTextAreaElementImpl::detach): Ditto.
385 2005-03-02 Ken Kocienda <kocienda@apple.com>
391 <rdar://problem/4006151> in reply, caret moves to next line after toggling bold style then typing
393 * khtml/editing/htmlediting.cpp:
394 (khtml::ApplyStyleCommand::applyInlineStyle): Defer cleaning up empty style until the end of the
395 function. In some situations, the render tree can get confused when we do this removal up front.
396 I wish I understood the reasons more deeply, but this bit of code shuffling seems harmless, and
399 2005-03-02 Darin Adler <darin@apple.com>
403 - fixed <rdar://problem/4024966> crash happened twice in [KWQTextField setHasFocus:] + 0xe8
405 Added more nil checks to the widget implementations. Anywhere a widget pointer is used, do a nil check,
406 rather than relying on high level assumptions about which calls can and can't destroy the HTML element
407 (and hence the widget). The case in the bug seems to be a case where scrolling destroyed the element.
408 We can't be sure this fixes the bug, but we can be relatively sure we didn't introduce any new problems,
409 because this just avoids nil-dereferencing.
412 (-[KWQButton becomeFirstResponder]):
413 (-[KWQButton nextKeyView]):
414 (-[KWQButton previousKeyView]):
416 (-[KWQTableView mouseDown:]):
417 (-[KWQTableView becomeFirstResponder]):
418 (-[KWQTableView numberOfRowsInTableView:]):
419 (-[KWQTableView tableViewSelectionDidChange:]):
420 (-[KWQTableView tableView:shouldSelectRow:]):
421 (-[KWQTableView selectionShouldChangeInTableView:]):
422 * kwq/KWQScrollBar.mm:
423 (-[KWQScrollBar scroll:]):
425 (-[KWQSlider mouseDown:]):
426 (-[KWQSlider slide:]):
427 (-[KWQSlider becomeFirstResponder]):
428 (-[KWQSlider nextKeyView]):
429 (-[KWQSlider previousKeyView]):
430 * kwq/KWQTextArea.mm:
431 (-[KWQTextAreaTextView becomeFirstResponder]):
432 (-[KWQTextAreaTextView resignFirstResponder]):
433 (-[KWQTextAreaTextView mouseDown:]):
434 * kwq/KWQTextField.mm:
435 (-[KWQTextFieldController action:]):
436 (-[KWQTextFieldController controlTextDidEndEditing:]):
437 (-[KWQTextFieldController controlTextDidChange:]):
438 (-[KWQTextFieldController textView:didHandleEvent:]):
439 (-[KWQTextFieldController setHasFocus:]):
441 2005-03-02 Richard Williamson <rjw@apple.com>
443 Fixed <rdar://problem/4031483> Leak (RenderObject::createInlineBox) reproducible with Stock widget
445 We were leaking inline block line boxes. Argh!
449 * khtml/rendering/render_flow.cpp:
450 (RenderFlow::dirtyLineBoxes):
451 * khtml/rendering/render_line.cpp:
452 (khtml::InlineBox::deleteLine):
454 2005-03-02 Chris Blumenberg <cblu@apple.com>
456 Fixed: <rdar://problem/3976872> REGRESSION (Mail): Pasted plain text doesn't get the proper style if pasted into newlines
458 Reviewed by kocienda.
460 * khtml/editing/htmlediting.cpp:
461 (khtml::EditCommand::styleAtPosition): new, factored out from calculateStyleBeforeInsertion
462 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): call styleAtPosition
463 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): clear new m_insertionStyle ivar
464 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): deref new m_insertionStyle ivar
465 (khtml::ReplaceSelectionCommand::doApply): store the style so it later be applied when matching style
466 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply style from m_insertionStyle when matching style
467 * khtml/editing/htmlediting.h:
469 2005-03-02 Maciej Stachowiak <mjs@apple.com>
473 <rdar://problem/4031718> REGRESSION (401-401+): Safari reproducible crash setting up scope in JSLazyEventListener::parseCode authenticating to bugweb
475 * khtml/ecma/kjs_events.cpp:
476 (JSLazyEventListener::parseCode): If originalNode is NULL, don't
477 mess with the scope chain.
479 * khtml/html/html_baseimpl.cpp:
480 (HTMLBodyElementImpl::parseHTMLAttribute): For handlers that are
481 delcared on body but set on the document, pass NULL to avoid
482 swizzling the scope chain. It turns out that this is what browsers
483 do, and it finesses the crash.
485 2005-03-02 David Harrison <harrison@apple.com>
489 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
491 * khtml/editing/htmlediting.cpp:
492 (khtml::ReplaceSelectionCommand::doApply):
494 2005-03-02 Ken Kocienda <kocienda@apple.com>
499 <rdar://problem/4020574> REGRESSION (Mail): copy/paste first part of reply-quoted text alters downstream style
501 The problem was that the operation to move nodes following the newly-pasted nodes did not preserve the
502 style of these moved nodes. I have generalized some of the functions that compute and preserve styles
503 for nodes and then apply these styles after a DOM operation.
505 * khtml/editing/htmlediting.cpp:
506 (khtml::ReplacementFragment::~ReplacementFragment): Call new derefNodesAndStylesInMap() helper function
507 in place of old code that had this deref'ing inline.
508 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls new mapDesiredStyleForNode() helper
509 function place of old code that had this style computation inline.
510 (khtml::ReplacementFragment::removeStyleNodes): Updated comment for new helper name.
511 (khtml::ReplaceSelectionCommand::doApply): Now calls new helpers in place of helpers whose names were changed,
512 or in place of pre-refactored inline code.
513 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Renamed from applyStyleToInsertedNodes(). Now generalized
514 to take the map of nodes to use for the fixup. This makes it possible to call this code with different maps,
515 and that is needed to fix the bug.
516 (khtml::mapDesiredStyleForNode): New helper function to compute the inheritable styles for a given node
517 and map this style to the given node in the given map. This function now also includes the code that was
518 in the removeBlockquoteColorsIfNeeded(). This latter helper has now been removed.
519 (khtml::derefNodesAndStylesInMap): Simple helper to deref map members.
520 * khtml/editing/htmlediting.h:
521 (khtml::ReplacementFragment::desiredStyles): New helper to return map of nodes-to-desiredStyles.
523 2005-03-01 Ken Kocienda <kocienda@apple.com>
529 <rdar://problem/4011358> REGRESSION(Mail): after dragging text to mail message and deleting, typing or dragging new text doesn't work
531 * khtml/editing/visible_position.cpp:
532 (khtml::VisiblePosition::isCandidate): Insertion point disappearing was due to a failed
533 check here after deleting all the content in the body element. The special "empty block"
534 needs to add check for DOM children. A block may have straggling anonymous render children in
535 some cases, and so the check needs to be (!DOM-kids || !render-kids).
537 Also, I botched the last checkin trying to split these two patches in my tree. Wrong layout tests
538 got checked in, I checked in a conflict marker in the Changelog, etc. I fixed everything with this checkin.
540 2005-03-01 Ken Kocienda <kocienda@apple.com>
544 Improved fix for this bug:
546 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
548 Maciej and I discussed this situation at length, and we came up with a better fix than I did earlier.
550 * khtml/editing/htmlediting.cpp:
551 (khtml::InsertParagraphSeparatorCommand::doApply): Simplify one special case so that it only handles the
552 "last in block" situation. Remove special case for "downstream node is in different block" and handle
553 this case with a little bit of special code in the general insertion case.
555 Results studied to make sure there were no problems.
557 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt
558 * layout-tests/editing/inserting/insert-div-001-expected.txt
559 * layout-tests/editing/inserting/insert-div-002-expected.txt
560 * layout-tests/editing/inserting/insert-div-004-expected.txt
561 * layout-tests/editing/inserting/insert-div-005-expected.txt
562 * layout-tests/editing/inserting/insert-div-009-expected.txt
563 * layout-tests/editing/inserting/insert-div-014-expected.txt
564 * layout-tests/editing/inserting/insert-div-018-expected.txt
565 * layout-tests/editing/inserting/insert-div-024-expected.txt
566 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
567 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
568 * layout-tests/editing/pasteboard/paste-text-015-expected.txt
569 * layout-tests/editing/style/block-style-004-expected.txt
570 * layout-tests/editing/style/block-style-005-expected.txt
571 * layout-tests/editing/style/block-style-006-expected.txt
575 * layout-tests/editing/inserting/insert-div-027.html
576 * layout-tests/editing/inserting/insert-div-027-expected.txt
578 2005-03-01 David Hyatt <hyatt@apple.com>
580 Fix for 4030890, regression with <sup> on Google. Fix some bogus != comparison checks in verticalPositionHint.
584 (RenderObject::getVerticalPosition):
586 2005-03-01 Chris Blumenberg <cblu@apple.com>
588 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
592 * khtml/editing/htmlediting.cpp:
593 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
594 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
595 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
596 * layout-tests/editing/deleting/smart-delete-001.html: Added.
597 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
598 * layout-tests/editing/deleting/smart-delete-002.html: Added.
600 2005-03-01 Richard Williamson <rjw@apple.com>
602 Fixed <rdar://problem/4029772> Weather widgets use a lot of memory (more that other widgets)
604 The string objects created by KWQHeaderStringFromDictionary() leaked.
606 Reviewed by John Louch.
609 (KWQHeaderStringFromDictionary):
611 2005-03-01 Jens Alfke <jens@apple.com>
615 <rdar://problem/4004531> Simple Sun Signed Applet throws exceptions; doesn't run
616 Two fixes for the way we extract the parameter-y goodness from <object> tags.
618 * khtml/rendering/render_frames.cpp:
619 (RenderPartObject::updateWidget):
621 2005-03-01 Richard Williamson <rjw@apple.com>
623 Fixed <rdar://problem/3990258> REGRESSION (125.12-181): top of picture that spans two pages is cut off on print from Safari
625 The problem was due to incorrect "object truncation" in RenderFlow::paintLines.
626 We attempt to push objects down if they don't fit on a page at
627 paint time. If the attempt to push object down failed we just
632 * khtml/rendering/render_flow.cpp:
633 (RenderFlow::paintLines):
636 2005-03-01 Chris Blumenberg <cblu@apple.com>
638 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
642 * khtml/editing/htmlediting.cpp:
643 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
644 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
645 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
646 * layout-tests/editing/deleting/smart-delete-001.html: Added.
647 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
648 * layout-tests/editing/deleting/smart-delete-002.html: Added.
650 2005-03-01 Ken Kocienda <kocienda@apple.com>
656 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
658 * khtml/editing/htmlediting.cpp:
659 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
661 2005-03-01 Maciej Stachowiak <mjs@apple.com>
665 <rdar://problem/4003774> REGRESSION(125-181): JavaScript problems @ Yankee/Dixie quiz
667 Reworked how scopes are set up for event handlers to match other
668 browser. This includes the following changes:
670 - Special scope entries are set up at the time the event handler
671 is created, not at the time it fires.
673 - Special scope is only set up for event handlers set in the html
674 source through an html attribute, not for handlers set using
675 addEventHandler or setting JS properties like onclick through
678 - Special scope is based on the DOM node on which the handler is
679 an attribute, not the event target.
681 This fixes the regression while allowing the fix to
682 <rdar://problem/3798453> (DIG: getting variable with same name as
683 DOM element attribute gets attribute value instead) to keep
686 * khtml/ecma/kjs_events.cpp:
687 (JSEventListener::handleEvent):
688 (JSLazyEventListener::JSLazyEventListener):
689 (JSLazyEventListener::parseCode):
690 * khtml/ecma/kjs_events.h:
691 * khtml/ecma/kjs_proxy.cpp:
692 (KJSProxyImpl::createHTMLEventHandler):
693 * khtml/ecma/kjs_proxy.h:
694 * khtml/ecma/kjs_window.cpp:
695 (Window::getJSLazyEventListener):
696 * khtml/ecma/kjs_window.h:
697 * khtml/html/html_baseimpl.cpp:
698 (HTMLBodyElementImpl::parseHTMLAttribute):
699 (HTMLFrameElementImpl::parseHTMLAttribute):
700 (HTMLFrameSetElementImpl::parseHTMLAttribute):
701 * khtml/html/html_elementimpl.cpp:
702 (HTMLElementImpl::parseHTMLAttribute):
703 * khtml/html/html_formimpl.cpp:
704 (DOM::HTMLFormElementImpl::parseHTMLAttribute):
705 (DOM::HTMLButtonElementImpl::parseHTMLAttribute):
706 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
707 (DOM::HTMLLabelElementImpl::parseHTMLAttribute):
708 (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
709 (DOM::HTMLTextAreaElementImpl::parseHTMLAttribute):
710 * khtml/html/html_imageimpl.cpp:
711 (HTMLImageElementImpl::parseHTMLAttribute):
712 * khtml/html/html_objectimpl.cpp:
713 (HTMLObjectElementImpl::parseHTMLAttribute):
714 * khtml/khtml_part.cpp:
715 (KHTMLPart::createHTMLEventListener):
716 * khtml/khtml_part.h:
717 * khtml/xml/dom_docimpl.cpp:
718 (DocumentImpl::createHTMLEventListener):
719 * khtml/xml/dom_docimpl.h:
723 2005-03-01 Chris Blumenberg <cblu@apple.com>
725 Backed out my patch since the tree was closed.
727 * khtml/editing/htmlediting.cpp:
728 (khtml::DeleteSelectionCommand::initializePositionData):
729 * khtml/editing/jsediting.cpp:
731 2005-03-01 Chris Blumenberg <cblu@apple.com>
733 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
737 * khtml/editing/htmlediting.cpp:
738 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
739 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
740 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
741 * layout-tests/editing/deleting/smart-delete-001.html: Added.
742 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
743 * layout-tests/editing/deleting/smart-delete-002.html: Added.
745 2005-03-01 Ken Kocienda <kocienda@apple.com>
751 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
753 * khtml/editing/htmlediting.cpp:
754 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
756 2005-03-01 David Harrison <harrison@apple.com>
760 <rdar://problem/3915560> Mail would like an SPI to enable "smart" text paste/drop
762 * kwq/WebCoreBridge.h:
763 * kwq/WebCoreBridge.mm:
764 (-[WebCoreBridge smartDeleteRangeForProposedRange:]):
765 (-[WebCoreBridge smartInsertForString:replacingRange:beforeString:afterString:]):
768 2005-03-01 Chris Blumenberg <cblu@apple.com>
770 Fixed: <rdar://problem/4030404> selection granularity should be set when extending selection via JS
772 Reviewed by kocienda.
774 * khtml/ecma/kjs_window.cpp:
775 (SelectionFunc::tryCall): set the granularity on the part. This will allow us to write smart paste layout tests.
776 * layout-tests/editing/pasteboard/smart-paste-001-expected.txt: Added.
777 * layout-tests/editing/pasteboard/smart-paste-001.html: Added.
778 * layout-tests/editing/pasteboard/smart-paste-002-expected.txt: Added.
779 * layout-tests/editing/pasteboard/smart-paste-002.html: Added.
780 * layout-tests/editing/pasteboard/smart-paste-003-expected.txt: Added.
781 * layout-tests/editing/pasteboard/smart-paste-003.html: Added.
782 * layout-tests/editing/pasteboard/smart-paste-004-expected.txt: Added.
783 * layout-tests/editing/pasteboard/smart-paste-004.html: Added.
784 * layout-tests/editing/pasteboard/smart-paste-005-expected.txt: Added.
785 * layout-tests/editing/pasteboard/smart-paste-005.html: Added.
786 * layout-tests/editing/pasteboard/smart-paste-006-expected.txt: Added.
787 * layout-tests/editing/pasteboard/smart-paste-006.html: Added.
788 * layout-tests/editing/pasteboard/smart-paste-007-expected.txt: Added.
789 * layout-tests/editing/pasteboard/smart-paste-007.html: Added.
791 2005-03-01 Chris Blumenberg <cblu@apple.com>
793 Fixed: <rdar://problem/4029934> smart paste with plain text can add too many spaces
795 Reviewed by kocienda.
797 * khtml/editing/htmlediting.cpp:
798 (khtml::ReplaceSelectionCommand::doApply): pass true for treatNBSPAsWhitespace to leadingWhitespacePosition and trailingWhitespacePosition
799 * khtml/xml/dom_position.cpp:
800 (DOM::isWS): take treatNBSPAsWhitespace param
801 (DOM::Position::leadingWhitespacePosition): ditto
802 (DOM::Position::trailingWhitespacePosition): ditto
803 * khtml/xml/dom_position.h:
805 2005-03-01 Ken Kocienda <kocienda@apple.com>
811 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
813 * khtml/editing/htmlediting.cpp:
814 (khtml::InsertParagraphSeparatorCommand::doApply): Look for the upstream-most block to insert after
815 when at the visible end of a block. This helps to avoid some undesirable sequences of markup which
816 Dave says will be vary hard to render. Changing the command in this way avoids the "limitations"
817 of the render tree by not asking it to render markup we do not want to make anyway.
819 All these tests change, but either in insignificant ways, or for the better.
821 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt:
822 * layout-tests/editing/inserting/insert-div-001-expected.txt:
823 * layout-tests/editing/inserting/insert-div-002-expected.txt:
824 * layout-tests/editing/inserting/insert-div-004-expected.txt:
825 * layout-tests/editing/inserting/insert-div-005-expected.txt:
826 * layout-tests/editing/inserting/insert-div-009-expected.txt:
827 * layout-tests/editing/inserting/insert-div-024-expected.txt:
828 * layout-tests/editing/pasteboard/paste-text-011-expected.txt:
829 * layout-tests/editing/pasteboard/paste-text-013-expected.txt:
830 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
831 * layout-tests/editing/style/block-style-004-expected.txt:
832 * layout-tests/editing/style/block-style-005-expected.txt:
833 * layout-tests/editing/style/block-style-006-expected.txt:
834 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
835 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
836 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
837 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
839 New test to check specific problem mentioned in the bug.
841 * layout-tests/editing/inserting/insert-div-026-expected.txt: Added.
842 * layout-tests/editing/inserting/insert-div-026.html: Added.
844 2005-02-28 Maciej Stachowiak <mjs@apple.com>
848 <rdar://problem/4002864> REGRESSION(125-146) getElementById in onload fails in a test case involving external resources
850 Moved management of elementById hashtable from attach/detach to
851 insertedIntoDocument/removedFromDocument, to avoid being thrown
852 off by temporary detaches due to style recalcs.
854 * khtml/xml/dom_elementimpl.cpp:
855 (ElementImpl::insertedIntoDocument):
856 (ElementImpl::removedFromDocument):
857 (ElementImpl::attach):
858 (ElementImpl::updateId):
859 * khtml/xml/dom_elementimpl.h:
861 Make sure that insertedIntoDocument is called before firing any
864 * khtml/xml/dom_nodeimpl.cpp:
865 (NodeBaseImpl::dispatchChildInsertedEvents):
867 2005-02-28 David Hyatt <hyatt@apple.com>
869 Fix for 4028999, safari crashes when resetting if mallocsribble is on. Clip rects were being cleared using dead
870 render objects. Change the ordering.
874 * khtml/rendering/render_box.cpp:
876 * khtml/rendering/render_layer.cpp:
877 (RenderLayer::~RenderLayer):
879 2005-02-28 Chris Blumenberg <cblu@apple.com>
881 Fixed: <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
883 Reviewed by kocienda.
885 * khtml/editing/htmlediting.cpp:
886 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Call updateLayout so caretMinOffset and caretMaxOffset return correct values.
888 2005-02-28 John Sullivan <sullivan@apple.com>
892 - WebCore part of fix for <rdar://problem/4023490> REGRESSION (125-185): Tabbing through links
893 on frameset page gets stuck at end (tivofaq.com)
895 * kwq/WebCoreBridge.h:
896 add nextValidKeyViewOutsideWebFrameViews (code is in WebKit)
898 2005-02-28 Ken Kocienda <kocienda@apple.com>
904 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
906 * khtml/css/css_computedstyle.cpp: inheritableProperties array now defined in css_valueimpl.cpp.
907 * khtml/css/css_valueimpl.cpp: Define inheritableProperties array here.
908 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Use new name for blockProperties, and use the new
909 constant for the number of items in the array.
910 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
911 (DOM::CSSMutableStyleDeclarationImpl::removeInheritableProperties): New function.
912 * khtml/css/css_valueimpl.h: Declare inheritableProperties array and numInheritableProperties extern so they
913 can be defined in css_valueimpl.cpp and used in css_computedstyle.cpp.
914 * khtml/editing/htmlediting.cpp:
915 (khtml::ReplacementFragment::removeStyleNodes): This code was misguided, and removed too much style from HTML
916 elements. Now, it removes from HTML elements only the styles that we replace later with a call to applyStyle().
917 Also, add ID_B to list of inline "style" nodes we are willing to remove. Leaving it off was an oversight.
919 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: ID_B fix made this result change, without any
920 visible change in the test.
924 * layout-tests/editing/style/smoosh-styles-003.html
925 * layout-tests/editing/style/smoosh-styles-003-expected.txt
927 2005-02-28 Richard Williamson <rjw@apple.com>
929 Fixed <rdar://problem/4026985> CrashTracer: ...14 crashes at com.apple.WebCore: -[KWQPageState invalidate] + 32
931 Added more nil checking and ASSERTS.
932 Without a reproducible case this is hard to definitively resolve.
934 Reviewed by John Sullivan.
936 * kwq/KWQPageState.mm:
937 (-[KWQPageState invalidate]):
939 2005-02-28 Richard Williamson <rjw@apple.com>
941 Fixed <rdar://problem/4027702> 3.5% performance regression btwn Safari-188 and Safari-400
943 I inadvertently checked in some debugging code that disabled
944 style sharing. Backed out that change.
946 * khtml/css/cssstyleselector.cpp:
947 (khtml::CSSStyleSelector::styleForElement):
949 2005-02-28 Chris Blumenberg <cblu@apple.com>
951 Fixed: <rdar://problem/4026639> www.bmw.ca configurator does not work with Safari
955 * khtml/ecma/kjs_html.cpp:
956 (KJS::HTMLElement::tryGet): when frameset.<name of frame child> is called, return the window object of the frame child
958 2005-02-28 Ken Kocienda <kocienda@apple.com>
964 <rdar://problem/4026906> Paste of HTML table content can break table structure
966 * khtml/editing/htmlediting.cpp:
967 (khtml::ReplacementFragment::pruneEmptyNodes): Call new isProbablyTableStructureNode() function to prevent
968 removal of empty table structure nodes.
969 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
970 (khtml::isProbablyTableStructureNode): New helper function.
971 * khtml/editing/htmlediting.h: Declare new helper.
973 2005-02-28 Chris Blumenberg <cblu@apple.com>
975 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
977 Reviewed by kocienda.
979 * khtml/editing/htmlediting.cpp:
980 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): ref and deref the element while it is "floating"
981 (khtml::ReplacementFragment::insertFragmentForTestRendering): ditto
982 (khtml::floatRefdElement): new, keeps an element alive while its ref count is 0
983 (khtml::createDefaultParagraphElement): removed commented out code
984 (khtml::createBlockPlaceholderElement): ref the element and return it as "floating"
985 (khtml::createFontElement): ditto
986 (khtml::createStyleSpanElement): ditto
987 * khtml/editing/htmlediting.h:
989 2005-02-27 Maciej Stachowiak <mjs@apple.com>
993 <rdar://problem/3993557> REGRESSION (125-180-ish): getElementsByTagName no longer works with namespace designations
995 * khtml/xml/dom_nodeimpl.cpp:
996 (NodeBaseImpl::getElementsByTagNameNS): When no namespace is specified, find elements
997 of the specified name in any namespace to match Mozilla and earlier Safari behavior.
999 2005-02-25 Darin Adler <darin@apple.com>
1003 - fixed <rdar://problem/4025618> Crash while searching at hollywoodvideo.com
1005 * khtml/html/html_formimpl.h: Added valueWithDefault.
1006 * khtml/html/html_formimpl.cpp:
1007 (DOM::HTMLInputElementImpl::appendFormData): Call valueWithDefault instead of going at the render object
1008 to try to get the default value; there may be no render object if this is display:none.
1009 (DOM::HTMLInputElementImpl::valueWithDefault): Added. Knows about the defaults for "submit" and "reset"
1010 buttons; otherwise just returns the value as-is.
1012 * khtml/rendering/render_form.h: Removed the defaultLabel member functions.
1013 * khtml/rendering/render_form.cpp:
1014 (RenderSubmitButton::rawText): Call valueWithDefault instead of using defaultLabel function here on
1015 the render side. The DOM needs to know how to deal with the default anyway for form submission.
1016 (RenderSubmitButton::defaultLabel): Removed.
1017 (RenderResetButton::defaultLabel): Removed.
1018 (RenderPushButton::defaultLabel): Removed.
1020 2005-02-25 Darin Adler <darin@apple.com>
1024 - fixed <rdar://problem/4025088> window onblur and onfocus don't fire when text field has focus
1026 * kwq/KWQKHTMLPart.h: Added setWindowHasFocus function and m_windowHasFocus data member.
1027 * kwq/KWQKHTMLPart.mm:
1028 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Took out the code that sends the focus and blur events.
1029 (KWQKHTMLPart::setWindowHasFocus): Put that code here instead.
1031 * kwq/WebCoreBridge.h: Added setWindowHasFocus: method to the bridge.
1032 * kwq/WebCoreBridge.mm: (-[WebCoreBridge setWindowHasFocus:]): Added. Calls method on the part.
1034 2005-02-25 Darin Adler <darin@apple.com>
1038 - re-fixed <rdar://problem/3665430> horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode
1040 * kwq/KWQTextArea.mm: (-[KWQTextArea _updateTextViewWidth]): Don't change the text view width
1041 to match the text area's width in the "wrap" case.
1043 2005-02-25 Ken Kocienda <kocienda@apple.com>
1049 <rdar://problem/4021518> 8A394 Mail crashes during paste: khtml::RootInlineBox::closestLeafChildForXPos
1051 * khtml/editing/visible_units.cpp:
1052 (khtml::previousLinePosition): Adding an updateLayout call at the start of the function fixes the crash, since
1053 we caught line boxes in a not-completely-updated state.
1054 (khtml::nextLinePosition): Ditto.
1056 2005-02-25 David Hyatt <hyatt@apple.com>
1058 Fix for 4010774, make sure to avoid an O(N^2) algorithm in nextRenderer() that is triggered when large
1059 DOM subtrees are inserted into documents via one insert/append call.
1061 Reviewed by kocienda
1063 * khtml/xml/dom_nodeimpl.cpp:
1064 (NodeImpl::nextRenderer):
1066 2005-02-25 Richard Williamson <rjw@apple.com>
1068 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
1070 Second pass at fixing 3382926 w/o causing layout regressions. Same concept:
1071 if directionality of text's element is RTL and first character has neutral directionality
1072 then set the initial directionality to RTL.
1076 * khtml/rendering/bidi.cpp:
1077 (khtml::RenderBlock::bidiReorderLine):
1078 (khtml::RenderBlock::determineStartPosition):
1082 2005-02-25 Ken Kocienda <kocienda@apple.com>
1086 Roll out Chris' change to fix this bug:
1088 <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
1090 That code change is responsible for all these new crashers:
1092 <rdar://problem/4025177> crash copying safari.apple.com into Blot document
1093 <rdar://problem/4025184> crash in DOM::NodeImpl::parentNode copying "New!" from google.com to Blot
1094 <rdar://problem/4025214> crash in DOM::NodeImpl::getRect loading paste-match-style-001.html
1096 Since we wish to close the tree for a build right now, I am rolling out rather than investigating.
1098 * khtml/editing/htmlediting.cpp:
1099 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded)
1100 (khtml::ReplacementFragment::insertFragmentForTestRendering)
1101 (khtml::createDefaultParagraphElement)
1102 (khtml::createBlockPlaceholderElement)
1103 (khtml::createFontElement)
1104 (khtml::createStyleSpanElement)
1105 * khtml/editing/htmlediting.h
1107 2005-02-25 Ken Kocienda <kocienda@apple.com>
1113 <rdar://problem/4020108> Pasting text into message makes Mail crash reproducibly
1115 Note that, even with this fix, development build will crash until this bug is fixed:
1116 <rdar://problem/4024996> Applying block styles can cause assertion failure in inline style removal
1118 This will not crash deployment builds, so I am going to land.
1120 * khtml/editing/htmlediting.cpp:
1121 (khtml::ApplyStyleCommand::applyBlockStyle): Applying block styles can make the loop to reach beyondEnd
1122 fail since the structure of the document can change. Cache the next node first before operating on it,
1125 2005-02-25 Vicki Murley <vicki@apple.com>
1127 - recommit this change, since rolling it out did NOT fix the performance regression!
1129 2005-02-23 Darin Adler <darin@apple.com>
1133 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
1135 The key was to change things around so that we don't push text from the DOM to the widget
1136 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
1137 during the blur process.
1139 * khtml/html/html_formimpl.cpp:
1140 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
1141 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
1142 new value is set here.
1143 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
1145 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
1146 to true, and also sends out the input event. It's better to have this here than in the renderer code.
1147 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
1148 m_dirtyvalue) and m_valueMatchesRenderer as false.
1149 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
1150 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
1151 where the value came from.
1152 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
1153 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
1154 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
1156 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
1157 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
1158 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
1160 * khtml/rendering/render_form.cpp:
1161 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
1163 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
1165 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
1166 (RenderTextArea::handleFocusOut): Ditto.
1167 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
1168 DOM if valueMatchesRenderer is true.
1169 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
1171 2005-02-25 Chris Blumenberg <cblu@apple.com>
1173 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
1177 * khtml/editing/htmlediting.cpp:
1178 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
1179 (khtml::ReplacementFragment::insertFragmentForTestRendering):
1180 (khtml::floatRefdElement):
1181 (khtml::createDefaultParagraphElement):
1182 (khtml::createBlockPlaceholderElement):
1183 (khtml::createFontElement):
1184 (khtml::createStyleSpanElement):
1185 * khtml/editing/htmlediting.h:
1187 2005-02-25 Darin Adler <darin@apple.com>
1189 * kwq/character-sets.txt: Checked in updated file. This new file has no effect, because none of the
1190 changes affect character sets that we support, but it's good to have the latest file in here, and
1191 completely safe because I checked that the generated files have not changed.
1193 2005-02-25 Vicki Murley <vicki@apple.com>
1197 - back out this change, since it causes a 3.5% performance regression
1199 2005-02-23 Darin Adler <darin@apple.com>
1203 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
1205 The key was to change things around so that we don't push text from the DOM to the widget
1206 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
1207 during the blur process.
1209 * khtml/html/html_formimpl.cpp:
1210 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
1211 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
1212 new value is set here.
1213 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
1215 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
1216 to true, and also sends out the input event. It's better to have this here than in the renderer code.
1217 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
1218 m_dirtyvalue) and m_valueMatchesRenderer as false.
1219 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
1220 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
1221 where the value came from.
1222 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
1223 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
1224 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
1226 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
1227 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
1228 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
1230 * khtml/rendering/render_form.cpp:
1231 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
1233 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
1235 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
1236 (RenderTextArea::handleFocusOut): Ditto.
1237 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
1238 DOM if valueMatchesRenderer is true.
1239 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
1241 2005-02-25 Darin Adler <darin@apple.com>
1245 - fixed <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
1247 * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply):
1248 Use the insertNodeAfterAndUpdateNodesInserted and insertNodeBeforeAndUpdateNodesInserted
1249 functions to add the leading and trailing spaces for smart paste.
1251 2005-02-25 David Hyatt <hyatt@apple.com>
1253 Back out fix for 3382926, since it breaks LTR text inside RTL contexts.
1257 * khtml/rendering/bidi.cpp:
1258 (khtml::BidiIterator::direction):
1260 2005-02-25 David Hyatt <hyatt@apple.com>
1262 Fix for 3975039, scrolling is slow in huge RSS views. Optimize the calculation of clip rects for overflow:hidden
1263 layers. Also optimize layer movement when scrolling overflow sections.
1267 * khtml/rendering/render_layer.cpp:
1269 (ClipRects::operator delete):
1270 (ClipRects::detach):
1271 (RenderLayer::RenderLayer):
1272 (RenderLayer::~RenderLayer):
1273 (RenderLayer::updateLayerPosition):
1274 (RenderLayer::removeOnlyThisLayer):
1275 (RenderLayer::insertOnlyThisLayer):
1276 (RenderLayer::scrollToOffset):
1277 (RenderLayer::hitTest):
1278 (RenderLayer::calculateClipRects):
1279 (RenderLayer::calculateRects):
1280 (RenderLayer::containsPoint):
1281 (RenderLayer::clearClipRects):
1282 (RenderLayer::clearClipRect):
1283 * khtml/rendering/render_layer.h:
1284 (khtml::ClipRects::m_refCnt):
1285 (khtml::ClipRects::overflowClipRect):
1286 (khtml::ClipRects::fixedClipRect):
1287 (khtml::ClipRects::posClipRect):
1288 (khtml::ClipRects::ref):
1289 (khtml::ClipRects::deref):
1290 (khtml::RenderLayer::clipRects):
1291 * khtml/rendering/render_object.cpp:
1292 (RenderObject::setStyle):
1294 2005-02-24 Maciej Stachowiak <mjs@apple.com>
1296 Reviewed by Darin and Dave a while ago.
1298 <rdar://problem/3996685> REGRESSION: Crash in KWQVectorImpl::at loading http://maps.google.com/mapfiles/homepanel.xsl
1300 * kwq/WebCoreBridge.mm:
1301 (formElementFromDOMElement): Check for isHTMLElement() as well as
1302 id() == ID_FORM. This seems like an impossible situation, but
1303 papering over it seems more expedient for the time being.
1305 2005-02-24 Richard Williamson <rjw@apple.com>
1307 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
1309 Use mirror characters correctly when rendering with RTL directionality.
1313 * khtml/rendering/bidi.cpp:
1314 (khtml::BidiIterator::direction):
1316 2005-02-24 Richard Williamson <rjw@apple.com>
1318 Fixed <rdar://problem/3985889> REGRESSION (125-180): setting <img> src to GIF that already animated does not animate; just shows final frame
1322 * WebCore.pbproj/project.pbxproj:
1323 * khtml/html/html_imageimpl.cpp:
1324 (HTMLImageLoader::updateFromElement):
1325 * khtml/rendering/render_image.cpp:
1326 (RenderImage::resetAnimation):
1327 * khtml/rendering/render_image.h:
1328 * khtml/rendering/render_list.cpp:
1329 (RenderListMarker::setStyle):
1330 (RenderListMarker::paint):
1331 * khtml/rendering/render_list.h:
1335 (QPixmap::resetAnimation):
1336 * kwq/WebCoreImageRenderer.h:
1338 2005-02-24 Chris Blumenberg <cblu@apple.com>
1340 Fixed: <rdar://problem/4020110> Safari crashes in setAllData while taking a www.zoomerang.com survey
1344 * kwq/KWQResourceLoader.mm:
1345 (-[KWQResourceLoader finishJobAndHandle:]): clear the job after we've deleted to avoid reentrancy
1347 2005-02-24 Darin Adler <darin@apple.com>
1351 - fixed <rdar://problem/4023360> REGRESSION (186-187): image file upload is broken at pep.apple.com
1353 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::appendFormData): Return true after
1354 setting up the form data for an uploaded file. The old code would fall through to the ISINDEX
1355 case and send double form data (the filename instead of the file contents the second time).
1357 2005-02-24 David Harrison <harrison@apple.com>
1361 <rdar://problem/3990849> AX: textMarkerRange for an AXUIElement within an AXWebArea
1363 * kwq/KWQAccObject.mm:
1364 (-[KWQAccObject textMarkerRange]):
1365 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
1366 (-[KWQAccObject doAXTextMarkerRangeForUIElement:]):
1367 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
1368 Added AXTextMarkerRangeForUIElement, or you can send textMarkerRange to the UIElement itself.
1370 2005-02-24 David Harrison <harrison@apple.com>
1374 <rdar://problem/4004279> 3 AXSelectedTextChanged notifications are firing each time I type a character
1376 * khtml/xml/dom_docimpl.cpp:
1377 (DocumentImpl::updateSelection):
1378 Send notification only if the selection is not null. This safely ignores transitory selections set during editing.
1380 2005-02-24 Darin Adler <darin@apple.com>
1384 - fixed <rdar://problem/3987619> in some cases, text doesn't resize with Format->Style->Bigger/Smaller
1386 * khtml/editing/htmlediting.cpp:
1387 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): Only call nodeFullySelected for non-text nodes.
1388 Text nodes are already split so they're either in the range and full selected or out of the range.
1389 And nodeFullySelected doesn't work for text nodes.
1390 (khtml::ApplyStyleCommand::nodeFullySelected): Add an assertion, since this function only works for elements,
1392 (khtml::ApplyStyleCommand::nodeFullyUnselected): Ditto.
1394 - make big improvement in <rdar://problem/3953636> Mail hung for ~10sec changing font of 84328 characters: khtml::ApplyStyleCommand::nodeFullySelected
1396 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints): Improve algorithm based on suggestion
1399 - fixed <rdar://problem/4020305> REGRESSION (185-186): loading image in new window using document.write fails
1401 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::open): If there is no parent document, don't blow away the base URL.
1403 - fixed <rdar://problem/4021701> REGRESSION (188-188+): form not submitted after pressing <return> at http://hrweb.apple.com
1405 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchMouseEvent): Send activate event in the case where the event
1406 sent is a KHTML_CLICK_EVENT, not CLICK_EVENT.
1408 2005-02-23 Kevin Decker <kdecker@apple.com>
1412 Fixed <rdar://problem/4020747> REGRESSION: stray </applet> tags crash Safari
1414 * khtml/html/htmlparser.cpp:
1415 (KHTMLParser::processCloseTag): Made a typesafe check that prevents crashes
1416 whenever there is a closing applet tag without an actual <applet> in the first place.
1417 Now verifies the current token is ID_APPLET before casting it to an HTMLAppletElementImpl.
1420 2005-02-23 Ken Kocienda <kocienda@apple.com>
1426 <rdar://problem/3977962> font loses bold style after pasting next to existing text and pressing return
1428 * khtml/editing/htmlediting.cpp:
1429 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Problem here was
1430 that we were doing work in cases where we should not, and content whose style would have
1431 been correct if we had done nothing was getting clobbered. It turns out that extra work
1432 to apply style to the new paragraph added in this command only needs to be done if we're
1433 at the boundaries of a paragraph. Otherwise, content that is moved as part of the work
1434 of the command will lend their styles to the new paragraph without any extra work needed.
1435 So, make this position check and return unless at a paragraph boundary.
1439 * layout-tests/editing/style/block-styles-007-expected.txt
1440 * layout-tests/editing/style/block-styles-007.html
1442 2005-02-23 Ken Kocienda <kocienda@apple.com>
1448 <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a selection starting from end of line once
1450 Problem is with the way we figure out whether to add or remove a style based on
1451 the current selection. In this case, the code is looking at the end of the
1452 previous line, which is not bold, and deduces incorrectly that the operation is
1453 a "make bold". Then the style code runs to make bold, but there is nothing on
1454 the end of the previous line to embolden, so we get into a cycle where the same
1455 thing happens each time cmd-b is hit.
1457 * khtml/khtml_part.cpp:
1458 (KHTMLPart::selectionComputedStyle): Call editingStartPosition() to get the right position for the font determination.
1459 * khtml/xml/dom2_rangeimpl.cpp:
1460 (DOM::RangeImpl::editingStartPosition): New helper function that "does the right thing" based on whether the
1461 selection is a caret or a range, moving upstream for the former, and downstream for the latter.
1462 * khtml/xml/dom2_rangeimpl.h:
1463 * kwq/KWQKHTMLPart.mm:
1464 (KWQKHTMLPart::fontForSelection): Call editingStartPosition() to get the right position for the font determination.
1468 * layout-tests/editing/style/style-boundary-001-expected.txt
1469 * layout-tests/editing/style/style-boundary-001.html
1470 * layout-tests/editing/style/style-boundary-002-expected.txt
1471 * layout-tests/editing/style/style-boundary-002.html
1472 * layout-tests/editing/style/style-boundary-003-expected.txt
1473 * layout-tests/editing/style/style-boundary-003.html
1474 * layout-tests/editing/style/style-boundary-004-expected.txt
1475 * layout-tests/editing/style/style-boundary-004.html
1477 2005-02-23 Richard Williamson <rjw@apple.com>
1479 Fixed <rdar://problem/3985579> 8A367: Dashboard: Stock widget not visible when click remove to remove single char ticker symbol
1481 Explicitly remove scroll bar views when removing them from
1484 Don't paint synchronously when the scroll position changes,
1485 this caused funky clip problems.
1489 * khtml/rendering/render_layer.cpp:
1490 (RenderLayer::scrollToOffset):
1491 (RenderLayer::setHasHorizontalScrollbar):
1492 (RenderLayer::setHasVerticalScrollbar):
1493 (RenderLayer::updateScrollInfoAfterLayout):
1495 2005-02-23 Ken Kocienda <kocienda@apple.com>
1501 <rdar://problem/3959996> REGRESSION (Mail): cursor moves to beginning of document when click is past end
1503 * khtml/rendering/render_block.cpp:
1504 (khtml::RenderBlock::positionForCoordinates): Skip blocks that are invisible or have no height when
1505 looking for a child to pass off to. And save away the last visible block with a height to pass off
1506 to if there is no child at the right y-coordinate.
1508 2005-02-23 David Harrison <harrison@apple.com>
1512 <rdar://problem/4010059> BoundsForTextMarkerRange does not update with scrolled web area
1514 * kwq/KWQAccObject.mm:
1515 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
1516 Adjust for scrolling.
1518 2005-02-22 Maciej Stachowiak <mjs@apple.com>
1522 <rdar://problem/3949790> hitting return after pasted styled line results in extra content getting the style
1524 * khtml/editing/htmlediting.cpp:
1525 (khtml::InsertParagraphSeparatorCommand::doApply): In the case
1526 where the start block is the root, insert the newly created DIV at
1527 the end of the root block instead of after the last sibling in the
1528 start node, since the start node could be inside other
1529 style-affecting nodes and we don't want to reparent its cousins
1532 2005-02-23 David Harrison <harrison@apple.com>
1536 <rdar://problem/4014691> switch to correctly spelled NSAccessibilityForegroundColorTextAttribute constant
1538 Also removed two older, now unneeded, wrappers.
1540 * kwq/KWQAccObject.mm:
1541 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
1542 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
1543 Removed these older, now unneeded, wrappers.
1545 (NSAccessibilityForegroundColorTextAttributeWrapper):
1546 New wrapper for NSAccessibilityForegroundColorTextAttribute.
1548 (AXAttributeStringSetStyle):
1549 Use NSAccessibilityForegroundColorTextAttributeWrapper.
1551 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
1552 Remove uses of visiblePositionForStartOfTextMarkerRange and visiblePositionForEndOfTextMarkerRange.
1554 2005-02-23 David Harrison <harrison@apple.com>
1558 <rdar://problem/3524784> AX hit test doesn't return info when done in empty space of content area
1560 * kwq/KWQAccObject.mm:
1561 (-[KWQAccObject accessibilityHitTest:]):
1562 Return unignored object.
1564 2005-02-23 Darin Adler <darin@apple.com>
1568 - fixed <rdar://problem/4006509> REGRESSION (171-172): Setting CSS -khtml-user-modify property triggers crash
1570 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyProperty):
1571 Removed the code that changes the style of the element. This was never needed, and caused the
1572 style to be modified while we were iterating it.
1574 2005-02-23 Ken Kocienda <kocienda@apple.com>
1580 <rdar://problem/3980209> Mail crashed when I pressed Cmd-Shift-[ (nil-deref in ApplyStyleCommand::addBlockStyleIfNeeded)
1582 * khtml/editing/htmlediting.cpp:
1583 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Reordered the new block
1584 insertion so that it come before the move. The logic stays exactly the same, however, with the old
1585 ordering, the new block could want to become a child of itself come insertion time. I considered
1586 making a more complicated code change to fix this problem, but the simple reordering works just
1587 as well, and seems less risky.
1589 These all changed in an insignificant way. It seems that with the new code, some empty text nodes
1590 got reordered in the document. This has no effect on anything visible to the user.
1592 * layout-tests/editing/style/create-block-for-style-003-expected.txt
1593 * layout-tests/editing/style/create-block-for-style-004-expected.txt
1594 * layout-tests/editing/style/create-block-for-style-009-expected.txt
1595 * layout-tests/editing/style/create-block-for-style-011-expected.txt
1596 * layout-tests/editing/style/create-block-for-style-013-expected.txt
1598 2005-02-23 Darin Adler <darin@apple.com>
1602 - fixed <rdar://problem/4013986> REGRESSION (173-174): onclick event not sent when mouse click on checkbox is double-click
1604 We need to send an onclick event *and* an ondblclick event when we process a double click.
1606 * khtml/khtmlview.cpp: (KHTMLView::dispatchMouseEvent): In the case where we're sending a CLICK_EVENT,
1607 follow it by a KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT when handling a double click, and a DOMACTIVATE_EVENT.
1608 We no longer do the DOMACTIVATE_EVENT in dispatchGenericEvent.
1609 * khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked): send only CLICK_EVENT here, and
1610 lets dispatchMouseEvent deal with the other subsequent events.
1611 * khtml/xml/dom_nodeimpl.cpp:
1612 (NodeImpl::dispatchGenericEvent): Remove the code that sends a DOMACTIVATE_EVENT, since there's no longer
1613 a good way to figure out if this is the last event that should be sent before it is.
1614 (NodeImpl::dispatchMouseEvent): Set the meta key modifier here (as it already is set elsewhere), and
1615 follow up a CLICK_EVENT with KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT, and DOMACTIVATE_EVENT as above.
1617 2005-02-23 Darin Adler <darin@apple.com>
1621 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
1623 The key was to change things around so that we don't push text from the DOM to the widget
1624 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
1625 during the blur process.
1627 * khtml/html/html_formimpl.cpp:
1628 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
1629 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
1630 new value is set here.
1631 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
1633 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
1634 to true, and also sends out the input event. It's better to have this here than in the renderer code.
1635 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
1636 m_dirtyvalue) and m_valueMatchesRenderer as false.
1637 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
1638 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
1639 where the value came from.
1640 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
1641 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
1642 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
1644 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
1645 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
1646 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
1648 * khtml/rendering/render_form.cpp:
1649 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
1651 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
1653 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
1654 (RenderTextArea::handleFocusOut): Ditto.
1655 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
1656 DOM if valueMatchesRenderer is true.
1657 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
1659 2005-02-22 Richard Williamson <rjw@apple.com>
1661 Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions
1663 Just set dashboard dirty bit when overflow scrolling changes.
1665 Don't do comparison of regions in before scroll regions are
1666 added, instead do it in WebKit after automatic scroll regions
1671 * khtml/css/cssparser.cpp:
1672 (CSSParser::parseDashboardRegions): Cleaned up comments
1673 * khtml/css/cssstyleselector.cpp:
1674 (khtml::CSSStyleSelector::styleForElement): Cleaned up comments
1676 * khtml/khtmlview.cpp:
1677 (KHTMLView::updateDashboardRegions):
1678 * khtml/rendering/render_layer.cpp:
1679 (RenderLayer::updateScrollInfoAfterLayout):
1680 * kwq/WebDashboardRegion.m:
1681 (-[WebDashboardRegion isEqual:]):
1683 2005-02-22 Chris Blumenberg <cblu@apple.com>
1685 Fixed: <rdar://problem/3976872> Pasted plain text doesn't get the proper style if pasted into newlines
1689 * khtml/editing/htmlediting.cpp:
1690 (khtml::ReplaceSelectionCommand::doApply): don't clear the typing style when matching style
1691 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply the typing style when matching style
1692 * khtml/editing/jsediting.cpp:
1693 * khtml/khtml_part.cpp:
1694 (KHTMLPart::pasteAndMatchStyle): new
1695 * khtml/khtml_part.h:
1696 * kwq/KWQKHTMLPart.h:
1697 * kwq/KWQKHTMLPart.mm:
1698 (KWQKHTMLPart::issuePasteAndMatchStyleCommand): new
1699 * kwq/WebCoreBridge.h:
1700 * layout-tests/editing/editing.js:
1702 2005-02-22 Darin Adler <darin@apple.com>
1706 - fixed <rdar://problem/4006596> REGRESSION (183-184): crash in DOM::DocumentImpl::setFocusNode(DOM::NodeImpl*)
1708 * khtml/xml/dom_docimpl.cpp:
1709 (widgetForNode): Added helper.
1710 (DocumentImpl::setFocusNode): Re-get the widget for the node after calling updateLayout.
1711 The updateLayout can destroy the old widget, so we can't keep a stale widget pointer around.
1713 2005-02-22 Ken Kocienda <kocienda@apple.com>
1719 <rdar://problem/4003463> Mail.app HTML uses inline styling markup not understood by Entourage and Eudora
1721 * khtml/editing/htmlediting.cpp:
1722 (khtml::isEmptyFontTag): Helper for removing <font> tags.
1723 (khtml::StyleChange::styleModeForParseMode): Helper to map a document parse mode to a use/don't use
1724 legacy-html-styles value.
1725 (khtml::StyleChange::checkForLegacyHTMLStyleChange): Add support for colors, font faces, and font sizes.
1726 (khtml::ApplyStyleCommand::isHTMLStyleNode):
1727 (khtml::ApplyStyleCommand::removeHTMLFontStyle):
1728 (khtml::ApplyStyleCommand::applyTextDecorationStyle): Now call styleModeForParseMode to determine
1729 whether to use legacy html styles or not.
1730 (khtml::ApplyStyleCommand::removeInlineStyle): Now properly removes <font> styles.
1731 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
1732 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
1733 (khtml::createFontElement): Helper for applying <font> elements.
1734 * khtml/editing/htmlediting.h: All the following support the new bits of data we need to store.
1735 (khtml::StyleChange::applyFontColor)
1736 (khtml::StyleChange::applyFontFace)
1737 (khtml::StyleChange::applyFontSize)
1738 (khtml::StyleChange::fontColor)
1739 (khtml::StyleChange::fontFace)
1740 (khtml::StyleChange::fontSize)
1742 Test results updated now that we will write out <font> tags for quirks mode documents.
1744 * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt
1745 * layout-tests/editing/style/block-style-004-expected.txt
1746 * layout-tests/editing/editing/pasteboard/paste-text-011-expected.txt
1747 * layout-tests/editing/style/block-style-005-expected.txt
1748 * layout-tests/editing/style/block-style-006-expected.txt
1749 * layout-tests/editing/style/smoosh-styles-001-expected.txt
1750 * layout-tests/editing/style/smoosh-styles-002-expected.txt
1752 2005-02-22 Maciej Stachowiak <mjs@apple.com>
1756 <rdar://problem/4017066> crash in KJS::ValueImp::dispatchType() every time I load www.nytimes.com/pages/automobiles
1758 When creating option elements, use lowercase "option" instead of
1759 uppercase "OPTION" to create option elements, because only
1760 lowercase works for XHTML.
1762 * khtml/ecma/kjs_html.cpp:
1763 (KJS::HTMLSelectCollection::tryPut):
1764 (OptionConstructorImp::construct):
1766 2005-02-22 Chris Blumenberg <cblu@apple.com>
1768 WebCore fix for: <rdar://problem/3918056> Mail not line breaking my <pre> formatted emails on replies
1770 Mail must 4018993 to fully address the problem.
1772 Reviewed by kocienda.
1774 * khtml/editing/markup.cpp:
1775 (khtml::startMarkup): don't compute style for text in PRE tags
1776 (khtml::createMarkup): include PRE if it is an ancestor of the nodes in the range
1778 2005-02-21 Richard Williamson <rjw@apple.com>
1780 Fixed <rdar://problem/4008338> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
1782 There was a long standing bug in cssText(). Double value were always cast int! So,
1783 opacity values values were incorrectly converted to text, i.e. 0.75 became 0.
1785 The problem was newly triggered because we parse the css for opacity *TWICE*. This is a result of
1786 incorrectly "invalidating" the style attribute (from fix for 3790449). The second parse was from
1787 the cssText() of the style.
1791 * khtml/css/css_valueimpl.cpp:
1792 (DOM::CSSPrimitiveValueImpl::cssText):
1794 2005-02-21 David Hyatt <hyatt@apple.com>
1796 Fix for 4017204, apply the same fix to the base class nodeAtPoint that was already applied to RenderBlock.
1797 Skip elements with layers and inline flows. Demoted <form>s can end up causing trouble otherwise.
1799 Reviewed by Richard Williamson
1801 * khtml/rendering/render_box.cpp:
1802 (RenderBox::nodeAtPoint):
1804 2005-02-21 David Hyatt <hyatt@apple.com>
1806 Fix for 4017033, CSS is being parsed twice. Make sure to always validate the style attribute when it is
1807 initially parsed. Add code to clean up decls when the style attribute is completely removed. Add a new
1808 synchronizing boolean that avoids reparsing the style declaration when the attribute is simply
1809 being synced up to the declaration.
1813 * khtml/css/css_valueimpl.cpp:
1814 (DOM::CSSMutableStyleDeclarationImpl::setChanged):
1815 * khtml/html/html_elementimpl.cpp:
1816 (HTMLElementImpl::invalidateStyleAttribute):
1817 (HTMLElementImpl::updateStyleAttributeIfNeeded):
1818 (HTMLElementImpl::HTMLElementImpl):
1819 (HTMLElementImpl::~HTMLElementImpl):
1820 (HTMLElementImpl::destroyInlineStyleDecl):
1821 (HTMLElementImpl::mapToEntry):
1822 (HTMLElementImpl::parseHTMLAttribute):
1823 * khtml/html/html_elementimpl.h:
1824 * khtml/xml/dom_elementimpl.cpp:
1825 (ElementImpl::ElementImpl):
1826 (ElementImpl::setAttribute):
1827 * khtml/xml/dom_elementimpl.h:
1828 (DOM::ElementImpl::updateStyleAttributeIfNeeded):
1832 2005-02-21 Darin Adler <darin@apple.com>
1834 - fixed Panther deployment build
1836 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Put more stuff inside #if.
1838 2005-02-21 David Harrison <harrison@apple.com>
1842 <rdar://problem/3943090> REGRESSION (Mail): Spelling underline incompletely erased following certain steps
1844 * khtml/rendering/render_text.cpp:
1845 (InlineTextBox::paintMarker):
1846 Make sure underline is placed within the text bounds.
1849 * kwq/KWQPainter.mm:
1850 (QPainter::misspellingLineThickness):
1851 * kwq/WebCoreTextRenderer.h:
1852 Add misspellingLineThickness for use by InlineTextBox::paintMarker.
1854 2005-02-21 Darin Adler <darin@apple.com>
1858 - fixed <rdar://problem/4012978> -[DOMRange markupString] crashes when range contains only a text node with a single space
1860 * khtml/editing/markup.cpp: (khtml::createMarkup): Added updateLayout calls, and added a missing
1863 2005-02-21 Darin Adler <darin@apple.com>
1867 - fixed <rdar://problem/4005435> Safari hung while pasting text into a <textarea> (Panther-only)
1869 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Don't setAutohidesScrollers:YES on Panther.
1871 2005-02-21 Ken Kocienda <kocienda@apple.com>
1877 <rdar://problem/4015499> REGRESSION (186-187): pasted quoted text starting with a blank line increases quote level of pasted text when pasted
1879 * khtml/editing/markup.cpp:
1880 (khtml::markup): Changed over to ASSERT instead of assert.
1881 (khtml::createMarkup): The issue was that the code to add parents all the way back to the common ancestor
1882 block did not check for blocks whose markup had already been added, and could result in adding markup for
1883 nodes twice (hence the additional and erroneous quote level). Now there is a new check that will
1884 only add markup for those nodes before the start of the selection range. This fixes the bug.
1885 (khtml::createFragmentFromMarkup): Changed over to ASSERT instead of assert.
1886 (khtml::createFragmentFromText): Ditto.
1888 2005-02-21 Ken Kocienda <kocienda@apple.com>
1894 <rdar://problem/4015494> REGRESSION (186-187) <cr> removed if quoted word is copy/pasted on line immediately above quoted text
1896 * khtml/editing/htmlediting.cpp:
1897 (khtml::ReplaceSelectionCommand::doApply): Relatively new check designed to remove a <br> element when
1898 that element was on a line by itself did not do an adequate check for this condition, causing the
1899 failure described in the bug. Fixed.
1901 2005-02-19 Ken Kocienda <kocienda@apple.com>
1905 * khtml/editing/htmlediting.cpp:
1906 (khtml::matchNearestBlockquoteColorString): New function which abstracts away the CSS property we use
1907 for this pseudo-color.
1908 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Set the new nearestBlockquoteColorString
1909 psuedo-color here, rather than removing colors as was done before.
1910 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): Check for the pseudo-color in the desired
1911 style, and determine the real color based on the nearest blockquote (or none) to the node.
1912 (khtml::nearestMailBlockquote): Name change from closestMailBlockquote to match new property better.
1914 All the rest of this change is the mechanical coding you need to do to add a new CSS property, in this
1915 case, -khtml-match-nearest-mail-blockquote-color.
1917 * khtml/css/css_computedstyle.cpp:
1918 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue)
1919 * khtml/css/cssparser.cpp:
1920 (CSSParser::parseValue):
1921 * khtml/css/cssproperties.c:
1924 * khtml/css/cssproperties.h:
1925 * khtml/css/cssproperties.in:
1926 * khtml/css/cssstyleselector.cpp:
1927 (khtml::CSSStyleSelector::applyProperty)
1928 * khtml/css/cssvalues.c:
1930 * khtml/css/cssvalues.h:
1931 * khtml/css/cssvalues.in:
1932 * khtml/rendering/render_style.h:
1933 (khtml::RenderStyle::matchNearestMailBlockquoteColor)
1934 (khtml::RenderStyle::setMatchNearestMailBlockquoteColor)
1935 (khtml::RenderStyle::initialMatchNearestMailBlockquoteColor)
1937 2005-02-19 Ken Kocienda <kocienda@apple.com>
1943 <rdar://problem/4014228> REGRESSION (186-187) extra, uneditable lines inserted above and below a line of pasted quoted text
1944 <rdar://problem/4014393> REGRESSION (186-187) pasted quoted text gets extra <cr>s when pasted at top of document
1946 * khtml/editing/htmlediting.cpp:
1947 (khtml::ReplacementFragment::ReplacementFragment): Part of a general refactoring of how
1948 the fragment is inserted into the document, rendered, and then tested for certain
1949 important pieces of information that are required for pasting.
1950 (khtml::ReplacementFragment::insertFragmentForTestRendering): New helper. Handles inserting
1951 the fragment nodes into the document.
1952 (khtml::ReplacementFragment::restoreTestRenderingNodesToFragment): Removes nodes from the
1953 document, and restores them to the fragment.
1954 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Factored out code that
1955 did this before into its own function.
1956 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
1957 (khtml::ReplacementFragment::countRenderedBlocks): This is a real improvement, as it
1958 eliminates a major use of the isProbablyBlock() function. Now, the blocks that are
1959 counted are real, rendered blocks.
1960 (khtml::ReplacementFragment::removeStyleNodes): Made this function retain margin-zeroing
1961 CSS properties on paragraphs. This does two things: 1) It helps us to maintain good behavior
1962 in the short term while there are still versions of Mail out there that use <p> elements
1963 instead of <div> elements for new paragraphs; and 2) It will help to maintain the compatibility
1964 with other mail clients that use <p> elements for their paragraphs but render them themselves
1965 with no margins as the result of quirks.
1966 (khtml::ReplaceSelectionCommand::doApply): Do some work to fix up and improve the handling
1967 of blank lines, be they <p> elements or <br> elements, that can be removed after pasting. This,
1968 coupled with the refactoring, fixes 4014393.
1969 * khtml/editing/htmlediting.h: Updated for new functions.
1970 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Updated results, actually improved with this change.
1971 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Ditto.
1973 2005-02-19 Kevin Decker <kdecker@apple.com>
1977 Fixed <rdar://problem/4010765> Flash player can be used to arbitrarily open popup windows without user permission
1979 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.
1981 * kwq/WebCoreBridge.h:
1982 * kwq/WebCoreBridge.mm:
1983 (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Changed this to invoke the new stringByEvaluatingJavaScriptFromString:forceUserGesture method below.
1984 (-[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.
1986 2005-02-18 Chris Blumenberg <cblu@apple.com>
1988 Fixed: <rdar://problem/3951196> REGRESSION (Mail): too many levels of reply quotes after certain steps
1990 Reviewed by kocienda.
1992 * khtml/editing/htmlediting.cpp:
1993 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1994 - 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.
1995 - Build up the list of ancestors after we've determined the actual topBlockquote.
1996 - Don't insert an extra new line if there is a new start node.
1998 2005-02-19 Chris Blumenberg <cblu@apple.com>
2000 Fixed: <rdar://problem/3978461> smart paste is broken
2004 * khtml/editing/htmlediting.cpp:
2005 (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.
2007 2005-02-18 Adele Amchan <adele@apple.com>
2011 Fix for <rdar://problem/3975568> REGRESSION(125-180)Australian Open pages have drawing problem
2013 This patch fixes two problems caused by our added support for custom tags. First, the layout problem at the sites mentioned in the bug
2014 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.
2015 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
2016 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
2017 endTagArray and tagPriorityArray.
2019 * khtml/html/dtd.h: changed all uses of the endTag array to endTagArray for our new wrapper functions
2020 (DOM::tagPriority): added function to check array bounds and to treat custom tags as spans
2021 (DOM::endTagRequirement): added function to check array bounds and to treat custom tags as spans
2022 * khtml/html/dtd.cpp: changed name of endTag and tagPriority arrays to endTagArray and tagPriorityArray
2023 (DOM::checkChild): treat custom tags as spans during this check
2024 * khtml/html/html_elementimpl.cpp: changed all uses of the endTag array to the endTagRequirement function
2025 (HTMLElementImpl::createContextualFragment):
2026 (HTMLElementImpl::setInnerText):
2027 (HTMLElementImpl::setOuterText):
2028 (HTMLElementImpl::toString):
2029 * 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.
2030 (KHTMLParser::parseToken):
2031 (KHTMLParser::insertNode):
2032 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): changed all uses of the endTag array to the endTagRequirement function
2033 * khtml/editing/markup.cpp: changed all uses of the endTag array to the endTagRequirement function
2037 2005-02-18 Jens Alfke <jens@apple.com>
2041 Fixed build: Whoops, setNeedsLayout's parameter is NOT optional.
2043 * khtml/html/html_objectimpl.cpp:
2044 (HTMLAppletElementImpl::setAllParamsAvailable):
2046 2005-02-18 Jens Alfke <jens@apple.com>
2048 Reviewed by cblu, hyatt.
2050 Fixes <rdar://problem/3603191> "REGRESSION: Applets not receiving all of the Applet Parameters in Java 1.4.1/1.4.2"
2051 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.
2053 * khtml/html/html_objectimpl.cpp:
2054 (HTMLAppletElementImpl::HTMLAppletElementImpl):
2055 (HTMLAppletElementImpl::getAppletInstance):
2056 (HTMLAppletElementImpl::setAllParamsAvailable):
2057 (HTMLAppletElementImpl::allParamsAvailable):
2058 * khtml/html/html_objectimpl.h:
2059 * khtml/html/htmlparser.cpp:
2060 (KHTMLParser::processCloseTag):
2061 * khtml/rendering/render_applet.cpp:
2062 (RenderApplet::createWidgetIfNecessary):
2064 2005-02-18 Richard Williamson <rjw@apple.com>
2066 Fixed <rdar://problem/4006161> Tiger8A380: Widgets leak dashboard regions
2068 We were leaking the DashboardRegionImpls.
2072 * khtml/css/css_valueimpl.cpp:
2073 (DOM::CSSPrimitiveValueImpl::cleanup):
2075 2005-02-18 Chris Blumenberg <cblu@apple.com>
2077 Fixed: <rdar://problem/3945271> REGRESSION (Mail): pasted plain text should pick up typing style instead of being unstyled
2079 Reviewed by kocienda.
2081 * khtml/editing/htmlediting.cpp:
2082 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): don't set class on element returned by createStyleSpanElement since that's already done
2083 (khtml::ReplacementFragment::ReplacementFragment): take matchStyle param, don't call computeStylesAndRemoveUnrendered() if !matchStyle
2084 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take matchStyle param
2085 (khtml::ReplaceSelectionCommand::doApply): if m_matchStyle, use selection.start() as the insertion position and don't call applyStyleToInsertedNodes()
2086 * khtml/editing/htmlediting.h:
2087 * kwq/WebCoreBridge.h:
2088 * kwq/WebCoreBridge.mm:
2089 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): take matchStyle param and pass it
2090 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): pass NO for matchStyle
2091 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): pass NO for matchStyle
2092 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): pass YES for matchStyle
2094 2005-02-18 Ken Kocienda <kocienda@apple.com>
2100 <rdar://problem/4013025> Copy/Paste of quoted word results in removal of any following <cr>
2101 <rdar://problem/4013100> Copy/Paste quoted text and then decrease quote level does not change text color
2103 For the most part, these bugs were caused by errors and lack of foresight on my part when
2104 I added the better paste code. Chalk these fixes up to the result of bake time.
2106 * khtml/editing/htmlediting.cpp:
2107 (khtml::ReplacementFragment::ReplacementFragment): Need to move count of number of blocks in
2108 fragment after the call to remove unrendered nodes. Meant to do this before, but forgot to.
2109 (khtml::ReplacementFragment::removeStyleNodes): Need to remove inline styles from elements!
2110 Terrible omission now fixed.
2111 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Remove blockquote colors for now.
2112 Code has a more extensive comment in it now to explain the difficulty, and the need for more
2114 (khtml::ReplaceSelectionCommand::doApply): Need to call applyStyleToInsertedNodes() in the
2115 m_fragment.hasInterchangeNewline() case. This was just missed before.
2116 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Updated results, subtly different, but OK.
2117 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Updated for <p> to <div> change in test content.
2118 * layout-tests/editing/pasteboard/paste-text-017.html: Needed to change <p> to <div> to
2119 make this test go with the new design of using <div> tags for default paragraphs.
2121 2005-02-18 David Hyatt <hyatt@apple.com>
2123 Fix for 3974263 (and possibly others). Don't let fixed tables use maxint as their maxwidth when some
2124 cells have percentage values.
2126 Reviewed by kocienda
2128 * khtml/misc/arena.cpp:
2130 * khtml/rendering/table_layout.cpp:
2131 (FixedTableLayout::calcWidthArray):
2132 (FixedTableLayout::calcMinMaxWidth):
2133 (AutoTableLayout::layout):
2135 2005-02-17 Darin Adler <darin@apple.com>
2139 - fixed <rdar://problem/3998627> WebKit crashes when deleting text in a modified div
2141 * khtml/khtml_part.cpp: (KHTMLPart::selectionComputedStyle): Add a ref and deref to keep
2142 the element alive until it's added to the DOM tree.
2143 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::styleForSelectionStart): Ditto.
2145 2005-02-17 Richard Williamson <rjw@apple.com>
2147 Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead
2149 Fixed w/o introducing a performance regression. Add early
2150 check for Osaka-Mono to avoid expensive call into WebKit.
2155 (QFont::isFixedPitch):
2157 2005-02-17 Darin Adler <darin@apple.com>
2161 - fixed <rdar://problem/4011210> REGRESSION (180-181): Maxlength property for INPUT object not working
2163 * kwq/KWQTextField.mm:
2164 (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): If controller returns
2165 YES, go on to call super, since super does the text formatter handling, which we need.
2166 (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
2167 (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
2171 2005-02-17 Ken Kocienda <kocienda@apple.com>
2177 <rdar://problem/4012058> Copy from quoted text and paste results in blue text
2179 The relatively-new paste code tries hard to retain style of the content from the
2180 source location. However, in the case of quoted material in mail messages, we do
2181 not want to carry the quoting color along. This fixes the problem by factoring
2184 * khtml/editing/htmlediting.cpp:
2185 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Now calls removeBlockquoteColorsIfNeeded()
2187 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): New function. Factors out colors that are
2188 the result of text being quoted.
2189 (khtml::isNodeRendered): Function moved in file. No other change.
2190 (khtml::isProbablyBlock): Function moved in file. No other change.
2191 (khtml::closestMailBlockquote): New function. Helps fix bug.
2192 (khtml::isMailBlockquote): Function moved to be free-floating instead of being a
2193 member of CompositeEditCommand. No other change.
2194 * khtml/editing/htmlediting.h: Moved around some functions. Added removeBlockquoteColorsIfNeeded().
2195 * khtml/editing/markup.cpp: Remove redundant static implementation of isMailBlockquote.
2197 2005-02-17 Richard Williamson <rjw@apple.com>
2199 Fixed <rdar://problem/4008163> dynamic support for -apple-dashboard-region is flakey
2201 Style operator== wasn't including regions.
2205 * khtml/rendering/render_style.cpp:
2206 (StyleCSS3NonInheritedData::operator==):
2208 2005-02-17 Adele Amchan <adele@apple.com>
2212 fix for <rdar://problem/4010028> 8A383: Safari v185 crash loading united.com multi city fare finder page.
2214 * khtml/dom/dom_string.cpp: (DOM::DOMString::operator += ): prevent nil dereference when DOMString being added is nil
2216 2005-02-17 Jens Alfke <jens@apple.com>
2220 Fix for rdar://3963151 "Mail only pasted ~950 of 1407 text lines into my message!"
2221 Force tokenizer to run synchronously while parsing document fragments, so it doesn't stop halfway through and cause truncated content.
2223 * khtml/html/html_elementimpl.cpp:
2224 (HTMLElementImpl::createContextualFragment):
2225 * khtml/html/htmltokenizer.cpp:
2226 (khtml::HTMLTokenizer::reset):
2227 (khtml::HTMLTokenizer::begin):
2228 (khtml::HTMLTokenizer::setForceSynchronous):
2229 (khtml::HTMLTokenizer::continueProcessing):
2230 * khtml/html/htmltokenizer.h:
2232 2005-02-17 Ken Kocienda <kocienda@apple.com>
2238 <rdar://problem/3982183> Mail's HTML paragraphs appear with unintended margins in Entourage and Eudora
2240 * khtml/editing/htmlediting.cpp:
2241 (khtml::createDefaultParagraphElement): Change element we make from <p> to <div>.
2242 This fixes the problem, as these other mailers show <div> elements without margins.
2244 Some test files needed to change to preserve the ability to "eyeball" the results.
2245 Many others changed just because their <p> elements changed to <div> elements.
2247 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt
2248 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt
2249 * layout-tests/editing/inserting/insert-div-013-expected.txt
2250 * layout-tests/editing/inserting/insert-div-013.html
2251 * layout-tests/editing/inserting/insert-div-014-expected.txt
2252 * layout-tests/editing/inserting/insert-div-014.html
2253 * layout-tests/editing/inserting/insert-div-018-expected.txt
2254 * layout-tests/editing/inserting/insert-div-018.html
2255 * layout-tests/editing/inserting/insert-div-019-expected.txt
2256 * layout-tests/editing/inserting/insert-div-019.html
2257 * layout-tests/editing/inserting/insert-div-020-expected.txt
2258 * layout-tests/editing/inserting/insert-div-020.html
2259 * layout-tests/editing/inserting/insert-div-021-expected.txt
2260 * layout-tests/editing/inserting/insert-div-021.html
2261 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
2262 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
2263 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt
2264 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt
2266 2005-02-17 Ken Kocienda <kocienda@apple.com>
2272 <rdar://problem/3996737> REGRESSION (Mail): Copy/paste in Mail inserts returns
2274 The root cause of the problem is that a couple of pieces of code in AppKit and Mail
2275 insert newlines into markup as it is generated, and the paste code in WebCore was
2276 not smart about nodes that do not render (as is the case with these added newlines).
2277 So, the solution is to remove these unrendered nodes in the paste code in a pre-pass.
2278 Fortunately, my recent addition of such a pass to the paste code to handle styles
2279 gave me a convenient place to put this new logic.
2281 * khtml/editing/htmlediting.cpp:
2282 (khtml::ReplacementFragment::ReplacementFragment): Use new name for function below.
2283 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Name change from computeStylesForNodes().
2284 Now does the additional work of removing unrendered nodes, as mentioned above.
2285 (khtml::isNodeRendered): New helper function.
2286 * khtml/editing/htmlediting.h: Updated as necessary.
2288 2005-02-17 Ken Kocienda <kocienda@apple.com>
2294 <rdar://problem/3998892> REGRESSION (Mail): bolding a selection from end of line changes unselected text on starting line.
2296 The styling code did not move to the next node when the starting position was
2297 at the last offset of a node. Instead, it styled it. Clearly wrong. Solution
2298 is to borrow a check from the delete algorithm. Though I call caretMaxOffset(),
2299 which I consider deprecated, it is still the simplest and most strightforward
2300 way to ask the right question for this kind of problem.
2302 * khtml/editing/htmlediting.cpp:
2303 (khtml::ApplyStyleCommand::applyInlineStyle): Fixed, as described above.
2304 * layout-tests/editing/style/style-3998892-fix-expected.txt: Added.
2305 * layout-tests/editing/style/style-3998892-fix.html: Added.
2307 2005-02-16 Chris Blumenberg <cblu@apple.com>
2309 Fixed: <rdar://problem/3954842> Forward/reply to an HTML email can result in nothing (in cases with <link> tags for CSS)
2313 * khtml/xml/dom_nodeimpl.cpp:
2314 (NodeBaseImpl::addChild): don't call insertedIntoDocument on the added child if "this" itself is not in the document.
2316 2005-02-16 John Sullivan <sullivan@apple.com>
2318 Written by Darin, reviewed by Maciej and me
2320 - change required to make previous checkin work with English language RSS pages
2323 new private method isHierarchical
2326 add hierarchical base URL check when determining whether the URL is absolute
2327 (KURL::isHierarchical):
2328 new method, returns true if this is a valid URL with a slash just past the scheme's trailing colon
2330 2005-02-16 John Sullivan <sullivan@apple.com>
2332 Written by Darin, reviewed by me.
2334 - WebCore part of fix for <rdar://problem/4007384>
2335 FILTER: Bookmark of RSS with Japanese search word & multiple RSS pages loses filter
2338 (-[DOMElement _getURLAttribute:]):
2339 new SPI method, uses parseURL and completeURL to get valid URL from attribute value
2342 declare new SPI method
2344 2005-02-15 Maciej Stachowiak <mjs@apple.com>
2348 <rdar://problem/3942428> reproducible crash loading cbs.sportsline.com
2350 This change reverts the fix for <rdar://problem/3805311>, and
2351 re-fixes it in a different (better) way. Instead of preventing
2352 programmatic open from setting the parsing flag, instead make sure
2353 that programmatic close resets it.
2355 * khtml/khtml_part.cpp:
2356 (KHTMLPart::openURL):
2357 (KHTMLPart::didExplicitOpen):
2358 (KHTMLPart::closeURL):
2361 (KHTMLPart::endIfNotLoading):
2362 (KHTMLPart::slotFinishedParsing):
2363 (KHTMLPart::checkEmitLoadEvent):
2364 * khtml/khtml_part.h:
2365 * khtml/khtmlpart_p.h:
2366 (KHTMLPartPrivate::KHTMLPartPrivate):
2367 * khtml/xml/dom_docimpl.cpp:
2368 (DocumentImpl::open):
2369 (DocumentImpl::implicitOpen):
2370 (DocumentImpl::close):
2371 (DocumentImpl::implicitClose):
2372 * khtml/xml/dom_docimpl.h:
2374 2005-02-15 David Harrison <harrison@apple.com>
2378 <rdar://problem/3933665> smart delete seems to delete too much after expanding selection with arrow keys
2380 Fixed by updating the selection granularity. Only byWord granularity enables smart delete, but in this
2381 case the granularity changed from byWord to byCharacter.
2383 * khtml/khtml_part.cpp:
2384 (KHTMLPart::setSelectionGranularity):
2385 * khtml/khtml_part.h:
2386 * kwq/WebCoreBridge.mm:
2387 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
2388 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
2389 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
2391 2005-02-15 David Harrison <harrison@apple.com>
2395 (continued) <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
2397 This was supposed have been committed yesterday with the other part of the fix, but was not.
2399 * khtml/editing/visible_units.cpp:
2402 2005-02-15 Ken Kocienda <kocienda@apple.com>
2408 <rdar://problem/3951178> REGRESSION (Mail): blank line lost after pasting as quotation
2410 Problem was that the blank line after the selection was getting deleted incorrectly since the
2411 paste code thought this was an unneeded placeholder rather than a placeholder outside of the
2414 * khtml/editing/htmlediting.cpp:
2415 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now calls findBlockPlaceholder.
2416 (khtml::CompositeEditCommand::findBlockPlaceholder): Moved finding code formerly in
2417 removeBlockPlaceholderIfNeeded to this new helper.
2418 (khtml::ReplaceSelectionCommand::doApply): Do not delete placeholder up front. Call
2419 findBlockPlaceholder, and delete it later if needed in the already-existing cleanup step.
2420 * khtml/editing/htmlediting.h: Add new function.
2424 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Added.
2425 * layout-tests/editing/pasteboard/paste-text-017.html: Added.
2427 Result changed for the better.
2429 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
2431 2005-02-14 David Harrison <harrison@apple.com>
2435 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
2439 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
2441 * khtml/editing/visible_text.cpp:
2442 (khtml::SimplifiedBackwardsTextIterator::advance):
2443 Add BR in for <rdar://problem/3917929> fix only if leaving a visible text node.
2445 * khtml/editing/visible_units.cpp:
2447 Do not move left over a paragraph boundary.
2449 2005-02-14 Darin Adler <darin@apple.com>
2453 - fixed <rdar://problem/3686434> Safari uses too much RAM on file upload, leading to malloc errors and crashes (HP printers)
2455 * khtml/html/html_formimpl.cpp:
2456 (DOM::FormDataList::begin): Updated to use a list of FormDataListItem instead of QCString.
2457 (DOM::FormDataList::end): Ditto.
2458 (DOM::HTMLFormElementImpl::formData): Same here, and also use appendFile rather than appendData
2459 when we encounter a path name rather than data.
2460 (DOM::HTMLInputElementImpl::appendFormData): Use appendFile here rather than reading the file
2461 in; the reading now happens inside WebKit.
2462 (DOM::FormDataList::appendString): Updated for FormDataListItem.
2463 (DOM::FormDataList::appendFile): Added.
2465 * ForwardingHeaders/kfileitem.h: Emptied out the file; no longer includes KWQKFileItem.h.
2466 * ForwardingHeaders/netaccess.h: Emptied out the file; no longer includes KWQKIONetAccess.h.
2467 * kwq/KWQKFileItem.h: Removed.
2468 * kwq/KWQKFileItem.mm: Removed.
2469 * kwq/KWQKIONetAccess.h: Removed.
2470 * kwq/KWQKIONetAccess.mm: Removed.
2471 * WebCore.pbproj/project.pbxproj: Removed the 4 files above.
2473 - small unrelated fix (not reviewed by John)
2475 * khtml/ecma/kjs_window.cpp: (Window::isSafeScript): Put some logging code outside if statements so it works all the time.
2477 2005-02-14 David Harrison <harrison@apple.com>
2481 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
2483 Fixed nextLinePosition to calculate affinity rather than take it as a parameter. Propagated the parameter change out to related methods.
2485 * khtml/editing/htmlediting.cpp:
2486 (khtml::DeleteSelectionCommand::initializePositionData):
2487 (khtml::InsertLineBreakCommand::doApply):
2488 (khtml::InsertParagraphSeparatorCommand::doApply):
2489 (khtml::InsertTextCommand::input):
2490 (khtml::ReplaceSelectionCommand::doApply):
2491 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes):
2492 * khtml/editing/selection.cpp:
2493 (khtml::Selection::modifyExtendingRightForward):
2494 (khtml::Selection::modifyMovingRightForward):
2495 (khtml::Selection::modifyExtendingLeftBackward):
2496 (khtml::Selection::modifyMovingLeftBackward):
2497 (khtml::Selection::modify):
2498 (khtml::Selection::validate):
2499 * khtml/editing/visible_position.cpp:
2500 (khtml::visiblePositionsOnDifferentLines):
2501 * khtml/editing/visible_units.cpp:
2502 (khtml::rootBoxForLine):
2503 (khtml::startOfLine):
2505 (khtml::inSameLine):
2506 (khtml::isStartOfLine):
2507 (khtml::isEndOfLine):
2508 (khtml::previousLinePosition):
2509 (khtml::nextLinePosition):
2510 (khtml::previousSentencePosition):
2511 (khtml::nextSentencePosition):
2512 (khtml::previousParagraphPosition):
2513 (khtml::nextParagraphPosition):
2514 * khtml/editing/visible_units.h:
2515 * khtml/khtml_events.cpp:
2516 (khtml::MouseEvent::offset):
2517 * khtml/khtml_part.cpp:
2518 (KHTMLPart::isPointInsideSelection):
2519 (KHTMLPart::selectClosestWordFromMouseEvent):
2520 (KHTMLPart::handleMousePressEventTripleClick):
2521 (KHTMLPart::handleMousePressEventSingleClick):
2522 (KHTMLPart::handleMouseMoveEventSelection):
2523 (KHTMLPart::khtmlMouseReleaseEvent):
2524 * khtml/rendering/render_block.cpp:
2525 (khtml::RenderBlock::positionForCoordinates):
2526 * khtml/rendering/render_block.h:
2527 * khtml/rendering/render_br.cpp:
2528 (RenderBR::positionForCoordinates):
2529 * khtml/rendering/render_br.h:
2530 * khtml/rendering/render_container.cpp:
2531 (RenderContainer::positionForCoordinates):
2532 * khtml/rendering/render_container.h:
2533 * khtml/rendering/render_inline.cpp:
2534 (RenderInline::positionForCoordinates):
2535 * khtml/rendering/render_inline.h:
2536 * khtml/rendering/render_object.cpp:
2537 (RenderObject::caretRect):
2538 (RenderObject::positionForCoordinates):
2539 * khtml/rendering/render_object.h:
2540 * khtml/rendering/render_replaced.cpp:
2541 (RenderReplaced::positionForCoordinates):
2542 * khtml/rendering/render_replaced.h:
2543 * khtml/rendering/render_text.cpp:
2544 (RenderText::positionForCoordinates):
2545 * khtml/rendering/render_text.h:
2546 * khtml/xml/dom_position.cpp:
2547 (DOM::Position::previousCharacterPosition):
2548 (DOM::Position::nextCharacterPosition):
2549 (DOM::Position::leadingWhitespacePosition):
2550 (DOM::Position::trailingWhitespacePosition):
2551 * khtml/xml/dom_position.h:
2552 * kwq/KWQAccObject.mm:
2553 (-[KWQAccObject value]):
2554 (-[KWQAccObject accessibilityAttributeValue:]):
2555 (-[KWQAccObject doAXLineForTextMarker:]):
2556 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
2557 (-[KWQAccObject doAXTextMarkerForPosition:]):
2558 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
2559 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2560 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2561 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
2562 * kwq/KWQKHTMLPart.mm:
2563 * kwq/WebCoreBridge.mm:
2564 (-[WebCoreBridge _visiblePositionForPoint:]):
2566 05-02-07 Maciej Stachowiak <mjs@apple.com>
2568 Reviewed by Ken and John.
2570 Re-fixed a specific case of the following:
2572 <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
2574 Oddly, Cmd-B, Cmd-U, type some text, return, Cmd-U, Cmd-B, type
2575 some text, worked fine. But hitting the second Cmd-B before the
2576 second Cmd-U still failed to remove underlining. The reason for
2577 this is that our code to compute the style of the current position
2578 did not work when you had a typing style and were positioned right
2579 at a <br> element. For various reasons, this did not show up for
2580 bold and italic, since those are handled through the font manager.
2582 The following change fixes this - for elements that can't have
2583 children, we add the dummy span after the element of interest,
2584 rather than as a child of it.
2586 * khtml/khtml_part.cpp:
2587 (KHTMLPart::selectionComputedStyle):
2589 2005-02-11 David Harrison <harrison@apple.com>
2593 <rdar://problem/3978980> Double Clicking on a line in Mail selected the entire body
2595 * khtml/editing/visible_units.cpp:
2596 (khtml::startOfWord):
2598 Pay attention to being at the end of a paragraph.
2600 (khtml::previousLinePosition):
2601 (khtml::nextLinePosition):
2602 (khtml::endOfParagraph):
2603 Use DOWNSTREAM per recent affinity changes.
2605 2005-02-11 Richard Williamson <rjw@apple.com>
2607 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
2609 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
2610 creates these wrappers. The WebCore subclass of the interpreter now overrides
2611 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
2613 * WebCore.pbproj/project.pbxproj:
2614 * khtml/ecma/kjs_binding.cpp:
2615 (ScriptInterpreter::createLanguageInstanceForValue):
2616 * khtml/ecma/kjs_binding.h:
2617 * kwq/DOMUtility.mm: Added.
2618 (KJS::ScriptInterpreter::createObjcInstanceForValue):
2619 * kwq/KWQKHTMLPart.mm:
2620 (KWQKHTMLPart::getAppletInstanceForView):
2621 (getInstanceForView):
2622 (KWQKHTMLPart::getEmbedInstanceForView):
2623 (KWQKHTMLPart::getObjectInstanceForView):
2625 2005-02-11 Chris Blumenberg <cblu@apple.com>
2627 Fixed: <rdar://problem/3937352> Quote level not maintained when copied and pasted within a Mail message
2629 Reviewed by harrison.
2631 * khtml/editing/markup.cpp:
2632 (khtml::isMailBlockquote): new
2633 (khtml::createMarkup): retain the Mail quote level by including all ancestor mail block quotes
2634 * khtml/rendering/render_block.cpp:
2635 (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
2636 * khtml/rendering/render_text.cpp:
2637 (RenderText::positionForCoordinates): ditto
2639 2005-02-11 Adele Amchan <adele@apple.com>
2643 fix for <rdar://problem/4004004> no need to add body element for xml documents
2645 In the fix for <rdar://problem/3758785> we decided to add a body element when closing a document
2646 to ensure that the onload handler would fire. This is unnecessary for xml documents,
2647 so now we also check to see if we're dealing with an html document before adding the body element.
2649 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
2651 2005-02-11 Adele Amchan <adele@apple.com>
2655 * layout-tests/apple-only/base/www.excite.com/index-expected.txt: updates tests because of custom tag change.
2656 * layout-tests/apple-only/base/www.msnbc.com/index-expected.txt:
2657 * layout-tests/apple-only/base/www.time.com/index-expected.txt:
2658 * layout-tests/apple-only/base/www.travelocity.com/index-expected.txt:
2659 * layout-tests/apple-only/base/www.zdnet.com/index-expected.txt:
2660 * layout-tests/fast/overflow/003-expected.txt:
2662 * layout-tests/fast/js/window-object-cross-frame-calls-expected.txt: updated test because of added Body (see rdar://problem/3758785)
2666 2005-02-11 Darin Adler <darin@apple.com>
2670 - 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
2672 * khtml/xml/dom_docimpl.h: Added a new openInternal function for use by KHTMLPart.
2673 * khtml/xml/dom_docimpl.cpp:
2674 (DocumentImpl::open): Changed to do everything we did before, but also clear the URL and set the
2675 base URL based on the enclosing document. This is the basic JavaScript/DOM operation of opening a
2676 document, which is supposed to clear the document, including the URL. In the long run we might want
2677 to do even more document "resetting and clearing" in here, but this URL clearing is what's needed
2678 now to fix the most important problem.
2679 (DocumentImpl::openInternal): Moved the old open code in here, except for the "parsing" check, which
2680 is unnecessary and inappropriate in the one place we call this.
2682 * khtml/khtml_part.cpp: (KHTMLPart::begin): Call openInternal instead of open.
2684 2005-02-10 Ken Kocienda <kocienda@apple.com>
2690 <rdar://problem/3992092> 8A374: Mail crash while pasting - RemoveNodeCommand
2692 * khtml/editing/htmlediting.cpp:
2693 (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in
2694 the document. We try to do a good job of detecting all these cases, and generally do. This
2695 one was missed. Fixed.
2697 2005-02-10 Darin Adler <darin@apple.com>
2699 Reviewed by Harrison.
2701 - added support needed to fix <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined
2703 * kwq/WebCoreBridge.h: Added selectionHasStyle: method.
2704 * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part.
2706 2005-02-10 Darin Adler <darin@apple.com>
2708 Reviewed by Harrison.
2710 - fixed <rdar://problem/3990484> cursor changes to I-beam when moving over text in widgets, even when selection off via CSS
2712 * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent): Changed code to check canSelect when deciding
2713 whether to show an I-beam cursor.
2715 * khtml/rendering/render_object.h: Added canSelect.
2716 * khtml/rendering/render_object.cpp:
2717 (selectStartNode): Added. Helper function with the guts of shouldSelect.
2718 (RenderObject::canSelect): Added. Like shouldSelect, but does not call the "start selecting" event handler.
2719 (RenderObject::shouldSelect): Refactored to use selectStartNode.
2721 * khtml/css/cssvalues.c: Regnerated with newer gperf.
2723 2005-02-10 David Hyatt <hyatt@apple.com>
2725 Fix for 3867759, .mac regression where scrollers don't show up. Make sure you can set the .width and
2726 .height properties on the Image object.
2728 Reviewed by John Sullivan
2730 * khtml/ecma/kjs_html.cpp:
2731 (ImageConstructorImp::construct):
2732 (Image::getValueProperty):
2735 * khtml/ecma/kjs_html.h:
2737 2005-02-10 Ken Kocienda <kocienda@apple.com>
2743 <rdar://problem/3965158> Drag-n-drop within a rich text message sometimes changes the color of the dragged text
2745 This change fixes the bug....and much more. Now, for the first time, the paste code can do "smart merging"
2746 or "smooshing" of styles during its operation. Since this new code is actively, rather than passively
2747 working with styles, it fixes the bug, and lays the groundwork for similar work we need to do to
2748 preserve quote levels in Mail.
2750 * khtml/css/css_valueimpl.cpp:
2751 (DOM::CSSMutableStyleDeclarationImpl::clear): New method.
2752 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
2753 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): Ditto.
2754 (DOM::operator==): Add operator for CSSProperty.
2755 * khtml/css/css_valueimpl.h: Declare new functions.
2756 * khtml/editing/htmlediting.cpp:
2757 (khtml::isEmptyStyleSpan): Improved the test in this function, rolling together the old implementation
2758 with some code that did this work inline elsewhere. Sum of the parts is better than either test was by itself.
2759 (khtml::isStyleSpan): Check for ID_SPAN.
2760 (khtml::ApplyStyleCommand::removeCSSStyle): Call isEmptyStyleSpan. This was the place with an inline implementation before.
2761 (khtml::ReplacementFragment::ReplacementFragment): Now takes a DocumentImpl argument. No longer does a "default style"
2762 check, but rather calls functions which do a similar check to that, and much more.
2763 (khtml::ReplacementFragment::~ReplacementFragment): Deref document, and computed styles.
2764 (khtml::ReplacementFragment::styleForNode): New helper. Looks up and returns computed style for a node.
2765 (khtml::ReplacementFragment::removeNodePreservingChildren): New helper.
2766 (khtml::ReplacementFragment::computeStylesForNodes): New function which computes the "desired" style for
2767 every node in the fragment. This information is used later after paste is done as a reference for testing
2768 what styles need to be added, and which can be removed as redundant, from all the nodes inserted by the
2770 (khtml::ReplacementFragment::removeStyleNodes): Clears out all style nodes from the fragment. They are
2771 no longer needed after the call to computeStylesForNodes(),
2772 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): Add a document to the call to initialize the
2773 command's ReplacementFragment.
2774 (khtml::ReplaceSelectionCommand::doApply): Call applyStyleToInsertedNodes() after inserting nodes to make
2775 styles come out right.
2776 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): This is the "style smooshing" function. It
2777 computes the styles that need to be added to each node inserted, comparing the style it gets from just
2778 being inserted into its correct destination with the computed "desired style" done in the
2779 ReplacementFragment constructor. It then adds in all the necessary styles, and will also remove redundant styles.
2780 * khtml/editing/htmlediting.h: Update declarations and member variables as needed.
2781 * khtml/editing/markup.cpp:
2782 (khtml::startMarkup): Add additional style annotations to the markup we generate, so that paste code can preserve it.
2783 (khtml::markup): Ditto.
2784 (khtml::createMarkup): Ditto.
2786 These test results are subtly better with this change. They no longer have an unneeded empty span.
2787 Visually the same as before.
2789 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
2790 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
2791 * layout-tests/editing/style/remove-underline-expected.txt
2792 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt
2796 * layout-tests/editing/style/smoosh-styles-001-expected.txt
2797 * layout-tests/editing/style/smoosh-styles-002-expected.txt
2798 * layout-tests/editing/style/smoosh-styles-001.html
2799 * layout-tests/editing/style/smoosh-styles-002.html
2801 2005-02-10 Darin Adler <darin@apple.com>
2805 - fixed <rdar://problem/3974988> WebHTMLView drops scroll wheel events when deltas are 0
2807 * kwq/WebCoreScrollView.m: (-[WebCoreScrollView autoforwardsScrollWheelEvents]): Added, for Tiger only.
2808 For Tiger, removed the override of scrollWheel:, which doesn't work quite right because of how the
2809 delta attributes return all 0 for newfangled scrolling events from the new trackpads.
2811 2005-02-10 David Harrison <harrison@apple.com>
2815 <rdar://problem/3991532> REGRESSION (Mail): Triple-click on trailing blank line should select previous line but doesn't
2817 * khtml/css/cssvalues.c:
2820 * khtml/editing/selection.cpp:
2821 (khtml::Selection::validate):
2822 Do moral equiavalent of LeftWordIfOnBoundary for PARAGRAPH.
2824 2005-02-10 David Harrison <harrison@apple.com>
2828 <rdar://problem/3991848> Double-click on first character selects wrong item
2830 * khtml/editing/selection.cpp:
2831 (khtml::Selection::validate):
2832 Honor the fact that clicking on a character positions the cursor on the left side of the character.
2834 2005-02-10 David Hyatt <hyatt@apple.com>
2836 Fix for 3980778, repro crash in RootInlineBox::paint. Make sure that when merging blocks we dirty them for layout
2837 up front. That way as we do the merge, we dont attempt to examine the lines in dirtyLinesForChangedChild.
2841 * khtml/rendering/render_block.cpp:
2842 (khtml::RenderBlock::removeChild):
2844 2005-02-10 David Hyatt <hyatt@apple.com>
2846 Fix for 3987010, fix a bug that caused the self-collapsing-block-cleared-float bit to never get set correctly.
2850 * khtml/rendering/render_block.h:
2851 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
2853 2005-02-10 David Hyatt <hyatt@apple.com>
2855 Fix for 3992440, text not wrapping correctly on half moon bay web site. Refine an incorrect optimization I
2856 added to be less restrictive.
2860 * khtml/rendering/render_block.cpp:
2861 (khtml::RenderBlock::layoutBlockChildren):
2863 2005-02-08 Maciej Stachowiak <mjs@apple.com>
2867 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
2869 I fixed this by removing all event listeners for a document, it's
2870 children, and any disconnected nodes that used to be in the
2871 document at document detach time. Mozilla temporarily disables
2872 event listeners on such nodes, but re-enables them if you
2873 re-parant a node into a new document. However, in WebCore, you
2874 can't re-parent a node into another document, so there is no
2875 observable change in behavior.
2877 We have to do this to break the possible reference cycles between
2878 event listeners and the dom nodes they are attached to (e.g. via
2879 scope chain, as in this case).
2881 * khtml/xml/dom_docimpl.cpp:
2882 (DocumentImpl::detach):
2883 (DocumentImpl::removeAllEventListenersFromAllNodesx):
2884 (DocumentImpl::registerDisconnectedNodeWithEventListeners):
2885 (DocumentImpl::unregisterDisconnectedNodeWithEventListeners):
2886 (DocumentImpl::removeAllDisconnectedNodeEventListeners):
2887 * khtml/xml/dom_docimpl.h:
2888 * khtml/xml/dom_nodeimpl.cpp:
2889 (NodeImpl::~NodeImpl):
2890 (NodeImpl::addEventListener):
2891 (NodeImpl::removeEventListener):
2892 (NodeImpl::removeAllEventListeners):
2893 (NodeImpl::removeHTMLEventListener):
2894 (NodeImpl::insertedIntoDocument):
2895 (NodeImpl::removedFromDocument):
2896 * khtml/xml/dom_nodeimpl.h:
2898 2005-02-09 Chris Blumenberg <cblu@apple.com>
2900 Fixed: <rdar://problem/3999213> Sometimes 2 Windows Media Player plugin instances are loaded
2904 * khtml/html/html_objectimpl.cpp:
2905 (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.
2906 (HTMLObjectElementImpl::recalcStyle): ditto
2908 2005-02-09 David Harrison <harrison@apple.com>
2912 <rdar://problem/3937447> Mail-689: Arrow key navigation in new message body stops working when a line ends with a bold word
2914 Added affinity to VisiblePosition. Changed Selection code to use affinity more.
2916 (Partial) <rdar://problem/3982096> editing/pasteboard/paste-text-007 is failing
2918 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.
2920 * khtml/ecma/kjs_window.cpp:
2921 (SelectionFunc::tryCall):
2922 * khtml/editing/htmlediting.cpp:
2923 (khtml::EditCommandPtr::setStartingSelection):
2924 (khtml::EditCommandPtr::setEndingSelection):
2925 (khtml::EditCommand::setStartingSelection):
2926 (khtml::EditCommand::setEndingSelection):
2927 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream):
2928 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
2929 (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
2930 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
2931 (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
2932 (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
2933 (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
2934 (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
2935 (khtml::ApplyStyleCommand::joinChildTextNodes):
2936 (khtml::DeleteSelectionCommand::initializePositionData):
2937 (khtml::DeleteSelectionCommand::handleGeneralDelete):
2938 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
2939 (khtml::DeleteSelectionCommand::doApply):
2940 (khtml::InsertLineBreakCommand::doApply):
2941 (khtml::InsertParagraphSeparatorCommand::doApply):
2942 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
2943 (khtml::InsertTextCommand::input):
2944 (khtml::MoveSelectionCommand::doApply):
2945 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
2946 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
2947 (khtml::ReplaceSelectionCommand::doApply):
2948 (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
2949 (khtml::ReplaceSelectionCommand::updateNodesInserted):
2950 (khtml::TypingCommand::deleteKeyPressed):
2951 (khtml::TypingCommand::forwardDeleteKeyPressed):
2952 (khtml::TypingCommand::markMisspellingsAfterTyping):
2953 * khtml/editing/htmlediting.h:
2954 * khtml/editing/selection.cpp:
2955 (khtml::Selection::Selection):
2956 (khtml::Selection::init):
2957 (khtml::Selection::moveTo):
2958 (khtml::Selection::modifyExtendingRightForward):
2959 (khtml::Selection::modifyMovingRightForward):
2960 (khtml::Selection::modifyExtendingLeftBackward):
2961 (khtml::Selection::modifyMovingLeftBackward):
2962 (khtml::Selection::modify):
2963 (khtml::Selection::xPosForVerticalArrowNavigation):
2964 (khtml::Selection::clear):
2965 (khtml::Selection::setBase):
2966 (khtml::Selection::setExtent):
2967 (khtml::Selection::setBaseAndExtent):
2968 (khtml::Selection::layout):
2969 (khtml::Selection::validate):
2970 * khtml/editing/selection.h:
2971 (khtml::Selection::startAffinity):
2972 (khtml::Selection::endAffinity):
2973 (khtml::Selection::baseAffinity):
2974 (khtml::Selection::extentAffinity):
2975 (khtml::operator==):
2976 * khtml/editing/text_affinity.h:
2978 * khtml/editing/visible_position.cpp:
2979 (khtml::VisiblePosition::VisiblePosition):
2980 (khtml::VisiblePosition::init):
2981 (khtml::VisiblePosition::initUpstream):
2982 (khtml::VisiblePosition::initDownstream):
2983 (khtml::VisiblePosition::next):
2984 (khtml::VisiblePosition::previous):
2985 (khtml::startVisiblePosition):
2986 (khtml::endVisiblePosition):
2987 * khtml/editing/visible_position.h:
2988 (khtml::VisiblePosition::):
2989 (khtml::VisiblePosition::VisiblePosition):
2990 (khtml::VisiblePosition::affinity):
2991 (khtml::VisiblePosition::setAffinity):
2992 (khtml::operator==):
2993 * khtml/editing/visible_units.cpp:
2994 (khtml::previousBoundary):
2995 (khtml::nextBoundary):
2996 (khtml::startOfLine):
2998 (khtml::previousLinePosition):
2999 (khtml::nextLinePosition):
3000 (khtml::startOfParagraph):
3001 (khtml::endOfParagraph):
3002 (khtml::previousParagraphPosition):
3003 (khtml::nextParagraphPosition):
3004 (khtml::startOfBlock):
3005 (khtml::endOfBlock):
3006 (khtml::startOfDocument):
3007 (khtml::endOfDocument):
3008 * khtml/editing/visible_units.h:
3009 * khtml/khtml_part.cpp:
3010 (KHTMLPart::findTextNext):
3011 (KHTMLPart::selectClosestWordFromMouseEvent):
3012 (KHTMLPart::handleMousePressEventTripleClick):
3013 (KHTMLPart::handleMousePressEventSingleClick):
3014 (KHTMLPart::handleMouseMoveEventSelection):
3015 (KHTMLPart::khtmlMouseReleaseEvent):
3016 (KHTMLPart::selectAll):
3017 (KHTMLPart::computeAndSetTypingStyle):
3018 (KHTMLPart::selectionComputedStyle):
3019 * khtml/rendering/render_br.cpp:
3020 (RenderBR::positionForCoordinates):
3021 * khtml/xml/dom_docimpl.cpp:
3022 (DocumentImpl::updateSelection):
3023 * khtml/xml/dom_nodeimpl.cpp:
3024 (NodeBaseImpl::setFocus):
3025 * khtml/xml/dom_position.cpp:
3026 (DOM::Position::previousCharacterPosition):
3027 (DOM::Position::nextCharacterPosition):
3028 * khtml/xml/dom_position.h:
3029 * kwq/KWQAccObject.mm:
3030 (-[KWQAccObject value]):
3031 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
3032 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
3033 (-[KWQAccObject accessibilityAttributeValue:]):
3034 (-[KWQAccObject doAXLineForTextMarker:]):
3035 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
3036 (-[KWQAccObject doAXTextMarkerForPosition:]):
3037 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
3038 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
3039 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
3040 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
3041 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
3042 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
3043 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
3044 * kwq/KWQAccObjectCache.mm:
3045 (KWQAccObjectCache::textMarkerForVisiblePosition):
3046 (KWQAccObjectCache::visiblePositionForTextMarker):
3047 * kwq/KWQKHTMLPart.mm:
3048 (KWQKHTMLPart::findString):
3049 (KWQKHTMLPart::advanceToNextMisspelling):
3050 (KWQKHTMLPart::styleForSelectionStart):
3051 (KWQKHTMLPart::baseWritingDirectionForSelectionStart):
3052 (KWQKHTMLPart::setSelectionFromNone):
3053 (KWQKHTMLPart::respondToChangedSelection):
3054 * kwq/WebCoreBridge.mm:
3055 (-[WebCoreBridge setSelectedDOMRange:affinity:]):
3056 (-[WebCoreBridge selectionAffinity]):
3057 (-[WebCoreBridge setMarkDOMRange:]):
3058 (-[WebCoreBridge _visiblePositionForPoint:]):
3059 (-[WebCoreBridge moveDragCaretToPoint:]):
3060 (-[WebCoreBridge editableDOMRangeForPoint:]):
3061 (-[WebCoreBridge ensureSelectionVisible]):
3062 (-[WebCoreBridge rangeOfCharactersAroundCaret]):
3064 2005-02-09 Chris Blumenberg <cblu@apple.com>
3066 Fixed: <rdar://problem/3985211> Seed: Mail: Drag-and-drop destination indicator / insertion point disappears
3068 Reviewed by kocienda.
3070 * khtml/rendering/render_block.cpp:
3071 (khtml::RenderBlock::paintCaret): new
3072 (khtml::RenderBlock::paintObject): call paintCaret for the cursor caret and the drag caret
3073 * khtml/rendering/render_block.h:
3077 2005-02-08 Ken Kocienda <kocienda@apple.com>
3083 <rdar://problem/3996344> Entire document content is deleted when only the first paragraph was supposed to be
3085 Problem stems from my attempt to fix this bug: <rdar://problem/3986155> Insertion point goes
3086 to beginning of doc after deleting.
3088 I added an "optimization" that proved to do more harm than good. So, basically, the fix is to remove code.
3090 * khtml/editing/htmlediting.cpp:
3091 (khtml::DeleteSelectionCommand::handleGeneralDelete)
3093 2005-02-07 Darin Adler <darin@apple.com>
3097 - fixed <rdar://problem/3890352> REGRESSION (125-170, Panther-only): pasted textarea contents disappear (exception in NSText)
3099 * kwq/KWQTextArea.mm: (-[KWQTextArea tile]): Don't resize the text view immediately here.
3100 Use performWithDelay to defer it to avoid the re-entrancy that bothers the Panther version
3101 of NSTextView. On Tiger, leave the code alone.
3103 2005-02-07 Adele Amchan <adele@apple.com>
3107 Fix for <rdar://problem/3993628> REGRESSION (180-181): Logitelnet bank's website doesn't work
3109 This fixes an oversight in the fix for <rdar://problem/3964286>.
3110 We're now making sure there is a document before calling checkCompleted in slotLoaderRequestDone.
3111 That function is called even when other parts finish loads of their subresources, so we could end
3112 up calling checkCompleted before we had a document. We also looked over all the other calls to
3113 checkCompleted to convince ourselves no other call sites had a similar issue.
3115 * khtml/khtml_part.cpp: (KHTMLPart::slotLoaderRequestDone): Check if doc is nil before calling
3118 2005-02-07 Ken Kocienda <kocienda@apple.com>
3124 <rdar://problem/3953302> Replacing quoted text ends up with blue-colored text that is not quoted
3126 * khtml/editing/htmlediting.cpp:
3127 (khtml::DeleteSelectionCommand::doApply): Removed special case delete code for select all. It was
3128 causing as many bugs as it fixed. What's more, the design concept is a bit shaky. By removing
3129 this special case, the bug goes away.
3130 * khtml/editing/htmlediting.h: Remove declaration.
3132 Test results using selectAll() updated to reflect changed behavior.
3134 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
3135 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
3136 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
3137 * layout-tests/editing/inserting/insert-3654864-fix-expected.txt:
3138 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
3139 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt:
3140 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt:
3141 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
3143 2005-02-06 Darin Adler <darin@apple.com>
3147 - fixed <rdar://problem/3994164> setting a new style attribute with setAttribute("style") doesn't blow away the old style
3149 * khtml/css/css_valueimpl.h: Renamed parseProperty to parseDeclaration, since it's used to parse
3150 an entire style declaration, not a single property.
3151 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::parseDeclaration): Renamed,
3152 and added code to clear m_values.
3153 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Call function by its
3154 new name, and remove some unnecessary comments.
3156 2005-02-06 Darin Adler <darin@apple.com>
3160 - fixed <rdar://problem/3993722> need oncut and onpaste handlers implemented for <textarea> (needed for widgets)
3162 * kwq/KWQTextArea.mm:
3163 (-[KWQTextAreaTextView dispatchHTMLEvent:]): Added.
3164 (-[KWQTextAreaTextView cut:]): Dispatch "before cut" and "cut" events.
3165 (-[KWQTextAreaTextView copy:]): Dispatch "before copy" and "copy" events.
3166 (-[KWQTextAreaTextView paste:]): Dispatch "before paste" and "paste" events.
3167 (-[KWQTextAreaTextView pasteAsPlainText:]): Ditto.
3168 (-[KWQTextAreaTextView pasteAsRichText:]): Ditto.
3170 2005-02-06 Darin Adler <darin@apple.com>
3174 - fixed <rdar://problem/3943038> <input type=search> that is focused in onload handler doesn't have a visible editor
3176 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setFocusNode): Always update layout before giving focus to a widget.
3177 This prevents the bad case where we give a widget focus before it has been positioned or sized, causing us to
3178 exercise edge cases AppKit doesn't handle well.
3180 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Remove workaround code I added
3181 to fix bug 3943049. Updating the layout fixes the same problem in a cleaner, safer way, and solves another problem,
3182 with the way the clip view is set up.
3184 2005-02-06 Darin Adler <darin@apple.com>
3188 - fixed <rdar://problem/3425232> textarea won't trigger onchange action when clicking to new field
3190 * khtml/rendering/render_form.h: Added new m_dirty data member.
3191 * khtml/rendering/render_form.cpp:
3192 (RenderTextArea::RenderTextArea): Initialize m_dirty to false.
3193 (RenderTextArea::detach): Call value() on the DOM element to cause it to fetch the value from this object.
3194 (RenderTextArea::handleFocusOut): Ditto. Also send the onchange event based only on the m_dirty flag.
3195 (RenderTextArea::updateFromElement): Clear the m_dirty flag if the edited value is blown away by a value
3196 that comes from the DOM element. Remove code to clear the element's m_dirtyvalue flag; that's an unnecessary
3197 optimization, and ideally we'll stop having code in the render object that knows about that flag later.
3198 (RenderTextArea::slotTextChanged): Set the m_dirty flag.
3200 2005-02-06 Darin Adler <darin@apple.com>
3204 - re-fixed <rdar://problem/3760910> please add support for custom tag names in HTML
3206 * khtml/xml/dom_docimpl.cpp:
3207 (DocumentImpl::tagId): Use ID_LAST_TAG + 1 for the ID of the first assigned tag ID. Before we'd use ID_LAST_TAG,
3208 which resulted in the same number being used for ID_COMMENT and the first custom tag.
3209 (DocumentImpl::tagName): Use ID_LAST_TAG + 1, as above.
3210 (DocumentImpl::namespaceURI): Change a < ID_LAST_TAG to <= ID_LAST_TAG in the same spirit as above.
3212 2005-02-06 Darin Adler <darin@apple.com>
3216 - fixed <rdar://problem/3986639> Crash occurs after choosing Undo Typing from the Edit menu
3218 * kwq/KWQTextArea.mm: (-[KWQTextArea viewWillMoveToWindow:]): Remove actions from undo manager when the view is
3219 removed from the window. Unfortunately, to do this the code has to know that the target of NSTextView actions
3220 will be the text storage object, but given the NSText architecture, that's pretty clear.
3222 2005-02-05 Chris Blumenberg <cblu@apple.com>
3224 Fixed: <rdar://problem/3991974> REGRESSION: www.jabra.com world location screen does not work
3228 * kwq/KWQKJavaAppletWidget.mm:
3229 (KJavaAppletWidget::KJavaAppletWidget): fallback to the document's base URL if there is no baseURL attribute
3230 * kwq/WebCoreBridge.h:
3231 * kwq/WebCoreBridge.mm:
3232 (-[WebCoreBridge baseURL]): new
3234 2005-02-04 David Harrison <harrison@apple.com>
3238 Rolled out Ken's accidental checkin when committing <rdar://problem/3986155> fix yesterday.
3240 * khtml/editing/selection.cpp:
3241 (khtml::Selection::validate):
3243 2005-02-04 Adele Amchan <adele@apple.com>
3247 Fix for <rdar://problem/3758785> Safari no longer works at BankOfAmerica online banking for military users
3249 When closing the document, if a body doesn't exist we now create one. This bug was preventing the onload handler from
3250 firing in cases where there wasn't a body. In the BankOfAmerica case, the page was just a bit of script where the onload
3251 handler redirected to the correct page.
3253 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
3255 2005-02-03 Ken Kocienda <kocienda@apple.com>
3261 <rdar://problem/3986155> Insertion point goes to beginning of doc after deleting
3263 * khtml/editing/htmlediting.cpp:
3264 (khtml::DeleteSelectionCommand::setStartNode): New convenience to handle reference counting when setting.
3265 (khtml::DeleteSelectionCommand::handleGeneralDelete): This contains the crux of the bug fix. Improve tests
3266 that detect when a selected node needs to be retained, rather than deleted, to preserve the intent of the user.
3267 This has the side effect of causing the insertion point placement code to succeed rather than fail. Before
3268 this fix, the failure of the insertion point placement code caused the insertion point to jump to the start
3269 of the document, which is the symptom that can be perceived by users when editing.
3270 * khtml/editing/htmlediting.h: Add setStartNode declaration.
3271 * khtml/editing/visible_units.cpp:
3272 (khtml::startOfBlock): This function had a stubbed-in non-tested implementation. Implement and
3273 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001-expected.txt: Added.
3274 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001.html: Added.
3275 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt: Added.
3276 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002.html: Added.
3277 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt: Added.
3278 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003.html: Added.
3279 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt: Added.
3280 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004.html: Added.
3281 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005-expected.txt: Added.
3282 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005.html: Added.
3283 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006-expected.txt: Added.
3284 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006.html: Added.
3288 2005-02-03 Richard Williamson <rjw@apple.com>
3290 Fixed <rdar://problem/3987419> Stocks and Weather leak what appears to XMLHTTPRequest results
3292 XMLHTTPRequests were causing massive leaks. _webcore_initWithHeaderString: did funky things with
3293 self replacement. Re-wrote to use more traditional factory constructor avoiding self replacement.
3295 Reviewed by David Harrison.
3298 (+[NSDictionary _webcore_dictionaryWithHeaderString:]):
3300 (KWQServeSynchronousRequest):
3302 2005-02-03 Chris Blumenberg <cblu@apple.com>
3304 Fixed: <rdar://problem/3938763> Cannot view Windows Media Player videos (soundtrack is played twice with delay)
3308 * khtml/html/html_objectimpl.cpp:
3309 (HTMLObjectElementImpl::attach): set needWidgetUpdate to false right after calling updateWidget because dispatchHTMLEvent can end up calling this method again
3310 (HTMLObjectElementImpl::recalcStyle): ditto
3312 2005-02-02 John Sullivan <sullivan@apple.com>
3316 - WebCore part of fix for <rdar://problem/3980651> REGRESSION (125-180): Huge number of pages printed from certain page,
3319 This also fixes the problems with printing from GMail, yay!