1 2005-03-07 Ken Kocienda <kocienda@apple.com>
7 <rdar://problem/4040136> Expose SPI for WebCore's functions to create document fragments from plain text and markup strings
9 * kwq/DOMHTML.mm: Add two new SPI functions.
10 (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:])
11 (-[DOMHTMLDocument _createDocumentFragmentWithText:])
12 * kwq/DOMPrivate.h: Declare the new SPI here, a privately-exported header, so Mail can make use of it.
14 2005-03-07 Ken Kocienda <kocienda@apple.com>
20 <rdar://problem/4039676> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date
22 * khtml/editing/htmlediting.cpp:
23 (khtml::ReplaceSelectionCommand::doApply): Code to "eat" a <br> element, that was creating an otherwise empty line, was running
24 when it should not. If the content being pasted in does not end in a "logical" newline itself, then the <br> already
25 in the content needs to be preserved. A simple one-line change now sees to this.
27 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: This test now has an extra, but harmless,
28 <br> at the end of a paragraph. This makes sense given the code change.
31 * layout-tests/editing/pasteboard/paste-text-018-expected.txt: Added.
32 * layout-tests/editing/pasteboard/paste-text-018.html: Added.
34 2005-03-07 Ken Kocienda <kocienda@apple.com>
40 <rdar://problem/4035648> REGRESSION (Mail): line feed in source HTML file causes bad copy/paste behavior
42 The createMarkup() function in markup.cpp iterates over the nodes in a range,
43 and does some bookkeeping to figure out when to add close tags to the markup.
44 Some code added at the start of the loop to prevent markup from being written
45 for unrendered nodes short-circuited the rest of the loop, and so prevented
46 the close-tag-writing code from running when it should.
48 This is why the "plain" text wound up inside of the bold tag in the example
49 above. The addition of the unrendered return character caused an incorrect
50 delay in the close tag for the bold element from being written out, with the
51 result being that it wound up including additional content.
53 The fix is to add checks for node renderers throughout the loop at the points
54 where markup is written out for each node. This allows the additional close
55 tag logic to run as needed.
57 All layout tests pass with this change.
59 * khtml/editing/markup.cpp:
64 * layout-tests/editing/pasteboard/paste-4035648-fix-expected.txt: Added.
65 * layout-tests/editing/pasteboard/paste-4035648-fix.html: Added.
67 2005-03-06 Christy Warren kali@appple.com
71 * khtml/rendering/render_text.cpp:
72 (lastRendererOnPrevLine): helper for RenderText::caretRect
73 (RenderText::caretRect): added code to properly handle bidi ordered text boxes
75 2005-03-06 Christy Warren <set EMAIL_ADDRESS environment variable>
79 * khtml/editing/visible_position.cpp: Eliminated code that cuts off searching through the text boxes based on an assumption that breaks under bidi
80 (khtml::VisiblePosition::isCandidate):
81 * kwq/KWQFontMetrics.mm:
82 (QFontMetrics::checkSelectionPoint): Made the initialization of the WebCoreStyle honor the reversed flag
84 2005-03-05 John Sullivan <sullivan@apple.com>
88 - fixed <rdar://problem/4038417> Mail crashed in StyleChange::checkForLegacyHTMLStyleChange
89 when composing a reply
91 * khtml/editing/htmlediting.cpp:
92 (khtml::StyleChange::checkForLegacyHTMLStyleChange):
93 Added missing nil check.
95 2005-03-05 Darin Adler <darin@apple.com>
99 - fixed <rdar://problem/4038478> Crash in renderer viewing RSS feed at feed://wvs.topleftpixel.com/index.rdf
101 * khtml/xml/dom_docimpl.cpp: (widgetForNode): Check for nil before going from node to renderer.
103 2005-03-05 Darin Adler <darin@apple.com>
107 - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk
109 * khtml/rendering/render_text.cpp:
110 (getCharacterBreakIterator): Added. Helper that sets up an iterator for the passed-in text.
111 Shares a single global iterator (fast, albeit not thread-safe).
112 (RenderText::previousOffset): Changed to call getCharacterBreakIterator.
113 (RenderText::nextOffset): Ditto.
115 2005-03-05 Ken Kocienda <kocienda@apple.com>
121 <rdar://problem/4038267> REGRESSION (Mail): Crash copying and pasting end of paragraph
123 Code to handle content that has a "logical" newline at the end of the pasted content, and the code
124 to adjust the selection at the end of the paste operation made an assumption that at least one
125 node had been inserted by the paste command. This is not necessarily true in the case where the sole content
126 in the pasted content is one of these "logical" newlines. Adjust some code around so that we don't deref
127 null, but still adjust the selection correctly for this case. In each of the two functions below, some
128 null checks have been added, and some code has been rearranged a little bit to continue on through
129 the end of completeHTMLReplacement, even if no nodes have been inserted. The patch looks bigger and more
130 complicated than the conceptual change.
132 * khtml/editing/htmlediting.cpp:
133 (khtml::ReplaceSelectionCommand::doApply)
134 (khtml::ReplaceSelectionCommand::completeHTMLReplacement)
136 * layout-tests/editing/pasteboard/paste-4038267-fix-expected.txt: Added.
137 * layout-tests/editing/pasteboard/paste-4038267-fix.html: Added.
139 2005-03-05 Darin Adler <darin@apple.com>
143 - fixed <rdar://problem/4025918> images copied from Safari with relative src URLs aren't pasted into Mail messages (KURL resolves base URLs incorrectly)
145 * kwq/KWQKURL.mm: (KURL::KURL): Add a slash at the start of the path if a relative part is adding
146 a path onto a URL that has "pre-path" bits like host name, but no path yet. This doesn't come up
147 for http because in that case we add a trailing "/" as part of canonicalization.
149 2005-03-04 John Sullivan <sullivan@apple.com>
153 - fixed <rdar://problem/4033705> REGRESSION (Mail): Copy/Paste from Excel
154 crashes Mail in KWQKHTMLPart::fontForSelection(bool*) const + 232
156 * kwq/KWQKHTMLPart.mm:
157 (KWQKHTMLPart::fontForSelection):
158 Check for nil startNode, not just nil renderer.
160 2005-03-04 David Harrison <harrison@apple.com>
162 Reviewed by Ken, Richard.
164 <rdar://problem/3996383> REGRESSION (Mail): Deleting all of first line also deletes line ending
166 Problem was the placeholder check was based on 0 height block, but the block in this
167 case is the BODY, which has other content even though the paragraph is gone.
169 * khtml/editing/htmlediting.cpp:
170 (khtml::CompositeEditCommand::insertBlockPlaceholder):
171 Now does insert instead of append!
173 (khtml::CompositeEditCommand::appendBlockPlaceholder):
174 New. Actually does append.
176 (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
177 Renamed from insertBlockPlaceholderIfNeeded because it can insert or append. Also accepts "force insert" flag.
179 (khtml::CompositeEditCommand::removeBlockPlaceholder):
180 Renamed for succinctness from removeBlockPlaceholderIfNeeded.
182 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
183 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
186 (khtml::DeleteSelectionCommand::doApply):
187 Use addBlockPlaceholderIfNeeded "force insert" flag if deleting whole paragraphs did not leave an empty one.
189 (khtml::InsertParagraphSeparatorCommand::doApply):
190 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
191 (khtml::InsertTextCommand::input):
194 * khtml/editing/htmlediting.h:
195 Renamed and new methods per above.
198 2005-03-04 Chris Blumenberg <cblu@apple.com>
200 Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after pasting attachment at end of message
204 * khtml/editing/visible_units.cpp:
205 (khtml::endOfParagraph): don't consider text nodes that have no rendered characters
207 2005-03-04 Richard Williamson <rjw@apple.com>
209 Fixed <rdar://problem/4034764> REGRESSION(125-188)Viewing text/plain page and going back/forward corrupts HTML pages (google.com)
211 The parse mode wasn't be restored to the document when going
216 * kwq/KWQKHTMLPart.mm:
217 (KWQKHTMLPart::openURLFromPageCache):
218 * kwq/KWQPageState.h:
219 * kwq/KWQPageState.mm:
220 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]):
222 2005-03-04 Ken Kocienda <kocienda@apple.com>
226 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Shame on me!
227 I landed my last fix without running layout tests. This one changes in a subtle, but
230 2005-03-04 Ken Kocienda <kocienda@apple.com>
236 <rdar://problem/4032543> REGRESSION (Mail): Mail hangs when quoted text is pasted twice
238 This code change fixes the bug in a non-obvious way. The root cause of the problem was
239 that a VisiblePosition created using an affinity originating in Mail code caused
240 two VisiblePosition objects that should have been equal to differ only in their
241 affinities, which in turn caused us to run a code path that should not have run.
243 * khtml/editing/visible_position.cpp:
244 (khtml::VisiblePosition::VisiblePosition): Added copy constructor.
245 (khtml::VisiblePosition::next): Factored out inline code that used to be here into new
246 setAffinityUsingLinePosition() function.
247 (khtml::isEqualIgnoringAffinity): New helper to handle cases when affinity in equality check does
248 not matter. However, we want to know about such cases where a VisiblePosition differs only by affinity,
249 and the code will assert in development when this happens.
250 (khtml::isNotEqualIgnoringAffinity): Ditto, but not. :)
251 (khtml::setAffinityUsingLinePosition): New helper function mentioned above. This will "correct"
252 upstream affinity to downstream if the affinity does not make a difference for the position.
253 * khtml/editing/visible_position.h:
254 * khtml/editing/visible_range.h: Wacky bug. The operator== for this class took VisiblePosition classes!
255 * khtml/editing/visible_units.cpp:
256 (khtml::isStartOfParagraph): Now performs equality check without regard to affinity.
257 (khtml::isEndOfParagraph): Ditto.
258 (khtml::isStartOfBlock): Ditto.
259 (khtml::isEndOfBlock): Ditto.
260 * kwq/WebCoreBridge.mm:
261 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Adjusts the affinity using setAffinityUsingLinePosition()
264 2005-03-04 Darin Adler <darin@apple.com>
268 - fixed <rdar://problem/4036817> REGRESSION: ctrl-y broken when a line + carriage return cut
270 * khtml/editing/htmlediting.h: Added insertTextRunWithoutNewlines.
271 * khtml/editing/htmlediting.cpp:
272 (khtml::InsertTextCommand::input): Added assertion to make sure strings with newlines don't get
274 (khtml::TypingCommand::insertText): Added. Takes the name of the old function, but is a new
275 level that breaks runs into lines and inserts each one separately.
276 (khtml::TypingCommand::insertTextRunWithoutNewlines): Renamed old insertText to this.
278 * khtml/dom/dom_string.h: Made substring be a const member function.
279 * khtml/dom/dom_string.cpp: (DOM::DOMString::substring): Made this const.
281 2005-03-04 Darin Adler <darin@apple.com>
285 - fixed <rdar://problem/4020413> REGRESSION (Mail): can't use fonts with names that start with "#" in Mail (Korean fonts)
287 * khtml/css/css_valueimpl.cpp:
288 (DOM::isLegalIdentifier): Added. Commented out and not used.
289 (DOM::quoteStringIfNeeded): Quotes the string if needed. For now only if it starts with "#".
290 (DOM::CSSPrimitiveValueImpl::cssText): Call quoteStringIfNeeded when asked for cssText for an arbitrary string, since we
291 need text you can re-parse.
292 (DOM::FontFamilyValueImpl::cssText): Ditto.
294 * khtml/editing/markup.cpp:
295 (khtml::startMarkup): Added comments about lack of quoting for attributes.
296 (khtml::createMarkup): Ditto.
298 2005-03-04 Adele Amchan <adele@apple.com>
302 Fix for <rdar://problem/4021711> REGRESSION(125-188) blank pages when browsing forum at cooperativeresearch.org - cached external script problem
304 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::scriptHandler): set flag needToRefCachedScript so we can make sure
305 notifyFinished is called after pendingSrc is set up with the right data from the cached script
307 2005-03-04 Ken Kocienda <kocienda@apple.com>
313 <rdar://problem/4029632> Tiger 8A398:- Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
315 * khtml/editing/htmlediting.cpp:
316 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): VisiblePosition constructor
317 was failing to yield a position for a node just pasted into the document since a layout was needed
318 for the calculation to come out right. Layout added. Crash gone.
322 2005-03-03 Chris Blumenberg <cblu@apple.com>
324 Fixed: <rdar://problem/3992803> Cannot navigate through list items with the keyboard, you're stuck in the same <li> block unless you click out
326 Reviewed by harrison.
328 * khtml/rendering/render_line.cpp:
329 (khtml::RootInlineBox::closestLeafChildForXPos): avoid returning list markers when possible. Also improved heuristic for returning the best InlineBox given the passed X position.
332 2005-03-03 Ken Kocienda <kocienda@apple.com>
338 <rdar://problem/4035198> Pasting text with different styles does not get reproducible results
340 I had a good idea yesterday to improve the way we "fixup" styles after
341 pasting, but i chose a poor data structure to do it, a map of
342 nodes-to-styles. In the fixup step, I iterated over the map elements and
343 did the fixup. However, since the order in which the items would come
344 out of the map is indeterminate, we got unpredictable results.
346 So, the concept was good, but the implementation was flawed. I have
347 fixed this mapping to be a list instead, so the order that nodes are
348 evaluated in the fixup step is document order. This works nicely.
350 * khtml/editing/htmlediting.cpp:
351 (khtml::ReplacementFragment::~ReplacementFragment): No longer need to explicity deref nodes and
352 styles saved away for later fixup. This is now handled by the new NodeDesiredStyle class.
353 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls computeAndStoreNodeDesiredStyle,
354 function renamed from mapDesiredStyleForNode.
355 Now accepts a QValueList<NodeDesiredStyle> in place of the old map.
356 (khtml::NodeDesiredStyle::NodeDesiredStyle): New class that represents a node-to-style mapping.
357 (khtml::NodeDesiredStyle::~NodeDesiredStyle): Ditto.
358 (khtml::NodeDesiredStyle::operator=): Ditto.
359 (khtml::ReplaceSelectionCommand::doApply): Now calls computeAndStoreNodeDesiredStyle,
360 function renamed from mapDesiredStyleForNode.
361 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Now operates on a QValueList<NodeDesiredStyle> in
362 place of the old map.
363 (khtml::computeAndStoreNodeDesiredStyle): Renamed from mapDesiredStyleForNode. Now operates on a
364 QValueList<NodeDesiredStyle> in place of the old map.
365 * khtml/editing/htmlediting.h:
366 (khtml::NodeDesiredStyle): New class that represents a node-to-style mapping.
367 (khtml::ReplacementFragment::desiredStyles): Now returns a QValueList<NodeDesiredStyle> in place of the old map.
369 * layout-tests/editing/style/typing-style-003-expected.txt: Results changed in an acceptable way.
371 2005-03-02 Darin Adler <darin@apple.com>
375 - fixed <rdar://problem/4029741> REGRESSION (188-189): <input type=text> are cleared when you hide/show them
377 * khtml/html/html_formimpl.h: Added detach functions for both input and text area elements, since
378 both have m_valueMatchesRenderer flags.
379 * khtml/html/html_formimpl.cpp:
380 (DOM::HTMLInputElementImpl::detach): Set m_valueMatchesRenderer to false, since the renderer is going away.
381 (DOM::HTMLTextAreaElementImpl::detach): Ditto.
383 2005-03-02 Ken Kocienda <kocienda@apple.com>
389 <rdar://problem/4006151> in reply, caret moves to next line after toggling bold style then typing
391 * khtml/editing/htmlediting.cpp:
392 (khtml::ApplyStyleCommand::applyInlineStyle): Defer cleaning up empty style until the end of the
393 function. In some situations, the render tree can get confused when we do this removal up front.
394 I wish I understood the reasons more deeply, but this bit of code shuffling seems harmless, and
397 2005-03-02 Darin Adler <darin@apple.com>
401 - fixed <rdar://problem/4024966> crash happened twice in [KWQTextField setHasFocus:] + 0xe8
403 Added more nil checks to the widget implementations. Anywhere a widget pointer is used, do a nil check,
404 rather than relying on high level assumptions about which calls can and can't destroy the HTML element
405 (and hence the widget). The case in the bug seems to be a case where scrolling destroyed the element.
406 We can't be sure this fixes the bug, but we can be relatively sure we didn't introduce any new problems,
407 because this just avoids nil-dereferencing.
410 (-[KWQButton becomeFirstResponder]):
411 (-[KWQButton nextKeyView]):
412 (-[KWQButton previousKeyView]):
414 (-[KWQTableView mouseDown:]):
415 (-[KWQTableView becomeFirstResponder]):
416 (-[KWQTableView numberOfRowsInTableView:]):
417 (-[KWQTableView tableViewSelectionDidChange:]):
418 (-[KWQTableView tableView:shouldSelectRow:]):
419 (-[KWQTableView selectionShouldChangeInTableView:]):
420 * kwq/KWQScrollBar.mm:
421 (-[KWQScrollBar scroll:]):
423 (-[KWQSlider mouseDown:]):
424 (-[KWQSlider slide:]):
425 (-[KWQSlider becomeFirstResponder]):
426 (-[KWQSlider nextKeyView]):
427 (-[KWQSlider previousKeyView]):
428 * kwq/KWQTextArea.mm:
429 (-[KWQTextAreaTextView becomeFirstResponder]):
430 (-[KWQTextAreaTextView resignFirstResponder]):
431 (-[KWQTextAreaTextView mouseDown:]):
432 * kwq/KWQTextField.mm:
433 (-[KWQTextFieldController action:]):
434 (-[KWQTextFieldController controlTextDidEndEditing:]):
435 (-[KWQTextFieldController controlTextDidChange:]):
436 (-[KWQTextFieldController textView:didHandleEvent:]):
437 (-[KWQTextFieldController setHasFocus:]):
439 2005-03-02 Richard Williamson <rjw@apple.com>
441 Fixed <rdar://problem/4031483> Leak (RenderObject::createInlineBox) reproducible with Stock widget
443 We were leaking inline block line boxes. Argh!
447 * khtml/rendering/render_flow.cpp:
448 (RenderFlow::dirtyLineBoxes):
449 * khtml/rendering/render_line.cpp:
450 (khtml::InlineBox::deleteLine):
452 2005-03-02 Chris Blumenberg <cblu@apple.com>
454 Fixed: <rdar://problem/3976872> REGRESSION (Mail): Pasted plain text doesn't get the proper style if pasted into newlines
456 Reviewed by kocienda.
458 * khtml/editing/htmlediting.cpp:
459 (khtml::EditCommand::styleAtPosition): new, factored out from calculateStyleBeforeInsertion
460 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): call styleAtPosition
461 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): clear new m_insertionStyle ivar
462 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): deref new m_insertionStyle ivar
463 (khtml::ReplaceSelectionCommand::doApply): store the style so it later be applied when matching style
464 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply style from m_insertionStyle when matching style
465 * khtml/editing/htmlediting.h:
467 2005-03-02 Maciej Stachowiak <mjs@apple.com>
471 <rdar://problem/4031718> REGRESSION (401-401+): Safari reproducible crash setting up scope in JSLazyEventListener::parseCode authenticating to bugweb
473 * khtml/ecma/kjs_events.cpp:
474 (JSLazyEventListener::parseCode): If originalNode is NULL, don't
475 mess with the scope chain.
477 * khtml/html/html_baseimpl.cpp:
478 (HTMLBodyElementImpl::parseHTMLAttribute): For handlers that are
479 delcared on body but set on the document, pass NULL to avoid
480 swizzling the scope chain. It turns out that this is what browsers
481 do, and it finesses the crash.
483 2005-03-02 David Harrison <harrison@apple.com>
487 <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget
489 * khtml/editing/htmlediting.cpp:
490 (khtml::ReplaceSelectionCommand::doApply):
492 2005-03-02 Ken Kocienda <kocienda@apple.com>
497 <rdar://problem/4020574> REGRESSION (Mail): copy/paste first part of reply-quoted text alters downstream style
499 The problem was that the operation to move nodes following the newly-pasted nodes did not preserve the
500 style of these moved nodes. I have generalized some of the functions that compute and preserve styles
501 for nodes and then apply these styles after a DOM operation.
503 * khtml/editing/htmlediting.cpp:
504 (khtml::ReplacementFragment::~ReplacementFragment): Call new derefNodesAndStylesInMap() helper function
505 in place of old code that had this deref'ing inline.
506 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls new mapDesiredStyleForNode() helper
507 function place of old code that had this style computation inline.
508 (khtml::ReplacementFragment::removeStyleNodes): Updated comment for new helper name.
509 (khtml::ReplaceSelectionCommand::doApply): Now calls new helpers in place of helpers whose names were changed,
510 or in place of pre-refactored inline code.
511 (khtml::ReplaceSelectionCommand::fixupNodeStyles): Renamed from applyStyleToInsertedNodes(). Now generalized
512 to take the map of nodes to use for the fixup. This makes it possible to call this code with different maps,
513 and that is needed to fix the bug.
514 (khtml::mapDesiredStyleForNode): New helper function to compute the inheritable styles for a given node
515 and map this style to the given node in the given map. This function now also includes the code that was
516 in the removeBlockquoteColorsIfNeeded(). This latter helper has now been removed.
517 (khtml::derefNodesAndStylesInMap): Simple helper to deref map members.
518 * khtml/editing/htmlediting.h:
519 (khtml::ReplacementFragment::desiredStyles): New helper to return map of nodes-to-desiredStyles.
521 2005-03-01 Ken Kocienda <kocienda@apple.com>
527 <rdar://problem/4011358> REGRESSION(Mail): after dragging text to mail message and deleting, typing or dragging new text doesn't work
529 * khtml/editing/visible_position.cpp:
530 (khtml::VisiblePosition::isCandidate): Insertion point disappearing was due to a failed
531 check here after deleting all the content in the body element. The special "empty block"
532 needs to add check for DOM children. A block may have straggling anonymous render children in
533 some cases, and so the check needs to be (!DOM-kids || !render-kids).
535 Also, I botched the last checkin trying to split these two patches in my tree. Wrong layout tests
536 got checked in, I checked in a conflict marker in the Changelog, etc. I fixed everything with this checkin.
538 2005-03-01 Ken Kocienda <kocienda@apple.com>
542 Improved fix for this bug:
544 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
546 Maciej and I discussed this situation at length, and we came up with a better fix than I did earlier.
548 * khtml/editing/htmlediting.cpp:
549 (khtml::InsertParagraphSeparatorCommand::doApply): Simplify one special case so that it only handles the
550 "last in block" situation. Remove special case for "downstream node is in different block" and handle
551 this case with a little bit of special code in the general insertion case.
553 Results studied to make sure there were no problems.
555 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt
556 * layout-tests/editing/inserting/insert-div-001-expected.txt
557 * layout-tests/editing/inserting/insert-div-002-expected.txt
558 * layout-tests/editing/inserting/insert-div-004-expected.txt
559 * layout-tests/editing/inserting/insert-div-005-expected.txt
560 * layout-tests/editing/inserting/insert-div-009-expected.txt
561 * layout-tests/editing/inserting/insert-div-014-expected.txt
562 * layout-tests/editing/inserting/insert-div-018-expected.txt
563 * layout-tests/editing/inserting/insert-div-024-expected.txt
564 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
565 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
566 * layout-tests/editing/pasteboard/paste-text-015-expected.txt
567 * layout-tests/editing/style/block-style-004-expected.txt
568 * layout-tests/editing/style/block-style-005-expected.txt
569 * layout-tests/editing/style/block-style-006-expected.txt
573 * layout-tests/editing/inserting/insert-div-027.html
574 * layout-tests/editing/inserting/insert-div-027-expected.txt
576 2005-03-01 David Hyatt <hyatt@apple.com>
578 Fix for 4030890, regression with <sup> on Google. Fix some bogus != comparison checks in verticalPositionHint.
582 (RenderObject::getVerticalPosition):
584 2005-03-01 Chris Blumenberg <cblu@apple.com>
586 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
590 * khtml/editing/htmlediting.cpp:
591 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
592 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
593 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
594 * layout-tests/editing/deleting/smart-delete-001.html: Added.
595 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
596 * layout-tests/editing/deleting/smart-delete-002.html: Added.
598 2005-03-01 Richard Williamson <rjw@apple.com>
600 Fixed <rdar://problem/4029772> Weather widgets use a lot of memory (more that other widgets)
602 The string objects created by KWQHeaderStringFromDictionary() leaked.
604 Reviewed by John Louch.
607 (KWQHeaderStringFromDictionary):
609 2005-03-01 Jens Alfke <jens@apple.com>
613 <rdar://problem/4004531> Simple Sun Signed Applet throws exceptions; doesn't run
614 Two fixes for the way we extract the parameter-y goodness from <object> tags.
616 * khtml/rendering/render_frames.cpp:
617 (RenderPartObject::updateWidget):
619 2005-03-01 Richard Williamson <rjw@apple.com>
621 Fixed <rdar://problem/3990258> REGRESSION (125.12-181): top of picture that spans two pages is cut off on print from Safari
623 The problem was due to incorrect "object truncation" in RenderFlow::paintLines.
624 We attempt to push objects down if they don't fit on a page at
625 paint time. If the attempt to push object down failed we just
630 * khtml/rendering/render_flow.cpp:
631 (RenderFlow::paintLines):
634 2005-03-01 Chris Blumenberg <cblu@apple.com>
636 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
640 * khtml/editing/htmlediting.cpp:
641 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
642 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
643 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
644 * layout-tests/editing/deleting/smart-delete-001.html: Added.
645 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
646 * layout-tests/editing/deleting/smart-delete-002.html: Added.
648 2005-03-01 Ken Kocienda <kocienda@apple.com>
654 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
656 * khtml/editing/htmlediting.cpp:
657 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
659 2005-03-01 Maciej Stachowiak <mjs@apple.com>
663 <rdar://problem/4003774> REGRESSION(125-181): JavaScript problems @ Yankee/Dixie quiz
665 Reworked how scopes are set up for event handlers to match other
666 browser. This includes the following changes:
668 - Special scope entries are set up at the time the event handler
669 is created, not at the time it fires.
671 - Special scope is only set up for event handlers set in the html
672 source through an html attribute, not for handlers set using
673 addEventHandler or setting JS properties like onclick through
676 - Special scope is based on the DOM node on which the handler is
677 an attribute, not the event target.
679 This fixes the regression while allowing the fix to
680 <rdar://problem/3798453> (DIG: getting variable with same name as
681 DOM element attribute gets attribute value instead) to keep
684 * khtml/ecma/kjs_events.cpp:
685 (JSEventListener::handleEvent):
686 (JSLazyEventListener::JSLazyEventListener):
687 (JSLazyEventListener::parseCode):
688 * khtml/ecma/kjs_events.h:
689 * khtml/ecma/kjs_proxy.cpp:
690 (KJSProxyImpl::createHTMLEventHandler):
691 * khtml/ecma/kjs_proxy.h:
692 * khtml/ecma/kjs_window.cpp:
693 (Window::getJSLazyEventListener):
694 * khtml/ecma/kjs_window.h:
695 * khtml/html/html_baseimpl.cpp:
696 (HTMLBodyElementImpl::parseHTMLAttribute):
697 (HTMLFrameElementImpl::parseHTMLAttribute):
698 (HTMLFrameSetElementImpl::parseHTMLAttribute):
699 * khtml/html/html_elementimpl.cpp:
700 (HTMLElementImpl::parseHTMLAttribute):
701 * khtml/html/html_formimpl.cpp:
702 (DOM::HTMLFormElementImpl::parseHTMLAttribute):
703 (DOM::HTMLButtonElementImpl::parseHTMLAttribute):
704 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
705 (DOM::HTMLLabelElementImpl::parseHTMLAttribute):
706 (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
707 (DOM::HTMLTextAreaElementImpl::parseHTMLAttribute):
708 * khtml/html/html_imageimpl.cpp:
709 (HTMLImageElementImpl::parseHTMLAttribute):
710 * khtml/html/html_objectimpl.cpp:
711 (HTMLObjectElementImpl::parseHTMLAttribute):
712 * khtml/khtml_part.cpp:
713 (KHTMLPart::createHTMLEventListener):
714 * khtml/khtml_part.h:
715 * khtml/xml/dom_docimpl.cpp:
716 (DocumentImpl::createHTMLEventListener):
717 * khtml/xml/dom_docimpl.h:
721 2005-03-01 Chris Blumenberg <cblu@apple.com>
723 Backed out my patch since the tree was closed.
725 * khtml/editing/htmlediting.cpp:
726 (khtml::DeleteSelectionCommand::initializePositionData):
727 * khtml/editing/jsediting.cpp:
729 2005-03-01 Chris Blumenberg <cblu@apple.com>
731 Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content
735 * khtml/editing/htmlediting.cpp:
736 (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
737 * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
738 * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
739 * layout-tests/editing/deleting/smart-delete-001.html: Added.
740 * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
741 * layout-tests/editing/deleting/smart-delete-002.html: Added.
743 2005-03-01 Ken Kocienda <kocienda@apple.com>
749 <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document
751 * khtml/editing/htmlediting.cpp:
752 (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.
754 2005-03-01 David Harrison <harrison@apple.com>
758 <rdar://problem/3915560> Mail would like an SPI to enable "smart" text paste/drop
760 * kwq/WebCoreBridge.h:
761 * kwq/WebCoreBridge.mm:
762 (-[WebCoreBridge smartDeleteRangeForProposedRange:]):
763 (-[WebCoreBridge smartInsertForString:replacingRange:beforeString:afterString:]):
766 2005-03-01 Chris Blumenberg <cblu@apple.com>
768 Fixed: <rdar://problem/4030404> selection granularity should be set when extending selection via JS
770 Reviewed by kocienda.
772 * khtml/ecma/kjs_window.cpp:
773 (SelectionFunc::tryCall): set the granularity on the part. This will allow us to write smart paste layout tests.
774 * layout-tests/editing/pasteboard/smart-paste-001-expected.txt: Added.
775 * layout-tests/editing/pasteboard/smart-paste-001.html: Added.
776 * layout-tests/editing/pasteboard/smart-paste-002-expected.txt: Added.
777 * layout-tests/editing/pasteboard/smart-paste-002.html: Added.
778 * layout-tests/editing/pasteboard/smart-paste-003-expected.txt: Added.
779 * layout-tests/editing/pasteboard/smart-paste-003.html: Added.
780 * layout-tests/editing/pasteboard/smart-paste-004-expected.txt: Added.
781 * layout-tests/editing/pasteboard/smart-paste-004.html: Added.
782 * layout-tests/editing/pasteboard/smart-paste-005-expected.txt: Added.
783 * layout-tests/editing/pasteboard/smart-paste-005.html: Added.
784 * layout-tests/editing/pasteboard/smart-paste-006-expected.txt: Added.
785 * layout-tests/editing/pasteboard/smart-paste-006.html: Added.
786 * layout-tests/editing/pasteboard/smart-paste-007-expected.txt: Added.
787 * layout-tests/editing/pasteboard/smart-paste-007.html: Added.
789 2005-03-01 Chris Blumenberg <cblu@apple.com>
791 Fixed: <rdar://problem/4029934> smart paste with plain text can add too many spaces
793 Reviewed by kocienda.
795 * khtml/editing/htmlediting.cpp:
796 (khtml::ReplaceSelectionCommand::doApply): pass true for treatNBSPAsWhitespace to leadingWhitespacePosition and trailingWhitespacePosition
797 * khtml/xml/dom_position.cpp:
798 (DOM::isWS): take treatNBSPAsWhitespace param
799 (DOM::Position::leadingWhitespacePosition): ditto
800 (DOM::Position::trailingWhitespacePosition): ditto
801 * khtml/xml/dom_position.h:
803 2005-03-01 Ken Kocienda <kocienda@apple.com>
809 <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML
811 * khtml/editing/htmlediting.cpp:
812 (khtml::InsertParagraphSeparatorCommand::doApply): Look for the upstream-most block to insert after
813 when at the visible end of a block. This helps to avoid some undesirable sequences of markup which
814 Dave says will be vary hard to render. Changing the command in this way avoids the "limitations"
815 of the render tree by not asking it to render markup we do not want to make anyway.
817 All these tests change, but either in insignificant ways, or for the better.
819 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt:
820 * layout-tests/editing/inserting/insert-div-001-expected.txt:
821 * layout-tests/editing/inserting/insert-div-002-expected.txt:
822 * layout-tests/editing/inserting/insert-div-004-expected.txt:
823 * layout-tests/editing/inserting/insert-div-005-expected.txt:
824 * layout-tests/editing/inserting/insert-div-009-expected.txt:
825 * layout-tests/editing/inserting/insert-div-024-expected.txt:
826 * layout-tests/editing/pasteboard/paste-text-011-expected.txt:
827 * layout-tests/editing/pasteboard/paste-text-013-expected.txt:
828 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
829 * layout-tests/editing/style/block-style-004-expected.txt:
830 * layout-tests/editing/style/block-style-005-expected.txt:
831 * layout-tests/editing/style/block-style-006-expected.txt:
832 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt:
833 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt:
834 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt:
835 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt:
837 New test to check specific problem mentioned in the bug.
839 * layout-tests/editing/inserting/insert-div-026-expected.txt: Added.
840 * layout-tests/editing/inserting/insert-div-026.html: Added.
842 2005-02-28 Maciej Stachowiak <mjs@apple.com>
846 <rdar://problem/4002864> REGRESSION(125-146) getElementById in onload fails in a test case involving external resources
848 Moved management of elementById hashtable from attach/detach to
849 insertedIntoDocument/removedFromDocument, to avoid being thrown
850 off by temporary detaches due to style recalcs.
852 * khtml/xml/dom_elementimpl.cpp:
853 (ElementImpl::insertedIntoDocument):
854 (ElementImpl::removedFromDocument):
855 (ElementImpl::attach):
856 (ElementImpl::updateId):
857 * khtml/xml/dom_elementimpl.h:
859 Make sure that insertedIntoDocument is called before firing any
862 * khtml/xml/dom_nodeimpl.cpp:
863 (NodeBaseImpl::dispatchChildInsertedEvents):
865 2005-02-28 David Hyatt <hyatt@apple.com>
867 Fix for 4028999, safari crashes when resetting if mallocsribble is on. Clip rects were being cleared using dead
868 render objects. Change the ordering.
872 * khtml/rendering/render_box.cpp:
874 * khtml/rendering/render_layer.cpp:
875 (RenderLayer::~RenderLayer):
877 2005-02-28 Chris Blumenberg <cblu@apple.com>
879 Fixed: <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
881 Reviewed by kocienda.
883 * khtml/editing/htmlediting.cpp:
884 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Call updateLayout so caretMinOffset and caretMaxOffset return correct values.
886 2005-02-28 John Sullivan <sullivan@apple.com>
890 - WebCore part of fix for <rdar://problem/4023490> REGRESSION (125-185): Tabbing through links
891 on frameset page gets stuck at end (tivofaq.com)
893 * kwq/WebCoreBridge.h:
894 add nextValidKeyViewOutsideWebFrameViews (code is in WebKit)
896 2005-02-28 Ken Kocienda <kocienda@apple.com>
902 <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
904 * khtml/css/css_computedstyle.cpp: inheritableProperties array now defined in css_valueimpl.cpp.
905 * khtml/css/css_valueimpl.cpp: Define inheritableProperties array here.
906 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Use new name for blockProperties, and use the new
907 constant for the number of items in the array.
908 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
909 (DOM::CSSMutableStyleDeclarationImpl::removeInheritableProperties): New function.
910 * khtml/css/css_valueimpl.h: Declare inheritableProperties array and numInheritableProperties extern so they
911 can be defined in css_valueimpl.cpp and used in css_computedstyle.cpp.
912 * khtml/editing/htmlediting.cpp:
913 (khtml::ReplacementFragment::removeStyleNodes): This code was misguided, and removed too much style from HTML
914 elements. Now, it removes from HTML elements only the styles that we replace later with a call to applyStyle().
915 Also, add ID_B to list of inline "style" nodes we are willing to remove. Leaving it off was an oversight.
917 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: ID_B fix made this result change, without any
918 visible change in the test.
922 * layout-tests/editing/style/smoosh-styles-003.html
923 * layout-tests/editing/style/smoosh-styles-003-expected.txt
925 2005-02-28 Richard Williamson <rjw@apple.com>
927 Fixed <rdar://problem/4026985> CrashTracer: ...14 crashes at com.apple.WebCore: -[KWQPageState invalidate] + 32
929 Added more nil checking and ASSERTS.
930 Without a reproducible case this is hard to definitively resolve.
932 Reviewed by John Sullivan.
934 * kwq/KWQPageState.mm:
935 (-[KWQPageState invalidate]):
937 2005-02-28 Richard Williamson <rjw@apple.com>
939 Fixed <rdar://problem/4027702> 3.5% performance regression btwn Safari-188 and Safari-400
941 I inadvertently checked in some debugging code that disabled
942 style sharing. Backed out that change.
944 * khtml/css/cssstyleselector.cpp:
945 (khtml::CSSStyleSelector::styleForElement):
947 2005-02-28 Chris Blumenberg <cblu@apple.com>
949 Fixed: <rdar://problem/4026639> www.bmw.ca configurator does not work with Safari
953 * khtml/ecma/kjs_html.cpp:
954 (KJS::HTMLElement::tryGet): when frameset.<name of frame child> is called, return the window object of the frame child
956 2005-02-28 Ken Kocienda <kocienda@apple.com>
962 <rdar://problem/4026906> Paste of HTML table content can break table structure
964 * khtml/editing/htmlediting.cpp:
965 (khtml::ReplacementFragment::pruneEmptyNodes): Call new isProbablyTableStructureNode() function to prevent
966 removal of empty table structure nodes.
967 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
968 (khtml::isProbablyTableStructureNode): New helper function.
969 * khtml/editing/htmlediting.h: Declare new helper.
971 2005-02-28 Chris Blumenberg <cblu@apple.com>
973 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
975 Reviewed by kocienda.
977 * khtml/editing/htmlediting.cpp:
978 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): ref and deref the element while it is "floating"
979 (khtml::ReplacementFragment::insertFragmentForTestRendering): ditto
980 (khtml::floatRefdElement): new, keeps an element alive while its ref count is 0
981 (khtml::createDefaultParagraphElement): removed commented out code
982 (khtml::createBlockPlaceholderElement): ref the element and return it as "floating"
983 (khtml::createFontElement): ditto
984 (khtml::createStyleSpanElement): ditto
985 * khtml/editing/htmlediting.h:
987 2005-02-27 Maciej Stachowiak <mjs@apple.com>
991 <rdar://problem/3993557> REGRESSION (125-180-ish): getElementsByTagName no longer works with namespace designations
993 * khtml/xml/dom_nodeimpl.cpp:
994 (NodeBaseImpl::getElementsByTagNameNS): When no namespace is specified, find elements
995 of the specified name in any namespace to match Mozilla and earlier Safari behavior.
997 2005-02-25 Darin Adler <darin@apple.com>
1001 - fixed <rdar://problem/4025618> Crash while searching at hollywoodvideo.com
1003 * khtml/html/html_formimpl.h: Added valueWithDefault.
1004 * khtml/html/html_formimpl.cpp:
1005 (DOM::HTMLInputElementImpl::appendFormData): Call valueWithDefault instead of going at the render object
1006 to try to get the default value; there may be no render object if this is display:none.
1007 (DOM::HTMLInputElementImpl::valueWithDefault): Added. Knows about the defaults for "submit" and "reset"
1008 buttons; otherwise just returns the value as-is.
1010 * khtml/rendering/render_form.h: Removed the defaultLabel member functions.
1011 * khtml/rendering/render_form.cpp:
1012 (RenderSubmitButton::rawText): Call valueWithDefault instead of using defaultLabel function here on
1013 the render side. The DOM needs to know how to deal with the default anyway for form submission.
1014 (RenderSubmitButton::defaultLabel): Removed.
1015 (RenderResetButton::defaultLabel): Removed.
1016 (RenderPushButton::defaultLabel): Removed.
1018 2005-02-25 Darin Adler <darin@apple.com>
1022 - fixed <rdar://problem/4025088> window onblur and onfocus don't fire when text field has focus
1024 * kwq/KWQKHTMLPart.h: Added setWindowHasFocus function and m_windowHasFocus data member.
1025 * kwq/KWQKHTMLPart.mm:
1026 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Took out the code that sends the focus and blur events.
1027 (KWQKHTMLPart::setWindowHasFocus): Put that code here instead.
1029 * kwq/WebCoreBridge.h: Added setWindowHasFocus: method to the bridge.
1030 * kwq/WebCoreBridge.mm: (-[WebCoreBridge setWindowHasFocus:]): Added. Calls method on the part.
1032 2005-02-25 Darin Adler <darin@apple.com>
1036 - re-fixed <rdar://problem/3665430> horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode
1038 * kwq/KWQTextArea.mm: (-[KWQTextArea _updateTextViewWidth]): Don't change the text view width
1039 to match the text area's width in the "wrap" case.
1041 2005-02-25 Ken Kocienda <kocienda@apple.com>
1047 <rdar://problem/4021518> 8A394 Mail crashes during paste: khtml::RootInlineBox::closestLeafChildForXPos
1049 * khtml/editing/visible_units.cpp:
1050 (khtml::previousLinePosition): Adding an updateLayout call at the start of the function fixes the crash, since
1051 we caught line boxes in a not-completely-updated state.
1052 (khtml::nextLinePosition): Ditto.
1054 2005-02-25 David Hyatt <hyatt@apple.com>
1056 Fix for 4010774, make sure to avoid an O(N^2) algorithm in nextRenderer() that is triggered when large
1057 DOM subtrees are inserted into documents via one insert/append call.
1059 Reviewed by kocienda
1061 * khtml/xml/dom_nodeimpl.cpp:
1062 (NodeImpl::nextRenderer):
1064 2005-02-25 Richard Williamson <rjw@apple.com>
1066 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
1068 Second pass at fixing 3382926 w/o causing layout regressions. Same concept:
1069 if directionality of text's element is RTL and first character has neutral directionality
1070 then set the initial directionality to RTL.
1074 * khtml/rendering/bidi.cpp:
1075 (khtml::RenderBlock::bidiReorderLine):
1076 (khtml::RenderBlock::determineStartPosition):
1080 2005-02-25 Ken Kocienda <kocienda@apple.com>
1084 Roll out Chris' change to fix this bug:
1086 <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
1088 That code change is responsible for all these new crashers:
1090 <rdar://problem/4025177> crash copying safari.apple.com into Blot document
1091 <rdar://problem/4025184> crash in DOM::NodeImpl::parentNode copying "New!" from google.com to Blot
1092 <rdar://problem/4025214> crash in DOM::NodeImpl::getRect loading paste-match-style-001.html
1094 Since we wish to close the tree for a build right now, I am rolling out rather than investigating.
1096 * khtml/editing/htmlediting.cpp:
1097 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded)
1098 (khtml::ReplacementFragment::insertFragmentForTestRendering)
1099 (khtml::createDefaultParagraphElement)
1100 (khtml::createBlockPlaceholderElement)
1101 (khtml::createFontElement)
1102 (khtml::createStyleSpanElement)
1103 * khtml/editing/htmlediting.h
1105 2005-02-25 Ken Kocienda <kocienda@apple.com>
1111 <rdar://problem/4020108> Pasting text into message makes Mail crash reproducibly
1113 Note that, even with this fix, development build will crash until this bug is fixed:
1114 <rdar://problem/4024996> Applying block styles can cause assertion failure in inline style removal
1116 This will not crash deployment builds, so I am going to land.
1118 * khtml/editing/htmlediting.cpp:
1119 (khtml::ApplyStyleCommand::applyBlockStyle): Applying block styles can make the loop to reach beyondEnd
1120 fail since the structure of the document can change. Cache the next node first before operating on it,
1123 2005-02-25 Vicki Murley <vicki@apple.com>
1125 - recommit this change, since rolling it out did NOT fix the performance regression!
1127 2005-02-23 Darin Adler <darin@apple.com>
1131 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
1133 The key was to change things around so that we don't push text from the DOM to the widget
1134 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
1135 during the blur process.
1137 * khtml/html/html_formimpl.cpp:
1138 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
1139 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
1140 new value is set here.
1141 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
1143 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
1144 to true, and also sends out the input event. It's better to have this here than in the renderer code.
1145 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
1146 m_dirtyvalue) and m_valueMatchesRenderer as false.
1147 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
1148 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
1149 where the value came from.
1150 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
1151 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
1152 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
1154 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
1155 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
1156 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
1158 * khtml/rendering/render_form.cpp:
1159 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
1161 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
1163 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
1164 (RenderTextArea::handleFocusOut): Ditto.
1165 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
1166 DOM if valueMatchesRenderer is true.
1167 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
1169 2005-02-25 Chris Blumenberg <cblu@apple.com>
1171 Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
1175 * khtml/editing/htmlediting.cpp:
1176 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
1177 (khtml::ReplacementFragment::insertFragmentForTestRendering):
1178 (khtml::floatRefdElement):
1179 (khtml::createDefaultParagraphElement):
1180 (khtml::createBlockPlaceholderElement):
1181 (khtml::createFontElement):
1182 (khtml::createStyleSpanElement):
1183 * khtml/editing/htmlediting.h:
1185 2005-02-25 Darin Adler <darin@apple.com>
1187 * kwq/character-sets.txt: Checked in updated file. This new file has no effect, because none of the
1188 changes affect character sets that we support, but it's good to have the latest file in here, and
1189 completely safe because I checked that the generated files have not changed.
1191 2005-02-25 Vicki Murley <vicki@apple.com>
1195 - back out this change, since it causes a 3.5% performance regression
1197 2005-02-23 Darin Adler <darin@apple.com>
1201 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
1203 The key was to change things around so that we don't push text from the DOM to the widget
1204 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
1205 during the blur process.
1207 * khtml/html/html_formimpl.cpp:
1208 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
1209 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
1210 new value is set here.
1211 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
1213 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
1214 to true, and also sends out the input event. It's better to have this here than in the renderer code.
1215 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
1216 m_dirtyvalue) and m_valueMatchesRenderer as false.
1217 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
1218 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
1219 where the value came from.
1220 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
1221 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
1222 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
1224 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
1225 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
1226 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
1228 * khtml/rendering/render_form.cpp:
1229 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
1231 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
1233 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
1234 (RenderTextArea::handleFocusOut): Ditto.
1235 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
1236 DOM if valueMatchesRenderer is true.
1237 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
1239 2005-02-25 Darin Adler <darin@apple.com>
1243 - fixed <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
1245 * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply):
1246 Use the insertNodeAfterAndUpdateNodesInserted and insertNodeBeforeAndUpdateNodesInserted
1247 functions to add the leading and trailing spaces for smart paste.
1249 2005-02-25 David Hyatt <hyatt@apple.com>
1251 Back out fix for 3382926, since it breaks LTR text inside RTL contexts.
1255 * khtml/rendering/bidi.cpp:
1256 (khtml::BidiIterator::direction):
1258 2005-02-25 David Hyatt <hyatt@apple.com>
1260 Fix for 3975039, scrolling is slow in huge RSS views. Optimize the calculation of clip rects for overflow:hidden
1261 layers. Also optimize layer movement when scrolling overflow sections.
1265 * khtml/rendering/render_layer.cpp:
1267 (ClipRects::operator delete):
1268 (ClipRects::detach):
1269 (RenderLayer::RenderLayer):
1270 (RenderLayer::~RenderLayer):
1271 (RenderLayer::updateLayerPosition):
1272 (RenderLayer::removeOnlyThisLayer):
1273 (RenderLayer::insertOnlyThisLayer):
1274 (RenderLayer::scrollToOffset):
1275 (RenderLayer::hitTest):
1276 (RenderLayer::calculateClipRects):
1277 (RenderLayer::calculateRects):
1278 (RenderLayer::containsPoint):
1279 (RenderLayer::clearClipRects):
1280 (RenderLayer::clearClipRect):
1281 * khtml/rendering/render_layer.h:
1282 (khtml::ClipRects::m_refCnt):
1283 (khtml::ClipRects::overflowClipRect):
1284 (khtml::ClipRects::fixedClipRect):
1285 (khtml::ClipRects::posClipRect):
1286 (khtml::ClipRects::ref):
1287 (khtml::ClipRects::deref):
1288 (khtml::RenderLayer::clipRects):
1289 * khtml/rendering/render_object.cpp:
1290 (RenderObject::setStyle):
1292 2005-02-24 Maciej Stachowiak <mjs@apple.com>
1294 Reviewed by Darin and Dave a while ago.
1296 <rdar://problem/3996685> REGRESSION: Crash in KWQVectorImpl::at loading http://maps.google.com/mapfiles/homepanel.xsl
1298 * kwq/WebCoreBridge.mm:
1299 (formElementFromDOMElement): Check for isHTMLElement() as well as
1300 id() == ID_FORM. This seems like an impossible situation, but
1301 papering over it seems more expedient for the time being.
1303 2005-02-24 Richard Williamson <rjw@apple.com>
1305 Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
1307 Use mirror characters correctly when rendering with RTL directionality.
1311 * khtml/rendering/bidi.cpp:
1312 (khtml::BidiIterator::direction):
1314 2005-02-24 Richard Williamson <rjw@apple.com>
1316 Fixed <rdar://problem/3985889> REGRESSION (125-180): setting <img> src to GIF that already animated does not animate; just shows final frame
1320 * WebCore.pbproj/project.pbxproj:
1321 * khtml/html/html_imageimpl.cpp:
1322 (HTMLImageLoader::updateFromElement):
1323 * khtml/rendering/render_image.cpp:
1324 (RenderImage::resetAnimation):
1325 * khtml/rendering/render_image.h:
1326 * khtml/rendering/render_list.cpp:
1327 (RenderListMarker::setStyle):
1328 (RenderListMarker::paint):
1329 * khtml/rendering/render_list.h:
1333 (QPixmap::resetAnimation):
1334 * kwq/WebCoreImageRenderer.h:
1336 2005-02-24 Chris Blumenberg <cblu@apple.com>
1338 Fixed: <rdar://problem/4020110> Safari crashes in setAllData while taking a www.zoomerang.com survey
1342 * kwq/KWQResourceLoader.mm:
1343 (-[KWQResourceLoader finishJobAndHandle:]): clear the job after we've deleted to avoid reentrancy
1345 2005-02-24 Darin Adler <darin@apple.com>
1349 - fixed <rdar://problem/4023360> REGRESSION (186-187): image file upload is broken at pep.apple.com
1351 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::appendFormData): Return true after
1352 setting up the form data for an uploaded file. The old code would fall through to the ISINDEX
1353 case and send double form data (the filename instead of the file contents the second time).
1355 2005-02-24 David Harrison <harrison@apple.com>
1359 <rdar://problem/3990849> AX: textMarkerRange for an AXUIElement within an AXWebArea
1361 * kwq/KWQAccObject.mm:
1362 (-[KWQAccObject textMarkerRange]):
1363 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
1364 (-[KWQAccObject doAXTextMarkerRangeForUIElement:]):
1365 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
1366 Added AXTextMarkerRangeForUIElement, or you can send textMarkerRange to the UIElement itself.
1368 2005-02-24 David Harrison <harrison@apple.com>
1372 <rdar://problem/4004279> 3 AXSelectedTextChanged notifications are firing each time I type a character
1374 * khtml/xml/dom_docimpl.cpp:
1375 (DocumentImpl::updateSelection):
1376 Send notification only if the selection is not null. This safely ignores transitory selections set during editing.
1378 2005-02-24 Darin Adler <darin@apple.com>
1382 - fixed <rdar://problem/3987619> in some cases, text doesn't resize with Format->Style->Bigger/Smaller
1384 * khtml/editing/htmlediting.cpp:
1385 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): Only call nodeFullySelected for non-text nodes.
1386 Text nodes are already split so they're either in the range and full selected or out of the range.
1387 And nodeFullySelected doesn't work for text nodes.
1388 (khtml::ApplyStyleCommand::nodeFullySelected): Add an assertion, since this function only works for elements,
1390 (khtml::ApplyStyleCommand::nodeFullyUnselected): Ditto.
1392 - make big improvement in <rdar://problem/3953636> Mail hung for ~10sec changing font of 84328 characters: khtml::ApplyStyleCommand::nodeFullySelected
1394 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints): Improve algorithm based on suggestion
1397 - fixed <rdar://problem/4020305> REGRESSION (185-186): loading image in new window using document.write fails
1399 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::open): If there is no parent document, don't blow away the base URL.
1401 - fixed <rdar://problem/4021701> REGRESSION (188-188+): form not submitted after pressing <return> at http://hrweb.apple.com
1403 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchMouseEvent): Send activate event in the case where the event
1404 sent is a KHTML_CLICK_EVENT, not CLICK_EVENT.
1406 2005-02-23 Kevin Decker <kdecker@apple.com>
1410 Fixed <rdar://problem/4020747> REGRESSION: stray </applet> tags crash Safari
1412 * khtml/html/htmlparser.cpp:
1413 (KHTMLParser::processCloseTag): Made a typesafe check that prevents crashes
1414 whenever there is a closing applet tag without an actual <applet> in the first place.
1415 Now verifies the current token is ID_APPLET before casting it to an HTMLAppletElementImpl.
1418 2005-02-23 Ken Kocienda <kocienda@apple.com>
1424 <rdar://problem/3977962> font loses bold style after pasting next to existing text and pressing return
1426 * khtml/editing/htmlediting.cpp:
1427 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Problem here was
1428 that we were doing work in cases where we should not, and content whose style would have
1429 been correct if we had done nothing was getting clobbered. It turns out that extra work
1430 to apply style to the new paragraph added in this command only needs to be done if we're
1431 at the boundaries of a paragraph. Otherwise, content that is moved as part of the work
1432 of the command will lend their styles to the new paragraph without any extra work needed.
1433 So, make this position check and return unless at a paragraph boundary.
1437 * layout-tests/editing/style/block-styles-007-expected.txt
1438 * layout-tests/editing/style/block-styles-007.html
1440 2005-02-23 Ken Kocienda <kocienda@apple.com>
1446 <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a selection starting from end of line once
1448 Problem is with the way we figure out whether to add or remove a style based on
1449 the current selection. In this case, the code is looking at the end of the
1450 previous line, which is not bold, and deduces incorrectly that the operation is
1451 a "make bold". Then the style code runs to make bold, but there is nothing on
1452 the end of the previous line to embolden, so we get into a cycle where the same
1453 thing happens each time cmd-b is hit.
1455 * khtml/khtml_part.cpp:
1456 (KHTMLPart::selectionComputedStyle): Call editingStartPosition() to get the right position for the font determination.
1457 * khtml/xml/dom2_rangeimpl.cpp:
1458 (DOM::RangeImpl::editingStartPosition): New helper function that "does the right thing" based on whether the
1459 selection is a caret or a range, moving upstream for the former, and downstream for the latter.
1460 * khtml/xml/dom2_rangeimpl.h:
1461 * kwq/KWQKHTMLPart.mm:
1462 (KWQKHTMLPart::fontForSelection): Call editingStartPosition() to get the right position for the font determination.
1466 * layout-tests/editing/style/style-boundary-001-expected.txt
1467 * layout-tests/editing/style/style-boundary-001.html
1468 * layout-tests/editing/style/style-boundary-002-expected.txt
1469 * layout-tests/editing/style/style-boundary-002.html
1470 * layout-tests/editing/style/style-boundary-003-expected.txt
1471 * layout-tests/editing/style/style-boundary-003.html
1472 * layout-tests/editing/style/style-boundary-004-expected.txt
1473 * layout-tests/editing/style/style-boundary-004.html
1475 2005-02-23 Richard Williamson <rjw@apple.com>
1477 Fixed <rdar://problem/3985579> 8A367: Dashboard: Stock widget not visible when click remove to remove single char ticker symbol
1479 Explicitly remove scroll bar views when removing them from
1482 Don't paint synchronously when the scroll position changes,
1483 this caused funky clip problems.
1487 * khtml/rendering/render_layer.cpp:
1488 (RenderLayer::scrollToOffset):
1489 (RenderLayer::setHasHorizontalScrollbar):
1490 (RenderLayer::setHasVerticalScrollbar):
1491 (RenderLayer::updateScrollInfoAfterLayout):
1493 2005-02-23 Ken Kocienda <kocienda@apple.com>
1499 <rdar://problem/3959996> REGRESSION (Mail): cursor moves to beginning of document when click is past end
1501 * khtml/rendering/render_block.cpp:
1502 (khtml::RenderBlock::positionForCoordinates): Skip blocks that are invisible or have no height when
1503 looking for a child to pass off to. And save away the last visible block with a height to pass off
1504 to if there is no child at the right y-coordinate.
1506 2005-02-23 David Harrison <harrison@apple.com>
1510 <rdar://problem/4010059> BoundsForTextMarkerRange does not update with scrolled web area
1512 * kwq/KWQAccObject.mm:
1513 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
1514 Adjust for scrolling.
1516 2005-02-22 Maciej Stachowiak <mjs@apple.com>
1520 <rdar://problem/3949790> hitting return after pasted styled line results in extra content getting the style
1522 * khtml/editing/htmlediting.cpp:
1523 (khtml::InsertParagraphSeparatorCommand::doApply): In the case
1524 where the start block is the root, insert the newly created DIV at
1525 the end of the root block instead of after the last sibling in the
1526 start node, since the start node could be inside other
1527 style-affecting nodes and we don't want to reparent its cousins
1530 2005-02-23 David Harrison <harrison@apple.com>
1534 <rdar://problem/4014691> switch to correctly spelled NSAccessibilityForegroundColorTextAttribute constant
1536 Also removed two older, now unneeded, wrappers.
1538 * kwq/KWQAccObject.mm:
1539 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
1540 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
1541 Removed these older, now unneeded, wrappers.
1543 (NSAccessibilityForegroundColorTextAttributeWrapper):
1544 New wrapper for NSAccessibilityForegroundColorTextAttribute.
1546 (AXAttributeStringSetStyle):
1547 Use NSAccessibilityForegroundColorTextAttributeWrapper.
1549 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
1550 Remove uses of visiblePositionForStartOfTextMarkerRange and visiblePositionForEndOfTextMarkerRange.
1552 2005-02-23 David Harrison <harrison@apple.com>
1556 <rdar://problem/3524784> AX hit test doesn't return info when done in empty space of content area
1558 * kwq/KWQAccObject.mm:
1559 (-[KWQAccObject accessibilityHitTest:]):
1560 Return unignored object.
1562 2005-02-23 Darin Adler <darin@apple.com>
1566 - fixed <rdar://problem/4006509> REGRESSION (171-172): Setting CSS -khtml-user-modify property triggers crash
1568 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyProperty):
1569 Removed the code that changes the style of the element. This was never needed, and caused the
1570 style to be modified while we were iterating it.
1572 2005-02-23 Ken Kocienda <kocienda@apple.com>
1578 <rdar://problem/3980209> Mail crashed when I pressed Cmd-Shift-[ (nil-deref in ApplyStyleCommand::addBlockStyleIfNeeded)
1580 * khtml/editing/htmlediting.cpp:
1581 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Reordered the new block
1582 insertion so that it come before the move. The logic stays exactly the same, however, with the old
1583 ordering, the new block could want to become a child of itself come insertion time. I considered
1584 making a more complicated code change to fix this problem, but the simple reordering works just
1585 as well, and seems less risky.
1587 These all changed in an insignificant way. It seems that with the new code, some empty text nodes
1588 got reordered in the document. This has no effect on anything visible to the user.
1590 * layout-tests/editing/style/create-block-for-style-003-expected.txt
1591 * layout-tests/editing/style/create-block-for-style-004-expected.txt
1592 * layout-tests/editing/style/create-block-for-style-009-expected.txt
1593 * layout-tests/editing/style/create-block-for-style-011-expected.txt
1594 * layout-tests/editing/style/create-block-for-style-013-expected.txt
1596 2005-02-23 Darin Adler <darin@apple.com>
1600 - fixed <rdar://problem/4013986> REGRESSION (173-174): onclick event not sent when mouse click on checkbox is double-click
1602 We need to send an onclick event *and* an ondblclick event when we process a double click.
1604 * khtml/khtmlview.cpp: (KHTMLView::dispatchMouseEvent): In the case where we're sending a CLICK_EVENT,
1605 follow it by a KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT when handling a double click, and a DOMACTIVATE_EVENT.
1606 We no longer do the DOMACTIVATE_EVENT in dispatchGenericEvent.
1607 * khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked): send only CLICK_EVENT here, and
1608 lets dispatchMouseEvent deal with the other subsequent events.
1609 * khtml/xml/dom_nodeimpl.cpp:
1610 (NodeImpl::dispatchGenericEvent): Remove the code that sends a DOMACTIVATE_EVENT, since there's no longer
1611 a good way to figure out if this is the last event that should be sent before it is.
1612 (NodeImpl::dispatchMouseEvent): Set the meta key modifier here (as it already is set elsewhere), and
1613 follow up a CLICK_EVENT with KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT, and DOMACTIVATE_EVENT as above.
1615 2005-02-23 Darin Adler <darin@apple.com>
1619 - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves
1621 The key was to change things around so that we don't push text from the DOM to the widget
1622 unless the DOM has actually been changed. This prevents the code path that wipes out inline input
1623 during the blur process.
1625 * khtml/html/html_formimpl.cpp:
1626 (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
1627 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
1628 new value is set here.
1629 (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
1631 (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
1632 to true, and also sends out the input event. It's better to have this here than in the renderer code.
1633 (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
1634 m_dirtyvalue) and m_valueMatchesRenderer as false.
1635 (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
1636 the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
1637 where the value came from.
1638 (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
1639 (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
1640 (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.
1642 * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
1643 and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
1644 by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.
1646 * khtml/rendering/render_form.cpp:
1647 (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
1649 (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
1651 (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
1652 (RenderTextArea::handleFocusOut): Ditto.
1653 (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
1654 DOM if valueMatchesRenderer is true.
1655 (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.
1657 2005-02-22 Richard Williamson <rjw@apple.com>
1659 Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions
1661 Just set dashboard dirty bit when overflow scrolling changes.
1663 Don't do comparison of regions in before scroll regions are
1664 added, instead do it in WebKit after automatic scroll regions
1669 * khtml/css/cssparser.cpp:
1670 (CSSParser::parseDashboardRegions): Cleaned up comments
1671 * khtml/css/cssstyleselector.cpp:
1672 (khtml::CSSStyleSelector::styleForElement): Cleaned up comments
1674 * khtml/khtmlview.cpp:
1675 (KHTMLView::updateDashboardRegions):
1676 * khtml/rendering/render_layer.cpp:
1677 (RenderLayer::updateScrollInfoAfterLayout):
1678 * kwq/WebDashboardRegion.m:
1679 (-[WebDashboardRegion isEqual:]):
1681 2005-02-22 Chris Blumenberg <cblu@apple.com>
1683 Fixed: <rdar://problem/3976872> Pasted plain text doesn't get the proper style if pasted into newlines
1687 * khtml/editing/htmlediting.cpp:
1688 (khtml::ReplaceSelectionCommand::doApply): don't clear the typing style when matching style
1689 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply the typing style when matching style
1690 * khtml/editing/jsediting.cpp:
1691 * khtml/khtml_part.cpp:
1692 (KHTMLPart::pasteAndMatchStyle): new
1693 * khtml/khtml_part.h:
1694 * kwq/KWQKHTMLPart.h:
1695 * kwq/KWQKHTMLPart.mm:
1696 (KWQKHTMLPart::issuePasteAndMatchStyleCommand): new
1697 * kwq/WebCoreBridge.h:
1698 * layout-tests/editing/editing.js:
1700 2005-02-22 Darin Adler <darin@apple.com>
1704 - fixed <rdar://problem/4006596> REGRESSION (183-184): crash in DOM::DocumentImpl::setFocusNode(DOM::NodeImpl*)
1706 * khtml/xml/dom_docimpl.cpp:
1707 (widgetForNode): Added helper.
1708 (DocumentImpl::setFocusNode): Re-get the widget for the node after calling updateLayout.
1709 The updateLayout can destroy the old widget, so we can't keep a stale widget pointer around.
1711 2005-02-22 Ken Kocienda <kocienda@apple.com>
1717 <rdar://problem/4003463> Mail.app HTML uses inline styling markup not understood by Entourage and Eudora
1719 * khtml/editing/htmlediting.cpp:
1720 (khtml::isEmptyFontTag): Helper for removing <font> tags.
1721 (khtml::StyleChange::styleModeForParseMode): Helper to map a document parse mode to a use/don't use
1722 legacy-html-styles value.
1723 (khtml::StyleChange::checkForLegacyHTMLStyleChange): Add support for colors, font faces, and font sizes.
1724 (khtml::ApplyStyleCommand::isHTMLStyleNode):
1725 (khtml::ApplyStyleCommand::removeHTMLFontStyle):
1726 (khtml::ApplyStyleCommand::applyTextDecorationStyle): Now call styleModeForParseMode to determine
1727 whether to use legacy html styles or not.
1728 (khtml::ApplyStyleCommand::removeInlineStyle): Now properly removes <font> styles.
1729 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
1730 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
1731 (khtml::createFontElement): Helper for applying <font> elements.
1732 * khtml/editing/htmlediting.h: All the following support the new bits of data we need to store.
1733 (khtml::StyleChange::applyFontColor)
1734 (khtml::StyleChange::applyFontFace)
1735 (khtml::StyleChange::applyFontSize)
1736 (khtml::StyleChange::fontColor)
1737 (khtml::StyleChange::fontFace)
1738 (khtml::StyleChange::fontSize)
1740 Test results updated now that we will write out <font> tags for quirks mode documents.
1742 * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt
1743 * layout-tests/editing/style/block-style-004-expected.txt
1744 * layout-tests/editing/editing/pasteboard/paste-text-011-expected.txt
1745 * layout-tests/editing/style/block-style-005-expected.txt
1746 * layout-tests/editing/style/block-style-006-expected.txt
1747 * layout-tests/editing/style/smoosh-styles-001-expected.txt
1748 * layout-tests/editing/style/smoosh-styles-002-expected.txt
1750 2005-02-22 Maciej Stachowiak <mjs@apple.com>
1754 <rdar://problem/4017066> crash in KJS::ValueImp::dispatchType() every time I load www.nytimes.com/pages/automobiles
1756 When creating option elements, use lowercase "option" instead of
1757 uppercase "OPTION" to create option elements, because only
1758 lowercase works for XHTML.
1760 * khtml/ecma/kjs_html.cpp:
1761 (KJS::HTMLSelectCollection::tryPut):
1762 (OptionConstructorImp::construct):
1764 2005-02-22 Chris Blumenberg <cblu@apple.com>
1766 WebCore fix for: <rdar://problem/3918056> Mail not line breaking my <pre> formatted emails on replies
1768 Mail must 4018993 to fully address the problem.
1770 Reviewed by kocienda.
1772 * khtml/editing/markup.cpp:
1773 (khtml::startMarkup): don't compute style for text in PRE tags
1774 (khtml::createMarkup): include PRE if it is an ancestor of the nodes in the range
1776 2005-02-21 Richard Williamson <rjw@apple.com>
1778 Fixed <rdar://problem/4008338> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com
1780 There was a long standing bug in cssText(). Double value were always cast int! So,
1781 opacity values values were incorrectly converted to text, i.e. 0.75 became 0.
1783 The problem was newly triggered because we parse the css for opacity *TWICE*. This is a result of
1784 incorrectly "invalidating" the style attribute (from fix for 3790449). The second parse was from
1785 the cssText() of the style.
1789 * khtml/css/css_valueimpl.cpp:
1790 (DOM::CSSPrimitiveValueImpl::cssText):
1792 2005-02-21 David Hyatt <hyatt@apple.com>
1794 Fix for 4017204, apply the same fix to the base class nodeAtPoint that was already applied to RenderBlock.
1795 Skip elements with layers and inline flows. Demoted <form>s can end up causing trouble otherwise.
1797 Reviewed by Richard Williamson
1799 * khtml/rendering/render_box.cpp:
1800 (RenderBox::nodeAtPoint):
1802 2005-02-21 David Hyatt <hyatt@apple.com>
1804 Fix for 4017033, CSS is being parsed twice. Make sure to always validate the style attribute when it is
1805 initially parsed. Add code to clean up decls when the style attribute is completely removed. Add a new
1806 synchronizing boolean that avoids reparsing the style declaration when the attribute is simply
1807 being synced up to the declaration.
1811 * khtml/css/css_valueimpl.cpp:
1812 (DOM::CSSMutableStyleDeclarationImpl::setChanged):
1813 * khtml/html/html_elementimpl.cpp:
1814 (HTMLElementImpl::invalidateStyleAttribute):
1815 (HTMLElementImpl::updateStyleAttributeIfNeeded):
1816 (HTMLElementImpl::HTMLElementImpl):
1817 (HTMLElementImpl::~HTMLElementImpl):
1818 (HTMLElementImpl::destroyInlineStyleDecl):
1819 (HTMLElementImpl::mapToEntry):
1820 (HTMLElementImpl::parseHTMLAttribute):
1821 * khtml/html/html_elementimpl.h:
1822 * khtml/xml/dom_elementimpl.cpp:
1823 (ElementImpl::ElementImpl):
1824 (ElementImpl::setAttribute):
1825 * khtml/xml/dom_elementimpl.h:
1826 (DOM::ElementImpl::updateStyleAttributeIfNeeded):
1830 2005-02-21 Darin Adler <darin@apple.com>
1832 - fixed Panther deployment build
1834 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Put more stuff inside #if.
1836 2005-02-21 David Harrison <harrison@apple.com>
1840 <rdar://problem/3943090> REGRESSION (Mail): Spelling underline incompletely erased following certain steps
1842 * khtml/rendering/render_text.cpp:
1843 (InlineTextBox::paintMarker):
1844 Make sure underline is placed within the text bounds.
1847 * kwq/KWQPainter.mm:
1848 (QPainter::misspellingLineThickness):
1849 * kwq/WebCoreTextRenderer.h:
1850 Add misspellingLineThickness for use by InlineTextBox::paintMarker.
1852 2005-02-21 Darin Adler <darin@apple.com>
1856 - fixed <rdar://problem/4012978> -[DOMRange markupString] crashes when range contains only a text node with a single space
1858 * khtml/editing/markup.cpp: (khtml::createMarkup): Added updateLayout calls, and added a missing
1861 2005-02-21 Darin Adler <darin@apple.com>
1865 - fixed <rdar://problem/4005435> Safari hung while pasting text into a <textarea> (Panther-only)
1867 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Don't setAutohidesScrollers:YES on Panther.
1869 2005-02-21 Ken Kocienda <kocienda@apple.com>
1875 <rdar://problem/4015499> REGRESSION (186-187): pasted quoted text starting with a blank line increases quote level of pasted text when pasted
1877 * khtml/editing/markup.cpp:
1878 (khtml::markup): Changed over to ASSERT instead of assert.
1879 (khtml::createMarkup): The issue was that the code to add parents all the way back to the common ancestor
1880 block did not check for blocks whose markup had already been added, and could result in adding markup for
1881 nodes twice (hence the additional and erroneous quote level). Now there is a new check that will
1882 only add markup for those nodes before the start of the selection range. This fixes the bug.
1883 (khtml::createFragmentFromMarkup): Changed over to ASSERT instead of assert.
1884 (khtml::createFragmentFromText): Ditto.
1886 2005-02-21 Ken Kocienda <kocienda@apple.com>
1892 <rdar://problem/4015494> REGRESSION (186-187) <cr> removed if quoted word is copy/pasted on line immediately above quoted text
1894 * khtml/editing/htmlediting.cpp:
1895 (khtml::ReplaceSelectionCommand::doApply): Relatively new check designed to remove a <br> element when
1896 that element was on a line by itself did not do an adequate check for this condition, causing the
1897 failure described in the bug. Fixed.
1899 2005-02-19 Ken Kocienda <kocienda@apple.com>
1903 * khtml/editing/htmlediting.cpp:
1904 (khtml::matchNearestBlockquoteColorString): New function which abstracts away the CSS property we use
1905 for this pseudo-color.
1906 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Set the new nearestBlockquoteColorString
1907 psuedo-color here, rather than removing colors as was done before.
1908 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): Check for the pseudo-color in the desired
1909 style, and determine the real color based on the nearest blockquote (or none) to the node.
1910 (khtml::nearestMailBlockquote): Name change from closestMailBlockquote to match new property better.
1912 All the rest of this change is the mechanical coding you need to do to add a new CSS property, in this
1913 case, -khtml-match-nearest-mail-blockquote-color.
1915 * khtml/css/css_computedstyle.cpp:
1916 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue)
1917 * khtml/css/cssparser.cpp:
1918 (CSSParser::parseValue):
1919 * khtml/css/cssproperties.c:
1922 * khtml/css/cssproperties.h:
1923 * khtml/css/cssproperties.in:
1924 * khtml/css/cssstyleselector.cpp:
1925 (khtml::CSSStyleSelector::applyProperty)
1926 * khtml/css/cssvalues.c:
1928 * khtml/css/cssvalues.h:
1929 * khtml/css/cssvalues.in:
1930 * khtml/rendering/render_style.h:
1931 (khtml::RenderStyle::matchNearestMailBlockquoteColor)
1932 (khtml::RenderStyle::setMatchNearestMailBlockquoteColor)
1933 (khtml::RenderStyle::initialMatchNearestMailBlockquoteColor)
1935 2005-02-19 Ken Kocienda <kocienda@apple.com>
1941 <rdar://problem/4014228> REGRESSION (186-187) extra, uneditable lines inserted above and below a line of pasted quoted text
1942 <rdar://problem/4014393> REGRESSION (186-187) pasted quoted text gets extra <cr>s when pasted at top of document
1944 * khtml/editing/htmlediting.cpp:
1945 (khtml::ReplacementFragment::ReplacementFragment): Part of a general refactoring of how
1946 the fragment is inserted into the document, rendered, and then tested for certain
1947 important pieces of information that are required for pasting.
1948 (khtml::ReplacementFragment::insertFragmentForTestRendering): New helper. Handles inserting
1949 the fragment nodes into the document.
1950 (khtml::ReplacementFragment::restoreTestRenderingNodesToFragment): Removes nodes from the
1951 document, and restores them to the fragment.
1952 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Factored out code that
1953 did this before into its own function.
1954 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
1955 (khtml::ReplacementFragment::countRenderedBlocks): This is a real improvement, as it
1956 eliminates a major use of the isProbablyBlock() function. Now, the blocks that are
1957 counted are real, rendered blocks.
1958 (khtml::ReplacementFragment::removeStyleNodes): Made this function retain margin-zeroing
1959 CSS properties on paragraphs. This does two things: 1) It helps us to maintain good behavior
1960 in the short term while there are still versions of Mail out there that use <p> elements
1961 instead of <div> elements for new paragraphs; and 2) It will help to maintain the compatibility
1962 with other mail clients that use <p> elements for their paragraphs but render them themselves
1963 with no margins as the result of quirks.
1964 (khtml::ReplaceSelectionCommand::doApply): Do some work to fix up and improve the handling
1965 of blank lines, be they <p> elements or <br> elements, that can be removed after pasting. This,
1966 coupled with the refactoring, fixes 4014393.
1967 * khtml/editing/htmlediting.h: Updated for new functions.
1968 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Updated results, actually improved with this change.
1969 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Ditto.
1971 2005-02-19 Kevin Decker <kdecker@apple.com>
1975 Fixed <rdar://problem/4010765> Flash player can be used to arbitrarily open popup windows without user permission
1977 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.
1979 * kwq/WebCoreBridge.h:
1980 * kwq/WebCoreBridge.mm:
1981 (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Changed this to invoke the new stringByEvaluatingJavaScriptFromString:forceUserGesture method below.
1982 (-[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.
1984 2005-02-18 Chris Blumenberg <cblu@apple.com>
1986 Fixed: <rdar://problem/3951196> REGRESSION (Mail): too many levels of reply quotes after certain steps
1988 Reviewed by kocienda.
1990 * khtml/editing/htmlediting.cpp:
1991 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1992 - 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.
1993 - Build up the list of ancestors after we've determined the actual topBlockquote.
1994 - Don't insert an extra new line if there is a new start node.
1996 2005-02-19 Chris Blumenberg <cblu@apple.com>
1998 Fixed: <rdar://problem/3978461> smart paste is broken
2002 * khtml/editing/htmlediting.cpp:
2003 (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.
2005 2005-02-18 Adele Amchan <adele@apple.com>
2009 Fix for <rdar://problem/3975568> REGRESSION(125-180)Australian Open pages have drawing problem
2011 This patch fixes two problems caused by our added support for custom tags. First, the layout problem at the sites mentioned in the bug
2012 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.
2013 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
2014 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
2015 endTagArray and tagPriorityArray.
2017 * khtml/html/dtd.h: changed all uses of the endTag array to endTagArray for our new wrapper functions
2018 (DOM::tagPriority): added function to check array bounds and to treat custom tags as spans
2019 (DOM::endTagRequirement): added function to check array bounds and to treat custom tags as spans
2020 * khtml/html/dtd.cpp: changed name of endTag and tagPriority arrays to endTagArray and tagPriorityArray
2021 (DOM::checkChild): treat custom tags as spans during this check
2022 * khtml/html/html_elementimpl.cpp: changed all uses of the endTag array to the endTagRequirement function
2023 (HTMLElementImpl::createContextualFragment):
2024 (HTMLElementImpl::setInnerText):
2025 (HTMLElementImpl::setOuterText):
2026 (HTMLElementImpl::toString):
2027 * 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.
2028 (KHTMLParser::parseToken):
2029 (KHTMLParser::insertNode):
2030 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): changed all uses of the endTag array to the endTagRequirement function
2031 * khtml/editing/markup.cpp: changed all uses of the endTag array to the endTagRequirement function
2035 2005-02-18 Jens Alfke <jens@apple.com>
2039 Fixed build: Whoops, setNeedsLayout's parameter is NOT optional.
2041 * khtml/html/html_objectimpl.cpp:
2042 (HTMLAppletElementImpl::setAllParamsAvailable):
2044 2005-02-18 Jens Alfke <jens@apple.com>
2046 Reviewed by cblu, hyatt.
2048 Fixes <rdar://problem/3603191> "REGRESSION: Applets not receiving all of the Applet Parameters in Java 1.4.1/1.4.2"
2049 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.
2051 * khtml/html/html_objectimpl.cpp:
2052 (HTMLAppletElementImpl::HTMLAppletElementImpl):
2053 (HTMLAppletElementImpl::getAppletInstance):
2054 (HTMLAppletElementImpl::setAllParamsAvailable):
2055 (HTMLAppletElementImpl::allParamsAvailable):
2056 * khtml/html/html_objectimpl.h:
2057 * khtml/html/htmlparser.cpp:
2058 (KHTMLParser::processCloseTag):
2059 * khtml/rendering/render_applet.cpp:
2060 (RenderApplet::createWidgetIfNecessary):
2062 2005-02-18 Richard Williamson <rjw@apple.com>
2064 Fixed <rdar://problem/4006161> Tiger8A380: Widgets leak dashboard regions
2066 We were leaking the DashboardRegionImpls.
2070 * khtml/css/css_valueimpl.cpp:
2071 (DOM::CSSPrimitiveValueImpl::cleanup):
2073 2005-02-18 Chris Blumenberg <cblu@apple.com>
2075 Fixed: <rdar://problem/3945271> REGRESSION (Mail): pasted plain text should pick up typing style instead of being unstyled
2077 Reviewed by kocienda.
2079 * khtml/editing/htmlediting.cpp:
2080 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): don't set class on element returned by createStyleSpanElement since that's already done
2081 (khtml::ReplacementFragment::ReplacementFragment): take matchStyle param, don't call computeStylesAndRemoveUnrendered() if !matchStyle
2082 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take matchStyle param
2083 (khtml::ReplaceSelectionCommand::doApply): if m_matchStyle, use selection.start() as the insertion position and don't call applyStyleToInsertedNodes()
2084 * khtml/editing/htmlediting.h:
2085 * kwq/WebCoreBridge.h:
2086 * kwq/WebCoreBridge.mm:
2087 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): take matchStyle param and pass it
2088 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): pass NO for matchStyle
2089 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): pass NO for matchStyle
2090 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): pass YES for matchStyle
2092 2005-02-18 Ken Kocienda <kocienda@apple.com>
2098 <rdar://problem/4013025> Copy/Paste of quoted word results in removal of any following <cr>
2099 <rdar://problem/4013100> Copy/Paste quoted text and then decrease quote level does not change text color
2101 For the most part, these bugs were caused by errors and lack of foresight on my part when
2102 I added the better paste code. Chalk these fixes up to the result of bake time.
2104 * khtml/editing/htmlediting.cpp:
2105 (khtml::ReplacementFragment::ReplacementFragment): Need to move count of number of blocks in
2106 fragment after the call to remove unrendered nodes. Meant to do this before, but forgot to.
2107 (khtml::ReplacementFragment::removeStyleNodes): Need to remove inline styles from elements!
2108 Terrible omission now fixed.
2109 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Remove blockquote colors for now.
2110 Code has a more extensive comment in it now to explain the difficulty, and the need for more
2112 (khtml::ReplaceSelectionCommand::doApply): Need to call applyStyleToInsertedNodes() in the
2113 m_fragment.hasInterchangeNewline() case. This was just missed before.
2114 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Updated results, subtly different, but OK.
2115 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Updated for <p> to <div> change in test content.
2116 * layout-tests/editing/pasteboard/paste-text-017.html: Needed to change <p> to <div> to
2117 make this test go with the new design of using <div> tags for default paragraphs.
2119 2005-02-18 David Hyatt <hyatt@apple.com>
2121 Fix for 3974263 (and possibly others). Don't let fixed tables use maxint as their maxwidth when some
2122 cells have percentage values.
2124 Reviewed by kocienda
2126 * khtml/misc/arena.cpp:
2128 * khtml/rendering/table_layout.cpp:
2129 (FixedTableLayout::calcWidthArray):
2130 (FixedTableLayout::calcMinMaxWidth):
2131 (AutoTableLayout::layout):
2133 2005-02-17 Darin Adler <darin@apple.com>
2137 - fixed <rdar://problem/3998627> WebKit crashes when deleting text in a modified div
2139 * khtml/khtml_part.cpp: (KHTMLPart::selectionComputedStyle): Add a ref and deref to keep
2140 the element alive until it's added to the DOM tree.
2141 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::styleForSelectionStart): Ditto.
2143 2005-02-17 Richard Williamson <rjw@apple.com>
2145 Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead
2147 Fixed w/o introducing a performance regression. Add early
2148 check for Osaka-Mono to avoid expensive call into WebKit.
2153 (QFont::isFixedPitch):
2155 2005-02-17 Darin Adler <darin@apple.com>
2159 - fixed <rdar://problem/4011210> REGRESSION (180-181): Maxlength property for INPUT object not working
2161 * kwq/KWQTextField.mm:
2162 (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): If controller returns
2163 YES, go on to call super, since super does the text formatter handling, which we need.
2164 (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
2165 (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
2169 2005-02-17 Ken Kocienda <kocienda@apple.com>
2175 <rdar://problem/4012058> Copy from quoted text and paste results in blue text
2177 The relatively-new paste code tries hard to retain style of the content from the
2178 source location. However, in the case of quoted material in mail messages, we do
2179 not want to carry the quoting color along. This fixes the problem by factoring
2182 * khtml/editing/htmlediting.cpp:
2183 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Now calls removeBlockquoteColorsIfNeeded()
2185 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): New function. Factors out colors that are
2186 the result of text being quoted.
2187 (khtml::isNodeRendered): Function moved in file. No other change.
2188 (khtml::isProbablyBlock): Function moved in file. No other change.
2189 (khtml::closestMailBlockquote): New function. Helps fix bug.
2190 (khtml::isMailBlockquote): Function moved to be free-floating instead of being a
2191 member of CompositeEditCommand. No other change.
2192 * khtml/editing/htmlediting.h: Moved around some functions. Added removeBlockquoteColorsIfNeeded().
2193 * khtml/editing/markup.cpp: Remove redundant static implementation of isMailBlockquote.
2195 2005-02-17 Richard Williamson <rjw@apple.com>
2197 Fixed <rdar://problem/4008163> dynamic support for -apple-dashboard-region is flakey
2199 Style operator== wasn't including regions.
2203 * khtml/rendering/render_style.cpp:
2204 (StyleCSS3NonInheritedData::operator==):
2206 2005-02-17 Adele Amchan <adele@apple.com>
2210 fix for <rdar://problem/4010028> 8A383: Safari v185 crash loading united.com multi city fare finder page.
2212 * khtml/dom/dom_string.cpp: (DOM::DOMString::operator += ): prevent nil dereference when DOMString being added is nil
2214 2005-02-17 Jens Alfke <jens@apple.com>
2218 Fix for rdar://3963151 "Mail only pasted ~950 of 1407 text lines into my message!"
2219 Force tokenizer to run synchronously while parsing document fragments, so it doesn't stop halfway through and cause truncated content.
2221 * khtml/html/html_elementimpl.cpp:
2222 (HTMLElementImpl::createContextualFragment):
2223 * khtml/html/htmltokenizer.cpp:
2224 (khtml::HTMLTokenizer::reset):
2225 (khtml::HTMLTokenizer::begin):
2226 (khtml::HTMLTokenizer::setForceSynchronous):
2227 (khtml::HTMLTokenizer::continueProcessing):
2228 * khtml/html/htmltokenizer.h:
2230 2005-02-17 Ken Kocienda <kocienda@apple.com>
2236 <rdar://problem/3982183> Mail's HTML paragraphs appear with unintended margins in Entourage and Eudora
2238 * khtml/editing/htmlediting.cpp:
2239 (khtml::createDefaultParagraphElement): Change element we make from <p> to <div>.
2240 This fixes the problem, as these other mailers show <div> elements without margins.
2242 Some test files needed to change to preserve the ability to "eyeball" the results.
2243 Many others changed just because their <p> elements changed to <div> elements.
2245 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt
2246 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt
2247 * layout-tests/editing/inserting/insert-div-013-expected.txt
2248 * layout-tests/editing/inserting/insert-div-013.html
2249 * layout-tests/editing/inserting/insert-div-014-expected.txt
2250 * layout-tests/editing/inserting/insert-div-014.html
2251 * layout-tests/editing/inserting/insert-div-018-expected.txt
2252 * layout-tests/editing/inserting/insert-div-018.html
2253 * layout-tests/editing/inserting/insert-div-019-expected.txt
2254 * layout-tests/editing/inserting/insert-div-019.html
2255 * layout-tests/editing/inserting/insert-div-020-expected.txt
2256 * layout-tests/editing/inserting/insert-div-020.html
2257 * layout-tests/editing/inserting/insert-div-021-expected.txt
2258 * layout-tests/editing/inserting/insert-div-021.html
2259 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
2260 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
2261 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt
2262 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt
2264 2005-02-17 Ken Kocienda <kocienda@apple.com>
2270 <rdar://problem/3996737> REGRESSION (Mail): Copy/paste in Mail inserts returns
2272 The root cause of the problem is that a couple of pieces of code in AppKit and Mail
2273 insert newlines into markup as it is generated, and the paste code in WebCore was
2274 not smart about nodes that do not render (as is the case with these added newlines).
2275 So, the solution is to remove these unrendered nodes in the paste code in a pre-pass.
2276 Fortunately, my recent addition of such a pass to the paste code to handle styles
2277 gave me a convenient place to put this new logic.
2279 * khtml/editing/htmlediting.cpp:
2280 (khtml::ReplacementFragment::ReplacementFragment): Use new name for function below.
2281 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Name change from computeStylesForNodes().
2282 Now does the additional work of removing unrendered nodes, as mentioned above.
2283 (khtml::isNodeRendered): New helper function.
2284 * khtml/editing/htmlediting.h: Updated as necessary.
2286 2005-02-17 Ken Kocienda <kocienda@apple.com>
2292 <rdar://problem/3998892> REGRESSION (Mail): bolding a selection from end of line changes unselected text on starting line.
2294 The styling code did not move to the next node when the starting position was
2295 at the last offset of a node. Instead, it styled it. Clearly wrong. Solution
2296 is to borrow a check from the delete algorithm. Though I call caretMaxOffset(),
2297 which I consider deprecated, it is still the simplest and most strightforward
2298 way to ask the right question for this kind of problem.
2300 * khtml/editing/htmlediting.cpp:
2301 (khtml::ApplyStyleCommand::applyInlineStyle): Fixed, as described above.
2302 * layout-tests/editing/style/style-3998892-fix-expected.txt: Added.
2303 * layout-tests/editing/style/style-3998892-fix.html: Added.
2305 2005-02-16 Chris Blumenberg <cblu@apple.com>
2307 Fixed: <rdar://problem/3954842> Forward/reply to an HTML email can result in nothing (in cases with <link> tags for CSS)
2311 * khtml/xml/dom_nodeimpl.cpp:
2312 (NodeBaseImpl::addChild): don't call insertedIntoDocument on the added child if "this" itself is not in the document.
2314 2005-02-16 John Sullivan <sullivan@apple.com>
2316 Written by Darin, reviewed by Maciej and me
2318 - change required to make previous checkin work with English language RSS pages
2321 new private method isHierarchical
2324 add hierarchical base URL check when determining whether the URL is absolute
2325 (KURL::isHierarchical):
2326 new method, returns true if this is a valid URL with a slash just past the scheme's trailing colon
2328 2005-02-16 John Sullivan <sullivan@apple.com>
2330 Written by Darin, reviewed by me.
2332 - WebCore part of fix for <rdar://problem/4007384>
2333 FILTER: Bookmark of RSS with Japanese search word & multiple RSS pages loses filter
2336 (-[DOMElement _getURLAttribute:]):
2337 new SPI method, uses parseURL and completeURL to get valid URL from attribute value
2340 declare new SPI method
2342 2005-02-15 Maciej Stachowiak <mjs@apple.com>
2346 <rdar://problem/3942428> reproducible crash loading cbs.sportsline.com
2348 This change reverts the fix for <rdar://problem/3805311>, and
2349 re-fixes it in a different (better) way. Instead of preventing
2350 programmatic open from setting the parsing flag, instead make sure
2351 that programmatic close resets it.
2353 * khtml/khtml_part.cpp:
2354 (KHTMLPart::openURL):
2355 (KHTMLPart::didExplicitOpen):
2356 (KHTMLPart::closeURL):
2359 (KHTMLPart::endIfNotLoading):
2360 (KHTMLPart::slotFinishedParsing):
2361 (KHTMLPart::checkEmitLoadEvent):
2362 * khtml/khtml_part.h:
2363 * khtml/khtmlpart_p.h:
2364 (KHTMLPartPrivate::KHTMLPartPrivate):
2365 * khtml/xml/dom_docimpl.cpp:
2366 (DocumentImpl::open):
2367 (DocumentImpl::implicitOpen):
2368 (DocumentImpl::close):
2369 (DocumentImpl::implicitClose):
2370 * khtml/xml/dom_docimpl.h:
2372 2005-02-15 David Harrison <harrison@apple.com>
2376 <rdar://problem/3933665> smart delete seems to delete too much after expanding selection with arrow keys
2378 Fixed by updating the selection granularity. Only byWord granularity enables smart delete, but in this
2379 case the granularity changed from byWord to byCharacter.
2381 * khtml/khtml_part.cpp:
2382 (KHTMLPart::setSelectionGranularity):
2383 * khtml/khtml_part.h:
2384 * kwq/WebCoreBridge.mm:
2385 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
2386 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
2387 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
2389 2005-02-15 David Harrison <harrison@apple.com>
2393 (continued) <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
2395 This was supposed have been committed yesterday with the other part of the fix, but was not.
2397 * khtml/editing/visible_units.cpp:
2400 2005-02-15 Ken Kocienda <kocienda@apple.com>
2406 <rdar://problem/3951178> REGRESSION (Mail): blank line lost after pasting as quotation
2408 Problem was that the blank line after the selection was getting deleted incorrectly since the
2409 paste code thought this was an unneeded placeholder rather than a placeholder outside of the
2412 * khtml/editing/htmlediting.cpp:
2413 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now calls findBlockPlaceholder.
2414 (khtml::CompositeEditCommand::findBlockPlaceholder): Moved finding code formerly in
2415 removeBlockPlaceholderIfNeeded to this new helper.
2416 (khtml::ReplaceSelectionCommand::doApply): Do not delete placeholder up front. Call
2417 findBlockPlaceholder, and delete it later if needed in the already-existing cleanup step.
2418 * khtml/editing/htmlediting.h: Add new function.
2422 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Added.
2423 * layout-tests/editing/pasteboard/paste-text-017.html: Added.
2425 Result changed for the better.
2427 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
2429 2005-02-14 David Harrison <harrison@apple.com>
2433 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
2437 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
2439 * khtml/editing/visible_text.cpp:
2440 (khtml::SimplifiedBackwardsTextIterator::advance):
2441 Add BR in for <rdar://problem/3917929> fix only if leaving a visible text node.
2443 * khtml/editing/visible_units.cpp:
2445 Do not move left over a paragraph boundary.
2447 2005-02-14 Darin Adler <darin@apple.com>
2451 - fixed <rdar://problem/3686434> Safari uses too much RAM on file upload, leading to malloc errors and crashes (HP printers)
2453 * khtml/html/html_formimpl.cpp:
2454 (DOM::FormDataList::begin): Updated to use a list of FormDataListItem instead of QCString.
2455 (DOM::FormDataList::end): Ditto.
2456 (DOM::HTMLFormElementImpl::formData): Same here, and also use appendFile rather than appendData
2457 when we encounter a path name rather than data.
2458 (DOM::HTMLInputElementImpl::appendFormData): Use appendFile here rather than reading the file
2459 in; the reading now happens inside WebKit.
2460 (DOM::FormDataList::appendString): Updated for FormDataListItem.
2461 (DOM::FormDataList::appendFile): Added.
2463 * ForwardingHeaders/kfileitem.h: Emptied out the file; no longer includes KWQKFileItem.h.
2464 * ForwardingHeaders/netaccess.h: Emptied out the file; no longer includes KWQKIONetAccess.h.
2465 * kwq/KWQKFileItem.h: Removed.
2466 * kwq/KWQKFileItem.mm: Removed.
2467 * kwq/KWQKIONetAccess.h: Removed.
2468 * kwq/KWQKIONetAccess.mm: Removed.
2469 * WebCore.pbproj/project.pbxproj: Removed the 4 files above.
2471 - small unrelated fix (not reviewed by John)
2473 * khtml/ecma/kjs_window.cpp: (Window::isSafeScript): Put some logging code outside if statements so it works all the time.
2475 2005-02-14 David Harrison <harrison@apple.com>
2479 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
2481 Fixed nextLinePosition to calculate affinity rather than take it as a parameter. Propagated the parameter change out to related methods.
2483 * khtml/editing/htmlediting.cpp:
2484 (khtml::DeleteSelectionCommand::initializePositionData):
2485 (khtml::InsertLineBreakCommand::doApply):
2486 (khtml::InsertParagraphSeparatorCommand::doApply):
2487 (khtml::InsertTextCommand::input):
2488 (khtml::ReplaceSelectionCommand::doApply):
2489 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes):
2490 * khtml/editing/selection.cpp:
2491 (khtml::Selection::modifyExtendingRightForward):
2492 (khtml::Selection::modifyMovingRightForward):
2493 (khtml::Selection::modifyExtendingLeftBackward):
2494 (khtml::Selection::modifyMovingLeftBackward):
2495 (khtml::Selection::modify):
2496 (khtml::Selection::validate):
2497 * khtml/editing/visible_position.cpp:
2498 (khtml::visiblePositionsOnDifferentLines):
2499 * khtml/editing/visible_units.cpp:
2500 (khtml::rootBoxForLine):
2501 (khtml::startOfLine):
2503 (khtml::inSameLine):
2504 (khtml::isStartOfLine):
2505 (khtml::isEndOfLine):
2506 (khtml::previousLinePosition):
2507 (khtml::nextLinePosition):
2508 (khtml::previousSentencePosition):
2509 (khtml::nextSentencePosition):
2510 (khtml::previousParagraphPosition):
2511 (khtml::nextParagraphPosition):
2512 * khtml/editing/visible_units.h:
2513 * khtml/khtml_events.cpp:
2514 (khtml::MouseEvent::offset):
2515 * khtml/khtml_part.cpp:
2516 (KHTMLPart::isPointInsideSelection):
2517 (KHTMLPart::selectClosestWordFromMouseEvent):
2518 (KHTMLPart::handleMousePressEventTripleClick):
2519 (KHTMLPart::handleMousePressEventSingleClick):
2520 (KHTMLPart::handleMouseMoveEventSelection):
2521 (KHTMLPart::khtmlMouseReleaseEvent):
2522 * khtml/rendering/render_block.cpp:
2523 (khtml::RenderBlock::positionForCoordinates):
2524 * khtml/rendering/render_block.h:
2525 * khtml/rendering/render_br.cpp:
2526 (RenderBR::positionForCoordinates):
2527 * khtml/rendering/render_br.h:
2528 * khtml/rendering/render_container.cpp:
2529 (RenderContainer::positionForCoordinates):
2530 * khtml/rendering/render_container.h:
2531 * khtml/rendering/render_inline.cpp:
2532 (RenderInline::positionForCoordinates):
2533 * khtml/rendering/render_inline.h:
2534 * khtml/rendering/render_object.cpp:
2535 (RenderObject::caretRect):
2536 (RenderObject::positionForCoordinates):
2537 * khtml/rendering/render_object.h:
2538 * khtml/rendering/render_replaced.cpp:
2539 (RenderReplaced::positionForCoordinates):
2540 * khtml/rendering/render_replaced.h:
2541 * khtml/rendering/render_text.cpp:
2542 (RenderText::positionForCoordinates):
2543 * khtml/rendering/render_text.h:
2544 * khtml/xml/dom_position.cpp:
2545 (DOM::Position::previousCharacterPosition):
2546 (DOM::Position::nextCharacterPosition):
2547 (DOM::Position::leadingWhitespacePosition):
2548 (DOM::Position::trailingWhitespacePosition):
2549 * khtml/xml/dom_position.h:
2550 * kwq/KWQAccObject.mm:
2551 (-[KWQAccObject value]):
2552 (-[KWQAccObject accessibilityAttributeValue:]):
2553 (-[KWQAccObject doAXLineForTextMarker:]):
2554 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
2555 (-[KWQAccObject doAXTextMarkerForPosition:]):
2556 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
2557 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2558 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2559 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
2560 * kwq/KWQKHTMLPart.mm:
2561 * kwq/WebCoreBridge.mm:
2562 (-[WebCoreBridge _visiblePositionForPoint:]):
2564 05-02-07 Maciej Stachowiak <mjs@apple.com>
2566 Reviewed by Ken and John.
2568 Re-fixed a specific case of the following:
2570 <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
2572 Oddly, Cmd-B, Cmd-U, type some text, return, Cmd-U, Cmd-B, type
2573 some text, worked fine. But hitting the second Cmd-B before the
2574 second Cmd-U still failed to remove underlining. The reason for
2575 this is that our code to compute the style of the current position
2576 did not work when you had a typing style and were positioned right
2577 at a <br> element. For various reasons, this did not show up for
2578 bold and italic, since those are handled through the font manager.
2580 The following change fixes this - for elements that can't have
2581 children, we add the dummy span after the element of interest,
2582 rather than as a child of it.
2584 * khtml/khtml_part.cpp:
2585 (KHTMLPart::selectionComputedStyle):
2587 2005-02-11 David Harrison <harrison@apple.com>
2591 <rdar://problem/3978980> Double Clicking on a line in Mail selected the entire body
2593 * khtml/editing/visible_units.cpp:
2594 (khtml::startOfWord):
2596 Pay attention to being at the end of a paragraph.
2598 (khtml::previousLinePosition):
2599 (khtml::nextLinePosition):
2600 (khtml::endOfParagraph):
2601 Use DOWNSTREAM per recent affinity changes.
2603 2005-02-11 Richard Williamson <rjw@apple.com>
2605 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
2607 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
2608 creates these wrappers. The WebCore subclass of the interpreter now overrides
2609 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
2611 * WebCore.pbproj/project.pbxproj:
2612 * khtml/ecma/kjs_binding.cpp:
2613 (ScriptInterpreter::createLanguageInstanceForValue):
2614 * khtml/ecma/kjs_binding.h:
2615 * kwq/DOMUtility.mm: Added.
2616 (KJS::ScriptInterpreter::createObjcInstanceForValue):
2617 * kwq/KWQKHTMLPart.mm:
2618 (KWQKHTMLPart::getAppletInstanceForView):
2619 (getInstanceForView):
2620 (KWQKHTMLPart::getEmbedInstanceForView):
2621 (KWQKHTMLPart::getObjectInstanceForView):
2623 2005-02-11 Chris Blumenberg <cblu@apple.com>
2625 Fixed: <rdar://problem/3937352> Quote level not maintained when copied and pasted within a Mail message
2627 Reviewed by harrison.
2629 * khtml/editing/markup.cpp:
2630 (khtml::isMailBlockquote): new
2631 (khtml::createMarkup): retain the Mail quote level by including all ancestor mail block quotes
2632 * khtml/rendering/render_block.cpp:
2633 (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
2634 * khtml/rendering/render_text.cpp:
2635 (RenderText::positionForCoordinates): ditto
2637 2005-02-11 Adele Amchan <adele@apple.com>
2641 fix for <rdar://problem/4004004> no need to add body element for xml documents
2643 In the fix for <rdar://problem/3758785> we decided to add a body element when closing a document
2644 to ensure that the onload handler would fire. This is unnecessary for xml documents,
2645 so now we also check to see if we're dealing with an html document before adding the body element.
2647 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
2649 2005-02-11 Adele Amchan <adele@apple.com>
2653 * layout-tests/apple-only/base/www.excite.com/index-expected.txt: updates tests because of custom tag change.
2654 * layout-tests/apple-only/base/www.msnbc.com/index-expected.txt:
2655 * layout-tests/apple-only/base/www.time.com/index-expected.txt:
2656 * layout-tests/apple-only/base/www.travelocity.com/index-expected.txt:
2657 * layout-tests/apple-only/base/www.zdnet.com/index-expected.txt:
2658 * layout-tests/fast/overflow/003-expected.txt:
2660 * layout-tests/fast/js/window-object-cross-frame-calls-expected.txt: updated test because of added Body (see rdar://problem/3758785)
2664 2005-02-11 Darin Adler <darin@apple.com>
2668 - 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
2670 * khtml/xml/dom_docimpl.h: Added a new openInternal function for use by KHTMLPart.
2671 * khtml/xml/dom_docimpl.cpp:
2672 (DocumentImpl::open): Changed to do everything we did before, but also clear the URL and set the
2673 base URL based on the enclosing document. This is the basic JavaScript/DOM operation of opening a
2674 document, which is supposed to clear the document, including the URL. In the long run we might want
2675 to do even more document "resetting and clearing" in here, but this URL clearing is what's needed
2676 now to fix the most important problem.
2677 (DocumentImpl::openInternal): Moved the old open code in here, except for the "parsing" check, which
2678 is unnecessary and inappropriate in the one place we call this.
2680 * khtml/khtml_part.cpp: (KHTMLPart::begin): Call openInternal instead of open.
2682 2005-02-10 Ken Kocienda <kocienda@apple.com>
2688 <rdar://problem/3992092> 8A374: Mail crash while pasting - RemoveNodeCommand
2690 * khtml/editing/htmlediting.cpp:
2691 (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in
2692 the document. We try to do a good job of detecting all these cases, and generally do. This
2693 one was missed. Fixed.
2695 2005-02-10 Darin Adler <darin@apple.com>
2697 Reviewed by Harrison.
2699 - added support needed to fix <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined
2701 * kwq/WebCoreBridge.h: Added selectionHasStyle: method.
2702 * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part.
2704 2005-02-10 Darin Adler <darin@apple.com>
2706 Reviewed by Harrison.
2708 - fixed <rdar://problem/3990484> cursor changes to I-beam when moving over text in widgets, even when selection off via CSS
2710 * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent): Changed code to check canSelect when deciding
2711 whether to show an I-beam cursor.
2713 * khtml/rendering/render_object.h: Added canSelect.
2714 * khtml/rendering/render_object.cpp:
2715 (selectStartNode): Added. Helper function with the guts of shouldSelect.
2716 (RenderObject::canSelect): Added. Like shouldSelect, but does not call the "start selecting" event handler.
2717 (RenderObject::shouldSelect): Refactored to use selectStartNode.
2719 * khtml/css/cssvalues.c: Regnerated with newer gperf.
2721 2005-02-10 David Hyatt <hyatt@apple.com>
2723 Fix for 3867759, .mac regression where scrollers don't show up. Make sure you can set the .width and
2724 .height properties on the Image object.
2726 Reviewed by John Sullivan
2728 * khtml/ecma/kjs_html.cpp:
2729 (ImageConstructorImp::construct):
2730 (Image::getValueProperty):
2733 * khtml/ecma/kjs_html.h:
2735 2005-02-10 Ken Kocienda <kocienda@apple.com>
2741 <rdar://problem/3965158> Drag-n-drop within a rich text message sometimes changes the color of the dragged text
2743 This change fixes the bug....and much more. Now, for the first time, the paste code can do "smart merging"
2744 or "smooshing" of styles during its operation. Since this new code is actively, rather than passively
2745 working with styles, it fixes the bug, and lays the groundwork for similar work we need to do to
2746 preserve quote levels in Mail.
2748 * khtml/css/css_valueimpl.cpp:
2749 (DOM::CSSMutableStyleDeclarationImpl::clear): New method.
2750 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
2751 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): Ditto.
2752 (DOM::operator==): Add operator for CSSProperty.
2753 * khtml/css/css_valueimpl.h: Declare new functions.
2754 * khtml/editing/htmlediting.cpp:
2755 (khtml::isEmptyStyleSpan): Improved the test in this function, rolling together the old implementation
2756 with some code that did this work inline elsewhere. Sum of the parts is better than either test was by itself.
2757 (khtml::isStyleSpan): Check for ID_SPAN.
2758 (khtml::ApplyStyleCommand::removeCSSStyle): Call isEmptyStyleSpan. This was the place with an inline implementation before.
2759 (khtml::ReplacementFragment::ReplacementFragment): Now takes a DocumentImpl argument. No longer does a "default style"
2760 check, but rather calls functions which do a similar check to that, and much more.
2761 (khtml::ReplacementFragment::~ReplacementFragment): Deref document, and computed styles.
2762 (khtml::ReplacementFragment::styleForNode): New helper. Looks up and returns computed style for a node.
2763 (khtml::ReplacementFragment::removeNodePreservingChildren): New helper.
2764 (khtml::ReplacementFragment::computeStylesForNodes): New function which computes the "desired" style for
2765 every node in the fragment. This information is used later after paste is done as a reference for testing
2766 what styles need to be added, and which can be removed as redundant, from all the nodes inserted by the
2768 (khtml::ReplacementFragment::removeStyleNodes): Clears out all style nodes from the fragment. They are
2769 no longer needed after the call to computeStylesForNodes(),
2770 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): Add a document to the call to initialize the
2771 command's ReplacementFragment.
2772 (khtml::ReplaceSelectionCommand::doApply): Call applyStyleToInsertedNodes() after inserting nodes to make
2773 styles come out right.
2774 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): This is the "style smooshing" function. It
2775 computes the styles that need to be added to each node inserted, comparing the style it gets from just
2776 being inserted into its correct destination with the computed "desired style" done in the
2777 ReplacementFragment constructor. It then adds in all the necessary styles, and will also remove redundant styles.
2778 * khtml/editing/htmlediting.h: Update declarations and member variables as needed.
2779 * khtml/editing/markup.cpp:
2780 (khtml::startMarkup): Add additional style annotations to the markup we generate, so that paste code can preserve it.
2781 (khtml::markup): Ditto.
2782 (khtml::createMarkup): Ditto.
2784 These test results are subtly better with this change. They no longer have an unneeded empty span.
2785 Visually the same as before.
2787 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
2788 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
2789 * layout-tests/editing/style/remove-underline-expected.txt
2790 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt
2794 * layout-tests/editing/style/smoosh-styles-001-expected.txt
2795 * layout-tests/editing/style/smoosh-styles-002-expected.txt
2796 * layout-tests/editing/style/smoosh-styles-001.html
2797 * layout-tests/editing/style/smoosh-styles-002.html
2799 2005-02-10 Darin Adler <darin@apple.com>
2803 - fixed <rdar://problem/3974988> WebHTMLView drops scroll wheel events when deltas are 0
2805 * kwq/WebCoreScrollView.m: (-[WebCoreScrollView autoforwardsScrollWheelEvents]): Added, for Tiger only.
2806 For Tiger, removed the override of scrollWheel:, which doesn't work quite right because of how the
2807 delta attributes return all 0 for newfangled scrolling events from the new trackpads.
2809 2005-02-10 David Harrison <harrison@apple.com>
2813 <rdar://problem/3991532> REGRESSION (Mail): Triple-click on trailing blank line should select previous line but doesn't
2815 * khtml/css/cssvalues.c:
2818 * khtml/editing/selection.cpp:
2819 (khtml::Selection::validate):
2820 Do moral equiavalent of LeftWordIfOnBoundary for PARAGRAPH.
2822 2005-02-10 David Harrison <harrison@apple.com>
2826 <rdar://problem/3991848> Double-click on first character selects wrong item
2828 * khtml/editing/selection.cpp:
2829 (khtml::Selection::validate):
2830 Honor the fact that clicking on a character positions the cursor on the left side of the character.
2832 2005-02-10 David Hyatt <hyatt@apple.com>
2834 Fix for 3980778, repro crash in RootInlineBox::paint. Make sure that when merging blocks we dirty them for layout
2835 up front. That way as we do the merge, we dont attempt to examine the lines in dirtyLinesForChangedChild.
2839 * khtml/rendering/render_block.cpp:
2840 (khtml::RenderBlock::removeChild):
2842 2005-02-10 David Hyatt <hyatt@apple.com>
2844 Fix for 3987010, fix a bug that caused the self-collapsing-block-cleared-float bit to never get set correctly.
2848 * khtml/rendering/render_block.h:
2849 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
2851 2005-02-10 David Hyatt <hyatt@apple.com>
2853 Fix for 3992440, text not wrapping correctly on half moon bay web site. Refine an incorrect optimization I
2854 added to be less restrictive.
2858 * khtml/rendering/render_block.cpp:
2859 (khtml::RenderBlock::layoutBlockChildren):
2861 2005-02-08 Maciej Stachowiak <mjs@apple.com>
2865 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
2867 I fixed this by removing all event listeners for a document, it's
2868 children, and any disconnected nodes that used to be in the
2869 document at document detach time. Mozilla temporarily disables
2870 event listeners on such nodes, but re-enables them if you
2871 re-parant a node into a new document. However, in WebCore, you
2872 can't re-parent a node into another document, so there is no
2873 observable change in behavior.
2875 We have to do this to break the possible reference cycles between
2876 event listeners and the dom nodes they are attached to (e.g. via
2877 scope chain, as in this case).
2879 * khtml/xml/dom_docimpl.cpp:
2880 (DocumentImpl::detach):
2881 (DocumentImpl::removeAllEventListenersFromAllNodesx):
2882 (DocumentImpl::registerDisconnectedNodeWithEventListeners):
2883 (DocumentImpl::unregisterDisconnectedNodeWithEventListeners):
2884 (DocumentImpl::removeAllDisconnectedNodeEventListeners):
2885 * khtml/xml/dom_docimpl.h:
2886 * khtml/xml/dom_nodeimpl.cpp:
2887 (NodeImpl::~NodeImpl):
2888 (NodeImpl::addEventListener):
2889 (NodeImpl::removeEventListener):
2890 (NodeImpl::removeAllEventListeners):
2891 (NodeImpl::removeHTMLEventListener):
2892 (NodeImpl::insertedIntoDocument):
2893 (NodeImpl::removedFromDocument):
2894 * khtml/xml/dom_nodeimpl.h:
2896 2005-02-09 Chris Blumenberg <cblu@apple.com>
2898 Fixed: <rdar://problem/3999213> Sometimes 2 Windows Media Player plugin instances are loaded
2902 * khtml/html/html_objectimpl.cpp:
2903 (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.
2904 (HTMLObjectElementImpl::recalcStyle): ditto
2906 2005-02-09 David Harrison <harrison@apple.com>
2910 <rdar://problem/3937447> Mail-689: Arrow key navigation in new message body stops working when a line ends with a bold word
2912 Added affinity to VisiblePosition. Changed Selection code to use affinity more.
2914 (Partial) <rdar://problem/3982096> editing/pasteboard/paste-text-007 is failing
2916 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.
2918 * khtml/ecma/kjs_window.cpp:
2919 (SelectionFunc::tryCall):
2920 * khtml/editing/htmlediting.cpp:
2921 (khtml::EditCommandPtr::setStartingSelection):
2922 (khtml::EditCommandPtr::setEndingSelection):
2923 (khtml::EditCommand::setStartingSelection):
2924 (khtml::EditCommand::setEndingSelection):
2925 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream):
2926 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
2927 (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
2928 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
2929 (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
2930 (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
2931 (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
2932 (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
2933 (khtml::ApplyStyleCommand::joinChildTextNodes):
2934 (khtml::DeleteSelectionCommand::initializePositionData):
2935 (khtml::DeleteSelectionCommand::handleGeneralDelete):
2936 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
2937 (khtml::DeleteSelectionCommand::doApply):
2938 (khtml::InsertLineBreakCommand::doApply):
2939 (khtml::InsertParagraphSeparatorCommand::doApply):
2940 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
2941 (khtml::InsertTextCommand::input):
2942 (khtml::MoveSelectionCommand::doApply):
2943 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
2944 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
2945 (khtml::ReplaceSelectionCommand::doApply):
2946 (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
2947 (khtml::ReplaceSelectionCommand::updateNodesInserted):
2948 (khtml::TypingCommand::deleteKeyPressed):
2949 (khtml::TypingCommand::forwardDeleteKeyPressed):
2950 (khtml::TypingCommand::markMisspellingsAfterTyping):
2951 * khtml/editing/htmlediting.h:
2952 * khtml/editing/selection.cpp:
2953 (khtml::Selection::Selection):
2954 (khtml::Selection::init):
2955 (khtml::Selection::moveTo):
2956 (khtml::Selection::modifyExtendingRightForward):
2957 (khtml::Selection::modifyMovingRightForward):
2958 (khtml::Selection::modifyExtendingLeftBackward):
2959 (khtml::Selection::modifyMovingLeftBackward):
2960 (khtml::Selection::modify):
2961 (khtml::Selection::xPosForVerticalArrowNavigation):
2962 (khtml::Selection::clear):
2963 (khtml::Selection::setBase):
2964 (khtml::Selection::setExtent):
2965 (khtml::Selection::setBaseAndExtent):
2966 (khtml::Selection::layout):
2967 (khtml::Selection::validate):
2968 * khtml/editing/selection.h:
2969 (khtml::Selection::startAffinity):
2970 (khtml::Selection::endAffinity):
2971 (khtml::Selection::baseAffinity):
2972 (khtml::Selection::extentAffinity):
2973 (khtml::operator==):
2974 * khtml/editing/text_affinity.h:
2976 * khtml/editing/visible_position.cpp:
2977 (khtml::VisiblePosition::VisiblePosition):
2978 (khtml::VisiblePosition::init):
2979 (khtml::VisiblePosition::initUpstream):
2980 (khtml::VisiblePosition::initDownstream):
2981 (khtml::VisiblePosition::next):
2982 (khtml::VisiblePosition::previous):
2983 (khtml::startVisiblePosition):
2984 (khtml::endVisiblePosition):
2985 * khtml/editing/visible_position.h:
2986 (khtml::VisiblePosition::):
2987 (khtml::VisiblePosition::VisiblePosition):
2988 (khtml::VisiblePosition::affinity):
2989 (khtml::VisiblePosition::setAffinity):
2990 (khtml::operator==):
2991 * khtml/editing/visible_units.cpp:
2992 (khtml::previousBoundary):
2993 (khtml::nextBoundary):
2994 (khtml::startOfLine):
2996 (khtml::previousLinePosition):
2997 (khtml::nextLinePosition):
2998 (khtml::startOfParagraph):
2999 (khtml::endOfParagraph):
3000 (khtml::previousParagraphPosition):
3001 (khtml::nextParagraphPosition):
3002 (khtml::startOfBlock):
3003 (khtml::endOfBlock):
3004 (khtml::startOfDocument):
3005 (khtml::endOfDocument):
3006 * khtml/editing/visible_units.h:
3007 * khtml/khtml_part.cpp:
3008 (KHTMLPart::findTextNext):
3009 (KHTMLPart::selectClosestWordFromMouseEvent):
3010 (KHTMLPart::handleMousePressEventTripleClick):
3011 (KHTMLPart::handleMousePressEventSingleClick):
3012 (KHTMLPart::handleMouseMoveEventSelection):
3013 (KHTMLPart::khtmlMouseReleaseEvent):
3014 (KHTMLPart::selectAll):
3015 (KHTMLPart::computeAndSetTypingStyle):
3016 (KHTMLPart::selectionComputedStyle):
3017 * khtml/rendering/render_br.cpp:
3018 (RenderBR::positionForCoordinates):
3019 * khtml/xml/dom_docimpl.cpp:
3020 (DocumentImpl::updateSelection):
3021 * khtml/xml/dom_nodeimpl.cpp:
3022 (NodeBaseImpl::setFocus):
3023 * khtml/xml/dom_position.cpp:
3024 (DOM::Position::previousCharacterPosition):
3025 (DOM::Position::nextCharacterPosition):
3026 * khtml/xml/dom_position.h:
3027 * kwq/KWQAccObject.mm:
3028 (-[KWQAccObject value]):
3029 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
3030 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
3031 (-[KWQAccObject accessibilityAttributeValue:]):
3032 (-[KWQAccObject doAXLineForTextMarker:]):
3033 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
3034 (-[KWQAccObject doAXTextMarkerForPosition:]):
3035 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
3036 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
3037 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
3038 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
3039 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
3040 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
3041 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
3042 * kwq/KWQAccObjectCache.mm:
3043 (KWQAccObjectCache::textMarkerForVisiblePosition):
3044 (KWQAccObjectCache::visiblePositionForTextMarker):
3045 * kwq/KWQKHTMLPart.mm:
3046 (KWQKHTMLPart::findString):
3047 (KWQKHTMLPart::advanceToNextMisspelling):
3048 (KWQKHTMLPart::styleForSelectionStart):
3049 (KWQKHTMLPart::baseWritingDirectionForSelectionStart):
3050 (KWQKHTMLPart::setSelectionFromNone):
3051 (KWQKHTMLPart::respondToChangedSelection):
3052 * kwq/WebCoreBridge.mm:
3053 (-[WebCoreBridge setSelectedDOMRange:affinity:]):
3054 (-[WebCoreBridge selectionAffinity]):
3055 (-[WebCoreBridge setMarkDOMRange:]):
3056 (-[WebCoreBridge _visiblePositionForPoint:]):
3057 (-[WebCoreBridge moveDragCaretToPoint:]):
3058 (-[WebCoreBridge editableDOMRangeForPoint:]):
3059 (-[WebCoreBridge ensureSelectionVisible]):
3060 (-[WebCoreBridge rangeOfCharactersAroundCaret]):
3062 2005-02-09 Chris Blumenberg <cblu@apple.com>
3064 Fixed: <rdar://problem/3985211> Seed: Mail: Drag-and-drop destination indicator / insertion point disappears
3066 Reviewed by kocienda.
3068 * khtml/rendering/render_block.cpp:
3069 (khtml::RenderBlock::paintCaret): new
3070 (khtml::RenderBlock::paintObject): call paintCaret for the cursor caret and the drag caret
3071 * khtml/rendering/render_block.h:
3075 2005-02-08 Ken Kocienda <kocienda@apple.com>
3081 <rdar://problem/3996344> Entire document content is deleted when only the first paragraph was supposed to be
3083 Problem stems from my attempt to fix this bug: <rdar://problem/3986155> Insertion point goes
3084 to beginning of doc after deleting.
3086 I added an "optimization" that proved to do more harm than good. So, basically, the fix is to remove code.
3088 * khtml/editing/htmlediting.cpp:
3089 (khtml::DeleteSelectionCommand::handleGeneralDelete)
3091 2005-02-07 Darin Adler <darin@apple.com>
3095 - fixed <rdar://problem/3890352> REGRESSION (125-170, Panther-only): pasted textarea contents disappear (exception in NSText)
3097 * kwq/KWQTextArea.mm: (-[KWQTextArea tile]): Don't resize the text view immediately here.
3098 Use performWithDelay to defer it to avoid the re-entrancy that bothers the Panther version
3099 of NSTextView. On Tiger, leave the code alone.
3101 2005-02-07 Adele Amchan <adele@apple.com>
3105 Fix for <rdar://problem/3993628> REGRESSION (180-181): Logitelnet bank's website doesn't work
3107 This fixes an oversight in the fix for <rdar://problem/3964286>.
3108 We're now making sure there is a document before calling checkCompleted in slotLoaderRequestDone.
3109 That function is called even when other parts finish loads of their subresources, so we could end
3110 up calling checkCompleted before we had a document. We also looked over all the other calls to
3111 checkCompleted to convince ourselves no other call sites had a similar issue.
3113 * khtml/khtml_part.cpp: (KHTMLPart::slotLoaderRequestDone): Check if doc is nil before calling
3116 2005-02-07 Ken Kocienda <kocienda@apple.com>
3122 <rdar://problem/3953302> Replacing quoted text ends up with blue-colored text that is not quoted
3124 * khtml/editing/htmlediting.cpp:
3125 (khtml::DeleteSelectionCommand::doApply): Removed special case delete code for select all. It was
3126 causing as many bugs as it fixed. What's more, the design concept is a bit shaky. By removing
3127 this special case, the bug goes away.
3128 * khtml/editing/htmlediting.h: Remove declaration.
3130 Test results using selectAll() updated to reflect changed behavior.
3132 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
3133 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
3134 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
3135 * layout-tests/editing/inserting/insert-3654864-fix-expected.txt:
3136 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
3137 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt:
3138 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt:
3139 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
3141 2005-02-06 Darin Adler <darin@apple.com>
3145 - fixed <rdar://problem/3994164> setting a new style attribute with setAttribute("style") doesn't blow away the old style
3147 * khtml/css/css_valueimpl.h: Renamed parseProperty to parseDeclaration, since it's used to parse
3148 an entire style declaration, not a single property.
3149 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::parseDeclaration): Renamed,
3150 and added code to clear m_values.
3151 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Call function by its
3152 new name, and remove some unnecessary comments.
3154 2005-02-06 Darin Adler <darin@apple.com>
3158 - fixed <rdar://problem/3993722> need oncut and onpaste handlers implemented for <textarea> (needed for widgets)
3160 * kwq/KWQTextArea.mm:
3161 (-[KWQTextAreaTextView dispatchHTMLEvent:]): Added.
3162 (-[KWQTextAreaTextView cut:]): Dispatch "before cut" and "cut" events.
3163 (-[KWQTextAreaTextView copy:]): Dispatch "before copy" and "copy" events.
3164 (-[KWQTextAreaTextView paste:]): Dispatch "before paste" and "paste" events.
3165 (-[KWQTextAreaTextView pasteAsPlainText:]): Ditto.
3166 (-[KWQTextAreaTextView pasteAsRichText:]): Ditto.
3168 2005-02-06 Darin Adler <darin@apple.com>
3172 - fixed <rdar://problem/3943038> <input type=search> that is focused in onload handler doesn't have a visible editor
3174 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setFocusNode): Always update layout before giving focus to a widget.
3175 This prevents the bad case where we give a widget focus before it has been positioned or sized, causing us to
3176 exercise edge cases AppKit doesn't handle well.
3178 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Remove workaround code I added
3179 to fix bug 3943049. Updating the layout fixes the same problem in a cleaner, safer way, and solves another problem,
3180 with the way the clip view is set up.
3182 2005-02-06 Darin Adler <darin@apple.com>
3186 - fixed <rdar://problem/3425232> textarea won't trigger onchange action when clicking to new field
3188 * khtml/rendering/render_form.h: Added new m_dirty data member.
3189 * khtml/rendering/render_form.cpp:
3190 (RenderTextArea::RenderTextArea): Initialize m_dirty to false.
3191 (RenderTextArea::detach): Call value() on the DOM element to cause it to fetch the value from this object.
3192 (RenderTextArea::handleFocusOut): Ditto. Also send the onchange event based only on the m_dirty flag.
3193 (RenderTextArea::updateFromElement): Clear the m_dirty flag if the edited value is blown away by a value
3194 that comes from the DOM element. Remove code to clear the element's m_dirtyvalue flag; that's an unnecessary
3195 optimization, and ideally we'll stop having code in the render object that knows about that flag later.
3196 (RenderTextArea::slotTextChanged): Set the m_dirty flag.
3198 2005-02-06 Darin Adler <darin@apple.com>
3202 - re-fixed <rdar://problem/3760910> please add support for custom tag names in HTML
3204 * khtml/xml/dom_docimpl.cpp:
3205 (DocumentImpl::tagId): Use ID_LAST_TAG + 1 for the ID of the first assigned tag ID. Before we'd use ID_LAST_TAG,
3206 which resulted in the same number being used for ID_COMMENT and the first custom tag.
3207 (DocumentImpl::tagName): Use ID_LAST_TAG + 1, as above.
3208 (DocumentImpl::namespaceURI): Change a < ID_LAST_TAG to <= ID_LAST_TAG in the same spirit as above.
3210 2005-02-06 Darin Adler <darin@apple.com>
3214 - fixed <rdar://problem/3986639> Crash occurs after choosing Undo Typing from the Edit menu
3216 * kwq/KWQTextArea.mm: (-[KWQTextArea viewWillMoveToWindow:]): Remove actions from undo manager when the view is
3217 removed from the window. Unfortunately, to do this the code has to know that the target of NSTextView actions
3218 will be the text storage object, but given the NSText architecture, that's pretty clear.
3220 2005-02-05 Chris Blumenberg <cblu@apple.com>
3222 Fixed: <rdar://problem/3991974> REGRESSION: www.jabra.com world location screen does not work
3226 * kwq/KWQKJavaAppletWidget.mm:
3227 (KJavaAppletWidget::KJavaAppletWidget): fallback to the document's base URL if there is no baseURL attribute
3228 * kwq/WebCoreBridge.h:
3229 * kwq/WebCoreBridge.mm:
3230 (-[WebCoreBridge baseURL]): new
3232 2005-02-04 David Harrison <harrison@apple.com>
3236 Rolled out Ken's accidental checkin when committing <rdar://problem/3986155> fix yesterday.
3238 * khtml/editing/selection.cpp:
3239 (khtml::Selection::validate):
3241 2005-02-04 Adele Amchan <adele@apple.com>
3245 Fix for <rdar://problem/3758785> Safari no longer works at BankOfAmerica online banking for military users
3247 When closing the document, if a body doesn't exist we now create one. This bug was preventing the onload handler from
3248 firing in cases where there wasn't a body. In the BankOfAmerica case, the page was just a bit of script where the onload
3249 handler redirected to the correct page.
3251 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
3253 2005-02-03 Ken Kocienda <kocienda@apple.com>
3259 <rdar://problem/3986155> Insertion point goes to beginning of doc after deleting
3261 * khtml/editing/htmlediting.cpp:
3262 (khtml::DeleteSelectionCommand::setStartNode): New convenience to handle reference counting when setting.
3263 (khtml::DeleteSelectionCommand::handleGeneralDelete): This contains the crux of the bug fix. Improve tests
3264 that detect when a selected node needs to be retained, rather than deleted, to preserve the intent of the user.
3265 This has the side effect of causing the insertion point placement code to succeed rather than fail. Before
3266 this fix, the failure of the insertion point placement code caused the insertion point to jump to the start
3267 of the document, which is the symptom that can be perceived by users when editing.
3268 * khtml/editing/htmlediting.h: Add setStartNode declaration.
3269 * khtml/editing/visible_units.cpp:
3270 (khtml::startOfBlock): This function had a stubbed-in non-tested implementation. Implement and
3271 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001-expected.txt: Added.
3272 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001.html: Added.
3273 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt: Added.
3274 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002.html: Added.
3275 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt: Added.
3276 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003.html: Added.
3277 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt: Added.
3278 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004.html: Added.
3279 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005-expected.txt: Added.
3280 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005.html: Added.
3281 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006-expected.txt: Added.
3282 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006.html: Added.
3286 2005-02-03 Richard Williamson <rjw@apple.com>
3288 Fixed <rdar://problem/3987419> Stocks and Weather leak what appears to XMLHTTPRequest results
3290 XMLHTTPRequests were causing massive leaks. _webcore_initWithHeaderString: did funky things with
3291 self replacement. Re-wrote to use more traditional factory constructor avoiding self replacement.
3293 Reviewed by David Harrison.
3296 (+[NSDictionary _webcore_dictionaryWithHeaderString:]):
3298 (KWQServeSynchronousRequest):
3300 2005-02-03 Chris Blumenberg <cblu@apple.com>
3302 Fixed: <rdar://problem/3938763> Cannot view Windows Media Player videos (soundtrack is played twice with delay)
3306 * khtml/html/html_objectimpl.cpp:
3307 (HTMLObjectElementImpl::attach): set needWidgetUpdate to false right after calling updateWidget because dispatchHTMLEvent can end up calling this method again
3308 (HTMLObjectElementImpl::recalcStyle): ditto
3310 2005-02-02 John Sullivan <sullivan@apple.com>
3314 - WebCore part of fix for <rdar://problem/3980651> REGRESSION (125-180): Huge number of pages printed from certain page,
3317 This also fixes the problems with printing from GMail, yay!
3319 * khtml/rendering/render_flow.cpp:
3320 (RenderFlow::paintLines):
3321 If the current line is taller than the entire page height (e.g. tall iFrame), don't try
3322 to avoid splitting it across pages.
3324 * kwq/WebCoreBridge.mm:
3325 (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
3326 Handle error cases in a more obvious manner; this will cause future problems like this
3327 to print a blank page and complain to the console on debug builds, rather than print a
3328 zillionty mostly-blank pages.
3330 2005-02-02 Chris Blumenberg <cblu@apple.com>
3332 Fixed: <rdar://problem/3960304> can't load a particular applet (at www.escape.de) unless it's the first applet to be loaded
3336 * khtml/rendering/render_frames.cpp:
3337 (RenderPartObject::updateWidget): when getting the MIME type from the PARAM tag, make sure the MIME type is the text from the left of the semi-colon if there is one. We do this elsewhere as well.
3339 2005-02-02 Chris Blumenberg <cblu@apple.com>
3341 Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)
3345 * kwq/KWQKHTMLPart.mm:
3346 (KWQKHTMLPart::sendContextMenuEvent): check if SPI to always enable selecting closest word is enabled
3347 * kwq/WebCoreBridge.h:
3349 2005-02-02 Ken Kocienda <kocienda@apple.com>
3353 * khtml/editing/markup.cpp:
3354 (khtml::createMarkup): Removed debug spam I committed earlier in error.
3356 2005-02-02 Ken Kocienda <kocienda@apple.com>
3362 <rdar://problem/3823109> WebKit should support -toggleBaseWritingDirection: (bidi editing support)
3364 Since base writing direction is a paragraph-level property in AppKit, and we use the CSS direction
3365 property in WebCore, which can be applied to inline elements as well as blocks, a new notion has
3366 been added to the WebCore apply style logic. It is now possible to force all properties in a
3367 style declaration to be applied as though they were block properties.
3369 * khtml/editing/htmlediting.cpp:
3370 (khtml::ApplyStyleCommand::ApplyStyleCommand): Add an enum and a flag to this command that controls whether to force all
3371 properties in the style to be applied as block styles. Default is "no", retaining previous behavior.
3372 (khtml::ApplyStyleCommand::doApply): Switch on new flag to apply styles as before, or force all preoperties to be applied
3374 * khtml/editing/htmlediting.h:
3375 (khtml::ApplyStyleCommand::): Add an enum and a flag, as above.
3376 * khtml/khtml_part.cpp:
3377 (KHTMLPart::applyParagraphStyle): New method to force application of all style properties as block styles.
3378 * khtml/khtml_part.h: Update header declarations.
3379 * kwq/KWQKHTMLPart.h: Update header declarations.
3380 * kwq/KWQKHTMLPart.mm:
3381 (KWQKHTMLPart::baseWritingDirectionForSelectionStart): Accessor to help WebKit do a toggle operation on
3383 * kwq/WebCoreBridge.h: Update header declarations.
3384 * kwq/WebCoreBridge.mm:
3385 (-[WebCoreBridge applyParagraphStyle:withUndoAction:]): New method to force application of all style properties as block styles.
3386 (-[WebCoreBridge baseWritingDirectionForSelectionStart]): Accessor to help WebKit do a toggle operation on
3391 <rdar://problem/3985035> REGRESSION (Mail): Text copied from wrapped line contains extra character when pasted
3393 * khtml/editing/markup.cpp:
3394 (khtml::renderedText): Add an enum and a flag to this command that controls whether to force all
3395 This is the result of an error in the code that computes the rendered text that is selected
3396 when copying. Since spaces collapse at the end of lines, and these spaces need to be copied
3397 when the selection spans line endings, code runs to compute this text. However, this code
3398 was also running incorrectly in cases where lines wrapped. I have now added the missing
3399 test to check that the selection does indeed extend to the end of the line.
3402 2005-02-02 Ken Kocienda <kocienda@apple.com>
3408 <rdar://problem/3984894> REGRESSION (Mail): Command-right-arrow in reply does the wrong thing (two ways)
3409 <rdar://problem/3985130> REGRESSION (Mail): command-right-arrow in pasted RTF selects only up to tab
3411 * khtml/editing/visible_units.cpp:
3412 (khtml::endOfLine): Two separate problems in this new function recently added to take the place of
3413 selectionForLine. In the first, endOfLine did not stop at BR elements, and returned the position
3414 beyond them. In the second, the VisiblePosition constructor gives the wrong answer in certain cases.
3415 Darin is going to work on a solution for that problem. In the meantime, I can fix the symptom of this
3416 bug by going down to the last leaf child of the root line box; a one line change we will roll out when
3419 2005-02-01 Richard Williamson <rjw@apple.com>
3421 Fixed <rdar://problem/3985535> QT Plug-in JavaScript support now fails in <embed> tag only case
3425 * khtml/ecma/kjs_html.cpp:
3426 (KJS::HTMLDocument::tryGet):
3428 2005-02-01 John Sullivan <sullivan@apple.com>
3430 Written by Darin, reviewed and tested by me
3432 - fixed <rdar://problem/3969684> Panther-only: extra blank lines between
3433 pasted content from Blot
3435 * kwq/KWQKHTMLPart.mm:
3436 (KWQKHTMLPart::attributedString):
3437 don't emit paragraph breaks if the margins are tiny; matches what
3438 we do for plain-text conversion
3442 2005-02-01 Ken Kocienda <kocienda@apple.com>
3448 <rdar://problem/3985160> Deficiencies in pasting architecture blocking progress on other bugs
3450 * khtml/editing/html_interchange.h: Move style span text used to mark element added to
3451 add style to this header.
3452 * khtml/editing/htmlediting.cpp:
3453 (khtml::styleSpanClassString): Change to use constant moved to html_interchange.h.
3454 (khtml::isStyleSpan): New helper function. Checks if this is a span we added to apply style.
3455 (khtml::CompositeEditCommand::insertNodeBefore): Added an assert to check that the node
3456 we are inserting before is not the body.
3457 (khtml::CompositeEditCommand::insertNodeAfter): Ditto, but check is for after.
3458 (khtml::ReplacementFragment::ReplacementFragment): Added code to process the "default style"
3459 that is added by the copy code.
3460 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): first and last nodes inserted are
3461 now member variables instead of function locals. Initialize them here.
3462 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): Deref first and last nodes inserted
3464 (khtml::ReplaceSelectionCommand::doApply): Change design to fix the bug. Major change is to
3465 separate out the code that inserts nodes into the tree so additional styling checks can
3466 be done in a centralized way. Also got rid of the notion of "merging into the end block." That
3467 concept was just wrong.
3468 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Tweak interface now that first and
3469 last nodes inserted are member variables.
3470 (khtml::ReplaceSelectionCommand::insertNodeAfterAndUpdateNodesInserted): New helper used
3471 by replace code to do the stated DOM operation and update state internal to the command.
3472 This will also be a catch point to handle the kinds of additional style checks needed to
3473 make paste work right.
3474 (khtml::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted): Ditto.
3475 (khtml::ReplaceSelectionCommand::insertNodeBeforeAndUpdateNodesInserted): Ditto.
3476 (khtml::ReplaceSelectionCommand::updateNodesInserted): Ditto.
3477 * khtml/editing/htmlediting.h: Update declarations as needed.
3478 * khtml/editing/markup.cpp:
3479 (khtml::createMarkup): Adds a "default style" span to the content written to the pasteboard.
3480 This will help us to fix some of the bugs blocked by the bug above.
3481 * khtml/xml/dom_nodeimpl.cpp:
3482 (NodeImpl::lastDescendent): New helper.
3483 * khtml/xml/dom_nodeimpl.h: Ditto.
3484 * khtml/xml/dom_position.cpp:
3485 (DOM::Position::upstream): Fixed a bug which would allow the upstream position returned to be
3486 in unrendered content.
3487 (DOM::Position::downstream): Ditto.
3489 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Ending positions tweaked due to
3490 changes in upstream() and downstream() functions.
3491 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Ditto
3492 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Ditto
3493 * layout-tests/editing/selection/extend-by-character-006-expected.txt: Ditto
3495 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Changed what we expect, given
3496 new behavior of paste code.
3498 2005-01-31 John Sullivan <sullivan@apple.com>
3500 Reviewed by Dave Hyatt.
3502 - fixed <rdar://problem/3983097> Tabbing on RSS pages gets stuck in search field
3503 with "full keyboard navigation" off
3507 (QSlider::focusPolicy):
3508 Implemented this method for KWQSlider. It is needed for our widget subclasses that
3509 can become focused in some situations. I missed this when fixing 3949203 because
3510 it only comes into play when tab-to-controls is on, and because the other relevant
3511 methods are objective-C methods.
3513 2005-01-31 David Harrison <harrison@apple.com>
3517 <rdar://problem/3964164> AXWebArea needs to unregister on going invisible
3519 * khtml/xml/dom_docimpl.cpp:
3520 (DocumentImpl::detach):
3521 Detach the AX UIElement for the AXWebArea.
3523 2005-01-31 David Harrison <harrison@apple.com>
3527 <rdar://problem/3850876> AX: button exposed as only an AXImage at http://appleseed.apple.com/ site (<input type=image>)
3529 * khtml/rendering/render_form.h:
3530 (khtml::RenderImageButton::isImageButton):
3532 * khtml/rendering/render_image.h:
3533 (khtml::RenderImage::isImageButton):
3535 * kwq/KWQAccObject.mm:
3536 (-[KWQAccObject isImageButton]):
3537 (-[KWQAccObject actionElement]):
3538 (-[KWQAccObject role]):
3539 (-[KWQAccObject accessibilityActionNames]):
3540 (-[KWQAccObject accessibilityPerformAction:]):
3541 Represent RenderImageButton elements as buttons instead of images.
3543 2005-01-31 David Harrison <harrison@apple.com>
3545 Prevent nil dereference in debug code.
3547 * khtml/xml/dom_nodeimpl.cpp:
3548 (NodeImpl::displayTree):
3549 Stop when parent is 0, too.
3551 2005-01-31 John Sullivan <sullivan@apple.com>
3553 Reviewed by Dave Hyatt.
3555 - fixed <rdar://problem/3949203> cannot tab to, within, or out of the RSS sidebar
3558 (-[KWQSlider becomeFirstResponder]):
3559 (-[KWQSlider resignFirstResponder]):
3560 (-[KWQSlider nextKeyView]):
3561 (-[KWQSlider previousKeyView]):
3562 (-[KWQSlider canBecomeKeyView]):
3563 (-[KWQSlider nextValidKeyView]):
3564 (-[KWQSlider previousValidKeyView]):
3565 Copied these methods from KWQButton. The lack of special handling for first-responder-ness
3566 here was causing the focus to get "stuck" on the RSS page's slider widget. Added FIXME
3567 about how it would be nice to share more of this code rather than replicating it in each
3568 KWQ widget subclass.
3570 2005-01-31 Darin Adler <darin@apple.com>
3572 Reviewed by Harrison.
3574 - fixed <rdar://problem/3980066> Double-click on single character moves insertion point to previous line
3576 * khtml/khtml_part.cpp:
3577 (KHTMLPart::selectClosestWordFromMouseEvent): Set affinity too.
3578 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
3579 (KHTMLPart::handleMouseMoveEventSelection): Ditto.
3580 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
3582 * khtml/editing/selection.cpp:
3583 (khtml::Selection::modifyExtendingRightForward): Use endOfLine and endOfDocument.
3584 (khtml::Selection::modifyMovingRightForward): Ditto.
3585 (khtml::Selection::modifyExtendingLeftBackward): Use startOfLine and startOfDocument.
3586 (khtml::Selection::modifyMovingLeftBackward): Ditto.
3587 (khtml::Selection::validate): Rewrote the section that handles double-click. Two main fixes: 1) use isStartOfLine to
3588 check for another case where we want to select the word to the right, and 2) use isEndOfParagraph, which seems
3589 to work correctly in cases where isLastVisiblePositionInParagraph is giving the wrong answer. Also changed the line
3590 code to use startOfLine/endOfLine and the document code to use startOfDocument/endOfDocument.
3592 2005-01-31 Darin Adler <darin@apple.com>
3594 Reviewed by Harrison.
3596 - fixed <rdar://problem/3935275> unexpected quit scrolling over link; last.fm (works in IE and Firefox)
3598 * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): By using the correct document, fix the crash reported here.
3599 The page still crashes when you close the browser window, but it's not trivial to fix so I'll file a new bug after that.
3601 2005-01-31 Darin Adler <darin@apple.com>
3603 Reviewed by Ken and Harrison.
3605 - fixed <rdar://problem/3947901> REGRESSION (Mail): Pasting paragraph of rich text leaves insertion point before pasted text
3606 - fixed <rdar://problem/3949790> hitting return after underlined line results in too much or too little underlined
3607 - fixed <rdar://problem/3981759> nil-deref and crash when pasting just a paragraph break
3608 - fixed a couple problems I discovered while working with bug 3949790
3610 * khtml/editing/htmlediting.cpp:
3611 (khtml::ApplyStyleCommand::applyInlineStyle): Pass StayInBlock to upstream. Without this, we end up going too far
3612 upstream in the test case in bug 3949790.
3613 (khtml::ApplyStyleCommand::removeInlineStyle): Pass StayInBlock to upstream and downstream. Same reason as above.
3614 (khtml::ReplaceSelectionCommand::doApply): Update endPos if inserting a new node and endPos is using that node's
3615 parent and an offset past the node being inserted. That change fixes a problem with the position of the insertion point
3616 after pasting into the top level of a document (from test cases in 3947901 and 3949790). When setting insertionPos, use
3617 code that works when lastNodeInserted is a block rather than a text node. That change fixes a problem where a newline is
3618 not added when pasting an entire paragraph into the end of a document (from test case in 3949790). Added nil check before
3619 checking if lastNodeInserted is a <br> element, which fixes the crash when pasting just a paragraph break.
3621 * khtml/editing/visible_units.h: Filled out the set of calls to add some boolean checks for lines (needed for the
3622 bug fix), and calls for blocks (not yet implemented), and documents. The document checks may need refinement to
3623 properly handle documents with a mix of editable and non-editable content, but for now they just refactor code
3624 and make things a little clearer. Also removed the "include line break" parameter from endOfSentence.
3625 * khtml/editing/visible_units.cpp:
3626 (khtml::rootBoxForLine): Added.
3627 (khtml::startOfLine): Added. Algorithm taken from selectionForLine in selection.cpp.
3628 (khtml::endOfLine): Ditto.
3629 (khtml::inSameLine): Added.
3630 (khtml::isStartOfLine): Added.
3631 (khtml::isEndOfLine): Added.
3632 (khtml::endOfSentence): Removed "include line break" parameter.
3633 (khtml::inSameParagraph): Added a null check.
3634 (khtml::isStartOfParagraph): Ditto.
3635 (khtml::isEndOfParagraph): Ditto.
3636 (khtml::startOfBlock): Added.
3637 (khtml::endOfBlock): Added.
3638 (khtml::inSameBlock): Added.
3639 (khtml::isStartOfBlock): Added.
3640 (khtml::isEndOfBlock): Added.
3641 (khtml::startOfDocument): Added.
3642 (khtml::endOfDocument): Added.
3643 (khtml::inSameDocument): Added.
3644 (khtml::isStartOfDocument): Added.
3645 (khtml::isEndOfDocument): Added.
3647 2005-01-30 Darin Adler <darin@apple.com>
3651 - fixed <rdar://problem/3977000> form data set posted for <input type="image" ...> omits name/value pair
3653 * khtml/html/html_formimpl.cpp:
3654 (DOM::HTMLInputElementImpl::appendFormData): Append a name/value pair for type IMAGE in addition to the X/Y
3657 2005-01-30 Darin Adler <darin@apple.com>
3661 - fixed <rdar://problem/3974246> REGRESSION (125-180): popup menus are missing item text on Harmony Remote web site
3663 * khtml/html/html_formimpl.cpp: (DOM::HTMLOptionElementImpl::text): Change this function to traverse the entire tree
3664 and gather all the text rather than just looking at immediate children.
3666 * khtml/xml/dom_nodeimpl.h: Added const.
3667 * khtml/xml/dom_nodeimpl.cpp:
3668 (NodeImpl::traverseNextNode): Added const.
3669 (NodeImpl::traverseNextSibling): Ditto.
3670 (NodeImpl::traversePreviousNodePostOrder): Ditto.
3671 (NodeImpl::detach): Add a missing nil check.
3673 2005-01-30 Darin Adler <darin@apple.com>
3677 - fixed <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
3679 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Added missing ref/deref of newly created element.
3681 2005-01-28 Darin Adler <darin@apple.com>
3683 * khtml/css/cssproperties.c: Regenerated with newer gperf.
3685 2005-01-28 David Harrison <harrison@apple.com>
3687 Reviewed by John Sullivan.
3689 <rdar://problem/3968144> AX need to be able to focus an AXLink by setting AXFocused to true
3691 * kwq/KWQAccObject.mm:
3692 (-[KWQAccObject accessibilityPerformAction:]):
3693 (-[KWQAccObject accessibilityIsAttributeSettable:]):
3694 Add AXFocused for AXLinks.
3696 2005-01-28 David Harrison <harrison@apple.com>
3700 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
3702 Use AppKit SPI _accessibilityParentForSubview to return KWQAccObject parent of AppKit AX object.
3704 * kwq/KWQAccObject.mm:
3705 (-[KWQAccObject _accessibilityParentForSubview:]):
3708 2005-01-27 Adele Amchan <adele@apple.com>
3710 fixed by Darin, reviewed by me.
3712 <rdar://problem/3976314> REGRESSION (180-TOT): submitting password fields fail on Panther
3714 * kwq/KWQTextField.mm: (-[KWQTextFieldController string]): on panther, the secure text field's editor
3715 does not contain the real string, so now we just call stringValue on the field in that case.
3717 2005-01-26 Maciej Stachowiak <mjs@apple.com>
3719 Reviewed by Darin, Hyatt and Ken.
3721 <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
3723 * khtml/css/css_computedstyle.cpp:
3724 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support
3725 for -khtml-text-decorations-in-effect property. This works like text-docration
3726 but follows proper inline semantics, that is, if a parent is causing text
3727 decoration then -khtml-text-decorations-in-effect on this element will reflect that.
3728 * khtml/css/cssproperties.in: Add -khtml-text-decorations-in-effect property.
3729 * khtml/css/cssproperties.h: regenerated
3730 * khtml/css/cssvalues.c: regenerated
3731 * khtml/css/cssparser.cpp: regenerated
3732 * khtml/css/cssproperties.c: regenerated
3734 * khtml/css/css_valueimpl.h: Made copyPropertiesInSet public.
3736 * khtml/editing/htmlediting.cpp:
3737 (khtml::StyleChange::init): Handle -khtml-text-decorations-in-effect
3738 specially, translate to text-decoration
3739 (khtml::ApplyStyleCommand::applyInlineStyle): Fix a comment.
3740 (khtml::ApplyStyleCommand::removeInlineStyle): Add new way of pushing down
3741 text-decoration styles around the edges of the selected range.
3742 (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAroundNode): Helper for this.
3743 (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): ditto
3744 (khtml::ApplyStyleCommand::nodeFullyUnselected): ditto
3745 (khtml::hasTextDecorationProperty): ditto
3746 (khtml::highestAncestorWithTextDecoration): ditto
3747 (khtml::ApplyStyleCommand::extractTextDecorationStyle): ditto
3748 (khtml::ApplyStyleCommand::extractAndNegateTextDecorationStyle): ditto
3749 (khtml::ApplyStyleCommand::applyTextDecorationStyle): ditto
3750 * khtml/editing/htmlediting.h: Prototype new methods.
3751 * khtml/editing/jsediting.cpp: Make underline execCommand use the new CSS property.
3753 - as a necessary part of the fix, fixed the longstanding problem
3754 that mutating an element's inlineStyleDecl would not property
3755 update its style attribute. now it does.
3757 * khtml/css/css_valueimpl.cpp:
3758 (DOM::CSSMutableStyleDeclarationImpl::setChanged): If this is an inline style
3759 declaration, tell the element it's style attribute needs updating.
3760 * khtml/html/html_elementimpl.cpp:
3761 (HTMLElementImpl::invalidateStyleAttribute): New method, just calls down
3763 (HTMLElementImpl::updateStyleAttribute): Regenerate style attribute from
3764 inline style declaration.
3765 * khtml/html/html_elementimpl.h: Prototype new stuff.
3766 * khtml/xml/dom_elementimpl.cpp:
3767 (ElementImpl::ElementImpl): Initialize new attribute.
3768 (ElementImpl::updateStyleAttributeIfNeeded): New method to check if the style
3769 is dirty and this is an html element, and if so call the html element to
3770 regenerate the style attribute.
3771 (ElementImpl::attributes): update style if needed
3772 (ElementImpl::getAttribute): ditto
3773 (ElementImpl::hasAttributes): ditto
3774 (ElementImpl::dump): ditto
3775 (XMLElementImpl::cloneNode): ditto
3776 * khtml/xml/dom_elementimpl.h:
3777 (DOM::ElementImpl::isStyleAttributeValid): new method to manage style attr
3779 (DOM::ElementImpl::setStyleAttributeValid): ditto
3781 - added new layout tests for underlining:
3783 * layout-tests/editing/editing.js:
3784 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt: Added.
3785 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt: Added.
3786 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold.html: Added.
3787 * layout-tests/editing/style/remove-underline-across-paragraph.html: Added.
3788 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt: Added.
3789 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt: Added.
3790 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold.html: Added.
3791 * layout-tests/editing/style/remove-underline-after-paragraph.html: Added.
3792 * layout-tests/editing/style/remove-underline-expected.txt: Added.
3793 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt: Added.
3794 * layout-tests/editing/style/remove-underline-from-stylesheet.html: Added.
3795 * layout-tests/editing/style/remove-underline-in-bold-expected.txt: Added.
3796 * layout-tests/editing/style/remove-underline-in-bold.html: Added.
3797 * layout-tests/editing/style/remove-underline.html: Added.
3798 * layout-tests/editing/style/underline-expected.txt: Added.
3799 * layout-tests/editing/style/underline.html: Added.
3801 2005-01-27 David Hyatt <hyatt@apple.com>
3803 Fix for 3875199, search field needs to be able to show a magnifying glass without a dropdown menu.
3805 Reviewed by kocienda
3807 * khtml/html/html_formimpl.cpp:
3808 (DOM::HTMLInputElementImpl::HTMLInputElementImpl):
3809 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
3810 * kwq/KWQLineEdit.mm:
3811 (QLineEdit::setMaxResults):
3813 2005-01-27 Ken Kocienda <kocienda@apple.com>
3819 <rdar://problem/3973254> Deletions of ranges does not coalesce correctly with subsequent typing
3821 * khtml/editing/htmlediting.cpp:
3822 (khtml::InsertTextCommand::deleteCharacter): Remove this dead code.
3823 (khtml::ReplaceSelectionCommand::editingAction): Moved this code to a better place in the file.
3824 It was in with unrelated functions.
3825 (khtml::TypingCommand::TypingCommand): Reorganize initialization list so it is easier to read.
3826 (khtml::TypingCommand::issueCommandForDeleteKey): Remove dead code. Roll in remaining code into deleteKeyPressed.
3827 (khtml::TypingCommand::deleteKeyPressed): Add in support for carrying along smart delete flag.
3828 (khtml::TypingCommand::forwardDeleteKeyPressed): New function. Makes forward delete work like
3829 "regular" delete in terms of coalescing typing.
3830 (khtml::TypingCommand::doApply): Add case for ForwardDeleteKey.
3831 (khtml::TypingCommand::preservesTypingStyle): Ditto.
3832 * khtml/editing/htmlediting.h:
3833 (khtml::TypingCommand::): Add ForwardDeleteKey constant. Remove a couple declarations for now-dead code.
3834 (khtml::TypingCommand::smartDelete): New accessor.
3835 (khtml::TypingCommand::setSmartDelete): Ditto.
3836 * kwq/WebCoreBridge.h:
3837 * kwq/WebCoreBridge.mm:
3838 (-[WebCoreBridge deleteKeyPressedWithSmartDelete:]): Add smart delete flag.
3839 (-[WebCoreBridge forwardDeleteKeyPressedWithSmartDelete:]): New method.
3840 * khtml/editing/jsediting.cpp: Add supprt for ForwardDelete command
3841 * layout-tests/editing/editing.js: Ditto.
3842 * layout-tests/editing/deleting/delete-and-undo-expected.txt: Added.
3843 * layout-tests/editing/deleting/delete-and-undo.html: Added.
3844 * layout-tests/editing/deleting/forward-delete-expected.txt: Added.
3845 * layout-tests/editing/deleting/forward-delete.html: Added.