3 2005-02-21 Darin Adler <darin@apple.com>
5 - fixed Panther deployment build
7 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Put more stuff inside #if.
9 2005-02-21 David Harrison <harrison@apple.com>
13 <rdar://problem/3943090> REGRESSION (Mail): Spelling underline incompletely erased following certain steps
15 * khtml/rendering/render_text.cpp:
16 (InlineTextBox::paintMarker):
17 Make sure underline is placed within the text bounds.
21 (QPainter::misspellingLineThickness):
22 * kwq/WebCoreTextRenderer.h:
23 Add misspellingLineThickness for use by InlineTextBox::paintMarker.
25 2005-02-21 Darin Adler <darin@apple.com>
29 - fixed <rdar://problem/4012978> -[DOMRange markupString] crashes when range contains only a text node with a single space
31 * khtml/editing/markup.cpp: (khtml::createMarkup): Added updateLayout calls, and added a missing
34 2005-02-21 Darin Adler <darin@apple.com>
38 - fixed <rdar://problem/4005435> Safari hung while pasting text into a <textarea> (Panther-only)
40 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Don't setAutohidesScrollers:YES on Panther.
42 2005-02-21 Ken Kocienda <kocienda@apple.com>
48 <rdar://problem/4015499> REGRESSION (186-187): pasted quoted text starting with a blank line increases quote level of pasted text when pasted
50 * khtml/editing/markup.cpp:
51 (khtml::markup): Changed over to ASSERT instead of assert.
52 (khtml::createMarkup): The issue was that the code to add parents all the way back to the common ancestor
53 block did not check for blocks whose markup had already been added, and could result in adding markup for
54 nodes twice (hence the additional and erroneous quote level). Now there is a new check that will
55 only add markup for those nodes before the start of the selection range. This fixes the bug.
56 (khtml::createFragmentFromMarkup): Changed over to ASSERT instead of assert.
57 (khtml::createFragmentFromText): Ditto.
59 2005-02-21 Ken Kocienda <kocienda@apple.com>
65 <rdar://problem/4015494> REGRESSION (186-187) <cr> removed if quoted word is copy/pasted on line immediately above quoted text
67 * khtml/editing/htmlediting.cpp:
68 (khtml::ReplaceSelectionCommand::doApply): Relatively new check designed to remove a <br> element when
69 that element was on a line by itself did not do an adequate check for this condition, causing the
70 failure described in the bug. Fixed.
72 2005-02-19 Ken Kocienda <kocienda@apple.com>
76 * khtml/editing/htmlediting.cpp:
77 (khtml::matchNearestBlockquoteColorString): New function which abstracts away the CSS property we use
78 for this pseudo-color.
79 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Set the new nearestBlockquoteColorString
80 psuedo-color here, rather than removing colors as was done before.
81 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): Check for the pseudo-color in the desired
82 style, and determine the real color based on the nearest blockquote (or none) to the node.
83 (khtml::nearestMailBlockquote): Name change from closestMailBlockquote to match new property better.
85 All the rest of this change is the mechanical coding you need to do to add a new CSS property, in this
86 case, -khtml-match-nearest-mail-blockquote-color.
88 * khtml/css/css_computedstyle.cpp:
89 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue)
90 * khtml/css/cssparser.cpp:
91 (CSSParser::parseValue):
92 * khtml/css/cssproperties.c:
95 * khtml/css/cssproperties.h:
96 * khtml/css/cssproperties.in:
97 * khtml/css/cssstyleselector.cpp:
98 (khtml::CSSStyleSelector::applyProperty)
99 * khtml/css/cssvalues.c:
101 * khtml/css/cssvalues.h:
102 * khtml/css/cssvalues.in:
103 * khtml/rendering/render_style.h:
104 (khtml::RenderStyle::matchNearestMailBlockquoteColor)
105 (khtml::RenderStyle::setMatchNearestMailBlockquoteColor)
106 (khtml::RenderStyle::initialMatchNearestMailBlockquoteColor)
108 2005-02-19 Ken Kocienda <kocienda@apple.com>
114 <rdar://problem/4014228> REGRESSION (186-187) extra, uneditable lines inserted above and below a line of pasted quoted text
115 <rdar://problem/4014393> REGRESSION (186-187) pasted quoted text gets extra <cr>s when pasted at top of document
117 * khtml/editing/htmlediting.cpp:
118 (khtml::ReplacementFragment::ReplacementFragment): Part of a general refactoring of how
119 the fragment is inserted into the document, rendered, and then tested for certain
120 important pieces of information that are required for pasting.
121 (khtml::ReplacementFragment::insertFragmentForTestRendering): New helper. Handles inserting
122 the fragment nodes into the document.
123 (khtml::ReplacementFragment::restoreTestRenderingNodesToFragment): Removes nodes from the
124 document, and restores them to the fragment.
125 (khtml::ReplacementFragment::computeStylesUsingTestRendering): Factored out code that
126 did this before into its own function.
127 (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
128 (khtml::ReplacementFragment::countRenderedBlocks): This is a real improvement, as it
129 eliminates a major use of the isProbablyBlock() function. Now, the blocks that are
130 counted are real, rendered blocks.
131 (khtml::ReplacementFragment::removeStyleNodes): Made this function retain margin-zeroing
132 CSS properties on paragraphs. This does two things: 1) It helps us to maintain good behavior
133 in the short term while there are still versions of Mail out there that use <p> elements
134 instead of <div> elements for new paragraphs; and 2) It will help to maintain the compatibility
135 with other mail clients that use <p> elements for their paragraphs but render them themselves
136 with no margins as the result of quirks.
137 (khtml::ReplaceSelectionCommand::doApply): Do some work to fix up and improve the handling
138 of blank lines, be they <p> elements or <br> elements, that can be removed after pasting. This,
139 coupled with the refactoring, fixes 4014393.
140 * khtml/editing/htmlediting.h: Updated for new functions.
141 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Updated results, actually improved with this change.
142 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Ditto.
144 2005-02-19 Kevin Decker <kdecker@apple.com>
148 Fixed <rdar://problem/4010765> Flash player can be used to arbitrarily open popup windows without user permission
150 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.
152 * kwq/WebCoreBridge.h:
153 * kwq/WebCoreBridge.mm:
154 (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Changed this to invoke the new stringByEvaluatingJavaScriptFromString:forceUserGesture method below.
155 (-[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.
157 2005-02-18 Chris Blumenberg <cblu@apple.com>
159 Fixed: <rdar://problem/3951196> REGRESSION (Mail): too many levels of reply quotes after certain steps
161 Reviewed by kocienda.
163 * khtml/editing/htmlediting.cpp:
164 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
165 - 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.
166 - Build up the list of ancestors after we've determined the actual topBlockquote.
167 - Don't insert an extra new line if there is a new start node.
169 2005-02-19 Chris Blumenberg <cblu@apple.com>
171 Fixed: <rdar://problem/3978461> smart paste is broken
175 * khtml/editing/htmlediting.cpp:
176 (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.
178 2005-02-18 Adele Amchan <adele@apple.com>
182 Fix for <rdar://problem/3975568> REGRESSION(125-180)Australian Open pages have drawing problem
184 This patch fixes two problems caused by our added support for custom tags. First, the layout problem at the sites mentioned in the bug
185 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.
186 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
187 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
188 endTagArray and tagPriorityArray.
190 * khtml/html/dtd.h: changed all uses of the endTag array to endTagArray for our new wrapper functions
191 (DOM::tagPriority): added function to check array bounds and to treat custom tags as spans
192 (DOM::endTagRequirement): added function to check array bounds and to treat custom tags as spans
193 * khtml/html/dtd.cpp: changed name of endTag and tagPriority arrays to endTagArray and tagPriorityArray
194 (DOM::checkChild): treat custom tags as spans during this check
195 * khtml/html/html_elementimpl.cpp: changed all uses of the endTag array to the endTagRequirement function
196 (HTMLElementImpl::createContextualFragment):
197 (HTMLElementImpl::setInnerText):
198 (HTMLElementImpl::setOuterText):
199 (HTMLElementImpl::toString):
200 * 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.
201 (KHTMLParser::parseToken):
202 (KHTMLParser::insertNode):
203 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): changed all uses of the endTag array to the endTagRequirement function
204 * khtml/editing/markup.cpp: changed all uses of the endTag array to the endTagRequirement function
208 2005-02-18 Jens Alfke <jens@apple.com>
212 Fixed build: Whoops, setNeedsLayout's parameter is NOT optional.
214 * khtml/html/html_objectimpl.cpp:
215 (HTMLAppletElementImpl::setAllParamsAvailable):
217 2005-02-18 Jens Alfke <jens@apple.com>
219 Reviewed by cblu, hyatt.
221 Fixes <rdar://problem/3603191> "REGRESSION: Applets not receiving all of the Applet Parameters in Java 1.4.1/1.4.2"
222 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.
224 * khtml/html/html_objectimpl.cpp:
225 (HTMLAppletElementImpl::HTMLAppletElementImpl):
226 (HTMLAppletElementImpl::getAppletInstance):
227 (HTMLAppletElementImpl::setAllParamsAvailable):
228 (HTMLAppletElementImpl::allParamsAvailable):
229 * khtml/html/html_objectimpl.h:
230 * khtml/html/htmlparser.cpp:
231 (KHTMLParser::processCloseTag):
232 * khtml/rendering/render_applet.cpp:
233 (RenderApplet::createWidgetIfNecessary):
235 2005-02-18 Richard Williamson <rjw@apple.com>
237 Fixed <rdar://problem/4006161> Tiger8A380: Widgets leak dashboard regions
239 We were leaking the DashboardRegionImpls.
243 * khtml/css/css_valueimpl.cpp:
244 (DOM::CSSPrimitiveValueImpl::cleanup):
246 2005-02-18 Chris Blumenberg <cblu@apple.com>
248 Fixed: <rdar://problem/3945271> REGRESSION (Mail): pasted plain text should pick up typing style instead of being unstyled
250 Reviewed by kocienda.
252 * khtml/editing/htmlediting.cpp:
253 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): don't set class on element returned by createStyleSpanElement since that's already done
254 (khtml::ReplacementFragment::ReplacementFragment): take matchStyle param, don't call computeStylesAndRemoveUnrendered() if !matchStyle
255 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take matchStyle param
256 (khtml::ReplaceSelectionCommand::doApply): if m_matchStyle, use selection.start() as the insertion position and don't call applyStyleToInsertedNodes()
257 * khtml/editing/htmlediting.h:
258 * kwq/WebCoreBridge.h:
259 * kwq/WebCoreBridge.mm:
260 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): take matchStyle param and pass it
261 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): pass NO for matchStyle
262 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): pass NO for matchStyle
263 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): pass YES for matchStyle
265 2005-02-18 Ken Kocienda <kocienda@apple.com>
271 <rdar://problem/4013025> Copy/Paste of quoted word results in removal of any following <cr>
272 <rdar://problem/4013100> Copy/Paste quoted text and then decrease quote level does not change text color
274 For the most part, these bugs were caused by errors and lack of foresight on my part when
275 I added the better paste code. Chalk these fixes up to the result of bake time.
277 * khtml/editing/htmlediting.cpp:
278 (khtml::ReplacementFragment::ReplacementFragment): Need to move count of number of blocks in
279 fragment after the call to remove unrendered nodes. Meant to do this before, but forgot to.
280 (khtml::ReplacementFragment::removeStyleNodes): Need to remove inline styles from elements!
281 Terrible omission now fixed.
282 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Remove blockquote colors for now.
283 Code has a more extensive comment in it now to explain the difficulty, and the need for more
285 (khtml::ReplaceSelectionCommand::doApply): Need to call applyStyleToInsertedNodes() in the
286 m_fragment.hasInterchangeNewline() case. This was just missed before.
287 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Updated results, subtly different, but OK.
288 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Updated for <p> to <div> change in test content.
289 * layout-tests/editing/pasteboard/paste-text-017.html: Needed to change <p> to <div> to
290 make this test go with the new design of using <div> tags for default paragraphs.
292 2005-02-18 David Hyatt <hyatt@apple.com>
294 Fix for 3974263 (and possibly others). Don't let fixed tables use maxint as their maxwidth when some
295 cells have percentage values.
299 * khtml/misc/arena.cpp:
301 * khtml/rendering/table_layout.cpp:
302 (FixedTableLayout::calcWidthArray):
303 (FixedTableLayout::calcMinMaxWidth):
304 (AutoTableLayout::layout):
306 2005-02-17 Darin Adler <darin@apple.com>
310 - fixed <rdar://problem/3998627> WebKit crashes when deleting text in a modified div
312 * khtml/khtml_part.cpp: (KHTMLPart::selectionComputedStyle): Add a ref and deref to keep
313 the element alive until it's added to the DOM tree.
314 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::styleForSelectionStart): Ditto.
316 2005-02-17 Richard Williamson <rjw@apple.com>
318 Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead
320 Fixed w/o introducing a performance regression. Add early
321 check for Osaka-Mono to avoid expensive call into WebKit.
326 (QFont::isFixedPitch):
328 2005-02-17 Darin Adler <darin@apple.com>
332 - fixed <rdar://problem/4011210> REGRESSION (180-181): Maxlength property for INPUT object not working
334 * kwq/KWQTextField.mm:
335 (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): If controller returns
336 YES, go on to call super, since super does the text formatter handling, which we need.
337 (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
338 (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
342 2005-02-17 Ken Kocienda <kocienda@apple.com>
348 <rdar://problem/4012058> Copy from quoted text and paste results in blue text
350 The relatively-new paste code tries hard to retain style of the content from the
351 source location. However, in the case of quoted material in mail messages, we do
352 not want to carry the quoting color along. This fixes the problem by factoring
355 * khtml/editing/htmlediting.cpp:
356 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Now calls removeBlockquoteColorsIfNeeded()
358 (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): New function. Factors out colors that are
359 the result of text being quoted.
360 (khtml::isNodeRendered): Function moved in file. No other change.
361 (khtml::isProbablyBlock): Function moved in file. No other change.
362 (khtml::closestMailBlockquote): New function. Helps fix bug.
363 (khtml::isMailBlockquote): Function moved to be free-floating instead of being a
364 member of CompositeEditCommand. No other change.
365 * khtml/editing/htmlediting.h: Moved around some functions. Added removeBlockquoteColorsIfNeeded().
366 * khtml/editing/markup.cpp: Remove redundant static implementation of isMailBlockquote.
368 2005-02-17 Richard Williamson <rjw@apple.com>
370 Fixed <rdar://problem/4008163> dynamic support for -apple-dashboard-region is flakey
372 Style operator== wasn't including regions.
376 * khtml/rendering/render_style.cpp:
377 (StyleCSS3NonInheritedData::operator==):
379 2005-02-17 Adele Amchan <adele@apple.com>
383 fix for <rdar://problem/4010028> 8A383: Safari v185 crash loading united.com multi city fare finder page.
385 * khtml/dom/dom_string.cpp: (DOM::DOMString::operator += ): prevent nil dereference when DOMString being added is nil
387 2005-02-17 Jens Alfke <jens@apple.com>
391 Fix for rdar://3963151 "Mail only pasted ~950 of 1407 text lines into my message!"
392 Force tokenizer to run synchronously while parsing document fragments, so it doesn't stop halfway through and cause truncated content.
394 * khtml/html/html_elementimpl.cpp:
395 (HTMLElementImpl::createContextualFragment):
396 * khtml/html/htmltokenizer.cpp:
397 (khtml::HTMLTokenizer::reset):
398 (khtml::HTMLTokenizer::begin):
399 (khtml::HTMLTokenizer::setForceSynchronous):
400 (khtml::HTMLTokenizer::continueProcessing):
401 * khtml/html/htmltokenizer.h:
403 2005-02-17 Ken Kocienda <kocienda@apple.com>
409 <rdar://problem/3982183> Mail's HTML paragraphs appear with unintended margins in Entourage and Eudora
411 * khtml/editing/htmlediting.cpp:
412 (khtml::createDefaultParagraphElement): Change element we make from <p> to <div>.
413 This fixes the problem, as these other mailers show <div> elements without margins.
415 Some test files needed to change to preserve the ability to "eyeball" the results.
416 Many others changed just because their <p> elements changed to <div> elements.
418 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt
419 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt
420 * layout-tests/editing/inserting/insert-div-013-expected.txt
421 * layout-tests/editing/inserting/insert-div-013.html
422 * layout-tests/editing/inserting/insert-div-014-expected.txt
423 * layout-tests/editing/inserting/insert-div-014.html
424 * layout-tests/editing/inserting/insert-div-018-expected.txt
425 * layout-tests/editing/inserting/insert-div-018.html
426 * layout-tests/editing/inserting/insert-div-019-expected.txt
427 * layout-tests/editing/inserting/insert-div-019.html
428 * layout-tests/editing/inserting/insert-div-020-expected.txt
429 * layout-tests/editing/inserting/insert-div-020.html
430 * layout-tests/editing/inserting/insert-div-021-expected.txt
431 * layout-tests/editing/inserting/insert-div-021.html
432 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
433 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
434 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt
435 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt
437 2005-02-17 Ken Kocienda <kocienda@apple.com>
443 <rdar://problem/3996737> REGRESSION (Mail): Copy/paste in Mail inserts returns
445 The root cause of the problem is that a couple of pieces of code in AppKit and Mail
446 insert newlines into markup as it is generated, and the paste code in WebCore was
447 not smart about nodes that do not render (as is the case with these added newlines).
448 So, the solution is to remove these unrendered nodes in the paste code in a pre-pass.
449 Fortunately, my recent addition of such a pass to the paste code to handle styles
450 gave me a convenient place to put this new logic.
452 * khtml/editing/htmlediting.cpp:
453 (khtml::ReplacementFragment::ReplacementFragment): Use new name for function below.
454 (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Name change from computeStylesForNodes().
455 Now does the additional work of removing unrendered nodes, as mentioned above.
456 (khtml::isNodeRendered): New helper function.
457 * khtml/editing/htmlediting.h: Updated as necessary.
459 2005-02-17 Ken Kocienda <kocienda@apple.com>
465 <rdar://problem/3998892> REGRESSION (Mail): bolding a selection from end of line changes unselected text on starting line.
467 The styling code did not move to the next node when the starting position was
468 at the last offset of a node. Instead, it styled it. Clearly wrong. Solution
469 is to borrow a check from the delete algorithm. Though I call caretMaxOffset(),
470 which I consider deprecated, it is still the simplest and most strightforward
471 way to ask the right question for this kind of problem.
473 * khtml/editing/htmlediting.cpp:
474 (khtml::ApplyStyleCommand::applyInlineStyle): Fixed, as described above.
475 * layout-tests/editing/style/style-3998892-fix-expected.txt: Added.
476 * layout-tests/editing/style/style-3998892-fix.html: Added.
478 2005-02-16 Chris Blumenberg <cblu@apple.com>
480 Fixed: <rdar://problem/3954842> Forward/reply to an HTML email can result in nothing (in cases with <link> tags for CSS)
484 * khtml/xml/dom_nodeimpl.cpp:
485 (NodeBaseImpl::addChild): don't call insertedIntoDocument on the added child if "this" itself is not in the document.
487 2005-02-16 John Sullivan <sullivan@apple.com>
489 Written by Darin, reviewed by Maciej and me
491 - change required to make previous checkin work with English language RSS pages
494 new private method isHierarchical
497 add hierarchical base URL check when determining whether the URL is absolute
498 (KURL::isHierarchical):
499 new method, returns true if this is a valid URL with a slash just past the scheme's trailing colon
501 2005-02-16 John Sullivan <sullivan@apple.com>
503 Written by Darin, reviewed by me.
505 - WebCore part of fix for <rdar://problem/4007384>
506 FILTER: Bookmark of RSS with Japanese search word & multiple RSS pages loses filter
509 (-[DOMElement _getURLAttribute:]):
510 new SPI method, uses parseURL and completeURL to get valid URL from attribute value
513 declare new SPI method
515 2005-02-15 Maciej Stachowiak <mjs@apple.com>
519 <rdar://problem/3942428> reproducible crash loading cbs.sportsline.com
521 This change reverts the fix for <rdar://problem/3805311>, and
522 re-fixes it in a different (better) way. Instead of preventing
523 programmatic open from setting the parsing flag, instead make sure
524 that programmatic close resets it.
526 * khtml/khtml_part.cpp:
527 (KHTMLPart::openURL):
528 (KHTMLPart::didExplicitOpen):
529 (KHTMLPart::closeURL):
532 (KHTMLPart::endIfNotLoading):
533 (KHTMLPart::slotFinishedParsing):
534 (KHTMLPart::checkEmitLoadEvent):
535 * khtml/khtml_part.h:
536 * khtml/khtmlpart_p.h:
537 (KHTMLPartPrivate::KHTMLPartPrivate):
538 * khtml/xml/dom_docimpl.cpp:
539 (DocumentImpl::open):
540 (DocumentImpl::implicitOpen):
541 (DocumentImpl::close):
542 (DocumentImpl::implicitClose):
543 * khtml/xml/dom_docimpl.h:
545 2005-02-15 David Harrison <harrison@apple.com>
549 <rdar://problem/3933665> smart delete seems to delete too much after expanding selection with arrow keys
551 Fixed by updating the selection granularity. Only byWord granularity enables smart delete, but in this
552 case the granularity changed from byWord to byCharacter.
554 * khtml/khtml_part.cpp:
555 (KHTMLPart::setSelectionGranularity):
556 * khtml/khtml_part.h:
557 * kwq/WebCoreBridge.mm:
558 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
559 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
560 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
562 2005-02-15 David Harrison <harrison@apple.com>
566 (continued) <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
568 This was supposed have been committed yesterday with the other part of the fix, but was not.
570 * khtml/editing/visible_units.cpp:
573 2005-02-15 Ken Kocienda <kocienda@apple.com>
579 <rdar://problem/3951178> REGRESSION (Mail): blank line lost after pasting as quotation
581 Problem was that the blank line after the selection was getting deleted incorrectly since the
582 paste code thought this was an unneeded placeholder rather than a placeholder outside of the
585 * khtml/editing/htmlediting.cpp:
586 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now calls findBlockPlaceholder.
587 (khtml::CompositeEditCommand::findBlockPlaceholder): Moved finding code formerly in
588 removeBlockPlaceholderIfNeeded to this new helper.
589 (khtml::ReplaceSelectionCommand::doApply): Do not delete placeholder up front. Call
590 findBlockPlaceholder, and delete it later if needed in the already-existing cleanup step.
591 * khtml/editing/htmlediting.h: Add new function.
595 * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Added.
596 * layout-tests/editing/pasteboard/paste-text-017.html: Added.
598 Result changed for the better.
600 * layout-tests/editing/pasteboard/paste-text-011-expected.txt
602 2005-02-14 David Harrison <harrison@apple.com>
606 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
610 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
612 * khtml/editing/visible_text.cpp:
613 (khtml::SimplifiedBackwardsTextIterator::advance):
614 Add BR in for <rdar://problem/3917929> fix only if leaving a visible text node.
616 * khtml/editing/visible_units.cpp:
618 Do not move left over a paragraph boundary.
620 2005-02-14 Darin Adler <darin@apple.com>
624 - fixed <rdar://problem/3686434> Safari uses too much RAM on file upload, leading to malloc errors and crashes (HP printers)
626 * khtml/html/html_formimpl.cpp:
627 (DOM::FormDataList::begin): Updated to use a list of FormDataListItem instead of QCString.
628 (DOM::FormDataList::end): Ditto.
629 (DOM::HTMLFormElementImpl::formData): Same here, and also use appendFile rather than appendData
630 when we encounter a path name rather than data.
631 (DOM::HTMLInputElementImpl::appendFormData): Use appendFile here rather than reading the file
632 in; the reading now happens inside WebKit.
633 (DOM::FormDataList::appendString): Updated for FormDataListItem.
634 (DOM::FormDataList::appendFile): Added.
636 * ForwardingHeaders/kfileitem.h: Emptied out the file; no longer includes KWQKFileItem.h.
637 * ForwardingHeaders/netaccess.h: Emptied out the file; no longer includes KWQKIONetAccess.h.
638 * kwq/KWQKFileItem.h: Removed.
639 * kwq/KWQKFileItem.mm: Removed.
640 * kwq/KWQKIONetAccess.h: Removed.
641 * kwq/KWQKIONetAccess.mm: Removed.
642 * WebCore.pbproj/project.pbxproj: Removed the 4 files above.
644 - small unrelated fix (not reviewed by John)
646 * khtml/ecma/kjs_window.cpp: (Window::isSafeScript): Put some logging code outside if statements so it works all the time.
648 2005-02-14 David Harrison <harrison@apple.com>
652 <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
654 Fixed nextLinePosition to calculate affinity rather than take it as a parameter. Propagated the parameter change out to related methods.
656 * khtml/editing/htmlediting.cpp:
657 (khtml::DeleteSelectionCommand::initializePositionData):
658 (khtml::InsertLineBreakCommand::doApply):
659 (khtml::InsertParagraphSeparatorCommand::doApply):
660 (khtml::InsertTextCommand::input):
661 (khtml::ReplaceSelectionCommand::doApply):
662 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes):
663 * khtml/editing/selection.cpp:
664 (khtml::Selection::modifyExtendingRightForward):
665 (khtml::Selection::modifyMovingRightForward):
666 (khtml::Selection::modifyExtendingLeftBackward):
667 (khtml::Selection::modifyMovingLeftBackward):
668 (khtml::Selection::modify):
669 (khtml::Selection::validate):
670 * khtml/editing/visible_position.cpp:
671 (khtml::visiblePositionsOnDifferentLines):
672 * khtml/editing/visible_units.cpp:
673 (khtml::rootBoxForLine):
674 (khtml::startOfLine):
677 (khtml::isStartOfLine):
678 (khtml::isEndOfLine):
679 (khtml::previousLinePosition):
680 (khtml::nextLinePosition):
681 (khtml::previousSentencePosition):
682 (khtml::nextSentencePosition):
683 (khtml::previousParagraphPosition):
684 (khtml::nextParagraphPosition):
685 * khtml/editing/visible_units.h:
686 * khtml/khtml_events.cpp:
687 (khtml::MouseEvent::offset):
688 * khtml/khtml_part.cpp:
689 (KHTMLPart::isPointInsideSelection):
690 (KHTMLPart::selectClosestWordFromMouseEvent):
691 (KHTMLPart::handleMousePressEventTripleClick):
692 (KHTMLPart::handleMousePressEventSingleClick):
693 (KHTMLPart::handleMouseMoveEventSelection):
694 (KHTMLPart::khtmlMouseReleaseEvent):
695 * khtml/rendering/render_block.cpp:
696 (khtml::RenderBlock::positionForCoordinates):
697 * khtml/rendering/render_block.h:
698 * khtml/rendering/render_br.cpp:
699 (RenderBR::positionForCoordinates):
700 * khtml/rendering/render_br.h:
701 * khtml/rendering/render_container.cpp:
702 (RenderContainer::positionForCoordinates):
703 * khtml/rendering/render_container.h:
704 * khtml/rendering/render_inline.cpp:
705 (RenderInline::positionForCoordinates):
706 * khtml/rendering/render_inline.h:
707 * khtml/rendering/render_object.cpp:
708 (RenderObject::caretRect):
709 (RenderObject::positionForCoordinates):
710 * khtml/rendering/render_object.h:
711 * khtml/rendering/render_replaced.cpp:
712 (RenderReplaced::positionForCoordinates):
713 * khtml/rendering/render_replaced.h:
714 * khtml/rendering/render_text.cpp:
715 (RenderText::positionForCoordinates):
716 * khtml/rendering/render_text.h:
717 * khtml/xml/dom_position.cpp:
718 (DOM::Position::previousCharacterPosition):
719 (DOM::Position::nextCharacterPosition):
720 (DOM::Position::leadingWhitespacePosition):
721 (DOM::Position::trailingWhitespacePosition):
722 * khtml/xml/dom_position.h:
723 * kwq/KWQAccObject.mm:
724 (-[KWQAccObject value]):
725 (-[KWQAccObject accessibilityAttributeValue:]):
726 (-[KWQAccObject doAXLineForTextMarker:]):
727 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
728 (-[KWQAccObject doAXTextMarkerForPosition:]):
729 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
730 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
731 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
732 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
733 * kwq/KWQKHTMLPart.mm:
734 * kwq/WebCoreBridge.mm:
735 (-[WebCoreBridge _visiblePositionForPoint:]):
737 05-02-07 Maciej Stachowiak <mjs@apple.com>
739 Reviewed by Ken and John.
741 Re-fixed a specific case of the following:
743 <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
745 Oddly, Cmd-B, Cmd-U, type some text, return, Cmd-U, Cmd-B, type
746 some text, worked fine. But hitting the second Cmd-B before the
747 second Cmd-U still failed to remove underlining. The reason for
748 this is that our code to compute the style of the current position
749 did not work when you had a typing style and were positioned right
750 at a <br> element. For various reasons, this did not show up for
751 bold and italic, since those are handled through the font manager.
753 The following change fixes this - for elements that can't have
754 children, we add the dummy span after the element of interest,
755 rather than as a child of it.
757 * khtml/khtml_part.cpp:
758 (KHTMLPart::selectionComputedStyle):
760 2005-02-11 David Harrison <harrison@apple.com>
764 <rdar://problem/3978980> Double Clicking on a line in Mail selected the entire body
766 * khtml/editing/visible_units.cpp:
767 (khtml::startOfWord):
769 Pay attention to being at the end of a paragraph.
771 (khtml::previousLinePosition):
772 (khtml::nextLinePosition):
773 (khtml::endOfParagraph):
774 Use DOWNSTREAM per recent affinity changes.
776 2005-02-11 Richard Williamson <rjw@apple.com>
778 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
780 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
781 creates these wrappers. The WebCore subclass of the interpreter now overrides
782 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
784 * WebCore.pbproj/project.pbxproj:
785 * khtml/ecma/kjs_binding.cpp:
786 (ScriptInterpreter::createLanguageInstanceForValue):
787 * khtml/ecma/kjs_binding.h:
788 * kwq/DOMUtility.mm: Added.
789 (KJS::ScriptInterpreter::createObjcInstanceForValue):
790 * kwq/KWQKHTMLPart.mm:
791 (KWQKHTMLPart::getAppletInstanceForView):
792 (getInstanceForView):
793 (KWQKHTMLPart::getEmbedInstanceForView):
794 (KWQKHTMLPart::getObjectInstanceForView):
796 2005-02-11 Chris Blumenberg <cblu@apple.com>
798 Fixed: <rdar://problem/3937352> Quote level not maintained when copied and pasted within a Mail message
800 Reviewed by harrison.
802 * khtml/editing/markup.cpp:
803 (khtml::isMailBlockquote): new
804 (khtml::createMarkup): retain the Mail quote level by including all ancestor mail block quotes
805 * khtml/rendering/render_block.cpp:
806 (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
807 * khtml/rendering/render_text.cpp:
808 (RenderText::positionForCoordinates): ditto
810 2005-02-11 Adele Amchan <adele@apple.com>
814 fix for <rdar://problem/4004004> no need to add body element for xml documents
816 In the fix for <rdar://problem/3758785> we decided to add a body element when closing a document
817 to ensure that the onload handler would fire. This is unnecessary for xml documents,
818 so now we also check to see if we're dealing with an html document before adding the body element.
820 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
822 2005-02-11 Adele Amchan <adele@apple.com>
826 * layout-tests/apple-only/base/www.excite.com/index-expected.txt: updates tests because of custom tag change.
827 * layout-tests/apple-only/base/www.msnbc.com/index-expected.txt:
828 * layout-tests/apple-only/base/www.time.com/index-expected.txt:
829 * layout-tests/apple-only/base/www.travelocity.com/index-expected.txt:
830 * layout-tests/apple-only/base/www.zdnet.com/index-expected.txt:
831 * layout-tests/fast/overflow/003-expected.txt:
833 * layout-tests/fast/js/window-object-cross-frame-calls-expected.txt: updated test because of added Body (see rdar://problem/3758785)
837 2005-02-11 Darin Adler <darin@apple.com>
841 - 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
843 * khtml/xml/dom_docimpl.h: Added a new openInternal function for use by KHTMLPart.
844 * khtml/xml/dom_docimpl.cpp:
845 (DocumentImpl::open): Changed to do everything we did before, but also clear the URL and set the
846 base URL based on the enclosing document. This is the basic JavaScript/DOM operation of opening a
847 document, which is supposed to clear the document, including the URL. In the long run we might want
848 to do even more document "resetting and clearing" in here, but this URL clearing is what's needed
849 now to fix the most important problem.
850 (DocumentImpl::openInternal): Moved the old open code in here, except for the "parsing" check, which
851 is unnecessary and inappropriate in the one place we call this.
853 * khtml/khtml_part.cpp: (KHTMLPart::begin): Call openInternal instead of open.
855 2005-02-10 Ken Kocienda <kocienda@apple.com>
861 <rdar://problem/3992092> 8A374: Mail crash while pasting - RemoveNodeCommand
863 * khtml/editing/htmlediting.cpp:
864 (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in
865 the document. We try to do a good job of detecting all these cases, and generally do. This
866 one was missed. Fixed.
868 2005-02-10 Darin Adler <darin@apple.com>
870 Reviewed by Harrison.
872 - added support needed to fix <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined
874 * kwq/WebCoreBridge.h: Added selectionHasStyle: method.
875 * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part.
877 2005-02-10 Darin Adler <darin@apple.com>
879 Reviewed by Harrison.
881 - fixed <rdar://problem/3990484> cursor changes to I-beam when moving over text in widgets, even when selection off via CSS
883 * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent): Changed code to check canSelect when deciding
884 whether to show an I-beam cursor.
886 * khtml/rendering/render_object.h: Added canSelect.
887 * khtml/rendering/render_object.cpp:
888 (selectStartNode): Added. Helper function with the guts of shouldSelect.
889 (RenderObject::canSelect): Added. Like shouldSelect, but does not call the "start selecting" event handler.
890 (RenderObject::shouldSelect): Refactored to use selectStartNode.
892 * khtml/css/cssvalues.c: Regnerated with newer gperf.
894 2005-02-10 David Hyatt <hyatt@apple.com>
896 Fix for 3867759, .mac regression where scrollers don't show up. Make sure you can set the .width and
897 .height properties on the Image object.
899 Reviewed by John Sullivan
901 * khtml/ecma/kjs_html.cpp:
902 (ImageConstructorImp::construct):
903 (Image::getValueProperty):
906 * khtml/ecma/kjs_html.h:
908 2005-02-10 Ken Kocienda <kocienda@apple.com>
914 <rdar://problem/3965158> Drag-n-drop within a rich text message sometimes changes the color of the dragged text
916 This change fixes the bug....and much more. Now, for the first time, the paste code can do "smart merging"
917 or "smooshing" of styles during its operation. Since this new code is actively, rather than passively
918 working with styles, it fixes the bug, and lays the groundwork for similar work we need to do to
919 preserve quote levels in Mail.
921 * khtml/css/css_valueimpl.cpp:
922 (DOM::CSSMutableStyleDeclarationImpl::clear): New method.
923 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
924 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): Ditto.
925 (DOM::operator==): Add operator for CSSProperty.
926 * khtml/css/css_valueimpl.h: Declare new functions.
927 * khtml/editing/htmlediting.cpp:
928 (khtml::isEmptyStyleSpan): Improved the test in this function, rolling together the old implementation
929 with some code that did this work inline elsewhere. Sum of the parts is better than either test was by itself.
930 (khtml::isStyleSpan): Check for ID_SPAN.
931 (khtml::ApplyStyleCommand::removeCSSStyle): Call isEmptyStyleSpan. This was the place with an inline implementation before.
932 (khtml::ReplacementFragment::ReplacementFragment): Now takes a DocumentImpl argument. No longer does a "default style"
933 check, but rather calls functions which do a similar check to that, and much more.
934 (khtml::ReplacementFragment::~ReplacementFragment): Deref document, and computed styles.
935 (khtml::ReplacementFragment::styleForNode): New helper. Looks up and returns computed style for a node.
936 (khtml::ReplacementFragment::removeNodePreservingChildren): New helper.
937 (khtml::ReplacementFragment::computeStylesForNodes): New function which computes the "desired" style for
938 every node in the fragment. This information is used later after paste is done as a reference for testing
939 what styles need to be added, and which can be removed as redundant, from all the nodes inserted by the
941 (khtml::ReplacementFragment::removeStyleNodes): Clears out all style nodes from the fragment. They are
942 no longer needed after the call to computeStylesForNodes(),
943 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): Add a document to the call to initialize the
944 command's ReplacementFragment.
945 (khtml::ReplaceSelectionCommand::doApply): Call applyStyleToInsertedNodes() after inserting nodes to make
946 styles come out right.
947 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): This is the "style smooshing" function. It
948 computes the styles that need to be added to each node inserted, comparing the style it gets from just
949 being inserted into its correct destination with the computed "desired style" done in the
950 ReplacementFragment constructor. It then adds in all the necessary styles, and will also remove redundant styles.
951 * khtml/editing/htmlediting.h: Update declarations and member variables as needed.
952 * khtml/editing/markup.cpp:
953 (khtml::startMarkup): Add additional style annotations to the markup we generate, so that paste code can preserve it.
954 (khtml::markup): Ditto.
955 (khtml::createMarkup): Ditto.
957 These test results are subtly better with this change. They no longer have an unneeded empty span.
958 Visually the same as before.
960 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
961 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
962 * layout-tests/editing/style/remove-underline-expected.txt
963 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt
967 * layout-tests/editing/style/smoosh-styles-001-expected.txt
968 * layout-tests/editing/style/smoosh-styles-002-expected.txt
969 * layout-tests/editing/style/smoosh-styles-001.html
970 * layout-tests/editing/style/smoosh-styles-002.html
972 2005-02-10 Darin Adler <darin@apple.com>
976 - fixed <rdar://problem/3974988> WebHTMLView drops scroll wheel events when deltas are 0
978 * kwq/WebCoreScrollView.m: (-[WebCoreScrollView autoforwardsScrollWheelEvents]): Added, for Tiger only.
979 For Tiger, removed the override of scrollWheel:, which doesn't work quite right because of how the
980 delta attributes return all 0 for newfangled scrolling events from the new trackpads.
982 2005-02-10 David Harrison <harrison@apple.com>
986 <rdar://problem/3991532> REGRESSION (Mail): Triple-click on trailing blank line should select previous line but doesn't
988 * khtml/css/cssvalues.c:
991 * khtml/editing/selection.cpp:
992 (khtml::Selection::validate):
993 Do moral equiavalent of LeftWordIfOnBoundary for PARAGRAPH.
995 2005-02-10 David Harrison <harrison@apple.com>
999 <rdar://problem/3991848> Double-click on first character selects wrong item
1001 * khtml/editing/selection.cpp:
1002 (khtml::Selection::validate):
1003 Honor the fact that clicking on a character positions the cursor on the left side of the character.
1005 2005-02-10 David Hyatt <hyatt@apple.com>
1007 Fix for 3980778, repro crash in RootInlineBox::paint. Make sure that when merging blocks we dirty them for layout
1008 up front. That way as we do the merge, we dont attempt to examine the lines in dirtyLinesForChangedChild.
1012 * khtml/rendering/render_block.cpp:
1013 (khtml::RenderBlock::removeChild):
1015 2005-02-10 David Hyatt <hyatt@apple.com>
1017 Fix for 3987010, fix a bug that caused the self-collapsing-block-cleared-float bit to never get set correctly.
1021 * khtml/rendering/render_block.h:
1022 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
1024 2005-02-10 David Hyatt <hyatt@apple.com>
1026 Fix for 3992440, text not wrapping correctly on half moon bay web site. Refine an incorrect optimization I
1027 added to be less restrictive.
1031 * khtml/rendering/render_block.cpp:
1032 (khtml::RenderBlock::layoutBlockChildren):
1034 2005-02-08 Maciej Stachowiak <mjs@apple.com>
1038 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
1040 I fixed this by removing all event listeners for a document, it's
1041 children, and any disconnected nodes that used to be in the
1042 document at document detach time. Mozilla temporarily disables
1043 event listeners on such nodes, but re-enables them if you
1044 re-parant a node into a new document. However, in WebCore, you
1045 can't re-parent a node into another document, so there is no
1046 observable change in behavior.
1048 We have to do this to break the possible reference cycles between
1049 event listeners and the dom nodes they are attached to (e.g. via
1050 scope chain, as in this case).
1052 * khtml/xml/dom_docimpl.cpp:
1053 (DocumentImpl::detach):
1054 (DocumentImpl::removeAllEventListenersFromAllNodesx):
1055 (DocumentImpl::registerDisconnectedNodeWithEventListeners):
1056 (DocumentImpl::unregisterDisconnectedNodeWithEventListeners):
1057 (DocumentImpl::removeAllDisconnectedNodeEventListeners):
1058 * khtml/xml/dom_docimpl.h:
1059 * khtml/xml/dom_nodeimpl.cpp:
1060 (NodeImpl::~NodeImpl):
1061 (NodeImpl::addEventListener):
1062 (NodeImpl::removeEventListener):
1063 (NodeImpl::removeAllEventListeners):
1064 (NodeImpl::removeHTMLEventListener):
1065 (NodeImpl::insertedIntoDocument):
1066 (NodeImpl::removedFromDocument):
1067 * khtml/xml/dom_nodeimpl.h:
1069 2005-02-09 Chris Blumenberg <cblu@apple.com>
1071 Fixed: <rdar://problem/3999213> Sometimes 2 Windows Media Player plugin instances are loaded
1075 * khtml/html/html_objectimpl.cpp:
1076 (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.
1077 (HTMLObjectElementImpl::recalcStyle): ditto
1079 2005-02-09 David Harrison <harrison@apple.com>
1083 <rdar://problem/3937447> Mail-689: Arrow key navigation in new message body stops working when a line ends with a bold word
1085 Added affinity to VisiblePosition. Changed Selection code to use affinity more.
1087 (Partial) <rdar://problem/3982096> editing/pasteboard/paste-text-007 is failing
1089 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.
1091 * khtml/ecma/kjs_window.cpp:
1092 (SelectionFunc::tryCall):
1093 * khtml/editing/htmlediting.cpp:
1094 (khtml::EditCommandPtr::setStartingSelection):
1095 (khtml::EditCommandPtr::setEndingSelection):
1096 (khtml::EditCommand::setStartingSelection):
1097 (khtml::EditCommand::setEndingSelection):
1098 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream):
1099 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
1100 (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
1101 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
1102 (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
1103 (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
1104 (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
1105 (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
1106 (khtml::ApplyStyleCommand::joinChildTextNodes):
1107 (khtml::DeleteSelectionCommand::initializePositionData):
1108 (khtml::DeleteSelectionCommand::handleGeneralDelete):
1109 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
1110 (khtml::DeleteSelectionCommand::doApply):
1111 (khtml::InsertLineBreakCommand::doApply):
1112 (khtml::InsertParagraphSeparatorCommand::doApply):
1113 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1114 (khtml::InsertTextCommand::input):
1115 (khtml::MoveSelectionCommand::doApply):
1116 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
1117 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
1118 (khtml::ReplaceSelectionCommand::doApply):
1119 (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
1120 (khtml::ReplaceSelectionCommand::updateNodesInserted):
1121 (khtml::TypingCommand::deleteKeyPressed):
1122 (khtml::TypingCommand::forwardDeleteKeyPressed):
1123 (khtml::TypingCommand::markMisspellingsAfterTyping):
1124 * khtml/editing/htmlediting.h:
1125 * khtml/editing/selection.cpp:
1126 (khtml::Selection::Selection):
1127 (khtml::Selection::init):
1128 (khtml::Selection::moveTo):
1129 (khtml::Selection::modifyExtendingRightForward):
1130 (khtml::Selection::modifyMovingRightForward):
1131 (khtml::Selection::modifyExtendingLeftBackward):
1132 (khtml::Selection::modifyMovingLeftBackward):
1133 (khtml::Selection::modify):
1134 (khtml::Selection::xPosForVerticalArrowNavigation):
1135 (khtml::Selection::clear):
1136 (khtml::Selection::setBase):
1137 (khtml::Selection::setExtent):
1138 (khtml::Selection::setBaseAndExtent):
1139 (khtml::Selection::layout):
1140 (khtml::Selection::validate):
1141 * khtml/editing/selection.h:
1142 (khtml::Selection::startAffinity):
1143 (khtml::Selection::endAffinity):
1144 (khtml::Selection::baseAffinity):
1145 (khtml::Selection::extentAffinity):
1146 (khtml::operator==):
1147 * khtml/editing/text_affinity.h:
1149 * khtml/editing/visible_position.cpp:
1150 (khtml::VisiblePosition::VisiblePosition):
1151 (khtml::VisiblePosition::init):
1152 (khtml::VisiblePosition::initUpstream):
1153 (khtml::VisiblePosition::initDownstream):
1154 (khtml::VisiblePosition::next):
1155 (khtml::VisiblePosition::previous):
1156 (khtml::startVisiblePosition):
1157 (khtml::endVisiblePosition):
1158 * khtml/editing/visible_position.h:
1159 (khtml::VisiblePosition::):
1160 (khtml::VisiblePosition::VisiblePosition):
1161 (khtml::VisiblePosition::affinity):
1162 (khtml::VisiblePosition::setAffinity):
1163 (khtml::operator==):
1164 * khtml/editing/visible_units.cpp:
1165 (khtml::previousBoundary):
1166 (khtml::nextBoundary):
1167 (khtml::startOfLine):
1169 (khtml::previousLinePosition):
1170 (khtml::nextLinePosition):
1171 (khtml::startOfParagraph):
1172 (khtml::endOfParagraph):
1173 (khtml::previousParagraphPosition):
1174 (khtml::nextParagraphPosition):
1175 (khtml::startOfBlock):
1176 (khtml::endOfBlock):
1177 (khtml::startOfDocument):
1178 (khtml::endOfDocument):
1179 * khtml/editing/visible_units.h:
1180 * khtml/khtml_part.cpp:
1181 (KHTMLPart::findTextNext):
1182 (KHTMLPart::selectClosestWordFromMouseEvent):
1183 (KHTMLPart::handleMousePressEventTripleClick):
1184 (KHTMLPart::handleMousePressEventSingleClick):
1185 (KHTMLPart::handleMouseMoveEventSelection):
1186 (KHTMLPart::khtmlMouseReleaseEvent):
1187 (KHTMLPart::selectAll):
1188 (KHTMLPart::computeAndSetTypingStyle):
1189 (KHTMLPart::selectionComputedStyle):
1190 * khtml/rendering/render_br.cpp:
1191 (RenderBR::positionForCoordinates):
1192 * khtml/xml/dom_docimpl.cpp:
1193 (DocumentImpl::updateSelection):
1194 * khtml/xml/dom_nodeimpl.cpp:
1195 (NodeBaseImpl::setFocus):
1196 * khtml/xml/dom_position.cpp:
1197 (DOM::Position::previousCharacterPosition):
1198 (DOM::Position::nextCharacterPosition):
1199 * khtml/xml/dom_position.h:
1200 * kwq/KWQAccObject.mm:
1201 (-[KWQAccObject value]):
1202 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
1203 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
1204 (-[KWQAccObject accessibilityAttributeValue:]):
1205 (-[KWQAccObject doAXLineForTextMarker:]):
1206 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
1207 (-[KWQAccObject doAXTextMarkerForPosition:]):
1208 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
1209 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
1210 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
1211 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
1212 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
1213 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
1214 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
1215 * kwq/KWQAccObjectCache.mm:
1216 (KWQAccObjectCache::textMarkerForVisiblePosition):
1217 (KWQAccObjectCache::visiblePositionForTextMarker):
1218 * kwq/KWQKHTMLPart.mm:
1219 (KWQKHTMLPart::findString):
1220 (KWQKHTMLPart::advanceToNextMisspelling):
1221 (KWQKHTMLPart::styleForSelectionStart):
1222 (KWQKHTMLPart::baseWritingDirectionForSelectionStart):
1223 (KWQKHTMLPart::setSelectionFromNone):
1224 (KWQKHTMLPart::respondToChangedSelection):
1225 * kwq/WebCoreBridge.mm:
1226 (-[WebCoreBridge setSelectedDOMRange:affinity:]):
1227 (-[WebCoreBridge selectionAffinity]):
1228 (-[WebCoreBridge setMarkDOMRange:]):
1229 (-[WebCoreBridge _visiblePositionForPoint:]):
1230 (-[WebCoreBridge moveDragCaretToPoint:]):
1231 (-[WebCoreBridge editableDOMRangeForPoint:]):
1232 (-[WebCoreBridge ensureSelectionVisible]):
1233 (-[WebCoreBridge rangeOfCharactersAroundCaret]):
1235 2005-02-09 Chris Blumenberg <cblu@apple.com>
1237 Fixed: <rdar://problem/3985211> Seed: Mail: Drag-and-drop destination indicator / insertion point disappears
1239 Reviewed by kocienda.
1241 * khtml/rendering/render_block.cpp:
1242 (khtml::RenderBlock::paintCaret): new
1243 (khtml::RenderBlock::paintObject): call paintCaret for the cursor caret and the drag caret
1244 * khtml/rendering/render_block.h:
1248 2005-02-08 Ken Kocienda <kocienda@apple.com>
1254 <rdar://problem/3996344> Entire document content is deleted when only the first paragraph was supposed to be
1256 Problem stems from my attempt to fix this bug: <rdar://problem/3986155> Insertion point goes
1257 to beginning of doc after deleting.
1259 I added an "optimization" that proved to do more harm than good. So, basically, the fix is to remove code.
1261 * khtml/editing/htmlediting.cpp:
1262 (khtml::DeleteSelectionCommand::handleGeneralDelete)
1264 2005-02-07 Darin Adler <darin@apple.com>
1268 - fixed <rdar://problem/3890352> REGRESSION (125-170, Panther-only): pasted textarea contents disappear (exception in NSText)
1270 * kwq/KWQTextArea.mm: (-[KWQTextArea tile]): Don't resize the text view immediately here.
1271 Use performWithDelay to defer it to avoid the re-entrancy that bothers the Panther version
1272 of NSTextView. On Tiger, leave the code alone.
1274 2005-02-07 Adele Amchan <adele@apple.com>
1278 Fix for <rdar://problem/3993628> REGRESSION (180-181): Logitelnet bank's website doesn't work
1280 This fixes an oversight in the fix for <rdar://problem/3964286>.
1281 We're now making sure there is a document before calling checkCompleted in slotLoaderRequestDone.
1282 That function is called even when other parts finish loads of their subresources, so we could end
1283 up calling checkCompleted before we had a document. We also looked over all the other calls to
1284 checkCompleted to convince ourselves no other call sites had a similar issue.
1286 * khtml/khtml_part.cpp: (KHTMLPart::slotLoaderRequestDone): Check if doc is nil before calling
1289 2005-02-07 Ken Kocienda <kocienda@apple.com>
1295 <rdar://problem/3953302> Replacing quoted text ends up with blue-colored text that is not quoted
1297 * khtml/editing/htmlediting.cpp:
1298 (khtml::DeleteSelectionCommand::doApply): Removed special case delete code for select all. It was
1299 causing as many bugs as it fixed. What's more, the design concept is a bit shaky. By removing
1300 this special case, the bug goes away.
1301 * khtml/editing/htmlediting.h: Remove declaration.
1303 Test results using selectAll() updated to reflect changed behavior.
1305 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
1306 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
1307 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
1308 * layout-tests/editing/inserting/insert-3654864-fix-expected.txt:
1309 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
1310 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt:
1311 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt:
1312 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
1314 2005-02-06 Darin Adler <darin@apple.com>
1318 - fixed <rdar://problem/3994164> setting a new style attribute with setAttribute("style") doesn't blow away the old style
1320 * khtml/css/css_valueimpl.h: Renamed parseProperty to parseDeclaration, since it's used to parse
1321 an entire style declaration, not a single property.
1322 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::parseDeclaration): Renamed,
1323 and added code to clear m_values.
1324 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Call function by its
1325 new name, and remove some unnecessary comments.
1327 2005-02-06 Darin Adler <darin@apple.com>
1331 - fixed <rdar://problem/3993722> need oncut and onpaste handlers implemented for <textarea> (needed for widgets)
1333 * kwq/KWQTextArea.mm:
1334 (-[KWQTextAreaTextView dispatchHTMLEvent:]): Added.
1335 (-[KWQTextAreaTextView cut:]): Dispatch "before cut" and "cut" events.
1336 (-[KWQTextAreaTextView copy:]): Dispatch "before copy" and "copy" events.
1337 (-[KWQTextAreaTextView paste:]): Dispatch "before paste" and "paste" events.
1338 (-[KWQTextAreaTextView pasteAsPlainText:]): Ditto.
1339 (-[KWQTextAreaTextView pasteAsRichText:]): Ditto.
1341 2005-02-06 Darin Adler <darin@apple.com>
1345 - fixed <rdar://problem/3943038> <input type=search> that is focused in onload handler doesn't have a visible editor
1347 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setFocusNode): Always update layout before giving focus to a widget.
1348 This prevents the bad case where we give a widget focus before it has been positioned or sized, causing us to
1349 exercise edge cases AppKit doesn't handle well.
1351 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Remove workaround code I added
1352 to fix bug 3943049. Updating the layout fixes the same problem in a cleaner, safer way, and solves another problem,
1353 with the way the clip view is set up.
1355 2005-02-06 Darin Adler <darin@apple.com>
1359 - fixed <rdar://problem/3425232> textarea won't trigger onchange action when clicking to new field
1361 * khtml/rendering/render_form.h: Added new m_dirty data member.
1362 * khtml/rendering/render_form.cpp:
1363 (RenderTextArea::RenderTextArea): Initialize m_dirty to false.
1364 (RenderTextArea::detach): Call value() on the DOM element to cause it to fetch the value from this object.
1365 (RenderTextArea::handleFocusOut): Ditto. Also send the onchange event based only on the m_dirty flag.
1366 (RenderTextArea::updateFromElement): Clear the m_dirty flag if the edited value is blown away by a value
1367 that comes from the DOM element. Remove code to clear the element's m_dirtyvalue flag; that's an unnecessary
1368 optimization, and ideally we'll stop having code in the render object that knows about that flag later.
1369 (RenderTextArea::slotTextChanged): Set the m_dirty flag.
1371 2005-02-06 Darin Adler <darin@apple.com>
1375 - re-fixed <rdar://problem/3760910> please add support for custom tag names in HTML
1377 * khtml/xml/dom_docimpl.cpp:
1378 (DocumentImpl::tagId): Use ID_LAST_TAG + 1 for the ID of the first assigned tag ID. Before we'd use ID_LAST_TAG,
1379 which resulted in the same number being used for ID_COMMENT and the first custom tag.
1380 (DocumentImpl::tagName): Use ID_LAST_TAG + 1, as above.
1381 (DocumentImpl::namespaceURI): Change a < ID_LAST_TAG to <= ID_LAST_TAG in the same spirit as above.
1383 2005-02-06 Darin Adler <darin@apple.com>
1387 - fixed <rdar://problem/3986639> Crash occurs after choosing Undo Typing from the Edit menu
1389 * kwq/KWQTextArea.mm: (-[KWQTextArea viewWillMoveToWindow:]): Remove actions from undo manager when the view is
1390 removed from the window. Unfortunately, to do this the code has to know that the target of NSTextView actions
1391 will be the text storage object, but given the NSText architecture, that's pretty clear.
1393 2005-02-05 Chris Blumenberg <cblu@apple.com>
1395 Fixed: <rdar://problem/3991974> REGRESSION: www.jabra.com world location screen does not work
1399 * kwq/KWQKJavaAppletWidget.mm:
1400 (KJavaAppletWidget::KJavaAppletWidget): fallback to the document's base URL if there is no baseURL attribute
1401 * kwq/WebCoreBridge.h:
1402 * kwq/WebCoreBridge.mm:
1403 (-[WebCoreBridge baseURL]): new
1405 2005-02-04 David Harrison <harrison@apple.com>
1409 Rolled out Ken's accidental checkin when committing <rdar://problem/3986155> fix yesterday.
1411 * khtml/editing/selection.cpp:
1412 (khtml::Selection::validate):
1414 2005-02-04 Adele Amchan <adele@apple.com>
1418 Fix for <rdar://problem/3758785> Safari no longer works at BankOfAmerica online banking for military users
1420 When closing the document, if a body doesn't exist we now create one. This bug was preventing the onload handler from
1421 firing in cases where there wasn't a body. In the BankOfAmerica case, the page was just a bit of script where the onload
1422 handler redirected to the correct page.
1424 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
1426 2005-02-03 Ken Kocienda <kocienda@apple.com>
1432 <rdar://problem/3986155> Insertion point goes to beginning of doc after deleting
1434 * khtml/editing/htmlediting.cpp:
1435 (khtml::DeleteSelectionCommand::setStartNode): New convenience to handle reference counting when setting.
1436 (khtml::DeleteSelectionCommand::handleGeneralDelete): This contains the crux of the bug fix. Improve tests
1437 that detect when a selected node needs to be retained, rather than deleted, to preserve the intent of the user.
1438 This has the side effect of causing the insertion point placement code to succeed rather than fail. Before
1439 this fix, the failure of the insertion point placement code caused the insertion point to jump to the start
1440 of the document, which is the symptom that can be perceived by users when editing.
1441 * khtml/editing/htmlediting.h: Add setStartNode declaration.
1442 * khtml/editing/visible_units.cpp:
1443 (khtml::startOfBlock): This function had a stubbed-in non-tested implementation. Implement and
1444 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001-expected.txt: Added.
1445 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001.html: Added.
1446 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt: Added.
1447 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002.html: Added.
1448 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt: Added.
1449 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003.html: Added.
1450 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt: Added.
1451 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004.html: Added.
1452 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005-expected.txt: Added.
1453 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005.html: Added.
1454 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006-expected.txt: Added.
1455 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006.html: Added.
1459 2005-02-03 Richard Williamson <rjw@apple.com>
1461 Fixed <rdar://problem/3987419> Stocks and Weather leak what appears to XMLHTTPRequest results
1463 XMLHTTPRequests were causing massive leaks. _webcore_initWithHeaderString: did funky things with
1464 self replacement. Re-wrote to use more traditional factory constructor avoiding self replacement.
1466 Reviewed by David Harrison.
1469 (+[NSDictionary _webcore_dictionaryWithHeaderString:]):
1471 (KWQServeSynchronousRequest):
1473 2005-02-03 Chris Blumenberg <cblu@apple.com>
1475 Fixed: <rdar://problem/3938763> Cannot view Windows Media Player videos (soundtrack is played twice with delay)
1479 * khtml/html/html_objectimpl.cpp:
1480 (HTMLObjectElementImpl::attach): set needWidgetUpdate to false right after calling updateWidget because dispatchHTMLEvent can end up calling this method again
1481 (HTMLObjectElementImpl::recalcStyle): ditto
1483 2005-02-02 John Sullivan <sullivan@apple.com>
1487 - WebCore part of fix for <rdar://problem/3980651> REGRESSION (125-180): Huge number of pages printed from certain page,
1490 This also fixes the problems with printing from GMail, yay!
1492 * khtml/rendering/render_flow.cpp:
1493 (RenderFlow::paintLines):
1494 If the current line is taller than the entire page height (e.g. tall iFrame), don't try
1495 to avoid splitting it across pages.
1497 * kwq/WebCoreBridge.mm:
1498 (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
1499 Handle error cases in a more obvious manner; this will cause future problems like this
1500 to print a blank page and complain to the console on debug builds, rather than print a
1501 zillionty mostly-blank pages.
1503 2005-02-02 Chris Blumenberg <cblu@apple.com>
1505 Fixed: <rdar://problem/3960304> can't load a particular applet (at www.escape.de) unless it's the first applet to be loaded
1509 * khtml/rendering/render_frames.cpp:
1510 (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.
1512 2005-02-02 Chris Blumenberg <cblu@apple.com>
1514 Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)
1518 * kwq/KWQKHTMLPart.mm:
1519 (KWQKHTMLPart::sendContextMenuEvent): check if SPI to always enable selecting closest word is enabled
1520 * kwq/WebCoreBridge.h:
1522 2005-02-02 Ken Kocienda <kocienda@apple.com>
1526 * khtml/editing/markup.cpp:
1527 (khtml::createMarkup): Removed debug spam I committed earlier in error.
1529 2005-02-02 Ken Kocienda <kocienda@apple.com>
1535 <rdar://problem/3823109> WebKit should support -toggleBaseWritingDirection: (bidi editing support)
1537 Since base writing direction is a paragraph-level property in AppKit, and we use the CSS direction
1538 property in WebCore, which can be applied to inline elements as well as blocks, a new notion has
1539 been added to the WebCore apply style logic. It is now possible to force all properties in a
1540 style declaration to be applied as though they were block properties.
1542 * khtml/editing/htmlediting.cpp:
1543 (khtml::ApplyStyleCommand::ApplyStyleCommand): Add an enum and a flag to this command that controls whether to force all
1544 properties in the style to be applied as block styles. Default is "no", retaining previous behavior.
1545 (khtml::ApplyStyleCommand::doApply): Switch on new flag to apply styles as before, or force all preoperties to be applied
1547 * khtml/editing/htmlediting.h:
1548 (khtml::ApplyStyleCommand::): Add an enum and a flag, as above.
1549 * khtml/khtml_part.cpp:
1550 (KHTMLPart::applyParagraphStyle): New method to force application of all style properties as block styles.
1551 * khtml/khtml_part.h: Update header declarations.
1552 * kwq/KWQKHTMLPart.h: Update header declarations.
1553 * kwq/KWQKHTMLPart.mm:
1554 (KWQKHTMLPart::baseWritingDirectionForSelectionStart): Accessor to help WebKit do a toggle operation on
1556 * kwq/WebCoreBridge.h: Update header declarations.
1557 * kwq/WebCoreBridge.mm:
1558 (-[WebCoreBridge applyParagraphStyle:withUndoAction:]): New method to force application of all style properties as block styles.
1559 (-[WebCoreBridge baseWritingDirectionForSelectionStart]): Accessor to help WebKit do a toggle operation on
1564 <rdar://problem/3985035> REGRESSION (Mail): Text copied from wrapped line contains extra character when pasted
1566 * khtml/editing/markup.cpp:
1567 (khtml::renderedText): Add an enum and a flag to this command that controls whether to force all
1568 This is the result of an error in the code that computes the rendered text that is selected
1569 when copying. Since spaces collapse at the end of lines, and these spaces need to be copied
1570 when the selection spans line endings, code runs to compute this text. However, this code
1571 was also running incorrectly in cases where lines wrapped. I have now added the missing
1572 test to check that the selection does indeed extend to the end of the line.
1575 2005-02-02 Ken Kocienda <kocienda@apple.com>
1581 <rdar://problem/3984894> REGRESSION (Mail): Command-right-arrow in reply does the wrong thing (two ways)
1582 <rdar://problem/3985130> REGRESSION (Mail): command-right-arrow in pasted RTF selects only up to tab
1584 * khtml/editing/visible_units.cpp:
1585 (khtml::endOfLine): Two separate problems in this new function recently added to take the place of
1586 selectionForLine. In the first, endOfLine did not stop at BR elements, and returned the position
1587 beyond them. In the second, the VisiblePosition constructor gives the wrong answer in certain cases.
1588 Darin is going to work on a solution for that problem. In the meantime, I can fix the symptom of this
1589 bug by going down to the last leaf child of the root line box; a one line change we will roll out when
1592 2005-02-01 Richard Williamson <rjw@apple.com>
1594 Fixed <rdar://problem/3985535> QT Plug-in JavaScript support now fails in <embed> tag only case
1598 * khtml/ecma/kjs_html.cpp:
1599 (KJS::HTMLDocument::tryGet):
1601 2005-02-01 John Sullivan <sullivan@apple.com>
1603 Written by Darin, reviewed and tested by me
1605 - fixed <rdar://problem/3969684> Panther-only: extra blank lines between
1606 pasted content from Blot
1608 * kwq/KWQKHTMLPart.mm:
1609 (KWQKHTMLPart::attributedString):
1610 don't emit paragraph breaks if the margins are tiny; matches what
1611 we do for plain-text conversion
1615 2005-02-01 Ken Kocienda <kocienda@apple.com>
1621 <rdar://problem/3985160> Deficiencies in pasting architecture blocking progress on other bugs
1623 * khtml/editing/html_interchange.h: Move style span text used to mark element added to
1624 add style to this header.
1625 * khtml/editing/htmlediting.cpp:
1626 (khtml::styleSpanClassString): Change to use constant moved to html_interchange.h.
1627 (khtml::isStyleSpan): New helper function. Checks if this is a span we added to apply style.
1628 (khtml::CompositeEditCommand::insertNodeBefore): Added an assert to check that the node
1629 we are inserting before is not the body.
1630 (khtml::CompositeEditCommand::insertNodeAfter): Ditto, but check is for after.
1631 (khtml::ReplacementFragment::ReplacementFragment): Added code to process the "default style"
1632 that is added by the copy code.
1633 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): first and last nodes inserted are
1634 now member variables instead of function locals. Initialize them here.
1635 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): Deref first and last nodes inserted
1637 (khtml::ReplaceSelectionCommand::doApply): Change design to fix the bug. Major change is to
1638 separate out the code that inserts nodes into the tree so additional styling checks can
1639 be done in a centralized way. Also got rid of the notion of "merging into the end block." That
1640 concept was just wrong.
1641 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Tweak interface now that first and
1642 last nodes inserted are member variables.
1643 (khtml::ReplaceSelectionCommand::insertNodeAfterAndUpdateNodesInserted): New helper used
1644 by replace code to do the stated DOM operation and update state internal to the command.
1645 This will also be a catch point to handle the kinds of additional style checks needed to
1646 make paste work right.
1647 (khtml::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted): Ditto.
1648 (khtml::ReplaceSelectionCommand::insertNodeBeforeAndUpdateNodesInserted): Ditto.
1649 (khtml::ReplaceSelectionCommand::updateNodesInserted): Ditto.
1650 * khtml/editing/htmlediting.h: Update declarations as needed.
1651 * khtml/editing/markup.cpp:
1652 (khtml::createMarkup): Adds a "default style" span to the content written to the pasteboard.
1653 This will help us to fix some of the bugs blocked by the bug above.
1654 * khtml/xml/dom_nodeimpl.cpp:
1655 (NodeImpl::lastDescendent): New helper.
1656 * khtml/xml/dom_nodeimpl.h: Ditto.
1657 * khtml/xml/dom_position.cpp:
1658 (DOM::Position::upstream): Fixed a bug which would allow the upstream position returned to be
1659 in unrendered content.
1660 (DOM::Position::downstream): Ditto.
1662 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Ending positions tweaked due to
1663 changes in upstream() and downstream() functions.
1664 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Ditto
1665 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Ditto
1666 * layout-tests/editing/selection/extend-by-character-006-expected.txt: Ditto
1668 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Changed what we expect, given
1669 new behavior of paste code.
1671 2005-01-31 John Sullivan <sullivan@apple.com>
1673 Reviewed by Dave Hyatt.
1675 - fixed <rdar://problem/3983097> Tabbing on RSS pages gets stuck in search field
1676 with "full keyboard navigation" off
1680 (QSlider::focusPolicy):
1681 Implemented this method for KWQSlider. It is needed for our widget subclasses that
1682 can become focused in some situations. I missed this when fixing 3949203 because
1683 it only comes into play when tab-to-controls is on, and because the other relevant
1684 methods are objective-C methods.
1686 2005-01-31 David Harrison <harrison@apple.com>
1690 <rdar://problem/3964164> AXWebArea needs to unregister on going invisible
1692 * khtml/xml/dom_docimpl.cpp:
1693 (DocumentImpl::detach):
1694 Detach the AX UIElement for the AXWebArea.
1696 2005-01-31 David Harrison <harrison@apple.com>
1700 <rdar://problem/3850876> AX: button exposed as only an AXImage at http://appleseed.apple.com/ site (<input type=image>)
1702 * khtml/rendering/render_form.h:
1703 (khtml::RenderImageButton::isImageButton):
1705 * khtml/rendering/render_image.h:
1706 (khtml::RenderImage::isImageButton):
1708 * kwq/KWQAccObject.mm:
1709 (-[KWQAccObject isImageButton]):
1710 (-[KWQAccObject actionElement]):
1711 (-[KWQAccObject role]):
1712 (-[KWQAccObject accessibilityActionNames]):
1713 (-[KWQAccObject accessibilityPerformAction:]):
1714 Represent RenderImageButton elements as buttons instead of images.
1716 2005-01-31 David Harrison <harrison@apple.com>
1718 Prevent nil dereference in debug code.
1720 * khtml/xml/dom_nodeimpl.cpp:
1721 (NodeImpl::displayTree):
1722 Stop when parent is 0, too.
1724 2005-01-31 John Sullivan <sullivan@apple.com>
1726 Reviewed by Dave Hyatt.
1728 - fixed <rdar://problem/3949203> cannot tab to, within, or out of the RSS sidebar
1731 (-[KWQSlider becomeFirstResponder]):
1732 (-[KWQSlider resignFirstResponder]):
1733 (-[KWQSlider nextKeyView]):
1734 (-[KWQSlider previousKeyView]):
1735 (-[KWQSlider canBecomeKeyView]):
1736 (-[KWQSlider nextValidKeyView]):
1737 (-[KWQSlider previousValidKeyView]):
1738 Copied these methods from KWQButton. The lack of special handling for first-responder-ness
1739 here was causing the focus to get "stuck" on the RSS page's slider widget. Added FIXME
1740 about how it would be nice to share more of this code rather than replicating it in each
1741 KWQ widget subclass.
1743 2005-01-31 Darin Adler <darin@apple.com>
1745 Reviewed by Harrison.
1747 - fixed <rdar://problem/3980066> Double-click on single character moves insertion point to previous line
1749 * khtml/khtml_part.cpp:
1750 (KHTMLPart::selectClosestWordFromMouseEvent): Set affinity too.
1751 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1752 (KHTMLPart::handleMouseMoveEventSelection): Ditto.
1753 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
1755 * khtml/editing/selection.cpp:
1756 (khtml::Selection::modifyExtendingRightForward): Use endOfLine and endOfDocument.
1757 (khtml::Selection::modifyMovingRightForward): Ditto.
1758 (khtml::Selection::modifyExtendingLeftBackward): Use startOfLine and startOfDocument.
1759 (khtml::Selection::modifyMovingLeftBackward): Ditto.
1760 (khtml::Selection::validate): Rewrote the section that handles double-click. Two main fixes: 1) use isStartOfLine to
1761 check for another case where we want to select the word to the right, and 2) use isEndOfParagraph, which seems
1762 to work correctly in cases where isLastVisiblePositionInParagraph is giving the wrong answer. Also changed the line
1763 code to use startOfLine/endOfLine and the document code to use startOfDocument/endOfDocument.
1765 2005-01-31 Darin Adler <darin@apple.com>
1767 Reviewed by Harrison.
1769 - fixed <rdar://problem/3935275> unexpected quit scrolling over link; last.fm (works in IE and Firefox)
1771 * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): By using the correct document, fix the crash reported here.
1772 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.
1774 2005-01-31 Darin Adler <darin@apple.com>
1776 Reviewed by Ken and Harrison.
1778 - fixed <rdar://problem/3947901> REGRESSION (Mail): Pasting paragraph of rich text leaves insertion point before pasted text
1779 - fixed <rdar://problem/3949790> hitting return after underlined line results in too much or too little underlined
1780 - fixed <rdar://problem/3981759> nil-deref and crash when pasting just a paragraph break
1781 - fixed a couple problems I discovered while working with bug 3949790
1783 * khtml/editing/htmlediting.cpp:
1784 (khtml::ApplyStyleCommand::applyInlineStyle): Pass StayInBlock to upstream. Without this, we end up going too far
1785 upstream in the test case in bug 3949790.
1786 (khtml::ApplyStyleCommand::removeInlineStyle): Pass StayInBlock to upstream and downstream. Same reason as above.
1787 (khtml::ReplaceSelectionCommand::doApply): Update endPos if inserting a new node and endPos is using that node's
1788 parent and an offset past the node being inserted. That change fixes a problem with the position of the insertion point
1789 after pasting into the top level of a document (from test cases in 3947901 and 3949790). When setting insertionPos, use
1790 code that works when lastNodeInserted is a block rather than a text node. That change fixes a problem where a newline is
1791 not added when pasting an entire paragraph into the end of a document (from test case in 3949790). Added nil check before
1792 checking if lastNodeInserted is a <br> element, which fixes the crash when pasting just a paragraph break.
1794 * khtml/editing/visible_units.h: Filled out the set of calls to add some boolean checks for lines (needed for the
1795 bug fix), and calls for blocks (not yet implemented), and documents. The document checks may need refinement to
1796 properly handle documents with a mix of editable and non-editable content, but for now they just refactor code
1797 and make things a little clearer. Also removed the "include line break" parameter from endOfSentence.
1798 * khtml/editing/visible_units.cpp:
1799 (khtml::rootBoxForLine): Added.
1800 (khtml::startOfLine): Added. Algorithm taken from selectionForLine in selection.cpp.
1801 (khtml::endOfLine): Ditto.
1802 (khtml::inSameLine): Added.
1803 (khtml::isStartOfLine): Added.
1804 (khtml::isEndOfLine): Added.
1805 (khtml::endOfSentence): Removed "include line break" parameter.
1806 (khtml::inSameParagraph): Added a null check.
1807 (khtml::isStartOfParagraph): Ditto.
1808 (khtml::isEndOfParagraph): Ditto.
1809 (khtml::startOfBlock): Added.
1810 (khtml::endOfBlock): Added.
1811 (khtml::inSameBlock): Added.
1812 (khtml::isStartOfBlock): Added.
1813 (khtml::isEndOfBlock): Added.
1814 (khtml::startOfDocument): Added.
1815 (khtml::endOfDocument): Added.
1816 (khtml::inSameDocument): Added.
1817 (khtml::isStartOfDocument): Added.
1818 (khtml::isEndOfDocument): Added.
1820 2005-01-30 Darin Adler <darin@apple.com>
1824 - fixed <rdar://problem/3977000> form data set posted for <input type="image" ...> omits name/value pair
1826 * khtml/html/html_formimpl.cpp:
1827 (DOM::HTMLInputElementImpl::appendFormData): Append a name/value pair for type IMAGE in addition to the X/Y
1830 2005-01-30 Darin Adler <darin@apple.com>
1834 - fixed <rdar://problem/3974246> REGRESSION (125-180): popup menus are missing item text on Harmony Remote web site
1836 * khtml/html/html_formimpl.cpp: (DOM::HTMLOptionElementImpl::text): Change this function to traverse the entire tree
1837 and gather all the text rather than just looking at immediate children.
1839 * khtml/xml/dom_nodeimpl.h: Added const.
1840 * khtml/xml/dom_nodeimpl.cpp:
1841 (NodeImpl::traverseNextNode): Added const.
1842 (NodeImpl::traverseNextSibling): Ditto.
1843 (NodeImpl::traversePreviousNodePostOrder): Ditto.
1844 (NodeImpl::detach): Add a missing nil check.
1846 2005-01-30 Darin Adler <darin@apple.com>
1850 - fixed <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
1852 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Added missing ref/deref of newly created element.
1854 2005-01-28 Darin Adler <darin@apple.com>
1856 * khtml/css/cssproperties.c: Regenerated with newer gperf.
1858 2005-01-28 David Harrison <harrison@apple.com>
1860 Reviewed by John Sullivan.
1862 <rdar://problem/3968144> AX need to be able to focus an AXLink by setting AXFocused to true
1864 * kwq/KWQAccObject.mm:
1865 (-[KWQAccObject accessibilityPerformAction:]):
1866 (-[KWQAccObject accessibilityIsAttributeSettable:]):
1867 Add AXFocused for AXLinks.
1869 2005-01-28 David Harrison <harrison@apple.com>
1873 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
1875 Use AppKit SPI _accessibilityParentForSubview to return KWQAccObject parent of AppKit AX object.
1877 * kwq/KWQAccObject.mm:
1878 (-[KWQAccObject _accessibilityParentForSubview:]):
1881 2005-01-27 Adele Amchan <adele@apple.com>
1883 fixed by Darin, reviewed by me.
1885 <rdar://problem/3976314> REGRESSION (180-TOT): submitting password fields fail on Panther
1887 * kwq/KWQTextField.mm: (-[KWQTextFieldController string]): on panther, the secure text field's editor
1888 does not contain the real string, so now we just call stringValue on the field in that case.
1890 2005-01-26 Maciej Stachowiak <mjs@apple.com>
1892 Reviewed by Darin, Hyatt and Ken.
1894 <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
1896 * khtml/css/css_computedstyle.cpp:
1897 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support
1898 for -khtml-text-decorations-in-effect property. This works like text-docration
1899 but follows proper inline semantics, that is, if a parent is causing text
1900 decoration then -khtml-text-decorations-in-effect on this element will reflect that.
1901 * khtml/css/cssproperties.in: Add -khtml-text-decorations-in-effect property.
1902 * khtml/css/cssproperties.h: regenerated
1903 * khtml/css/cssvalues.c: regenerated
1904 * khtml/css/cssparser.cpp: regenerated
1905 * khtml/css/cssproperties.c: regenerated
1907 * khtml/css/css_valueimpl.h: Made copyPropertiesInSet public.
1909 * khtml/editing/htmlediting.cpp:
1910 (khtml::StyleChange::init): Handle -khtml-text-decorations-in-effect
1911 specially, translate to text-decoration
1912 (khtml::ApplyStyleCommand::applyInlineStyle): Fix a comment.
1913 (khtml::ApplyStyleCommand::removeInlineStyle): Add new way of pushing down
1914 text-decoration styles around the edges of the selected range.
1915 (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAroundNode): Helper for this.
1916 (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): ditto
1917 (khtml::ApplyStyleCommand::nodeFullyUnselected): ditto
1918 (khtml::hasTextDecorationProperty): ditto
1919 (khtml::highestAncestorWithTextDecoration): ditto
1920 (khtml::ApplyStyleCommand::extractTextDecorationStyle): ditto
1921 (khtml::ApplyStyleCommand::extractAndNegateTextDecorationStyle): ditto
1922 (khtml::ApplyStyleCommand::applyTextDecorationStyle): ditto
1923 * khtml/editing/htmlediting.h: Prototype new methods.
1924 * khtml/editing/jsediting.cpp: Make underline execCommand use the new CSS property.
1926 - as a necessary part of the fix, fixed the longstanding problem
1927 that mutating an element's inlineStyleDecl would not property
1928 update its style attribute. now it does.
1930 * khtml/css/css_valueimpl.cpp:
1931 (DOM::CSSMutableStyleDeclarationImpl::setChanged): If this is an inline style
1932 declaration, tell the element it's style attribute needs updating.
1933 * khtml/html/html_elementimpl.cpp:
1934 (HTMLElementImpl::invalidateStyleAttribute): New method, just calls down
1936 (HTMLElementImpl::updateStyleAttribute): Regenerate style attribute from
1937 inline style declaration.
1938 * khtml/html/html_elementimpl.h: Prototype new stuff.
1939 * khtml/xml/dom_elementimpl.cpp:
1940 (ElementImpl::ElementImpl): Initialize new attribute.
1941 (ElementImpl::updateStyleAttributeIfNeeded): New method to check if the style
1942 is dirty and this is an html element, and if so call the html element to
1943 regenerate the style attribute.
1944 (ElementImpl::attributes): update style if needed
1945 (ElementImpl::getAttribute): ditto
1946 (ElementImpl::hasAttributes): ditto
1947 (ElementImpl::dump): ditto
1948 (XMLElementImpl::cloneNode): ditto
1949 * khtml/xml/dom_elementimpl.h:
1950 (DOM::ElementImpl::isStyleAttributeValid): new method to manage style attr
1952 (DOM::ElementImpl::setStyleAttributeValid): ditto
1954 - added new layout tests for underlining:
1956 * layout-tests/editing/editing.js:
1957 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt: Added.
1958 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt: Added.
1959 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold.html: Added.
1960 * layout-tests/editing/style/remove-underline-across-paragraph.html: Added.
1961 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt: Added.
1962 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt: Added.
1963 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold.html: Added.
1964 * layout-tests/editing/style/remove-underline-after-paragraph.html: Added.
1965 * layout-tests/editing/style/remove-underline-expected.txt: Added.
1966 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt: Added.
1967 * layout-tests/editing/style/remove-underline-from-stylesheet.html: Added.
1968 * layout-tests/editing/style/remove-underline-in-bold-expected.txt: Added.
1969 * layout-tests/editing/style/remove-underline-in-bold.html: Added.
1970 * layout-tests/editing/style/remove-underline.html: Added.
1971 * layout-tests/editing/style/underline-expected.txt: Added.
1972 * layout-tests/editing/style/underline.html: Added.
1974 2005-01-27 David Hyatt <hyatt@apple.com>
1976 Fix for 3875199, search field needs to be able to show a magnifying glass without a dropdown menu.
1978 Reviewed by kocienda
1980 * khtml/html/html_formimpl.cpp:
1981 (DOM::HTMLInputElementImpl::HTMLInputElementImpl):
1982 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
1983 * kwq/KWQLineEdit.mm:
1984 (QLineEdit::setMaxResults):
1986 2005-01-27 Ken Kocienda <kocienda@apple.com>
1992 <rdar://problem/3973254> Deletions of ranges does not coalesce correctly with subsequent typing
1994 * khtml/editing/htmlediting.cpp:
1995 (khtml::InsertTextCommand::deleteCharacter): Remove this dead code.
1996 (khtml::ReplaceSelectionCommand::editingAction): Moved this code to a better place in the file.
1997 It was in with unrelated functions.
1998 (khtml::TypingCommand::TypingCommand): Reorganize initialization list so it is easier to read.
1999 (khtml::TypingCommand::issueCommandForDeleteKey): Remove dead code. Roll in remaining code into deleteKeyPressed.
2000 (khtml::TypingCommand::deleteKeyPressed): Add in support for carrying along smart delete flag.
2001 (khtml::TypingCommand::forwardDeleteKeyPressed): New function. Makes forward delete work like
2002 "regular" delete in terms of coalescing typing.
2003 (khtml::TypingCommand::doApply): Add case for ForwardDeleteKey.
2004 (khtml::TypingCommand::preservesTypingStyle): Ditto.
2005 * khtml/editing/htmlediting.h:
2006 (khtml::TypingCommand::): Add ForwardDeleteKey constant. Remove a couple declarations for now-dead code.
2007 (khtml::TypingCommand::smartDelete): New accessor.
2008 (khtml::TypingCommand::setSmartDelete): Ditto.
2009 * kwq/WebCoreBridge.h:
2010 * kwq/WebCoreBridge.mm:
2011 (-[WebCoreBridge deleteKeyPressedWithSmartDelete:]): Add smart delete flag.
2012 (-[WebCoreBridge forwardDeleteKeyPressedWithSmartDelete:]): New method.
2013 * khtml/editing/jsediting.cpp: Add supprt for ForwardDelete command
2014 * layout-tests/editing/editing.js: Ditto.
2015 * layout-tests/editing/deleting/delete-and-undo-expected.txt: Added.
2016 * layout-tests/editing/deleting/delete-and-undo.html: Added.
2017 * layout-tests/editing/deleting/forward-delete-expected.txt: Added.
2018 * layout-tests/editing/deleting/forward-delete.html: Added.
2022 2005-01-27 David Harrison <harrison@apple.com>
2026 <rdar://problem/3962214> AX: AXLeftLineTextMarkerRangeForTextMarker returns incorrect range
2028 * kwq/KWQAccObject.mm:
2029 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2030 Allowed for selection to end of line including the linebreak.
2032 2005-01-27 David Harrison <harrison@apple.com>
2034 Reviewed by Darin, Ken.
2036 <rdar://problem/3964470> AX: Include attachments in AXAttributedStringForTextMarkerRange
2038 * kwq/KWQAccObject.mm:
2039 (-[KWQAccObject isAttachment]):
2040 (-[KWQAccObject attachmentView]):
2041 (-[KWQAccObject role]):
2042 (-[KWQAccObject subrole]):
2043 (-[KWQAccObject roleDescription]):
2044 (-[KWQAccObject value]):
2045 (-[KWQAccObject title]):
2046 (-[KWQAccObject accessibilityDescription]):
2047 (-[KWQAccObject accessibilityIsIgnored]):
2048 (-[KWQAccObject accessibilityAttributeNames]):
2049 (-[KWQAccObject accessibilityAttributeValue:]):
2050 Make attachments accessible.
2052 (CreateCGColorIfDifferent):
2053 (AXAttributeStringSetColor):
2054 (AXAttributeStringSetNumber):
2055 (AXAttributeStringSetFont):
2056 (AXAttributeStringSetStyle):
2057 (AXAttributeStringSetElement):
2058 (AXLinkElementForNode):
2059 (AXAttributedStringAppendText):
2060 (AXAttributedStringAppendReplaced):
2061 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
2062 Add attachments and more text attributes to AXAttributedStringForTextMarkerRange.
2064 2005-01-27 Darin Adler <darin@apple.com>
2068 - fixed <rdar://problem/3807935> DOM CSS computed style line-height is wrong in two ways
2070 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2071 Use specified size rather than computed size when dealing with a percentage for line height.
2073 2005-01-27 Darin Adler <darin@apple.com>
2077 - fixed <rdar://problem/3971372> SWB: template function DOM_cast() won't compile with gcc 4.0
2078 - fixed other gcc 4.0 compiling problems Patrick Beard pointed out on the phone
2080 * kwq/DOMInternal.h: (DOM_cast): Change the "failToCompile()" trick to use a dependent name.
2081 Nowadays, if a name is not dependent, it is checked at template definition time. But we want
2082 a failure only at template instantiation time.
2084 * ForwardingHeaders/editing/text_granularity.h: Added. Needed but a bug in the 3.3 compiler made
2085 it compile anyway without this.
2089 * khtml/html/html_miscimpl.h: For clarity, mark these functions virtual too. They are automatically
2090 virtual because the base class ones are virtual, but it's ugly to leave it this way.
2092 2005-01-26 Ken Kocienda <kocienda@apple.com>
2098 <rdar://problem/3971609> REGRESSION (Mail): up/down arrow navigation broken after rewrapping text by resizing window
2099 <rdar://problem/3975661> REGRESSION (Mail): left/right arrow navigation can place insertion point after last character on line
2101 * khtml/editing/selection.cpp:
2102 (khtml::Selection::modifyAffinity): PARAGRAPH and LINE movements should not alter affinity. This was
2103 just a mistake before when it reset to upstream in some cases.
2104 * khtml/rendering/render_line.cpp:
2105 (khtml::RootInlineBox::closestLeafChildForXPos): Move this function down from InlineBox, and
2106 rework the implementation. This fixes 3971609.
2107 * khtml/rendering/render_line.h:
2108 * khtml/rendering/render_text.cpp:
2109 (RenderText::caretRect): Rework the algorithm to fix 3975661. This regressed when we began placing
2110 the spaces on the end of lines in text boxes when lines wrap.
2112 2005-01-26 Richard Williamson <rjw@apple.com>
2114 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
2116 I added a member variable to ObjectImp. This changed it's size and consequently
2117 hampered the optimizations built into the garbage collector. Objects no longer
2118 fit within the allocators cell size, and thus allocation fell back to a slower
2121 As a result of this fix I also dramatically cleaned up how runtime objects are
2122 accessed. The path mostly *removes* code.
2126 * khtml/ecma/kjs_dom.cpp:
2127 (DOMDocumentProtoFunc::tryCall):
2128 (DOMElementProtoFunc::tryCall):
2129 (KJS::getRuntimeObject):
2130 * khtml/ecma/kjs_dom.h:
2131 * khtml/ecma/kjs_html.cpp:
2132 (KJS::HTMLDocument::tryGet):
2133 (KJS::HTMLElement::tryGet):
2134 (KJS::HTMLElement::implementsCall):
2135 (KJS::HTMLElement::call):
2136 (KJS::HTMLElement::tryPut):
2137 (KJS::HTMLCollection::tryGet):
2138 (KJS::HTMLCollection::getNamedItems):
2139 * khtml/ecma/kjs_html.h:
2140 * khtml/ecma/kjs_window.cpp:
2143 2005-01-26 Richard Williamson <rjw@apple.com>
2145 Fixed <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
2147 For now we are using ICU UBreakIterator to determine grapheme boundaries for
2148 cursor and deletion. This does not match what Cocoa does exactly, but does match
2149 what Carbon does. The areas are difference are obscure, but, according to
2150 Deborah Goldsmith, using the UBreakIterator is the reasonable approach.
2154 * khtml/rendering/render_text.cpp:
2155 (RenderText::previousOffset):
2156 (RenderText::nextOffset):
2158 2005-01-25 David Harrison <harrison@apple.com>
2160 Reviewed by Maciej and Richard.
2162 <rdar://problem/3963731> AX VO: Changing window sizes causes a crash using with Voice Over - KWQPtrDictImpl::clear
2164 * khtml/html/html_miscimpl.cpp:
2165 (HTMLCollectionImpl::HTMLCollectionImpl):
2166 Ensure that isHTMLDocument before calling HTMLDocument-only method.
2168 2005-01-25 Richard Williamson <rjw@apple.com>
2170 Part one of fix for <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
2172 This patch changes the semantics of next() and previous() on
2173 VisiblePosition to move a grapheme (character cluster) at a
2174 time. This means that cursor navigation with correctly move
2175 over an entire cluster.
2177 However, the expected behavior for deleting a grapheme is to
2178 delete individual code points, thus decomposing the grapheme
2179 into it constituent parts. That will be addressed in the next
2184 * khtml/editing/visible_position.cpp:
2185 (khtml::VisiblePosition::previousPosition):
2186 (khtml::VisiblePosition::nextPosition):
2187 * khtml/editing/visible_position.h:
2188 * khtml/rendering/render_object.cpp:
2189 (RenderObject::previousOffset):
2190 (RenderObject::nextOffset):
2191 * khtml/rendering/render_object.h:
2192 * khtml/rendering/render_text.cpp:
2193 (RenderText::previousOffset):
2194 (RenderText::nextOffset):
2195 (RenderText::findNextInlineTextBox):
2196 * khtml/rendering/render_text.h:
2197 * khtml/xml/dom_nodeimpl.cpp:
2198 (NodeImpl::previousOffset):
2199 (NodeImpl::nextOffset):
2200 * khtml/xml/dom_nodeimpl.h:
2202 2005-01-25 David Harrison <harrison@apple.com>
2206 <rdar://problem/3973067> AXWebArea for http://apple.netscape.com/ has an empty AXLinkUIElements
2208 * kwq/KWQAccObject.mm:
2209 (-[KWQAccObject accessibilityAttributeValue:]):
2210 Omit ignored AXLinks from AXLinkUIElements result
2212 2005-01-25 Ken Kocienda <kocienda@apple.com>
2218 <rdar://problem/3972851> REGRESSION (179-180+): Repro crash in ApplyStyleCommand::cleanUpEmptyStyleSpans
2220 * khtml/editing/htmlediting.cpp:
2221 (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans): Added two null checks.
2223 2005-01-25 Ken Kocienda <kocienda@apple.com>
2229 <rdar://problem/3954710> Mail crashed while editing signatures - NodeImpl::isBlockFlow
2231 The fix is more general than for this one bug, and may work to fix many crashers. The problem
2232 is that the ReplaceSelectionCommand never checked whether its starting selection is empty. If
2233 it is, then we need to bail before doing the work of the command, which we need to deref the
2234 start and end points of the selection in order to do its work. I think you can see the crash
2237 * khtml/editing/htmlediting.cpp:
2238 (khtml::ReplaceSelectionCommand::doApply): Assert selection is not empty.
2239 * kwq/WebCoreBridge.mm:
2240 (partHasSelection): New helper function to test that bridge has a part with a selection.
2242 Use new helper function to test part and selection; return from these function if this test fails.
2244 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:])
2245 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:])
2246 (-[WebCoreBridge alterCurrentSelection:direction:granularity:])
2247 (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:])
2248 (-[WebCoreBridge alterCurrentSelection:verticalDistance:])
2249 (-[WebCoreBridge documentFragmentWithText:])
2250 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
2251 (-[WebCoreBridge insertLineBreak])
2252 (-[WebCoreBridge insertParagraphSeparator])
2253 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent])
2254 (-[WebCoreBridge insertText:selectInsertedText:])
2255 (-[WebCoreBridge deleteSelectionWithSmartDelete:])
2256 (-[WebCoreBridge ensureSelectionVisible])
2258 2005-01-24 Kevin Decker <kdecker@apple.com>
2262 Fixed <rdar://problem/3932374> REGRESSION: 'ReferenceError - Can't find variable' JavaScript error at webxpress.fidelity.com
2264 * khtml/html/html_miscimpl.h: Missing virtual identifiers for namedItem() and nextNamedItem() exposed a flaw that prevented finding variables in form [HTMLFormCollectionImpl] scopes.
2267 2005-01-24 Vicki Murley <vicki@apple.com>
2269 Reviewed by kocienda.
2271 - fix <rdar://problem/3810661> computed style not handled for Apple extensions
2273 * khtml/css/css_computedstyle.cpp: (DOM::):
2274 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): add -apple-line-clamp and -apple-text-size-adjust
2276 2005-01-24 Darin Adler <darin@apple.com>
2280 - fixed <rdar://problem/3969884> REGRESSION (179-180): Typing password not echoed as "bullets" at paypal.com when field is first focused
2282 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]):
2283 Sizing up the form editor, which fixes things for normal fields and search fields,
2284 screws things up for password fields. Eventually, I'll need to figure out why this is
2285 and file a bug so that the AppKit team fixes it. In the mean time, just check for the
2286 case of the secure text field, and don't size up in that case.
2288 2005-01-24 Ken Kocienda <kocienda@apple.com>
2294 <rdar://problem/3963560> 8A354: Inserting Japanese text to the line head causes line break
2296 * khtml/editing/htmlediting.cpp:
2297 (khtml::ReplaceSelectionCommand::doApply): Add one more case where we merge content into the
2298 existing line. This covers the situation see using the steps to reproduce this bug.
2300 2005-01-21 Maciej Stachowiak <mjs@apple.com>
2304 <rdar://problem/3967572> Editing should split elements before removing style
2306 * khtml/editing/htmlediting.cpp:
2307 (khtml::CompositeEditCommand::splitElement):
2308 (khtml::CompositeEditCommand::mergeIdenticalElements):
2309 (khtml::CompositeEditCommand::wrapContentsInDummySpan):
2310 (khtml::CompositeEditCommand::splitTextNodeContainingElement):
2311 (khtml::ApplyStyleCommand::applyInlineStyle):
2312 (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
2313 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
2314 (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
2315 (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
2316 (khtml::areIdenticalElements):
2317 (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
2318 (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
2319 (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans):
2320 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
2321 (khtml::InsertParagraphSeparatorCommand::doApply):
2322 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
2323 (khtml::InsertTextCommand::prepareForTextInsertion):
2324 (khtml::SplitTextNodeCommand::doUnapply):
2325 (khtml::SplitElementCommand::SplitElementCommand):
2326 (khtml::SplitElementCommand::~SplitElementCommand):
2327 (khtml::SplitElementCommand::doApply):
2328 (khtml::SplitElementCommand::doUnapply):
2329 (khtml::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand):
2330 (khtml::MergeIdenticalElementsCommand::~MergeIdenticalElementsCommand):
2331 (khtml::MergeIdenticalElementsCommand::doApply):
2332 (khtml::MergeIdenticalElementsCommand::doUnapply):
2333 (khtml::WrapContentsInDummySpanCommand::WrapContentsInDummySpanCommand):
2334 (khtml::WrapContentsInDummySpanCommand::~WrapContentsInDummySpanCommand):
2335 (khtml::WrapContentsInDummySpanCommand::doApply):
2336 (khtml::WrapContentsInDummySpanCommand::doUnapply):
2337 (khtml::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand):
2338 (khtml::SplitTextNodeContainingElementCommand::~SplitTextNodeContainingElementCommand):
2339 (khtml::SplitTextNodeContainingElementCommand::doApply):
2340 * khtml/editing/htmlediting.h:
2342 New layout test that shows the side benefit of this.
2344 * layout-tests/editing/style/unbold-in-bold-expected.txt: Added.
2345 * layout-tests/editing/style/unbold-in-bold.html: Added.
2347 2005-01-24 Darin Adler <darin@apple.com>
2351 - fixed <rdar://problem/3933435> -[DOMRange cloneContents] sometimes alters the original DOMRange
2353 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Fixed code that was collapsing
2354 the range after processing the contents. That's right for extract and delete, but not clone.
2356 - fixed <rdar://problem/3714184> inline input works incorrectly when I type Korean slowly in textfield in form on www.google.co.kr
2357 - fixed <rdar://problem/3193848> Can't enter SSN to sign up for Chase visa online account (changing focus inside key press handler)
2358 - fixed <rdar://problem/3874683> REGRESSION (161-162): Crash after typing command-Z to undo after pasting text with newline in it into a text field <input type=text>
2360 * kwq/KWQLineEdit.mm:
2361 (QLineEdit::text): Changed to call a new string method on the controller instead of calling
2362 stringValue, since stringValue has a bad side effect of ending inline input.
2363 (QLineEdit::selectAll): Changed to only call selectText: when the field is already selected.
2364 When you are giving the field focus, it automatically gets all selected, and this change
2365 is required in the case where we defer the focus change.
2367 * kwq/KWQTextField.h: Added a new string method to the controller.
2368 * kwq/KWQTextField.mm:
2369 (-[KWQTextFieldController setMaximumLength:]): Call the new string method instead of using stringValue.
2370 (-[KWQTextFieldController controlTextDidChange:]): Removed the code to truncate at the first CR or LF.
2371 That's now handled in the shouldChangeTextInRange method instead.
2372 (-[KWQTextFieldController textView:shouldHandleEvent:]): Add new logic to defer responder changes until
2373 after the event is handled. This makes sure the key gets into the field that's already handling it at
2374 rather than ending up in the newly-focused field if the key press handler focuses a different element.
2375 (-[KWQTextFieldController textView:didHandleEvent:]): Turn off deferral here, now that the key press
2377 (-[KWQTextFieldController string]): Added. Calls stringValue only if there's no editor. If there is
2378 an editor, calls string on that instead.
2379 (-[KWQTextFieldController textView:shouldChangeTextInRange:replacementString:]): Added. Called by
2380 the three field subclasses. Truncates incoming strings at the first CR or LF character. This works
2381 properly with Undo, and the old technique did not.
2382 (-[KWQTextFieldController preprocessString:]): Added. Helper used for all the setStringValue methods
2383 so they all truncate at the first CR or LF as well as truncating to the appropriate length.
2384 (-[KWQTextField setStringValue:]): Changed to call the controller.
2385 (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): Added. Calls the controller.
2386 (-[KWQSecureTextField setStringValue:]): More of the same.
2387 (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
2388 (-[KWQSearchField setStringValue:]): Ditto.
2389 (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
2391 * kwq/KWQWidget.h: Added the new setDeferFirstResponderChanges function.
2393 (QWidget::~QWidget): Clear out the deferredFirstResponder global just in case we are destroyed
2394 while we "have the ball".
2395 (QWidget::hasFocus): If we are in the deferred mode, use the global to decide who to say is focused.
2396 (QWidget::setFocus): If we are in the deferred mode, set the global instead of making something be
2397 the first responder.
2398 (QWidget::setDeferFirstResponderChanges): Set the boolean. If the boolean is being cleared, then
2399 get the deferred first responder and call setFocus on it again, which will do the work we didn't
2402 2005-01-24 Ken Kocienda <kocienda@apple.com>
2408 <rdar://problem/3964350> Deleting all content and typing in a message gets one letter, then beeps
2410 This is a problem with the way we turn key events, when a user starts typing, into editing commands.
2411 Right now, that initial delete key in an empty window is turned into an editing command, and much
2412 editing code runs that need not run. What's more, this is confusing the selection machinery. The
2413 solution is to detect the "delete in an empty window" case and don't turn this into an editing
2416 * khtml/editing/htmlediting.cpp:
2417 (khtml::TypingCommand::deleteKeyPressed)
2419 2005-01-23 Adele Amchan <adele@apple.com>
2421 Fixed <rdar://problem/3964286> REGRESSION (178-179): menus and "go to old site" link at Ameritrade's new site don't work
2423 Removed check for document from checkCompleted. In this case, WebCore never knew that a WebImageView was complete because
2424 it fell into this document check case in checkCompleted.
2425 Added check for document to tokenizerProcessedData (see <rdar://problem/3807144>)
2429 * khtml/khtml_part.cpp:
2431 (KHTMLPart::checkCompleted):
2432 * khtml/khtml_part.h:
2433 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::tokenizerProcessedData):
2435 2005-01-21 Richard Williamson <rjw@apple.com>
2437 Fixed <rdar://problem/3759399> Javascript / Liveconnect problems ((event handler):Undefined value)
2439 Java applets specified with <object> or <embed> weren't scriptable. Now they are.
2443 * khtml/html/html_objectimpl.cpp:
2444 (HTMLEmbedElementImpl::getEmbedInstance):
2445 (HTMLObjectElementImpl::getObjectInstance):
2447 2005-01-21 Ken Kocienda <kocienda@apple.com>
2453 <rdar://problem/3959464> REGRESSION (Mail): Insertion point goes back to beginning of document after deleting
2455 * khtml/editing/htmlediting.cpp:
2456 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add special case to handle retaining a fully-selected block.
2458 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt: Added.
2459 * layout-tests/editing/deleting/delete-3959464-fix.html: Added.
2461 2005-01-21 Richard Williamson <rjw@apple.com>
2463 Fixed <rdar://problem/3966998> REGRESSION(179-TOT) clicking on gmail message brings me to blank screen
2465 getElementById() sometimes returns Undefined() instead of Null().
2469 * khtml/ecma/kjs_dom.cpp:
2470 (DOMDocumentProtoFunc::tryCall):
2472 2005-01-21 David Hyatt <hyatt@apple.com>
2474 Fix for 3773809, make sure that overflow regions never end up at an invalid scroll offset because of a layout change.
2476 Reviewed by kocienda
2478 * khtml/rendering/render_layer.cpp:
2479 (RenderLayer::updateScrollInfoAfterLayout):
2481 2005-01-21 David Hyatt <hyatt@apple.com>
2483 Fix for 3966349, hang loading page. Make sure that loops using popOneBlock properly check for a null
2484 blockStack to avoid an infinite loop.
2486 Reviewed by kocienda
2488 * khtml/html/htmlparser.cpp:
2489 (KHTMLParser::parseToken):
2490 (KHTMLParser::insertNode):
2491 (KHTMLParser::popInlineBlocks):
2493 2005-01-21 Ken Kocienda <kocienda@apple.com>
2499 <rdar://problem/3957204> Mail crashed when sending a message in ~InsertParagraphSeparatorInQuotedContentCommand
2501 * khtml/editing/htmlediting.cpp:
2502 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
2503 InsertParagraphSeparatorInQuotedContentCommand has this member variable: DOM::ElementImpl *m_breakNode;
2504 I failed to initialize this variable to null in the constructor, and there is an uncommonly-traveled
2505 code path which does not set this variable to something good. In the destructor, we check for null,
2506 and deref if non-null. Obvious "BOOM" potential. Fixed.
2508 2005-01-21 Ken Kocienda <kocienda@apple.com>
2514 <rdar://problem/3966311> REGRESSION (Mail): Hitting return makes space character disappear
2516 * khtml/editing/htmlediting.cpp:
2517 (khtml::InsertParagraphSeparatorCommand::doApply): When writing the code to insert a block
2518 in response to the return key, I did not write code to cover the case described in the bug.
2520 * layout-tests/editing/inserting/insert-div-025-expected.txt: Added.
2521 * layout-tests/editing/inserting/insert-div-025.html: Added.
2523 2005-01-20 Maciej Stachowiak <mjs@apple.com>
2527 <rdar://problem/3965196> security fix for javascript: exploit missed one case (already fixed in updates)
2529 * khtml/ecma/kjs_window.cpp:
2530 (WindowFunc::tryCall): correct mistake in earlier fix for the following bug, caught by Adele:
2532 2005-01-20 Maciej Stachowiak <mjs@apple.com>
2536 <rdar://problem/3965466> editing needs to insert text before applying typing style
2538 * khtml/editing/htmlediting.cpp:
2539 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Remove a FIXME comment.
2540 (khtml::InsertLineBreakCommand::doApply): Apply style to the BR
2541 node after inserting it.
2542 (khtml::InsertTextCommand::prepareForTextInsertion): Don't try to
2543 apply style to any new nodes created before inserting.
2544 (khtml::InsertTextCommand::input): Apply style to the inserted range
2545 after doing the text insert.
2546 * khtml/editing/htmlediting.h:
2548 This change leads to improved results on one of the layout tests:
2550 * layout-tests/editing/inserting/insert-div-024-expected.txt:
2554 2005-01-20 Ken Kocienda <kocienda@apple.com>
2560 <rdar://problem/3964646> REGRESSION (179-180): Typing space at end of line makes following paragraph disappear
2562 * khtml/editing/htmlediting.cpp:
2563 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Recent change to block placeholder removal code
2564 caused this regression. The code became too aggressive in removing block placeholders, and would remove them
2565 from blocks other than the block containing the selection.
2566 * layout-tests/editing/inserting/insert-div-023-expected.txt: This file had a spurious BR element in it that
2567 I did not notice earlier.
2568 * layout-tests/editing/inserting/insert-div-024-expected.txt: Ditto.
2570 2005-01-20 David Hyatt <hyatt@apple.com>
2572 Fix for oddness on albertsons.com. Make sure not to crash when setting/removing style properties on a node
2573 with no document. The bug # is 3813900.
2577 2005-01-20 David Harrison <harrison@apple.com>
2581 PARTIAL fix for following bug. Create attributed string with fonts and links. Still need to add attachments.
2582 <rdar://problem/3942606> AX: Support kAXAttributedStringForTextMarkerRangeParameterizedAttribute
2584 * kwq/KWQAccObject.mm:
2585 (-[KWQAccObject textUnderElement]):
2586 Touched up previous checkin to match code review comments.
2588 (-[KWQAccObject value]):
2589 Use plainText for this one instead of obsolete attributedString.
2591 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
2592 Advertise AXAttributedStringForTextMarkerRange.
2594 (AXAttributeStringAddFont):
2595 (AXAttributeStringAddElement):
2596 (-[KWQAccObject linkUIElementForNode:]):
2597 (-[KWQAccObject _addAttachmentForElement:URL:needsParagraph:usePlaceholder:]):
2598 (-[KWQAccObject accessibilityAttributedStringForRange:]):
2599 New routines to support AXAttributedStringForTextMarkerRange.
2601 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
2602 Use new routines instead of obsolete attributedString.
2604 2005-01-20 David Harrison <harrison@apple.com>
2608 <rdar://problem/3960196> AX Crash in DOM::Range::setStartBefore
2610 * khtml/xml/dom_docimpl.cpp:
2611 (DocumentImpl::getAccObjectCache):
2612 Adjust when detecting cache in non-top level WebArea.
2613 * kwq/KWQAccObject.mm:
2614 (-[KWQAccObject textUnderElement]):
2615 (-[KWQAccObject accessibilityAttributeValue:]):
2616 Make sure the elements document is the current one for the part.
2618 2005-01-20 Darin Adler <darin@apple.com>
2622 - fixed <rdar://problem/3922980> Mail not crashing, just quitting itself suddenly in -[WebHTMLView(MailExtras) findString:options:]
2624 * khtml/dom/dom2_range.cpp: (DOM::operator==): Handle null and detached ranges without raising exceptions.
2625 The uncaught exception would make the entire program terminate.
2627 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
2629 * kwq/DOM-CSS.mm: (-[DOMCSSStyleDeclaration setProperty:::]): Uncommented this code which I had to disable
2630 back in November because Mail was stumbling over it.
2632 - fixed <rdar://problem/3943049> focus() called during onload handler results in square text field on <input type=search>
2634 * kwq/KWQLineEdit.mm: (QLineEdit::baselinePosition): Change computation so it will work even for fields
2635 that position their text in a way that depends on vertical size. In the case of a search field, the text
2636 is centered, so the old logic was broken.
2637 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Set the frame size to
2638 something large enough to accomodate the field editor. If we start the frame at size 0,0 we run into
2639 AppKit trouble when it insets the frame to figure out the frame for the field editor. In the case of this
2640 bug this happens because we become first responder before being sized and positioned by the HTML layout code.
2642 - improved debugging output when using "po" from gdb with Objective-C DOM
2645 (-[DOMNode description]): Added. Includes node name ("<tr>") and node value (e.g., string for text node).
2646 (-[DOMRange description]): Tweaked format.
2648 2005-01-19 Richard Williamson <rjw@apple.com>
2650 After further discussion with Real we have decided to NOT include the
2651 additional CLSID for the real plugin. See 3958601.
2655 * khtml/rendering/render_frames.cpp:
2656 (RenderPartObject::updateWidget):
2658 2005-01-19 David Harrison <harrison@apple.com>
2662 <rdar://problem/3949429> AX: word marker routines returns incorrect data for empty line
2664 Previous checkin for this bug was missing some of the patch. Editing snafu with multiple changes in tree.
2666 * kwq/KWQAccObject.mm:
2667 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2668 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
2669 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
2670 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2671 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
2672 (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
2673 (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
2675 2005-01-19 Ken Kocienda <kocienda@apple.com>
2679 * khtml/editing/htmlediting.cpp:
2680 (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Small, cosmetic change John and I decided
2681 to do on my last checkin, but I forgot to do before landing.
2683 2005-01-19 Ken Kocienda <kocienda@apple.com>
2689 <rdar://problem/3959727> REGRESSION (Mail): Style not preserved on blank lines
2691 * khtml/editing/htmlediting.cpp:
2692 (khtml::CompositeEditCommand::applyStyle):
2693 (khtml::CompositeEditCommand::insertBlockPlaceholder): New function that unconditionally adds a block placeholder.
2694 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Now returns bool based on whether
2695 placeholder was added or not.
2696 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now searches all the descendents of a block
2697 looking for a placeholder. The old code, which just looked at the last child of a node, started missing
2698 once block placeholders became styled (which started happening with this patch).
2699 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Now handles applying typing style
2700 to a block placeholder at call time, rather than setting the typing style as a latent style that
2701 might be applied later. This is an important part of the bug fix.
2702 (khtml::DeleteSelectionCommand::doApply): Now uses bool return value from insertBlockPlaceholderIfNeeded()
2703 and passes it along to calculateStyleBeforeInsertion, so the case where a block placeholder needs to
2704 be styled can be detected.
2705 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Changed the way this class
2706 managed style. Before it would calculate and set typing style for the block added. This is not
2707 sufficient. Added blocks need to styled immediately. Some name changes to instance variables in
2708 this class due to the change to accommodate this change.
2709 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Name changes, as above.
2710 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Ditto.
2711 (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Ditto.
2712 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
2713 (khtml::ReplaceSelectionCommand::doApply): Improve check for testing when a placeholder
2714 block can be removed in its entirety after the insertion.
2715 * khtml/editing/htmlediting.h: Update header accordingly.
2716 * khtml/khtml_part.cpp:
2717 (KHTMLPart::selectionComputedStyle): Move position for computed style check downstream before
2718 doing check when the position is in an empty block (this makes sure any style on any block
2719 placeholder is accounted for).
2721 New layout tests to check bug fix.
2723 * layout-tests/editing/style/block-style-004-expected.txt: Added.
2724 * layout-tests/editing/style/block-style-004.html: Added.
2725 * layout-tests/editing/style/block-style-005-expected.txt: Added.
2726 * layout-tests/editing/style/block-style-005.html: Added.
2727 * layout-tests/editing/style/block-style-006-expected.txt: Added.
2728 * layout-tests/editing/style/block-style-006.html: Added.
2730 Results updated to reflect new block placeholder code.
2732 * layout-tests/editing/inserting/insert-div-004-expected.txt
2733 * layout-tests/editing/inserting/insert-div-005-expected.txt
2734 * layout-tests/editing/inserting/insert-div-006-expected.txt
2735 * layout-tests/editing/inserting/insert-div-008-expected.txt
2736 * layout-tests/editing/inserting/insert-div-011-expected.txt
2737 * layout-tests/editing/inserting/insert-div-012-expected.txt
2738 * layout-tests/editing/inserting/insert-div-013-expected.txt
2739 * layout-tests/editing/inserting/insert-div-014-expected.txt
2740 * layout-tests/editing/inserting/insert-div-015-expected.txt
2741 * layout-tests/editing/inserting/insert-div-016-expected.txt
2742 * layout-tests/editing/inserting/insert-div-017-expected.txt
2743 * layout-tests/editing/inserting/insert-div-018-expected.txt
2744 * layout-tests/editing/inserting/insert-div-019-expected.txt
2745 * layout-tests/editing/inserting/insert-div-021-expected.txt
2746 * layout-tests/editing/inserting/insert-div-022-expected.txt
2747 * layout-tests/editing/inserting/insert-div-023-expected.txt
2748 * layout-tests/editing/inserting/insert-div-024-expected.txt
2750 2005-01-19 David Hyatt <hyatt@apple.com>
2752 Dont null-check the renderer before submitting, since a script can set it to display:none and still expect the
2753 submission to occur. Fixes bug #3477282.
2757 (DOM::HTMLInputElementImpl::defaultEventHandler):
2759 2005-01-18 Richard Williamson <rjw@apple.com>
2761 Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
2763 Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
2764 Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
2765 Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
2766 Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
2768 We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
2769 tags. Also, if any of these elements are named they can be accessed from the document or window objects.
2770 Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
2774 * khtml/dom/html_document.cpp:
2775 (HTMLDocument::objects):
2776 * khtml/dom/html_document.h:
2777 * khtml/ecma/kjs_dom.cpp:
2778 (DOMDocumentProtoFunc::tryCall):
2779 (DOMElementProtoFunc::tryCall):
2780 (KJS::getRuntimeObject):
2781 * khtml/ecma/kjs_dom.h:
2782 * khtml/ecma/kjs_html.cpp:
2783 (KJS::HTMLDocument::tryGet):
2784 (KJS::HTMLElement::tryGet):
2785 (KJS::HTMLCollection::tryGet):
2786 (KJS::HTMLCollection::getNamedItems):
2787 * khtml/ecma/kjs_window.cpp:
2789 * khtml/html/html_miscimpl.cpp:
2790 (HTMLCollectionImpl::traverseNextItem):
2791 * khtml/html/html_miscimpl.h:
2792 (DOM::HTMLCollectionImpl::):
2793 * khtml/html/html_objectimpl.cpp:
2794 (HTMLAppletElementImpl::getAppletInstance):
2795 (HTMLObjectElementImpl::HTMLObjectElementImpl):
2796 (HTMLObjectElementImpl::getObjectInstance):
2797 * khtml/html/html_objectimpl.h:
2798 * khtml/rendering/render_frames.cpp:
2799 (RenderPartObject::updateWidget):
2800 * kwq/KWQKHTMLPart.h:
2801 * kwq/KWQKHTMLPart.mm:
2802 (KWQKHTMLPart::getObjectInstanceForView):
2804 2005-01-18 David Hyatt <hyatt@apple.com>
2806 Fix for 3948123, rolling over link erases nearby text. The repaint rect check for lines was wrong whenever
2807 two lines overlapped.
2809 Reviewed by kocienda
2811 * khtml/rendering/render_flow.cpp:
2812 (RenderFlow::paintLines):
2814 2005-01-18 Ken Kocienda <kocienda@apple.com>
2820 <rdar://problem/3960116> Focus rings paint incorrectly for contenteditable blocks in web pages
2822 * khtml/rendering/render_flow.cpp:
2823 (RenderFlow::addFocusRingRects): Fix painting of focus rings so that ring only paints around
2824 outermost contenteditable elements.
2826 2005-01-18 David Harrison <harrison@apple.com>
2830 <rdar://problem/3959668> accessibilityFocusedUIElement sometimes returns an ignored element; it must not
2832 * kwq/KWQAccObject.mm:
2833 (-[KWQAccObject accessibilityFocusedUIElement]):
2834 Return parentObjectUnignored if focused object is ignored.
2836 2005-01-18 Ken Kocienda <kocienda@apple.com>
2842 <rdar://problem/3952877> REGRESSION (Mail): Command-left/right-arrows don't work with file attachment
2844 * khtml/editing/selection.cpp:
2845 (khtml::nodeForInlineBox): New helper function used in reimplementation of function below.
2846 (khtml::selectionForLine): Reimplemented using line box smarts. I originally wrote this code when
2847 I had a less than full understanding of line layout. I can do better now, and my new version no
2848 longer fails to notice attachments when doing the kind of navigation mentioned in the bug.
2850 2005-01-17 David Harrison <harrison@apple.com>
2852 Reviewed by John Sullivan.
2854 <rdar://problem/3949429> AX: word marker routines returns incorrect data for empty line
2855 <rdar://problem/3949848> AX: paragraph marker routines do not work when given a paragraph end marker
2857 Also fixed sentence support in the same way.
2859 * kwq/KWQAccObject.mm:
2860 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2861 (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
2862 (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
2863 (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
2864 (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
2865 Move one position in desired direction before calling visible_units.cpp code.
2867 2005-01-17 David Harrison <harrison@apple.com>
2869 Updated expected test results.
2871 <rdar://problem/3945880> line-ending space seems not to be present
2873 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt:
2874 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt:
2875 * layout-tests/editing/inserting/insert-div-020-expected.txt:
2876 * layout-tests/editing/inserting/insert-div-021-expected.txt:
2877 * layout-tests/editing/inserting/insert-div-022-expected.txt:
2878 * layout-tests/editing/inserting/insert-div-023-expected.txt:
2879 * layout-tests/editing/inserting/insert-div-024-expected.txt:
2881 2005-01-17 David Harrison <harrison@apple.com>
2883 Reviewed by Dave Hyatt (bidi.cpp) and Darin Adler (selection.cpp).
2885 <rdar://problem/3945880> line-ending space seems not to be present
2887 * khtml/editing/selection.cpp:
2888 (khtml::Selection::validate):
2889 Extend AFTER_WHITE_SPACE code to support white spac in the middle of paragraphs, not just the end.
2890 * khtml/rendering/bidi.cpp:
2891 (khtml::RenderBlock::findNextLineBreak):
2892 Pick left/rightness of word selection based on being at the end of paragraph (i.e. after a hard line break).
2894 2005-01-17 Darin Adler <darin@apple.com>
2896 Reviewed by John Louch.
2898 - fixed <rdar://problem/3958503> need screenX and screenY to use WebKit windowFrame delegate
2900 * khtml/ecma/kjs_window.cpp: (Window::get): Change screenX and screenY to use frameGeometry instead
2901 of using mapToGlobal and screen in a complicated way.
2902 * kwq/KWQKHTMLView.mm: Removed unused mapToGlobal function.
2903 * kwq/KWQWindowWidget.h: Ditto.
2904 * kwq/KWQWindowWidget.mm: Ditto.
2906 2005-01-17 David Hyatt <hyatt@apple.com>
2908 Fix a screwup in rightmost/lowets position computation. 3955207. Make sure floats with layers are still checked.
2910 Reviewed by kocienda
2912 * khtml/rendering/render_block.cpp
2914 2005-01-17 Ken Kocienda <kocienda@apple.com>
2918 <rdar://problem/3953366> Problems with typing attributes in HTML compose
2920 * khtml/editing/htmlediting.cpp:
2921 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Remove misguided "optimization"
2922 that tried to sense when typing style could be cleared without actually doing a style diff between
2923 before-delete and after-delete positions. Removing this extra check and running the
2924 general-purpose code fixes the bug.
2926 2005-01-17 Richard Williamson <rjw@apple.com>
2928 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
2930 Keep track of originating execution context and target execution
2931 context for native JS object wrappers, and perform appropriate
2934 Reviewed by David Harrison.
2936 * khtml/ecma/kjs_binding.cpp:
2937 (ScriptInterpreter::isGlobalObject):
2938 (ScriptInterpreter::isSafeScript):
2939 (ScriptInterpreter::interpreterForGlobalObject):
2940 * khtml/ecma/kjs_binding.h:
2941 * khtml/ecma/kjs_window.cpp:
2942 (Window::interpreter):
2943 (Window::isSafeScript):
2944 * khtml/ecma/kjs_window.h:
2945 * kwq/DOMInternal.mm:
2946 (-[WebScriptObject _initializeScriptDOMNodeImp]):
2947 * kwq/KWQKHTMLPart.mm:
2948 (KWQKHTMLPart::windowScriptObject):
2949 (KWQKHTMLPart::windowScriptNPObject):
2950 * kwq/WebCoreBridge.mm:
2952 (-[WebCoreBridge init]):
2954 2005-01-17 Ken Kocienda <kocienda@apple.com>
2960 <rdar://problem/3786659> REGRESSION (Mail): editable WebViews don't work with
2961 "size up" and "size down" NSFontManager changes
2963 * khtml/css/cssparser.cpp:
2964 (CSSParser::parseValue): Add support for parsing new font size delta property.
2965 * khtml/css/cssproperties.c: Generated file.
2966 * khtml/css/cssproperties.h: Ditto.
2967 * khtml/css/cssproperties.in: Add support for parsing new font size delta property.
2968 * khtml/editing/htmlediting.cpp:
2969 (khtml::isEmptyStyleSpan): New helper function. Code existed before, but now factored out for convenient use.
2970 (khtml::CompositeEditCommand::removeNodeAttribute): Does check on value to see it exists before creating
2971 and running command to do the removal.
2972 (khtml::ApplyStyleCommand::doApply): Now calls new applyRelativeFontStyleChange() function as part of its work.
2973 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): New function that does the "heavy lifting" to handle
2974 relative font size changes.
2975 (khtml::ApplyStyleCommand::applyInlineStyle): Range check the start and end positions to make sure the start is
2976 before or equal to the end. Swap them if not true. I ran into this problem in some similar code in
2977 applyRelativeFontStyleChange(). Moving that goodness here too.
2978 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded): Uses a local variable to save a value used often.
2979 Code is the same, but reads better now. Function now returns bool as well, just like splitTextAtStartIfNeeded.
2980 I use the bool return value now (I obviously did not need it before).
2981 (khtml::ApplyStyleCommand::computedFontSize): New helper function.
2982 (khtml::ApplyStyleCommand::joinChildTextNodes): Ditto.
2983 (khtml::createStyleSpanElement): Ditto.
2984 * khtml/editing/htmlediting.h: Update header accordingly.
2985 * khtml/editing/jsediting.cpp: Add new command string to enable relative font size changes.
2987 (-[DOMCSSStyleDeclaration _fontSizeDelta]): New convenience.
2988 (-[DOMCSSStyleDeclaration _setFontSizeDelta:]): Ditto.
2989 * kwq/DOMPrivate.h: Declare new conveniences.
2990 * layout-tests/editing/editing.js: Add new JS to enable relative font size changes, as well as explicit font size setting.
2991 * layout-tests/editing/style/relative-font-size-change-001-expected.txt: Added.
2992 * layout-tests/editing/style/relative-font-size-change-001.html: Added.
2993 * layout-tests/editing/style/relative-font-size-change-002-expected.txt: Added.
2994 * layout-tests/editing/style/relative-font-size-change-002.html: Added.
2995 * layout-tests/editing/style/relative-font-size-change-003-expected.txt: Added.
2996 * layout-tests/editing/style/relative-font-size-change-003.html: Added.
2997 * layout-tests/editing/style/relative-font-size-change-004-expected.txt: Added.
2998 * layout-tests/editing/style/relative-font-size-change-004.html: Added.
3000 2005-01-14 Darin Adler <darin@apple.com>
3002 * khtml/css/cssproperties.c: Regenerated with gperf 3.0.1.
3003 * khtml/css/cssvalues.c: Regenerated with gperf 3.0.1.
3004 * khtml/misc/htmlattrs.c: Regenerated with gperf 3.0.1.
3005 * khtml/misc/htmltags.c: Regenerated with gperf 3.0.1.
3007 2005-01-14 Chris Blumenberg <cblu@apple.com>
3009 Fixed: <rdar://problem/3886415> arrow keys don't work when the user hits Back to return to RSS page
3013 (KWQKHTMLPart::openURLFromPageCache): restore mousePressNode
3014 (KWQKHTMLPart::mousePressNode): new
3015 * kwq/KWQPageState.h:
3016 * kwq/KWQPageState.mm:
3017 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]): save the mousePressNode
3018 (-[KWQPageState clear]): clear the mousePressNode
3019 (-[KWQPageState dealloc]): deref the mousePressNode
3020 (-[KWQPageState mousePressNode]): new
3024 2005-01-13 Vicki Murley <vicki@apple.com>
3028 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
3030 * WebCore.pbproj/project.pbxproj: bump "2004" to "2005"
3032 2005-01-13 David Harrison <harrison@apple.com>
3034 Reviewed by Ken Kocienda.
3036 Better fix for 3905066.
3038 * khtml/editing/htmlediting.cpp:
3039 (khtml::InsertParagraphSeparatorCommand::doApply):
3041 2005-01-10 Maciej Stachowiak <mjs@apple.com>
3045 <rdar://problem/3758033> REGRESSION (Mail): Support attributes in marked text (International input)
3047 * khtml/rendering/render_text.cpp:
3048 (InlineTextBox::paint): Support painting custom underline markers for
3049 marked text in place of generic yellow.
3050 (InlineTextBox::paintMarkedTextUnderline): New method that handles this.
3051 * khtml/rendering/render_text.h:
3052 * kwq/KWQKHTMLPart.h: Declare new methods and structs.
3053 * kwq/KWQKHTMLPart.mm:
3054 (KWQKHTMLPart::clear): Clear marked test underlines.
3055 (KWQKHTMLPart::setMarkedTextRange): Takes attributes and ranges now.
3056 (convertAttributesToUnderlines): Converts NSAttributedString attributes
3057 to simplified and C++-friendly form.
3058 (KWQKHTMLPart::markedTextUsesUnderlines): New method.
3059 (KWQKHTMLPart::markedTextUnderlines): New method.
3060 * kwq/KWQPainter.mm:
3061 (QPainter::drawLineForText): Handle pen width.
3062 * kwq/WebCoreBridge.h:
3063 * kwq/WebCoreBridge.mm:
3064 (-[WebCoreBridge setMarkedTextDOMRange:customAttributes:ranges:]): Take attributes
3066 * kwq/WebCoreTextRenderer.h:
3068 2005-01-12 David Harrison <harrison@apple.com>
3070 Reviewed by Dave Hyatt.
3072 <rdar://problem/3888973> AX: Parent AXWebArea of nested AXWebAreas is messed up
3074 * kwq/KWQAccObject.mm:
3075 (-[KWQAccObject addChildrenToArray:]):
3076 Use the widget's outer view.
3078 2005-01-12 David Harrison <harrison@apple.com>
3080 Reviewed by Darin Adler.
3082 <rdar://problem/3949908> Crash when asking for the kAXLengthForTextMarkerRangeParameterizedAttribute
3084 * khtml/xml/dom_nodeimpl.cpp:
3085 (NodeImpl::displayNode):
3086 Add quotes around text node content.
3087 (NodeBaseImpl::childNode):
3088 Add nil check to return nil rather than crash when child node not found.
3089 * kwq/KWQAccObject.mm:
3090 (-[KWQAccObject doAXStringForTextMarkerRange:]):
3091 Pass range compliant positions to TextIterator.
3093 2005-01-12 David Hyatt <hyatt@apple.com>
3095 Fix for 3951203, CSS border style incorrectly clipped on inline elements. Make sure the repaint rect set during
3096 line layout is smarter about including the overflow for both old states and new states.
3100 * khtml/rendering/bidi.cpp:
3101 (khtml::RenderBlock::layoutInlineChildren):
3103 2005-01-12 David Hyatt <hyatt@apple.com>
3105 Fix for bug 3937608, versiontracker.com flashes and displays the right column below content. Make sure to move
3106 tables/overflows that dont fit within a block only in strict mode.
3108 Fix for bug 3931049, characters dont show up when typing. Make sure to dirty the right lines when this specific
3109 case in editing is hit.
3111 Reviewed by darin (first one), kocienda (second one)
3113 * khtml/rendering/render_block.cpp:
3114 (khtml::RenderBlock::getClearDelta):
3115 * khtml/rendering/render_flow.cpp:
3116 (RenderFlow::dirtyLinesFromChangedChild):
3117 * khtml/rendering/render_line.cpp:
3118 (khtml::InlineFlowBox::verticallyAlignBoxes):
3120 2005-01-12 Ken Kocienda <kocienda@apple.com>
3126 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
3128 * khtml/editing/htmlediting.cpp:
3129 (khtml::DeleteSelectionCommand::initializePositionData): Change test that will prevent block
3130 merging. End-of-line test was just wrong. Call new start-of and end-of paragraph functions
3131 added to visible_position files.
3132 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Add tests for BR elements, which makes
3133 tests to determine when to stop moving nodes more complete and correct. Also improved comments.
3134 * khtml/editing/visible_position.cpp:
3135 (khtml::isFirstVisiblePositionInParagraph): New function.
3136 (khtml::isLastVisiblePositionInParagraph): New function.
3137 * khtml/editing/visible_position.h: Update header accordingly.
3138 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: New results, slightly different from former
3139 results but still correct.
3140 * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Ditto.
3141 * layout-tests/editing/deleting/delete-block-merge-contents-018-expected.txt: Added.
3142 * layout-tests/editing/deleting/delete-block-merge-contents-018.html: Added.
3143 * layout-tests/editing/deleting/delete-block-merge-contents-019-expected.txt: Added.
3144 * layout-tests/editing/deleting/delete-block-merge-contents-019.html: Added.
3145 * layout-tests/editing/deleting/delete-block-merge-contents-020-expected.txt: Added.
3146 * layout-tests/editing/deleting/delete-block-merge-contents-020.html: Added.
3147 * layout-tests/editing/deleting/delete-block-merge-contents-021-expected.txt: Added.
3148 * layout-tests/editing/deleting/delete-block-merge-contents-021.html: Added.
3149 * layout-tests/editing/deleting/delete-line-014-expected.txt: These new results are actually better, and fix a bug.
3151 2005-01-11 Richard Williamson <rjw@apple.com>
3153 Fixed 3922875. Fall back to DOM object is EMBED element
3154 has no associated runtime object.
3158 * khtml/ecma/kjs_dom.cpp:
3159 (KJS::getRuntimeObject):
3160 * khtml/ecma/kjs_html.cpp:
3161 (KJS::HTMLDocument::tryGet):
3162 (KJS::HTMLElement::tryGet):
3163 (KJS::HTMLCollection::tryGet):
3164 (KJS::HTMLCollection::getNamedItems):
3166 2005-01-11 David Hyatt <hyatt@apple.com>
3168 Fix for 3882299, missing content on gibson.com. Change our handling of " and ' in certain states of the parser to match
3173 * khtml/html/htmltokenizer.cpp:
3174 (khtml::HTMLTokenizer::parseTag):
3176 2005-01-11 Chris Blumenberg <cblu@apple.com>
3178 Fixed: <rdar://problem/3930733> Mail prints second page of email blank
3182 * khtml/rendering/render_canvas.cpp:
3183 (RenderCanvas::paint): cache the print rect since the dirty rect can get changed during printing
3184 * khtml/rendering/render_flow.cpp:
3185 (RenderFlow::paintLines): removed null check since the print rect should never be null
3186 * khtml/rendering/render_list.cpp:
3187 (RenderListMarker::paint): ditto
3188 * kwq/KWQKHTMLPart.mm:
3189 (KWQKHTMLPart::adjustPageHeight): don't set the print rect here since this method is not called for the last page
3191 2005-01-10 Ken Kocienda <kocienda@apple.com>
3197 <rdar://problem/3943648> extra line is inserted after pressing return within quoted text of reply
3199 * khtml/editing/htmlediting.cpp:
3200 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): This bug was the result of a
3201 simple coding mistake. A local variable was erroneously redefined in a deeper scope, and so the
3202 result calculated in that deeper scope was not available when tested.
3204 2005-01-10 Ken Kocienda <kocienda@apple.com>
3210 <rdar://problem/3946852> Option-e goes to next line
3212 * khtml/editing/htmlediting.cpp:
3213 (khtml::ReplaceSelectionCommand::doApply): Tweak case used to determine when merging content
3214 into the start line is done. We plan to change pretty substantially soon to better handle
3215 the problem described in <rdar://problem/3937352> Quote level not maintained when copied
3216 and pasted within a Mail message. In the meantime, this change does no harm, and fixes the bug.
3218 2005-01-10 Ken Kocienda <kocienda@apple.com>
3224 <rdar://problem/3907005> Applying block styles to a line of text can unexpectedly affect other lines
3226 * khtml/editing/htmlediting.cpp:
3227 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): New function which moves "paragraphs"
3228 to their own blocks if needed so that a block style can be applied.
3229 (khtml::CompositeEditCommand::isMailBlockquote): Moved this function to base class so it can be used more generally.
3230 (khtml::ApplyStyleCommand::applyBlockStyle): Pass a node instead of a block to addBlockStyleIfNeeded().
3231 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Now accepts a node instead of a block for styling.
3232 This function also now calls moveParagraphContentsToNewBlockIfNecessary() to make sure that only the current
3233 paragraph is styled.
3234 (khtml::SetNodeAttributeCommand::doUnapply): Should not assert on undo if old value of attribute was null.
3235 Should remove attributue instead.
3236 * khtml/editing/htmlediting.h: Touch function declarations accordingly.
3237 * layout-tests/editing/style/create-block-for-style-001-expected.txt: Added.
3238 * layout-tests/editing/style/create-block-for-style-001.html: Added.
3239 * layout-tests/editing/style/create-block-for-style-002-expected.txt: Added.
3240 * layout-tests/editing/style/create-block-for-style-002.html: Added.
3241 * layout-tests/editing/style/create-block-for-style-003-expected.txt: Added.
3242 * layout-tests/editing/style/create-block-for-style-003.html: Added.
3243 * layout-tests/editing/style/create-block-for-style-004-expected.txt: Added.
3244 * layout-tests/editing/style/create-block-for-style-004.html: Added.
3245 * layout-tests/editing/style/create-block-for-style-005-expected.txt: Added.
3246 * layout-tests/editing/style/create-block-for-style-005.html: Added.
3247 * layout-tests/editing/style/create-block-for-style-006-expected.txt: Added.
3248 * layout-tests/editing/style/create-block-for-style-006.html: Added.
3249 * layout-tests/editing/style/create-block-for-style-007-expected.txt: Added.
3250 * layout-tests/editing/style/create-block-for-style-007.html: Added.
3251 * layout-tests/editing/style/create-block-for-style-008-expected.txt: Added.
3252 * layout-tests/editing/style/create-block-for-style-008.html: Added.
3253 * layout-tests/editing/style/create-block-for-style-009-expected.txt: Added.
3254 * layout-tests/editing/style/create-block-for-style-009.html: Added.
3255 * layout-tests/editing/style/create-block-for-style-010-expected.txt: Added.
3256 * layout-tests/editing/style/create-block-for-style-010.html: Added.
3257 * layout-tests/editing/style/create-block-for-style-011-expected.txt: Added.
3258 * layout-tests/editing/style/create-block-for-style-011.html: Added.
3259 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Added.
3260 * layout-tests/editing/style/create-block-for-style-012.html: Added.
3261 * layout-tests/editing/style/create-block-for-style-013-expected.txt: Added.
3262 * layout-tests/editing/style/create-block-for-style-013.html: Added.
3264 Unrelated updates to these expected results.
3265 * layout-tests/editing/inserting/insert-div-007-expected.txt
3266 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
3268 2005-01-10 Chris Blumenberg <cblu@apple.com>
3270 Fixed: <rdar://problem/3936844> Mail: Messages with rich text do not print
3274 * khtml/rendering/render_flow.cpp:
3275 (RenderFlow::paintLines): don't do pagination work if printRect is not set
3276 * khtml/rendering/render_list.cpp:
3277 (RenderListMarker::paint): ditto
3279 2005-01-10 David Harrison <harrison@apple.com>
3283 * kwq/KWQTextUtilities.mm:
3284 (currentTextBreakLocaleID):
3285 Return empty string (AKA root locale) if locale pref can not be canonicalized.
3287 2005-01-10 John Sullivan <sullivan@apple.com>
3289 Fixed broken Panther build.
3291 * kwq/KWQTextUtilities.mm:
3292 (currentTextBreakLocaleID):
3293 This recently-added function was using code copy/pasted from CarbonCore UnicodeUtilities.
3294 That code used a Tiger-only function, CFLocaleCreateCanonicalLanguageIdentifierFromString.
3295 To fix the build, I added a BUILDING_ON_PANTHER #ifdef that avoids the call to the Tiger
3296 function. However, the Tiger-only code was wrong; the string generated using
3297 CFLocaleCreateCanonicalLanguageIdentifierFromString was not used at all, so I fixed that
3300 2005-01-09 David Harrison <harrison@apple.com>
3302 Reviewed by Ken Kocienda.
3304 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
3306 * khtml/editing/htmlediting.cpp: