3 2004-10-29 Darin Adler <darin@apple.com>
5 Reviewed by NOBODY (OOPS!).
7 - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
9 * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
10 before advancing one character; before it did it backwards.
12 2004-10-29 Chris Blumenberg <cblu@apple.com>
14 Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
16 Reviewed by kocienda, adele.
18 * khtml/rendering/render_frames.cpp:
19 (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
21 2004-10-29 Darin Adler <darin@apple.com>
25 - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
27 * khtml/khtmlview.cpp:
28 (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
29 deleted before this function finishes running.
30 (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
31 (KHTMLView::viewportMouseReleaseEvent): Ditto.
32 (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
33 is guaranteed to do ref/deref as needed.
35 * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
37 2004-10-28 Chris Blumenberg <cblu@apple.com>
39 Enabled XSLT on Panther. See intrigue mail for compiling instructions.
43 * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
44 * WebCorePrefix.h: always use XSLT
46 2004-10-28 Ken Kocienda <kocienda@apple.com>
52 <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
53 <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
55 * khtml/editing/htmlediting.cpp:
56 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members
57 to initialization list, zeroing them out.
58 (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
59 handle a delete of content in special cases where the only thing selected is a BR. This
60 code path is much simpler than the newly-named performGeneralDelete, and detects when no
61 content merging should be done between blocks. This aspect of the change fixes 3854848.
62 One of the special cases added fixes 3803832.
63 (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
64 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
65 like the other helpers in this class.
66 (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
67 (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
68 * khtml/editing/htmlediting.h: Added new helper and changed an old one.
70 2004-10-28 Chris Blumenberg <cblu@apple.com>
72 Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
76 * kwq/KWQKHTMLPart.mm:
77 (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
79 2004-10-28 Ken Kocienda <kocienda@apple.com>
83 Reorganization of delete command functionality so that doApply is not
84 several hundred lines long. This is not a squeaky-clean cleanup, but
85 it is a step in the right direction. No functionality changes.
87 * khtml/editing/htmlediting.cpp:
88 (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
89 (khtml::DeleteSelectionCommand::initializePositionData): New helper.
90 (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
91 (khtml::DeleteSelectionCommand::performDelete): Ditto.
92 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
93 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
94 (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
95 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
96 (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
97 (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
98 * khtml/editing/htmlediting.h:
100 2004-10-28 Ken Kocienda <kocienda@apple.com>
104 * khtml/editing/htmlediting.cpp:
105 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
106 new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
108 2004-10-27 Ken Kocienda <kocienda@apple.com>
112 * khtml/editing/htmlediting.cpp:
113 (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
114 whether content not in the block containing the start of the selection is moved to that block
115 after the selection is deleted.
116 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
117 (khtml::DeleteSelectionCommand::doApply): Ditto.
118 (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
119 to handle the case of inserting a newline when in quoted content in Mail.
120 (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
121 (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
122 (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
123 (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
124 (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
125 (khtml::TypingCommand::doApply): Ditto.
126 (khtml::TypingCommand::preservesTypingStyle): Ditto.
127 * khtml/editing/htmlediting.h: Add new delclarations.
128 (khtml::TypingCommand::): Ditto.
129 * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
130 * kwq/WebCoreBridge.mm:
131 (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
133 2004-10-26 Chris Blumenberg <cblu@apple.com>
135 Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
139 * khtml/ecma/kjs_dom.cpp:
140 (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
141 * khtml/ecma/kjs_dom.h:
143 * khtml/ecma/kjs_dom.lut.h:
146 2004-10-26 David Hyatt <hyatt@apple.com>
148 Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
153 * khtml/rendering/bidi.cpp:
154 (khtml::RenderBlock::layoutInlineChildren):
156 2004-10-26 David Hyatt <hyatt@apple.com>
158 Convert selectionRect() from using a list to a dict and patch it to be like setSelection. It was still trying
159 to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
163 * khtml/rendering/render_canvas.cpp:
164 (RenderCanvas::selectionRect):
165 * khtml/rendering/render_object.h:
166 (khtml::RenderObject::hasSelectedChildren):
168 2004-10-26 Ken Kocienda <kocienda@apple.com>
174 <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
176 * khtml/editing/htmlediting.cpp:
177 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
178 let the caller know if a placeholder was removed.
179 (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
180 removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
181 some cases, the selection was still set on the removed BR, and this was the cause of the
183 * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
185 2004-10-26 Darin Adler <darin@apple.com>
189 - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
191 * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
193 2004-10-26 Ken Kocienda <kocienda@apple.com>
197 * khtml/editing/htmlediting.cpp:
198 (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
199 with a zero-length string. That triggers an assert. Call deleteText instead,
200 using the same indices that are passed to replaceText.
202 Cleaned up the asserts in these three functions below, making them
203 more consistent. This is not needed for the fix, but I tripped over
204 these in the course of debugging.
206 (khtml::InsertTextCommand::InsertTextCommand):
207 (khtml::InsertTextCommand::doApply):
208 (khtml::InsertTextCommand::doUnapply):
210 2004-10-25 Adele Amchan <adele@apple.com>
214 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
215 * khtml/xml/dom_docimpl.h:
217 2004-10-25 Adele Amchan <adele@apple.com>
219 Reviewed by me, code change by Darin.
221 * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
223 2004-10-25 Ken Kocienda <kocienda@apple.com>
225 Oops. These two test results changed with my last checkin, for the better.
227 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
228 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
230 2004-10-25 Ken Kocienda <kocienda@apple.com>
236 <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
238 * khtml/editing/htmlediting.cpp:
239 (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
240 expand the selection outwards when the selection is on the visible boundary of a root
241 editable element. This fixes the bug. Note that this function also contains a little code
242 I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
243 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
244 (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
245 * khtml/editing/htmlediting.h: Declare new helpers.
246 * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
247 * layout-tests/editing/deleting/delete-select-all-001.html: Added.
248 * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
249 * layout-tests/editing/deleting/delete-select-all-002.html: Added.
250 * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
251 * layout-tests/editing/deleting/delete-select-all-003.html: Added.
253 2004-10-25 Ken Kocienda <kocienda@apple.com>
255 Added some more editing layout tests.
257 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
258 * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
259 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
260 * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
261 * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
262 * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
263 * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
264 * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
265 * layout-tests/editing/inserting/typing-003-expected.txt: Added.
266 * layout-tests/editing/inserting/typing-003.html: Added.
268 2004-10-25 Ken Kocienda <kocienda@apple.com>
272 * khtml/rendering/bidi.cpp:
273 (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
274 yesterday quite right: words that should have been placed on the next line were instead
275 appearing on the line before, beyond the right margin. This was a one-word only error
276 based on moving the line break object when it should have stayed put. Here is the rule:
277 The line break object only moves to after the whitespace on the end of a line if that
278 whitespace caused line overflow when its width is added in.
280 2004-10-25 Adele Amchan <adele@apple.com>
284 Fix for <rdar://problem/3619890> Feature request: designMode
286 This change implements the designMode property of a document. This is an IE property that is also supported by Mozilla.
287 This will enable more JS editing compatibility.
289 * khtml/ecma/kjs_html.cpp:
290 (KJS::HTMLDocument::tryGet): added case for designMode
291 (KJS::HTMLDocument::putValue): added case for designMode
292 * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
293 * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
294 * khtml/xml/dom_docimpl.cpp:
295 (DocumentImpl::DocumentImpl): initialize m_designMode member variable
296 (DocumentImpl::setDesignMode): added function to assign m_designMode value
297 (DocumentImpl::getDesignMode): return m_designMode value
298 (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value.
299 Otherwise, it will just return the m_designMode value.
300 (DocumentImpl::parentDocument):
301 * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
302 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
304 2004-10-22 Ken Kocienda <kocienda@apple.com>
310 <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
312 * khtml/editing/htmlediting.cpp:
313 (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
314 everything that could be affected.
315 (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
316 braces, making it act as a comma operator, with a zero value as the right value!!! This made
317 an important check always fail!!! It turns out that we do not want the constant at all, since
318 that constant is only needed when checking a computed style, not an inline style as is being
320 (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
321 (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
322 RangeImpl::compareBoundaryPoints to perform the required check.
323 * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
325 2004-10-22 Ken Kocienda <kocienda@apple.com>
331 <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
332 <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
334 * khtml/rendering/bidi.cpp:
335 (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
336 it is when we are editing, add in the space of the current character when calculating the width
337 of committed plus uncommitted characters. If this value exceeds the width of the line, move up
338 the line break object and call skipWhitespace to move past the end of the whitespace.
342 2004-10-22 Ken Kocienda <kocienda@apple.com>
344 * WebCore.pbproj/project.pbxproj:
345 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
347 2004-10-21 David Hyatt <hyatt@apple.com>
351 Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
353 <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
354 <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
356 * khtml/rendering/render_block.cpp:
357 (khtml::getInlineRun):
358 (khtml::RenderBlock::makeChildrenNonInline):
360 2004-10-21 David Hyatt <hyatt@apple.com>
362 Fix for 3810389, crash because of continuation() craziness. Revert back to the old behavior of
363 making sure that all line boxes get deleted and recreated when inlines are split because of a block.
367 * khtml/rendering/render_inline.cpp:
368 (RenderInline::splitFlow):
370 2004-10-21 Ken Kocienda <kocienda@apple.com>
374 Significant improvement to the way that whitespace is handled during editing.
376 * khtml/editing/htmlediting.cpp:
377 (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
378 two being added with this name) that delete "insignificant" unrendered text.
379 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
380 calculates the downstream position to use as the endpoint for the deletion, and
381 then calls deleteInsignificantText with this start and end.
382 (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
383 (khtml::InputNewlineCommand::doApply): Ditto.
384 (khtml::InputTextCommand::input): Ditto.
385 * khtml/editing/htmlediting.h: Add new declarations.
387 Modified layout test results:
388 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
389 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
390 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
391 * layout-tests/editing/deleting/delete-selection-001-expected.txt:
392 * layout-tests/editing/deleting/delete-tab-001-expected.txt:
393 * layout-tests/editing/deleting/delete-tab-004-expected.txt:
394 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
395 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
396 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
397 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
398 * layout-tests/editing/inserting/insert-br-001-expected.txt:
399 * layout-tests/editing/inserting/insert-br-004-expected.txt:
400 * layout-tests/editing/inserting/insert-br-005-expected.txt:
401 * layout-tests/editing/inserting/insert-br-006-expected.txt:
402 * layout-tests/editing/inserting/insert-tab-001-expected.txt:
403 * layout-tests/editing/inserting/insert-tab-002-expected.txt:
404 * layout-tests/editing/inserting/insert-tab-004-expected.txt:
405 * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
406 * layout-tests/editing/inserting/typing-001-expected.txt:
407 * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
408 * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
409 * layout-tests/editing/style/typing-style-003-expected.txt:
410 * layout-tests/editing/undo/redo-typing-001-expected.txt:
411 * layout-tests/editing/undo/undo-typing-001-expected.txt:
413 2004-10-21 David Hyatt <hyatt@apple.com>
415 Fix for 3847054, assertion failure in RenderText::layout() on news.com page. Fix getInlineRun so that
416 it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
420 * khtml/rendering/render_block.cpp:
421 (khtml::getInlineRun):
423 2004-10-20 David Hyatt <hyatt@apple.com>
425 Add better dumping of overflow information for scrolling regions.
427 Fix for 3726524, crash in updateLayerPosition. Make sure anonymous elements properly remove themselves
428 from the render tree so that layers and so forth are cleaned up.
432 * khtml/rendering/render_container.cpp:
433 (RenderContainer::detach):
434 * khtml/rendering/render_layer.h:
435 (khtml::RenderLayer::scrollXOffset):
436 (khtml::RenderLayer::scrollYOffset):
437 * kwq/KWQRenderTreeDebug.cpp:
440 2004-10-20 David Hyatt <hyatt@apple.com>
442 Fix for 3791146, make sure all lines are checked when computing overflow.
446 * khtml/rendering/bidi.cpp:
447 (khtml::RenderBlock::computeHorizontalPositionsForLine):
448 (khtml::RenderBlock::layoutInlineChildren):
449 (khtml::RenderBlock::findNextLineBreak):
450 (khtml::RenderBlock::checkLinesForOverflow):
451 * khtml/rendering/render_block.h:
453 2004-10-20 David Hyatt <hyatt@apple.com>
455 Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
459 * khtml/rendering/break_lines.cpp:
460 (khtml::isBreakable):
462 2004-10-20 Darin Adler <darin@apple.com>
466 - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
468 * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
469 Create a palette with the background and foreground colors in it and set it on the widget.
471 * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
472 with APPLE_CHANGES. Removed palette and palette-related function members.
473 * khtml/rendering/render_style.cpp:
474 (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
475 (RenderStyle::diff): No palette to compare.
477 * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
478 * kwq/KWQLineEdit.mm:
479 (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
480 (QLineEdit::text): Made const.
482 * kwq/KWQTextEdit.h: Added setPalette override.
483 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
486 * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
487 per color group, and only a single color group per palette.
488 * kwq/KWQColorGroup.mm: Removed.
489 * kwq/KWQPalette.mm: Removed.
490 * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
492 * kwq/KWQApplication.h: Removed unused palette function.
493 * kwq/KWQApplication.mm: Ditto.
495 * kwq/KWQWidget.h: Removed unsetPalette.
496 * kwq/KWQWidget.mm: Ditto.
500 * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
501 Roll in storage leak fix from KDE guys.
503 2004-10-19 David Hyatt <hyatt@apple.com>
507 More cleanup of block layout. Eliminates the separate step for tables that dont fit on a line with a float
508 and consolidates it with clearing.
510 Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
512 * khtml/rendering/render_block.cpp:
513 (khtml::getInlineRun):
514 (khtml::RenderBlock::layoutBlock):
515 (khtml::RenderBlock::adjustFloatingBlock):
516 (khtml::RenderBlock::collapseMargins):
517 (khtml::RenderBlock::clearFloatsIfNeeded):
518 (khtml::RenderBlock::estimateVerticalPosition):
519 (khtml::RenderBlock::layoutBlockChildren):
520 (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
521 (khtml::RenderBlock::getClearDelta):
522 (khtml::RenderBlock::calcBlockMinMaxWidth):
523 * khtml/rendering/render_block.h:
524 * khtml/rendering/render_frames.cpp:
525 (RenderFrameSet::layout):
526 * khtml/xml/dom_textimpl.cpp:
527 (TextImpl::rendererIsNeeded):
529 Fix for 3841060, regression with * in frames. Reviewed by kocienda.
531 * layout-tests/fast/frames/002-expected.txt: Added.
532 * layout-tests/fast/frames/002.html: Added.
534 2004-10-19 Darin Adler <darin@apple.com>
538 - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
540 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
541 scripts being loaded here. If the current code being run is the external script itself, then we don't want
542 to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
543 assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
544 wrong since there can be a script loading in that case too. Layout tests check for both problems.
546 * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
547 * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
548 * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
550 * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
552 2004-10-18 Darin Adler <darin@apple.com>
554 Reviewed by Dave Hyatt.
556 - fixed <rdar://problem/3807234> REGRESSION (152-153): can't get element by ID that was just written with document.write in separate JS file (lacoccinelle.net)
558 * khtml/html/htmltokenizer.cpp:
559 (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
560 (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
561 we only want to look at loadingExtScript if m_executingScript is 0.
563 2004-10-18 Ken Kocienda <kocienda@apple.com>
569 <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
571 * khtml/css/css_valueimpl.cpp:
572 (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
573 Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the
574 lifecycle issues associated with creating a string to be returned in the ident case.
575 * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
576 * khtml/css/cssstyleselector.cpp:
577 (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
579 2004-10-18 Chris Blumenberg <cblu@apple.com>
581 Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
583 Reviewed by kocienda.
585 * khtml/rendering/render_frames.cpp:
586 (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
588 2004-10-15 Chris Blumenberg <cblu@apple.com>
590 Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
595 (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
598 2004-10-15 Ken Kocienda <kocienda@apple.com>
602 * khtml/rendering/bidi.cpp:
603 (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
604 skipping after a clean line break, in addition to the cases already
606 * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
607 * layout-tests/editing/inserting/insert-br-007.html: Added.
608 * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
609 * layout-tests/editing/inserting/insert-br-008.html: Added.
613 2004-10-14 Ken Kocienda <kocienda@apple.com>
619 <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
621 * khtml/editing/visible_position.cpp:
622 (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
623 position code to new-style VisiblePosition code. In retrospect, this code was misguided.
624 Since we do a good job of insulating external code from the internal workings of
625 VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
626 in the case of this bug, was doing harm. Simply removing this code makes the bug
627 go away and does not cause any editing layout test regresssions.
629 2004-10-14 Ken Kocienda <kocienda@apple.com>
633 * khtml/rendering/bidi.cpp:
634 (khtml::skipNonBreakingSpace): New helper.
635 (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
636 at the start of a block. This was preventing users from typing spaces in empty
638 * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
639 * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
641 2004-10-14 Adele Amchan <adele@apple.com>
643 Reviewed by Darin and Ken.
645 fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
647 This change shifts some code around so that the code that determines what typing style
648 is in effect is called before deleteUnrenderedText is called. Two asserts are also added
649 to ensure that start and end nodes of the selection are in the document.
651 * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
653 2004-10-14 Adele Amchan <adele@apple.com>
657 This change makes these three functions virtual so that the work is being done in KWQHTMLPart
658 instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
660 * khtml/khtml_part.cpp:
661 (KHTMLPart::shouldBeginEditing):
662 (KHTMLPart::shouldEndEditing):
663 (KHTMLPart::isContentEditable):
664 * khtml/khtml_part.h:
665 * kwq/KWQKHTMLPart.h:
667 2004-10-14 Ken Kocienda <kocienda@apple.com>
671 Final fix for these bugs:
673 <rdar://problem/3806306> HTML editing puts spaces at start of line
674 <rdar://problem/3814252> HTML editing groups space with word causing wrapping
676 This change sets some new CSS properties that have been added to WebCore to
677 enable whitespace-handling and line-breaking features that make WebView work
678 more like a text editor.
680 * khtml/css/cssstyleselector.cpp:
681 (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties
682 based on property value.
683 * khtml/html/html_elementimpl.cpp:
684 (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties
685 based on attribute value.
686 * khtml/khtml_part.cpp:
687 (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
689 (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
691 (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
692 (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
693 * khtml/khtml_part.h: Add new declarations.
694 * kwq/WebCoreBridge.h: Ditto.
695 * kwq/WebCoreBridge.mm:
696 (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
697 (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
698 (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
699 (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
701 2004-10-14 John Sullivan <sullivan@apple.com>
705 - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
707 * khtml/editing/htmlediting.cpp:
708 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
709 needed a nil check to handle empty document case
711 2004-10-13 Maciej Stachowiak <mjs@apple.com>
715 <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
717 - I fixed this by turning off all colormatching for WebKit
718 content. We might turn it back on later. For now, it's possible to
719 turn it on temporarily by defining COLORMATCH_EVERYTHING.
722 * khtml/ecma/kjs_html.cpp:
723 (KJS::Context2DFunction::tryCall):
724 (Context2D::colorRefFromValue):
725 (Gradient::getShading):
726 * khtml/rendering/render_canvasimage.cpp:
727 (RenderCanvasImage::createDrawingContext):
729 (QColor::getNSColor):
732 (CGColorFromNSColor):
733 (QPainter::selectedTextBackgroundColor):
734 (QPainter::rgbColorSpace):
735 (QPainter::grayColorSpace):
736 (QPainter::cmykColorSpace):
737 * kwq/WebCoreGraphicsBridge.h:
738 * kwq/WebCoreGraphicsBridge.m:
739 (-[WebCoreGraphicsBridge createRGBColorSpace]):
740 (-[WebCoreGraphicsBridge createGrayColorSpace]):
741 (-[WebCoreGraphicsBridge createCMYKColorSpace]):
743 2004-10-13 Ken Kocienda <kocienda@apple.com>
747 * khtml/css/css_valueimpl.cpp:
748 (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
749 is non-null before appending.
751 2004-10-13 Ken Kocienda <kocienda@apple.com>
753 Update expected results for improved behavior as a result of fix to 3816768.
755 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
756 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
757 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
759 2004-10-13 Ken Kocienda <kocienda@apple.com>
763 * khtml/css/css_computedstyle.cpp:
764 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
765 for getting -khtml-line-break and -khml-nbsp-mode.
767 2004-10-13 Ken Kocienda <kocienda@apple.com>
773 <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly
774 moves caret out of block.
776 The issue here is that an empty block with no explicit height set by style collapses
777 to zero height, and does so immediately after the last bit of content is removed from
778 it (as a result of deleting text with the delete key for instance). Since zero-height
779 blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
781 The fix is to detect when a block has not been removed itself, but has had all its
782 contents removed. In this case, a BR element is placed in the block, one that is
783 specially marked as a placeholder. Later, if the block ever receives content, this
784 placeholder is removed.
786 * khtml/editing/htmlediting.cpp:
787 (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
788 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
789 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
790 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
791 Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong
792 (it's very clear that we needs to be able to move more than just text nodes). This may expose
793 bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
794 made the test case in the bug work.
795 (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
796 removeBlockPlaceholderIfNeeded.
797 (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
798 (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
799 * khtml/editing/htmlediting.h: Declare new functions.
801 2004-10-13 Richard Williamson <rjw@apple.com>
803 Added support for -apple-dashboard-region:none. And fixed
804 a few computed style problems.
806 Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
809 * khtml/css/css_computedstyle.cpp:
810 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
811 * khtml/css/css_valueimpl.cpp:
812 (CSSPrimitiveValueImpl::cssText):
813 * khtml/css/cssparser.cpp:
814 (CSSParser::parseValue):
815 (CSSParser::parseDashboardRegions):
816 * khtml/css/cssstyleselector.cpp:
817 (khtml::CSSStyleSelector::applyProperty):
818 * khtml/rendering/render_style.cpp:
819 (RenderStyle::noneDashboardRegions):
820 * khtml/rendering/render_style.h:
821 * kwq/KWQKHTMLPart.mm:
822 (KWQKHTMLPart::dashboardRegionsDictionary):
824 2004-10-13 David Hyatt <hyatt@apple.com>
826 Rework block layout to clean it up and simplify it (r=kocienda).
828 Also fixing the style sharing bug (r=mjs).
830 * khtml/rendering/render_block.cpp:
831 (khtml::RenderBlock::MarginInfo::MarginInfo):
832 (khtml::RenderBlock::layoutBlock):
833 (khtml::RenderBlock::adjustPositionedBlock):
834 (khtml::RenderBlock::adjustFloatingBlock):
835 (khtml::RenderBlock::handleSpecialChild):
836 (khtml::RenderBlock::handleFloatingOrPositionedChild):
837 (khtml::RenderBlock::handleCompactChild):
838 (khtml::RenderBlock::insertCompactIfNeeded):
839 (khtml::RenderBlock::handleRunInChild):
840 (khtml::RenderBlock::collapseMargins):
841 (khtml::RenderBlock::clearFloatsIfNeeded):
842 (khtml::RenderBlock::estimateVerticalPosition):
843 (khtml::RenderBlock::determineHorizontalPosition):
844 (khtml::RenderBlock::setCollapsedBottomMargin):
845 (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
846 (khtml::RenderBlock::handleBottomOfBlock):
847 (khtml::RenderBlock::layoutBlockChildren):
848 (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
849 (khtml::RenderBlock::addOverHangingFloats):
850 * khtml/rendering/render_block.h:
851 (khtml::RenderBlock::maxTopMargin):
852 (khtml::RenderBlock::maxBottomMargin):
853 (khtml::RenderBlock::CompactInfo::compact):
854 (khtml::RenderBlock::CompactInfo::block):
855 (khtml::RenderBlock::CompactInfo::matches):
856 (khtml::RenderBlock::CompactInfo::clear):
857 (khtml::RenderBlock::CompactInfo::set):
858 (khtml::RenderBlock::CompactInfo::CompactInfo):
859 (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
860 (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
861 (khtml::RenderBlock::MarginInfo::clearMargin):
862 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
863 (khtml::RenderBlock::MarginInfo::setTopQuirk):
864 (khtml::RenderBlock::MarginInfo::setBottomQuirk):
865 (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
866 (khtml::RenderBlock::MarginInfo::setPosMargin):
867 (khtml::RenderBlock::MarginInfo::setNegMargin):
868 (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
869 (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
870 (khtml::RenderBlock::MarginInfo::setMargin):
871 (khtml::RenderBlock::MarginInfo::atTopOfBlock):
872 (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
873 (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
874 (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
875 (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
876 (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
877 (khtml::RenderBlock::MarginInfo::quirkContainer):
878 (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
879 (khtml::RenderBlock::MarginInfo::topQuirk):
880 (khtml::RenderBlock::MarginInfo::bottomQuirk):
881 (khtml::RenderBlock::MarginInfo::posMargin):
882 (khtml::RenderBlock::MarginInfo::negMargin):
883 (khtml::RenderBlock::MarginInfo::margin):
884 * khtml/rendering/render_box.cpp:
885 (RenderBox::calcAbsoluteVertical):
886 * khtml/rendering/render_box.h:
887 (khtml::RenderBox::marginTop):
888 (khtml::RenderBox::marginBottom):
889 (khtml::RenderBox::marginLeft):
890 (khtml::RenderBox::marginRight):
891 * khtml/rendering/render_image.cpp:
892 (RenderImage::setImage):
893 * khtml/rendering/render_object.cpp:
894 (RenderObject::sizesToMaxWidth):
895 * khtml/rendering/render_object.h:
896 (khtml::RenderObject::collapsedMarginTop):
897 (khtml::RenderObject::collapsedMarginBottom):
898 (khtml::RenderObject::maxTopMargin):
899 (khtml::RenderObject::maxBottomMargin):
900 (khtml::RenderObject::marginTop):
901 (khtml::RenderObject::marginBottom):
902 (khtml::RenderObject::marginLeft):
903 (khtml::RenderObject::marginRight):
904 * khtml/rendering/render_text.h:
905 (khtml::RenderText::marginLeft):
906 (khtml::RenderText::marginRight):
907 * khtml/xml/dom_elementimpl.cpp:
908 (ElementImpl::recalcStyle):
910 2004-10-12 Ken Kocienda <kocienda@apple.com>
916 <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line
918 * khtml/editing/selection.cpp:
919 (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
920 This will make it seem like the run ends on the next line.
922 2004-10-12 Ken Kocienda <kocienda@apple.com>
928 <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages
930 * khtml/editing/htmlediting.cpp:
931 (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
932 row, section, or column.
933 (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
934 of table structure when doing deletes, rather than deleting the structure elements themselves.
935 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
936 of table structure. We may want to revisit this some day, but this seems like the best behavior
938 (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
940 * khtml/editing/htmlediting.h: Add declarations for new functions.
942 2004-10-12 Richard Williamson <rjw@apple.com>
944 Fixed access to DOM object via WebScriptObject API.
945 The execution context for DOM objects wasn't being found.
946 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
949 Fixed <rdar://problem/3831063> regions use left offset instead of top offset
952 * khtml/khtml_part.h:
953 * khtml/rendering/render_object.cpp:
954 (RenderObject::addDashboardRegions):
956 (-[DOMNode isContentEditable]):
957 (-[DOMNode KJS::Bindings::]):
958 * kwq/KWQKHTMLPart.h:
959 * kwq/KWQKHTMLPart.mm:
960 (KWQKHTMLPart::executionContextForDOM):
962 2004-10-12 Ken Kocienda <kocienda@apple.com>
968 <rdar://problem/3834779> Mail crashes when editing HTML message - khtml::Selection::layout()
970 * kwq/KWQKHTMLPart.mm:
971 (KWQKHTMLPart::styleForSelectionStart): Table code seems to be more robust when the call to
972 insert our style-checking node is done with an appendChild rather than an insertBefore. Note
973 that this table-related problem was exposed by fixing Selection::layout(), which I did
974 yesterday. This change simply improves things even more so that we do not crash in the
975 scenario described in the bug.
977 2004-10-11 Ken Kocienda <kocienda@apple.com>
981 This is a partial fix to this bug:
983 <rdar://problem/3832886> increase quote level on new mail document leads to immediate
984 crash in caret painting code
986 To eliminate the bad behavior for good, I have done some investigations in Mail code,
987 and I have sent a suggested code change on to Grant. Basically, Mail can't add empty
988 blocks (like blockquote elements used for quoting) to documents without giving those
989 blocks some content (so they have a height).
991 I added some other crash protections below.
993 * khtml/editing/selection.cpp:
994 (khtml::Selection::layout): Check for non-null position after calls to VisiblePosition, since
995 the VisiblePosition constructors may fail to find a visible spot in the document. Also, add
996 a couple position-has-renderer assertion checks.
997 * kwq/KWQKHTMLPart.mm:
998 (KWQKHTMLPart::styleForSelectionStart): Take out pos.isNotNull() assertion since VisiblePosition
999 may not yield a position. This assertion is a holdover from before we had VisiblePosition.
1000 (KWQKHTMLPart::fontForSelection): Rearrange the code a little to deal with possible null results from
1003 2004-10-11 Darin Adler <darin@apple.com>
1007 - fixed <rdar://problem/3834230> empty table can result in division by 0
1009 * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows):
1010 Added 0 check; rolled in from KDE.
1012 2004-10-11 Darin Adler <darin@apple.com>
1016 - fixed <rdar://problem/3818712> form checkbox value property is read only
1018 The underlying problem was that we were storing two separate values for all
1019 form elements; one for the value property (JavaScript) and the other for the
1020 value attribute (DOM). This is a good idea for text input, but not for other types.
1022 * khtml/html/html_formimpl.h: Changed setValue to take a const DOMString reference.
1023 Added private storesValueSeparateFromAttribute function.
1024 * khtml/html/html_formimpl.cpp:
1025 (DOM::HTMLInputElementImpl::setType): Handle type changes, including detaching and re-attaching
1026 if type changed, and moving value from m_value to ATTR_VALUE and vice versa.
1027 (DOM::HTMLInputElementImpl::type): Added a case for ISINDEX and moved the default out of the
1028 switch so that we will get a warning if a type is left out.
1029 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Tweaked comment format.
1030 (DOM::HTMLInputElementImpl::reset): Changed to only nuke the value if the value property is stored
1031 separately from the attribute. Otherwise, we just want to lave it alone
1032 (DOM::HTMLInputElementImpl::value): Changed to always use m_value if it's not null, then fall back
1033 on the attribute, and finally fall back to the "on" for the checkbox only if both are null.
1034 (DOM::HTMLInputElementImpl::setValue): Changed to set the attribute unless the value property is
1035 supposed to be stored separate from the attribute.
1036 (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute): Added. Returns true for text-type
1037 input elements, and false for the others.
1039 2004-10-11 Darin Adler <darin@apple.com>
1043 - fixed <rdar://problem/3296652> checkbox input type does not respond to onchange
1045 * khtml/rendering/render_form.cpp:
1046 (RenderFormElement::updateFromElement): Some new code, commented out, for form element colors.
1047 (RenderCheckBox::slotStateChanged): Added call to onChange.
1049 2004-10-11 Ken Kocienda <kocienda@apple.com>
1053 Finish selection affinity implementation. This includes code to set the
1054 affinity correctly when clicking with the mouse, and clearing the
1055 affinity when altering the selection using any of the Selection object
1058 Each instance of the positionForCoordinates, inlineBox and caretRect
1059 functions have been changed to include an EAffinity argument to give results
1060 which take this bit into account.
1062 * khtml/editing/selection.cpp:
1063 (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
1064 (khtml::Selection::modifyAffinity): New function to compute affinity based on
1065 modification constants.
1066 (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
1067 (khtml::Selection::modifyExtendingRightForward): Ditto.
1068 (khtml::Selection::modifyMovingRightForward): Ditto.
1069 (khtml::Selection::modifyExtendingLeftBackward): Ditto.
1070 (khtml::Selection::modifyMovingLeftBackward): Ditto.
1071 (khtml::Selection::modify): Support saving, restoring, and then calculating new
1072 affinity value as needed.
1073 (khtml::Selection::xPosForVerticalArrowNavigation):
1074 (khtml::Selection::clear): Reset affinity to UPSTREAM.
1075 (khtml::Selection::setBase): Ditto.
1076 (khtml::Selection::setExtent): Ditto.
1077 (khtml::Selection::setBaseAndExtent): Ditto.
1078 (khtml::Selection::layout): Pass affinity to caretRect().
1079 (khtml::Selection::validate): Pass along affinity parameter to new functions that
1081 (khtml::startOfFirstRunAt): Changed the way that the y-coordinate search is done, to
1082 keep this code working with changes made in selectionForLine().
1083 (khtml::endOfLastRunAt): Ditto.
1084 (khtml::selectionForLine): Make this function work for all renderers, not just text
1086 * khtml/editing/selection.h:
1087 (khtml::operator==): Consider affinity in equality check.
1088 * khtml/editing/visible_units.cpp:
1089 (khtml::previousLinePosition): Pass affinity argument to function so it can take this
1090 information into account while processing.
1091 (khtml::nextLinePosition): Ditto.
1092 (khtml::previousParagraphPosition): Ditto.
1093 (khtml::nextParagraphPosition): Ditto.
1094 * khtml/editing/visible_units.h: Ditto, for each of the functions listed.
1095 * khtml/khtml_events.cpp:
1096 (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
1097 as this function is being removed.
1098 * khtml/khtml_part.cpp:
1099 (KHTMLPart::isPointInsideSelection): Ditto.
1100 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
1101 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1102 (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
1103 call to positionForCoordinates, and set resulting affinity on the selection.
1104 (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on
1105 NodeImpl::positionForCoordinates, as this function is being removed.
1106 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
1107 * khtml/rendering/render_block.cpp:
1108 (khtml::RenderBlock::positionForCoordinates): Now takes an affinity argument.
1109 * khtml/rendering/render_block.h:
1110 * khtml/rendering/render_box.cpp:
1111 (RenderBox::caretRect): Ditto.
1112 * khtml/rendering/render_box.h:
1113 * khtml/rendering/render_br.cpp:
1114 (RenderBR::positionForCoordinates): Ditto.
1115 (RenderBR::caretRect): Ditto.
1116 (RenderBR::inlineBox): Ditto.
1117 * khtml/rendering/render_br.h:
1118 * khtml/rendering/render_container.cpp:
1119 (RenderContainer::positionForCoordinates): Ditto.
1120 * khtml/rendering/render_container.h:
1121 * khtml/rendering/render_flow.cpp:
1122 (RenderFlow::caretRect): Ditto.
1123 * khtml/rendering/render_flow.h:
1124 * khtml/rendering/render_inline.cpp:
1125 (RenderInline::positionForCoordinates): Ditto.
1126 * khtml/rendering/render_inline.h:
1127 * khtml/rendering/render_object.cpp:
1128 (RenderObject::caretRect): Ditto.
1129 (RenderObject::positionForCoordinates): Ditto.
1130 (RenderObject::inlineBox): Ditto.
1131 * khtml/rendering/render_object.h:
1132 * khtml/rendering/render_replaced.cpp:
1133 (RenderReplaced::positionForCoordinates): Ditto.
1134 * khtml/rendering/render_replaced.h:
1135 * khtml/rendering/render_text.cpp:
1136 (RenderText::positionForCoordinates): Ditto.
1137 (firstRendererOnNextLine): New helper used by caretRect().
1138 (RenderText::caretRect): Now takes an affinity argument.
1139 (RenderText::inlineBox): Ditto.
1140 * khtml/rendering/render_text.h:
1141 * khtml/xml/dom_nodeimpl.cpp: Remove positionForCoordinates helper.
1142 * khtml/xml/dom_nodeimpl.h: Ditto.
1143 * khtml/xml/dom_position.cpp:
1144 (DOM::Position::previousLinePosition): Now takes an affinity argument.
1145 (DOM::Position::nextLinePosition): Ditto.
1146 * khtml/xml/dom_position.h:
1147 * kwq/WebCoreBridge.h:
1148 * kwq/WebCoreBridge.mm:
1149 (-[WebCoreBridge caretRectAtNode:offset:affinity:]): Ditto.
1150 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
1151 (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on
1152 NodeImpl::positionForCoordinates, as this function is being removed.
1154 2004-10-11 Darin Adler <darin@apple.com>
1158 - fixed <rdar://problem/3670280> scroll position on overflowed textareas resets when leaving the tab
1160 * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView becomeFirstResponder]):
1161 Scroll to reveal the text area, don't scroll to reveal the text view itself.
1162 Scrolling the text view ended up putting it at the top left, regardless of
1163 where the insertion point is.
1165 2004-10-11 Darin Adler <darin@apple.com>
1169 - fixed <rdar://problem/3831546> More text is copied than is visually selected
1171 The bug here is that upstream was moving a position too far.
1173 * khtml/xml/dom_position.cpp:
1174 (DOM::Position::upstream): Use the "deep equivalent" node rather than the original node passed
1175 in for various checks. Also use local variables a bit more for slightly more efficiency.
1176 (DOM::Position::downstream): Ditto.
1178 2004-10-11 Darin Adler <darin@apple.com>
1182 - fixed <rdar://problem/3833841> adding an event listener for keypress events does not work
1184 * khtml/xml/dom2_eventsimpl.h: Added numEventIds and made typeToId take a const DOMString &.
1185 * khtml/xml/dom2_eventsimpl.cpp:
1186 (EventImpl::typeToId): Changed to use table. Added "keypress", otherwise, the same as before.
1187 (EventImpl::idToType): Changed to use table.
1189 2004-10-10 John Sullivan <sullivan@apple.com>
1191 - fixed <rdar://problem/3664375> repro crash in -[KWQAccObject accessibilityAttributeNames]
1193 (-[KWQAccObject accessibilityActionNames]):
1194 check for nil m_renderer
1196 2004-10-09 Darin Adler <darin@apple.com>
1200 - fixed <rdar://problem/3828147> REGRESSION: textareas with wrap="off" show their contents in a thin vertical line of text
1202 * kwq/KWQTextArea.h: Added setTextColor and setBackgroundColor methods. This is really for another fix
1203 I'm landing later, but it does no harm to add these now.
1204 * kwq/KWQTextArea.mm:
1205 (-[KWQTextArea _configureTextViewForWordWrapMode]): Set the container size after changing the flag that
1206 determines if the width tracks the text view. Otherwise, we won't successfully set the width in the case
1207 where we don't want it to track the text view. This caused the bug.
1208 (-[KWQTextArea _createTextView]): Remove unneeded call to setMaxSize. The above method already does that.
1209 (-[KWQTextArea setTextColor:]): Added.
1210 (-[KWQTextArea setBackgroundColor:]): Added.
1212 2004-10-09 Darin Adler <darin@apple.com>
1216 - fixed <rdar://problem/3829452> REGRESSION (156-157): onload handler doesn't run on page with meta refresh of 0 duration (new Apple start page)
1218 The fix for <rdar://problem/3773150> made it so <meta> redirects prevent tokenizing the rest of the page.
1219 This is incorrect; the reason the JavaScript-triggered loads prevent tokenizing is that they take place
1220 "right away" in other browsers, but that is not true of <meta> redirect. We fixed this by using a separate
1221 call for <meta> redirect and not preventing tokenizing when that's in effect.
1223 * khtml/khtml_part.h: Removed userGesture parameter from scheduleRedirection. Renamed
1224 isImmediateRedirectPending to isScheduledLocationChangePending. Added scheduleLocationChange.
1225 * khtml/khtml_part.cpp:
1226 (KHTMLPart::openURL): Updated for new constant name.
1227 (KHTMLPart::scheduleRedirection): Removed now-unneeded userGesture parameter, and removed code that
1228 does the special case for redirection during load; a <meta> refresh can never be one of those special
1229 redirects during a load because it redirects the frame itself, not another frame. Also tightened up
1230 the logic by always stopping the redirect timer even if we aren't restarting it.
1231 (KHTMLPart::scheduleLocationChange): Added. Like scheduleRedirection, but with a different constant
1232 so we can tell it apart and always a delay of 0. The "redirection during load" case was moved in here
1233 and renamed to locationChangeScheduledDuringLoad.
1234 (KHTMLPart::isScheduledLocationChangePending): Renamed from isImmediateRedirectPending. This now
1235 returns true only for location changes and history navigation, not <meta> redirects.
1236 (KHTMLPart::scheduleHistoryNavigation): Tightened up logic to do the stop() outside the if as above,
1237 and got rid of a silly timer delay computation that always resulted in 0.
1239 * khtml/khtmlpart_p.h: Added a new value to the RedirectionScheduled enum for scheduleLocationChange
1240 and also renamed one of the existing values.
1242 * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::write): Changed to use isScheduledLocationChangePending instead
1243 of isImmediateRedirectPending, because we do want to continue tokenizing if it's actually a redirect.
1245 * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Changed to call the new scheduleLocationChange
1246 instead of calling scheduleRedirection with delay of 0.
1247 * khtml/ecma/kjs_window.cpp:
1248 (Window::put): Ditto.
1249 (WindowFunc::tryCall): Ditto.
1250 (Location::put): Ditto.
1251 (LocationFunc::tryCall): Ditto.
1253 2004-10-09 Darin Adler <darin@apple.com>
1257 - fixed <rdar://problem/3658277> REGRESSION (1.1-1.2): form submission should either not simulate a click at all or use (0,0) the way Mozilla does
1259 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::click): Use 0,0 for the coordinates.
1261 2004-10-09 Darin Adler <darin@apple.com>
1265 - fixed <rdar://problem/3804665> REGRESSION: WebCore framework now has many init routines
1267 * khtml/xml/dom_nodeimpl.h: Changed anyQName declaration to not use the inline function
1268 makeId. Surprisingly, the inline function was not "constant-folded" and we ended up with
1269 a copy of the function in each file as an init routine for the framework.
1271 * khtml/ecma/kjs_html.cpp: (Gradient::colorStops): Get rid of initialized ColorStop
1272 globals; their constructors were showing up as init routines for the framework.
1274 * khtml/rendering/render_style.h: Got rid of inline initialDashboardRegions function.
1275 * khtml/rendering/render_style.cpp: (RenderStyle::initialDashboardRegions): Made this
1276 a normal function. When it was an inline function, the constructors for the per-file
1277 copies of the globals were showing up as init routines for the framework.
1279 2004-10-09 Chris Blumenberg <cblu@apple.com>
1282 <rdar://problem/3625352> up and down arrow and page up/down keys don't work to scroll overflow:auto/scroll/overlay areas
1283 <rdar://problem/3397658> scroll wheel does not work to scroll overflow:auto/scroll/overlay areas (RSS)
1284 <rdar://problem/3822027> REGRESSION (Mail): When selection moves out of visible area, should center as NSText does
1286 Reviewed by hyatt, kocienda.
1288 * khtml/rendering/render_layer.cpp:
1289 (RenderLayer::scroll): new
1290 * khtml/rendering/render_layer.h:
1291 * khtml/rendering/render_object.cpp:
1292 (RenderObject::scroll): new
1293 * khtml/rendering/render_object.h:
1294 * kwq/KWQKHTMLPart.h:
1295 * kwq/KWQKHTMLPart.mm:
1296 (KWQKHTMLPart::scrollOverflow): new
1297 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent): new
1298 (KWQKHTMLPart::khtmlMousePressEvent): store pressed node so we know where the focus is
1299 * kwq/KWQScrollBar.h:
1300 * kwq/KWQScrollBar.mm:
1301 (QScrollBar::setValue): return a bool
1302 (QScrollBar::scrollbarHit): ditto
1303 (QScrollBar::scroll): new
1304 * kwq/WebCoreBridge.h:
1305 * kwq/WebCoreBridge.mm:
1306 (-[WebCoreBridge scrollOverflowInDirection:granularity:]): new
1307 (-[WebCoreBridge scrollOverflowWithScrollWheelEvent:]): new
1308 (-[WebCoreBridge ensureSelectionVisible]): visually center the extent of the selection
1310 2004-10-06 David Hyatt <hyatt@apple.com>
1312 Back out style sharing perf fix.
1314 * khtml/css/cssstyleselector.cpp:
1315 (khtml::CSSStyleSelector::locateCousinList):
1316 (khtml::CSSStyleSelector::canShareStyleWithElement):
1317 (khtml::CSSStyleSelector::locateSharedStyle):
1318 * khtml/css/cssstyleselector.h:
1319 * khtml/html/html_elementimpl.h:
1320 (DOM::HTMLElementImpl::inlineStyleDecl):
1321 * khtml/xml/dom_elementimpl.cpp:
1322 (ElementImpl::recalcStyle):
1323 * khtml/xml/dom_elementimpl.h:
1327 2004-10-05 David Hyatt <hyatt@apple.com>
1329 Fix a bug in the iteration of locateCousinList and clean up the style sharing stats code.
1331 * khtml/css/cssstyleselector.cpp:
1332 (khtml::CSSStyleSelector::locateCousinList):
1333 (khtml::CSSStyleSelector::elementsCanShareStyle):
1334 (khtml::CSSStyleSelector::locateSharedStyle):
1335 (khtml::CSSStyleSelector::styleForElement):
1337 2004-10-05 Ken Kocienda <kocienda@apple.com>
1341 * khtml/rendering/bidi.cpp:
1342 (khtml::RenderBlock::computeHorizontalPositionsForLine): Fix coding mistake that
1343 broke layout tests involving compacts.
1345 2004-10-05 Ken Kocienda <kocienda@apple.com>
1349 Finish selection affinity implementation. This includes code to set the
1350 affinity correctly when clicking with the mouse, and clearing the
1351 affinity when altering the selection using any of the Selection object
1354 Each instance of the positionForCoordinates function in the render tree
1355 has been changed to include an EAffinity argument. It is now the job of this
1356 function to set the selection affinity.
1358 * khtml/editing/selection.cpp:
1359 (khtml::Selection::moveTo): Set affinity to DOWNSTREAM.
1360 (khtml::Selection::modify): Ditto.
1361 (khtml::Selection::clear): Ditto.
1362 (khtml::Selection::setBase): Ditto.
1363 (khtml::Selection::setExtent): Ditto.
1364 (khtml::Selection::setBaseAndExtent): Ditto.
1365 * khtml/editing/selection.h:
1366 (khtml::operator==): Consider affinity in equality check.
1367 * khtml/khtml_events.cpp:
1368 (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
1369 as this function is being removed.
1370 * khtml/khtml_part.cpp:
1371 (KHTMLPart::isPointInsideSelection): Ditto.
1372 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
1373 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1374 (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
1375 call to positionForCoordinates, and set resulting affinity on the selection.
1376 (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on
1377 NodeImpl::positionForCoordinates, as this function is being removed.
1378 (KHTMLPart::khtmlMouseReleaseEvent):
1379 * khtml/rendering/render_block.cpp:
1380 (khtml::RenderBlock::positionForCoordinates): Changed, as described above.
1381 * khtml/rendering/render_block.h:
1382 * khtml/rendering/render_br.cpp:
1383 (RenderBR::positionForCoordinates): Ditto.
1384 * khtml/rendering/render_br.h:
1385 * khtml/rendering/render_container.cpp:
1386 (RenderContainer::positionForCoordinates): Ditto.
1387 * khtml/rendering/render_container.h:
1388 * khtml/rendering/render_inline.cpp:
1389 (RenderInline::positionForCoordinates): Ditto.
1390 * khtml/rendering/render_inline.h:
1391 * khtml/rendering/render_object.cpp:
1392 (RenderObject::positionForCoordinates): Ditto.
1393 * khtml/rendering/render_object.h:
1394 * khtml/rendering/render_replaced.cpp:
1395 (RenderReplaced::positionForCoordinates): Ditto.
1396 * khtml/rendering/render_replaced.h:
1397 * khtml/rendering/render_text.cpp:
1398 (RenderText::positionForCoordinates): Ditto.
1399 * khtml/rendering/render_text.h:
1400 * khtml/xml/dom_nodeimpl.cpp: Removed positionForCoordinates convenience.
1401 * khtml/xml/dom_nodeimpl.h: Ditto.
1402 * kwq/WebCoreBridge.mm:
1403 (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on
1404 NodeImpl::positionForCoordinates, as this function is being removed.
1406 2004-10-05 David Hyatt <hyatt@apple.com>
1408 Fix style sharing optimization to be fast again. Go back to using pointer comparisons when looking for
1413 * khtml/css/cssstyleselector.cpp:
1414 (khtml::CSSStyleSelector::locateCousinList):
1415 * khtml/rendering/render_object.cpp:
1416 (RenderObject::setStyleInternal):
1417 * khtml/rendering/render_object.h:
1418 * khtml/xml/dom_elementimpl.cpp:
1419 (ElementImpl::recalcStyle):
1421 2004-10-05 David Hyatt <hyatt@apple.com>
1423 Fix lists so that they properly participate in line layout as though they are text (when text bullets are
1424 used) and as images (when image bullets are used).
1426 Reviewed by kocienda
1428 * khtml/rendering/render_list.cpp:
1429 (RenderListMarker::createInlineBox):
1430 * khtml/rendering/render_list.h:
1431 (khtml::ListMarkerBox:::InlineBox):
1432 (khtml::ListMarkerBox::isText):
1434 2004-10-05 Ken Kocienda <kocienda@apple.com>
1438 Recent checkin adding upstreamDeepEquivalent had it backwards. The helper
1439 we want is downstreamDeepEquivalent, as the deepEquivalent function returns
1440 an upstream position.
1442 * khtml/editing/selection.cpp:
1443 (khtml::Selection::layout): DOWNSTREAM case now uses downstreamDeepEquivalent.
1444 UPSTREAM uses deepEquivalent.
1445 * khtml/editing/visible_position.cpp:
1446 (khtml::VisiblePosition::downstreamDeepEquivalent): New helper, replacing
1447 upstreamDeepEquivalent.
1448 * khtml/editing/visible_position.h
1450 2004-10-05 David Hyatt <hyatt@apple.com>
1452 New selection gap-filling architecture. Makes the gap-filling much more like NSTextView and puts the responsibility
1453 for gap-filling in the block. Fixes numerous bugs with selection drawing including bidi issues, incorrect old
1454 horizontal gap filling, and selection performance issues.
1456 Reviewed by kocienda
1458 * khtml/html/html_imageimpl.cpp:
1459 (HTMLImageLoader::notifyFinished):
1460 * khtml/misc/khtmllayout.h:
1461 (khtml::GapRects::left):
1462 (khtml::GapRects::center):
1463 (khtml::GapRects::right):
1464 (khtml::GapRects::uniteLeft):
1465 (khtml::GapRects::uniteCenter):
1466 (khtml::GapRects::uniteRight):
1467 (khtml::GapRects::unite):
1468 (khtml::GapRects::operator QRect):
1469 (khtml::GapRects::operator==):
1470 (khtml::GapRects::operator!=):
1471 * khtml/rendering/font.cpp:
1472 (Font::drawHighlightForText):
1473 * khtml/rendering/font.h:
1474 * khtml/rendering/render_block.cpp:
1475 (khtml:::RenderFlow):
1476 (khtml::RenderBlock::removeChild):
1477 (khtml::RenderBlock::paintObject):
1478 (khtml::RenderBlock::paintEllipsisBoxes):
1479 (khtml::RenderBlock::setSelectionState):
1480 (khtml::RenderBlock::shouldPaintSelectionGaps):
1481 (khtml::RenderBlock::isSelectionRoot):
1482 (khtml::RenderBlock::selectionGapRects):
1483 (khtml::RenderBlock::paintSelection):
1484 (khtml::RenderBlock::fillSelectionGaps):
1485 (khtml::RenderBlock::fillInlineSelectionGaps):
1486 (khtml::RenderBlock::fillBlockSelectionGaps):
1487 (khtml::RenderBlock::fillHorizontalSelectionGap):
1488 (khtml::RenderBlock::fillVerticalSelectionGap):
1489 (khtml::RenderBlock::fillLeftSelectionGap):
1490 (khtml::RenderBlock::fillRightSelectionGap):
1491 (khtml::RenderBlock::getHorizontalSelectionGapInfo):
1492 (khtml::RenderBlock::leftSelectionOffset):
1493 (khtml::RenderBlock::rightSelectionOffset):
1494 * khtml/rendering/render_block.h:
1495 (khtml::RenderBlock::hasSelectedChildren):
1496 (khtml::RenderBlock::selectionState):
1497 (khtml::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
1498 (khtml::RenderBlock::BlockSelectionInfo::rects):
1499 (khtml::RenderBlock::BlockSelectionInfo::state):
1500 (khtml::RenderBlock::BlockSelectionInfo::block):
1501 (khtml::RenderBlock::selectionRect):
1502 * khtml/rendering/render_box.cpp:
1503 (RenderBox::position):
1504 * khtml/rendering/render_br.cpp:
1505 (RenderBR::inlineBox):
1506 * khtml/rendering/render_br.h:
1507 (khtml::RenderBR::selectionRect):
1508 (khtml::RenderBR::paint):
1509 * khtml/rendering/render_canvas.cpp:
1510 (RenderCanvas::selectionRect):
1511 (RenderCanvas::setSelection):
1512 * khtml/rendering/render_canvasimage.cpp:
1513 (RenderCanvasImage::paint):
1514 * khtml/rendering/render_image.cpp:
1515 (RenderImage::paint):
1516 * khtml/rendering/render_image.h:
1517 * khtml/rendering/render_line.cpp:
1518 (khtml::InlineBox::nextLeafChild):
1519 (khtml::InlineBox::prevLeafChild):
1520 (khtml::InlineBox::selectionState):
1521 (khtml::InlineFlowBox::addToLine):
1522 (khtml::InlineFlowBox::firstLeafChild):
1523 (khtml::InlineFlowBox::lastLeafChild):
1524 (khtml::InlineFlowBox::firstLeafChildAfterBox):
1525 (khtml::InlineFlowBox::lastLeafChildBeforeBox):
1526 (khtml::InlineFlowBox::selectionState):
1527 (khtml::RootInlineBox::fillLineSelectionGap):
1528 (khtml::RootInlineBox::setHasSelectedChildren):
1529 (khtml::RootInlineBox::selectionState):
1530 (khtml::RootInlineBox::firstSelectedBox):
1531 (khtml::RootInlineBox::lastSelectedBox):
1532 (khtml::RootInlineBox::selectionTop):
1533 (khtml::RootInlineBox::block):
1534 * khtml/rendering/render_line.h:
1535 (khtml::RootInlineBox::RootInlineBox):
1536 (khtml::RootInlineBox::hasSelectedChildren):
1537 (khtml::RootInlineBox::selectionHeight):
1538 * khtml/rendering/render_object.cpp:
1539 (RenderObject::selectionColor):
1540 * khtml/rendering/render_object.h:
1541 (khtml::RenderObject::):
1542 (khtml::RenderObject::selectionState):
1543 (khtml::RenderObject::setSelectionState):
1544 (khtml::RenderObject::selectionRect):
1545 (khtml::RenderObject::canBeSelectionLeaf):
1546 (khtml::RenderObject::hasSelectedChildren):
1547 (khtml::RenderObject::hasDirtySelectionState):
1548 (khtml::RenderObject::setHasDirtySelectionState):
1549 (khtml::RenderObject::shouldPaintSelectionGaps):
1550 (khtml::RenderObject::SelectionInfo::SelectionInfo):
1551 * khtml/rendering/render_replaced.cpp:
1552 (RenderReplaced::RenderReplaced):
1553 (RenderReplaced::shouldPaint):
1554 (RenderReplaced::selectionRect):
1555 (RenderReplaced::setSelectionState):
1556 (RenderReplaced::selectionColor):
1557 (RenderWidget::paint):
1558 (RenderWidget::setSelectionState):
1559 * khtml/rendering/render_replaced.h:
1560 (khtml::RenderReplaced::canBeSelectionLeaf):
1561 (khtml::RenderReplaced::selectionState):
1562 * khtml/rendering/render_text.cpp:
1563 (InlineTextBox::checkVerticalPoint):
1564 (InlineTextBox::isSelected):
1565 (InlineTextBox::selectionState):
1566 (InlineTextBox::selectionRect):
1567 (InlineTextBox::paintSelection):
1568 (InlineTextBox::paintMarkedTextBackground):
1569 (RenderText::paint):
1570 (RenderText::setSelectionState):
1571 (RenderText::selectionRect):
1572 * khtml/rendering/render_text.h:
1573 (khtml::RenderText::canBeSelectionLeaf):
1575 * kwq/KWQPainter.mm:
1576 (QPainter::drawHighlightForText):
1578 (QPtrDictIterator::toFirst):
1581 * kwq/WebCoreTextRenderer.h:
1582 * kwq/WebCoreTextRendererFactory.mm:
1583 (WebCoreInitializeEmptyTextGeometry):
1585 2004-10-05 Ken Kocienda <kocienda@apple.com>
1589 Use the new CSS properties I added with my previous check-in. Also makes
1590 some changes to caret positioning and drawing to make the proper editing
1591 end-of-line behavior work correctly.
1593 * khtml/editing/selection.cpp:
1594 (khtml::Selection::layout): Caret drawing now takes affinity into account
1595 when deciding where to paint the caret (finally!).
1596 * khtml/editing/visible_position.cpp:
1597 (khtml::VisiblePosition::previousVisiblePosition): Move off Position::rendersInDifferentPosition
1598 to determine the result. Use a simpler test involving comparisons between
1599 downstream positions while iterating. This is cheaper to do and easier to understand.
1600 (khtml::VisiblePosition::nextVisiblePosition): Ditto.
1601 * khtml/rendering/bidi.cpp:
1602 (khtml::BidiIterator::current): Do not return non-breaking spaces for empty
1603 text renderers and for non-text renderers. Return a null Qchar instead. Returning
1604 non-breaking spaces was causing errors when the new -khtml-nbsp-mode was set to "space".
1605 (khtml::RenderBlock::computeHorizontalPositionsForLine): Shrink line boxes that
1606 contain with more spaces than can fit on the end of a line.
1607 (khtml::RenderBlock::skipWhitespace): Factor this out from findNextLineBreak.
1608 (khtml::RenderBlock::findNextLineBreak): Use new skipWhitespace function. Add
1609 in code to check and use new CSS properties.
1610 * khtml/rendering/break_lines.cpp:
1611 (khtml::isBreakable): Consider a non-breaking space a breakable character based
1612 on setting of new -khtml-nbsp-mode property.
1613 * khtml/rendering/break_lines.h: Ditto.
1614 * khtml/rendering/render_block.h: Declare skipWhitespace function.
1615 * khtml/rendering/render_text.cpp:
1616 (RenderText::caretRect): Do not draw the caret beyond the right edge of the
1617 window when in white-space normal mode.
1619 2004-10-05 Ken Kocienda <kocienda@apple.com>
1625 In this patch, I add two new CSS properties and their associated behavior.
1626 This is to support end-of-line and word-wrapping features that match the
1627 conventions of text editors.
1629 There are also some other small changes here which begin to lay the groundwork
1630 for using these new properties to bring about the desired editing behavior.
1632 * khtml/css/cssparser.cpp:
1633 (CSSParser::parseValue): Add support for new CSS properties.
1634 * khtml/css/cssproperties.c: Generated file.
1635 * khtml/css/cssproperties.h: Ditto.
1636 * khtml/css/cssproperties.in: Add new properties.
1637 * khtml/css/cssstyleselector.cpp:
1638 (khtml::CSSStyleSelector::applyProperty): Add support for new CSS properties.
1639 * khtml/css/cssvalues.c: Generated file.
1640 * khtml/css/cssvalues.h: Ditto.
1641 * khtml/css/cssvalues.in: Add support for new CSS properties.
1642 * khtml/editing/visible_position.cpp:
1643 (khtml::VisiblePosition::upstreamDeepEquivalent): Added new helper.
1644 * khtml/editing/visible_position.h:
1645 * khtml/rendering/render_box.cpp:
1646 (RenderBox::deleteLineBoxWrapper): Zero out inlineBoxWrapper.
1647 * khtml/rendering/render_replaced.cpp:
1648 (RenderWidget::detach): Zero out inlineBoxWrapper.
1649 * khtml/rendering/render_style.cpp:
1650 (StyleCSS3InheritedData):
1651 (StyleCSS3InheritedData::operator==): Add support for new CSS properties.
1652 (RenderStyle::diff): Ditto.
1653 * khtml/rendering/render_style.h:
1654 (khtml::RenderStyle::nbspMode): Ditto.
1655 (khtml::RenderStyle::khtmlLineBreak): Ditto.
1656 (khtml::RenderStyle::setNBSPMode): Ditto.
1657 (khtml::RenderStyle::setKHTMLLineBreak): Ditto.
1658 (khtml::RenderStyle::initialNBSPMode): Ditto.
1659 (khtml::RenderStyle::initialKHTMLLineBreak): Ditto.
1661 2004-10-05 Darin Adler <darin@apple.com>
1665 - fixed <rdar://problem/3673150> Pasting string from clipboard that is longer than input box will accept fails rather than truncating
1667 * kwq/KWQTextField.mm:
1668 (-[KWQTextFieldFormatter isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:]):
1669 Wrote a new version of this method that truncates incoming strings rather than rejecting them
1672 2004-10-04 Darin Adler <darin@apple.com>
1676 - fixed <rdar://problem/3826343> crash in KHTMLParser::setCurrent parsing document fragment (happens in Calendar widget)
1678 * khtml/html/htmlparser.cpp:
1679 (KHTMLParser::KHTMLParser): Initialized currentIsReferenced to false (fixes bug).
1680 (KHTMLParser::reset): Use doc() to make code easier to read.
1681 (KHTMLParser::setCurrent): Ditto.
1682 (KHTMLParser::parseToken): Ditto.
1683 (KHTMLParser::insertNode): Ditto.
1684 (KHTMLParser::getElement): Ditto.
1685 (KHTMLParser::popOneBlock): Ditto.
1687 - fixed <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window
1689 * kwq/KWQKHTMLPart.h: Added fontAttributesForSelectionStart.
1690 * kwq/KWQKHTMLPart.mm:
1691 (KWQKHTMLPart::styleForSelectionStart): Factored out most of fontForSelection.
1692 (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
1693 (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
1694 (KWQKHTMLPart::registerCommandForUndo): Updated for name change (see below).
1695 (KWQKHTMLPart::registerCommandForRedo): Ditto.
1697 * kwq/WebCoreBridge.h: Added fontAttributesForSelectionStart.
1698 * kwq/WebCoreBridge.mm:
1699 (-[WebCoreBridge undoEditing:]): Updated for name change (see below).
1700 (-[WebCoreBridge redoEditing:]): Ditto.
1701 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Got rid of named temporary
1702 EditCommandPtr variable to make things slightly more terse.
1703 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): Ditto.
1704 (-[WebCoreBridge deleteSelectionWithSmartDelete:]): Ditto.
1705 (-[WebCoreBridge fontAttributesForSelectionStart]): Added.
1707 - fix compile on Panther and other cleanup
1709 * khtml/khtml_part.cpp: Removed unneeded include.
1710 * kwq/KWQEditCommand.h: Got rid of use of "impl" when referring to EditCommand pointers.
1711 * kwq/KWQEditCommand.mm: Added include so we compile on Panther.
1712 (-[KWQEditCommand initWithEditCommand:]): Changed name.
1713 (-[KWQEditCommand dealloc]): Updated for m_impl change to m_command.
1714 (-[KWQEditCommand finalize]): Ditto.
1715 (+[KWQEditCommand commandWithEditCommand:]): Changed name.
1716 (-[KWQEditCommand command]): Changed name.
1718 2004-10-04 Darin Adler <darin@apple.com>
1722 - did a more-robust version of the fix I just landed
1724 * khtml/html/htmlparser.h: Added currentIsReferenced boolean.
1725 * khtml/html/htmlparser.cpp:
1726 (KHTMLParser::KHTMLParser): Initializes currentIsReferenced.
1727 (KHTMLParser::setCurrent): Changed to respect and set currentIsReferenced.
1729 2004-10-04 Darin Adler <darin@apple.com>
1733 - fixed <rdar://problem/3824393> REGRESSION (165-TOT): Crash in KHTMLParser::popOneBlock closing window (bose.com)
1735 * khtml/html/htmlparser.cpp:
1736 (KHTMLParser::~KHTMLParser): Move call to setCurrent(0) after the call to freeBlock, since freeBlock doesn't
1737 work well when current is 0, and there's no reason we need to reset the current block first.
1738 (KHTMLParser::setCurrent): Don't ever hold a reference to the document. This prevents a situation where there
1739 would be a reference cycle. In the test case from the bug above, this cycle actually happened and resulted
1740 in a double-delete of the document, tokenizer, and parser.
1742 2004-10-04 Darin Adler <darin@apple.com>
1746 - fixed <rdar://problem/3825429> onclick handler called when mouse down on another element (affects Dashboard Movies widget, test case enclosed)
1748 * khtml/khtmlview.cpp:
1749 (KHTMLViewPrivate::KHTMLViewPrivate): Initialize the click node to 0.
1750 (KHTMLViewPrivate::~KHTMLViewPrivate): Deref the click node.
1751 (KHTMLViewPrivate::reset): Clear the click node.
1752 (KHTMLView::viewportMousePressEvent): Call invalidateClick when we pass the event to a subframe to
1753 reduce the chance that we'll hold on to an old click node for a long time. Set the click node to
1754 the node we we are clicking on.
1755 (KHTMLView::viewportMouseDoubleClickEvent): Only send a click even if the node is the same one from
1756 the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
1757 old click node for a long time.
1758 (KHTMLView::invalidateClick): Clear the click node.
1759 (KHTMLView::viewportMouseReleaseEvent): Only send a click even if the node is the same one from
1760 the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
1761 old click node for a long time.
1762 (KHTMLView::keyPressEvent): Remove code that sets the originalNode field, which is never used.
1764 2004-10-04 Ken Kocienda <kocienda@apple.com>
1770 <rdar://problem/3825289> REGRESSION (Mail): Crash in fontForSelection in empty window
1772 * khtml/editing/visible_position.cpp:
1773 (khtml::VisiblePosition::previousPosition): Switch to node iteration instead "leaf"
1774 iteration. I have been wanting to make this change for a long time, but couldn't
1775 since other code relied on the leaf behavior. That is no longer true. Plus, the
1776 bug fix requires the new behavior.
1777 (khtml::VisiblePosition::nextPosition): Ditto.
1778 (khtml::VisiblePosition::isCandidate): Empty blocks needed a height to be a candidate,
1779 but we make a special case for the body element. This fixes the bug.
1781 2004-10-04 Darin Adler <darin@apple.com>
1785 - fixed <rdar://problem/3800667> REGRESSION (Mail): double-clicking multiple spaces only selects two spaces
1787 * kwq/KWQTextUtilities.mm: (KWQFindWordBoundary): Moved here from the .cpp file. Changed to use the
1788 doubleClickAtIndex: method from NSAttributedString rather than using Unicode Utilities.
1789 * kwq/KWQTextUtilities.cpp: Removed.
1790 * WebCore.pbproj/project.pbxproj: Removed KWQTextUtilities.cpp.
1792 - fixed a problem that would show up using HTML editing under garbage collection
1794 * kwq/KWQEditCommand.mm: (-[KWQEditCommand finalize]): Fixed a [super dealloc] that should have been a
1797 - another small change
1799 * khtml/editing/visible_units.cpp: (khtml::nextWordBoundary): Tweaked a comment.
1801 2004-10-01 Darin Adler <darin@apple.com>
1803 Reviewed by Ken (or arguably done by Ken, reviewed by Darin).
1805 - fixed <rdar://problem/3823828> REGRESSION (Mail): Clicking past end of any line puts insertion point at beginning of next line
1807 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::VisiblePosition):
1808 Check for an offset of 0 and a <br> and use UPSTREAM affinity in that case.
1809 This is a short term fix for something that needs a better longer-term fix.
1811 - fixed <rdar://problem/3823816> REGRESSION (Mail): double-clicking first word on line also selects previous empty line
1813 * khtml/editing/visible_units.cpp: (khtml::previousWordBoundary): Added a special
1814 case for <br>. While I'm not sure why this regressed, I'm sure this fix is good.
1816 2004-10-01 Darin Adler <darin@apple.com>
1820 - fixed <rdar://problem/3782117> CrashTracer: ..722 crashes at com.apple.WebCore: DOM::HTMLBodyElementImpl::insertedIntoDocument + 0x2c (AOL website)
1822 * khtml/html/html_baseimpl.cpp:
1823 (HTMLBodyElementImpl::insertedIntoDocument): Check for nil document case.
1824 (HTMLFrameElementImpl::isURLAllowed): Ditto.
1825 (HTMLFrameElementImpl::openURL): Ditto.
1827 2004-10-01 Darin Adler <darin@apple.com>
1831 - fixed <rdar://problem/3822218> REGRESSION (164-165): images don't update on rollover on directv.com page
1833 I introduced a major regression where various JavaScript window properties would not be found when I
1836 * khtml/ecma/kjs_window.h: Added hasProperty.
1837 * khtml/ecma/kjs_window.cpp: (Window::hasProperty): Return true in all the cases where get returns something.
1839 2004-09-30 Darin Adler <darin@apple.com>
1843 - fixed <rdar://problem/3461499> JavaScript function document.open() is buggy with 2nd argument "replace"
1845 Experiments with Firefox indicate that document.open() should not be treated as window.open() unless there
1846 are more than two parameters. Also, Firefox does not implement the "replace" behavior, so we don't have
1847 to worry about it either.
1849 * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): Only forward to window if there are more than
1850 two parameters, rather than if there are more than one.
1852 - fixed <rdar://problem/3672933> oninput is firing at page load time for <input type=range>
1854 * kwq/KWQSlider.mm: (QSlider::setValue): Don't emit a signal here. This follows the usual pattern, where
1855 a signal is only emitted for changes that are not explicitly requested by the caller.
1857 - fixed <rdar://problem/3821167> leaks of something allocated by recalcStyle after loading altavista page from cvs-base
1859 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Ref and deref the style we allocate so it's
1860 not left floating if setStyle decides not to ref it.
1862 - fixed <rdar://problem/3821172> leak of HTML attribute string after loading the ESPN page from cvs-base
1864 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Use the DOMString version of
1865 the lower() operation so we don't end up leaving a DOMStringImpl * floating if AtomicString decides not
1868 2004-09-30 Richard Williamson <rjw@apple.com>
1870 Fixed <rdar://problem/3822330> REGRESSION: crash on launch when homepage is set to about:blank
1874 * kwq/KWQKHTMLPart.mm:
1875 (KWQKHTMLPart::setDisplaysWithFocusAttributes):
1877 2004-09-30 Chris Blumenberg <cblu@apple.com>
1879 Fixed: <rdar://problem/3792822> Safari is calling the Cocoa QuickTime plugin twice for the OBJECT and EMBED tags
1883 * khtml/html/html_objectimpl.cpp:
1884 (HTMLObjectElementImpl::attach): call dispatchHTMLEvent after updateWidget instead of every time this method is called
1885 (HTMLObjectElementImpl::recalcStyle): ditto
1887 2004-09-30 Darin Adler <darin@apple.com>
1889 - rolled out bad image change that caused performance regression
1891 * khtml/rendering/render_image.cpp: (RenderImage::setPixmap):
1892 Don't reference the new image before doing the assignment.
1893 This forced an unwanted.
1895 2004-09-30 Ken Kocienda <kocienda@apple.com>
1897 Reviewed by me, coded by Darin
1899 - fixed <rdar://problem/3818305> REGRESSION (Mail): Shift + page up has no effect; should modify selection
1901 * khtml/editing/selection.cpp: (khtml::Selection::modify): Fix problem where vertical distance
1902 was used as a distance threshold, but was a negative number. Now make it positive at the start
1903 of the function (and make a couple related changes).
1905 2004-09-29 Richard Williamson <rjw@apple.com>
1907 Fixed <rdar://problem/3779998> bringing window to front or sending to back does not send focus/blur events to JavaScript window object
1909 The fix has two parts, 1) make onblur and onfocus work for windows,
1910 and 2), allow the dashboard to override WebKit's special key/non-key
1915 * kwq/KWQKHTMLPart.mm:
1916 (KWQKHTMLPart::setDisplaysWithFocusAttributes):
1918 2004-09-29 Ken Kocienda <kocienda@apple.com>
1924 <rdar://problem/3705894> REGRESSION (Mail): if a single word is wider than the window,
1925 it doesn't break and just runs off the right side
1927 * khtml/css/css_computedstyle.cpp:
1928 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support for CSS_PROP_WORD_WRAP.
1929 * khtml/css/cssparser.cpp:
1930 (CSSParser::parseValue): Ditto.
1931 * khtml/css/cssproperties.c: Generated file.
1932 * khtml/css/cssproperties.h: Ditto.
1933 * khtml/css/cssproperties.in: Add word-wrap property.
1934 * khtml/css/cssstyleselector.cpp:
1935 (khtml::CSSStyleSelector::applyProperty): Add support for CSS_PROP_WORD_WRAP.
1936 * khtml/css/cssvalues.c: Generated file.
1937 * khtml/css/cssvalues.h: Ditto.
1938 * khtml/css/cssvalues.in: Add break-word value.
1939 * khtml/rendering/bidi.cpp:
1940 (khtml::RenderBlock::findNextLineBreak): Add code to implement new word wrapping feature.
1941 * khtml/rendering/render_style.cpp:
1942 (StyleCSS3InheritedData): Add support for new wordWrap property.
1943 (StyleCSS3InheritedData::operator==): Ditto.
1944 (RenderStyle::diff): Ditto.
1945 * khtml/rendering/render_style.h:
1946 (khtml::RenderStyle::wordWrap): Ditto.
1947 (khtml::RenderStyle::setWordWrap): Ditto.
1948 (khtml::RenderStyle::initialWordWrap): Ditto.
1950 2004-09-29 Maciej Stachowiak <mjs@apple.com>
1954 - consolidated OS version checks into prefix header
1957 * khtml/rendering/render_canvasimage.cpp:
1958 * kwq/KWQAccObject.mm:
1959 (-[KWQAccObject roleDescription]):
1960 (-[KWQAccObject accessibilityActionDescription:]):
1961 * kwq/KWQComboBox.mm:
1962 (QComboBox::QComboBox):
1963 * kwq/KWQFoundationExtras.h:
1965 2004-09-29 David Hyatt <hyatt@apple.com>
1967 Make sure <br>s always get line boxes. Also prevent the creation of RenderTexts for whitespace normal/nowrap nodes
1970 Reviewed by kocienda
1972 * khtml/editing/visible_position.cpp:
1973 (khtml::VisiblePosition::isCandidate):
1974 * khtml/rendering/render_br.cpp:
1975 (RenderBR::RenderBR):
1976 (RenderBR::createInlineBox):
1977 (RenderBR::baselinePosition):
1978 (RenderBR::lineHeight):
1979 * khtml/rendering/render_br.h:
1980 * khtml/rendering/render_line.cpp:
1981 (khtml::InlineFlowBox::placeBoxesVertically):
1982 * khtml/rendering/render_line.h:
1983 (khtml::InlineBox::isText):
1984 (khtml::InlineFlowBox::addToLine):
1985 * khtml/rendering/render_text.cpp:
1986 (RenderText::detach):
1987 * khtml/rendering/render_text.h:
1988 (khtml::InlineTextBox:::InlineRunBox):
1989 (khtml::InlineTextBox::isInlineTextBox):
1990 (khtml::InlineTextBox::isText):
1991 (khtml::InlineTextBox::setIsText):
1992 * khtml/xml/dom_textimpl.cpp:
1993 (TextImpl::rendererIsNeeded):
1994 * kwq/KWQRenderTreeDebug.cpp:
1997 2004-09-29 Ken Kocienda <kocienda@apple.com>
2003 <rdar://problem/3815895> exception inside fontForSelection causes Mail to abort when selection hits bottom
2005 * khtml/editing/selection.cpp:
2006 (khtml::Selection::toRange): Use RangeImpl calls to detect exceptions when creating a Range
2007 from a Selection. Return an empty Range when there is an exception.
2011 <rdar://problem/3817268> REGRESSION (Mail): Window does not scroll when selecting out of
2012 visible area of view with arrow keys
2014 * khtml/editing/selection.cpp: Did some name changing. m_needsCaretLayout -> m_needsLayout.
2015 Added m_expectedVisibleRect which supplies the right rectangle to update when scrolling.
2016 (khtml::Selection::Selection): m_needsCaretLayout -> m_needsLayout name change.
2017 (khtml::Selection::init): Handle m_expectedVisibleRect in initialization.
2018 (khtml::Selection::operator=): Handle m_expectedVisibleRect in assignment.
2019 (khtml::Selection::setNeedsLayout): m_needsCaretLayout -> m_needsLayout name change.
2020 (khtml::Selection::layout): Changed name from layoutCaret, since m_expectedVisibleRect
2021 is also calculated here.
2022 (khtml::Selection::caretRect): m_needsCaretLayout -> m_needsLayout name change.
2023 (khtml::Selection::expectedVisibleRect): New. Returns m_expectedVisibleRect, doing a
2025 (khtml::Selection::needsCaretRepaint): m_needsCaretLayout -> m_needsLayout name change.
2026 (khtml::Selection::paintCaret): Ditto.
2027 (khtml::Selection::validate): Ditto.
2028 * khtml/editing/selection.h: Add m_expectedVisibleRect member variable and
2029 expectedVisibleRect accessor.
2030 * kwq/WebCoreBridge.h: Change name of ensureCaretVisible to ensureSelectionVisible, since
2031 this is not only about making the caret visible anymore. Now it can reveal the varying
2032 end of the selection when scrolling with arrow keys.
2033 * kwq/WebCoreBridge.mm:
2034 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): ensureCaretVisible to
2035 ensureSelectionVisible name change.
2036 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto
2037 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Ditto
2038 (-[WebCoreBridge insertNewline]): Ditto
2039 (-[WebCoreBridge insertText:selectInsertedText:]): Ditto
2040 (-[WebCoreBridge deleteKeyPressed]): Ditto
2041 (-[WebCoreBridge ensureSelectionVisible]): Ditto
2043 2004-09-29 Ken Kocienda <kocienda@apple.com>
2049 <rdar://problem/3818296> REGRESSION (Mail): centerSelectionInVisibleArea does not work correctly
2051 * kwq/KWQKHTMLPart.h:
2052 * kwq/KWQKHTMLPart.mm:
2053 (KWQKHTMLPart::centerSelectionInVisibleArea): New function. Handles both caret
2054 and range selections correctly.
2055 * kwq/KWQNSViewExtras.h: Add forceCentering boolean to some methods in this file.
2056 * kwq/KWQNSViewExtras.m: Ditto. This addition has been done since the AppKit
2057 method we use to do the centering, -[NSView scrollRectToVisible:], does not alter
2058 the view if the rectangle passed to it is already in view. When forceCentering is
2059 true, extra math is done to make scrollRectToVisible center the rectangle we want.
2060 (-[NSView _KWQ_scrollFrameToVisible]): Pass NO for forceCentering in call through to
2061 _KWQ_scrollRectToVisible:forceCentering:
2062 (-[NSView _KWQ_scrollRectToVisible:forceCentering:]): Add forceCentering argument.
2063 (-[NSView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto.
2064 (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto. Do extra
2065 math to implement the forceCentering effect.
2066 * kwq/KWQScrollView.h: Add forceCentering default argument to ensureRectVisibleCentered.
2067 * kwq/KWQScrollView.mm:
2068 (QScrollView::ensureRectVisibleCentered): Ditto.
2069 * kwq/WebCoreBridge.h:
2070 * kwq/WebCoreBridge.mm:
2071 (-[WebCoreBridge centerSelectionInVisibleArea]): New function. Call through to KWQKHTMLPart.
2073 2004-09-28 Chris Blumenberg <cblu@apple.com>
2075 Fixed: WebArchives begin with "<#document/>"
2079 * khtml/xml/dom_nodeimpl.cpp:
2080 (NodeImpl::startMarkup): don't return markup if this is a document node, forgot this when factoring this method out from toHTML
2082 2004-09-28 Chris Blumenberg <cblu@apple.com>
2084 Removed range parameter from recursive_toHTML and friends since that code path is no longer used.
2088 * khtml/xml/dom2_rangeimpl.cpp:
2089 (DOM::RangeImpl::toHTML):
2090 * khtml/xml/dom_nodeimpl.cpp:
2091 (NodeImpl::recursive_toString):
2092 (NodeImpl::recursive_toHTML):
2093 * khtml/xml/dom_nodeimpl.h:
2094 * kwq/WebCoreBridge.mm:
2095 (-[WebCoreBridge markupStringFromNode:nodes:]):
2097 2004-09-28 Darin Adler <darin@apple.com>
2101 - improve spell checking so it doesn't unmark and remark as you move the cursor with the arrow
2103 * khtml/editing/htmlediting.h: Remove obsolete markMisspellingsInSelection private function.
2104 * khtml/editing/htmlediting.cpp:
2105 (khtml::EditCommand::EditCommand): Blow away the selection when starting an edit command.
2106 (khtml::EditCommand::apply): Remove code to mark misspellings because that's now done as part
2107 of blowing away the selection.
2108 (khtml::EditCommand::unapply): Blow away the selection instead of marking mispellings.
2109 (khtml::EditCommand::reapply): Ditto.
2110 (khtml::ReplaceSelectionCommand::doApply): Removed incorrect code that does spell checking
2111 on inserted text; this doesn't match NSText behavior.
2112 (khtml::TypingCommand::markMisspellingsAfterTyping): Use markMisspellingsInAdjacentWords
2113 function for greater clarity on what this actually does.
2115 * khtml/khtml_part.h: Replaced setSelection's "unmarkOldSelection" boolean parameter with a
2116 "keepTypingStyle" boolean parameter. Removed notifySelectionChanged.
2117 * khtml/khtml_part.cpp:
2118 (KHTMLPart::setSelection): Replaced the "unmarkOldSelection" boolean with a new "keepTypingStyle"
2119 boolean. This is a step on the way to simplifying how this works. Moved the code from the
2120 notifySelectionChanged function here, since there was no clear line between the two functions.
2121 (KHTMLPart::clearSelection): Call setSelection rather that having special case code here for
2122 the case of an empty selection.
2123 (KHTMLPart::appliedEditing): Remove the explicit "false" for "unmarkOldSelection".
2124 (KHTMLPart::unappliedEditing): Ditto.
2125 (KHTMLPart::reappliedEditing): Ditto.
2127 * kwq/KWQKHTMLPart.h: Replaced markMisspellingsInSelection and updateSpellChecking with
2128 markMisspellings and markMisspellingsInAdjacentWords. Added parameters to respondToChangedSelection.
2129 * kwq/KWQKHTMLPart.mm:
2130 (KWQKHTMLPart::markMisspellingsInAdjacentWords): Added.
2131 (KWQKHTMLPart::markMisspellings): New name for markMisspellingsInSelection. Simplified logic a
2132 bit and made it the caller's responsibility to expand the selection passed in to word boundaries.
2133 (KWQKHTMLPart::respondToChangedSelection): Added parameter that identifies the old selection,
2134 and changed logic so it won't mark mispellings in a word if the selection still starts in that word.
2136 - implemented empty-cells property in computed style
2138 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2139 Added code for CSS_PROP_EMPTY_CELLS. I think the HTML converter in AppKit uses this.
2141 2004-09-28 Chris Blumenberg <cblu@apple.com>
2143 Fixed n-squared issues with appending to KWQValueListImpl. This fixes the hang in 3794799.
2145 Fixed by Darin, reviewed by me.
2147 * khtml/xml/dom2_rangeimpl.cpp:
2148 (DOM::RangeImpl::toHTML): tweaks
2149 * kwq/KWQValueListImpl.mm:
2150 (KWQValueListImpl::KWQValueListPrivate::KWQValueListPrivate):
2151 (KWQValueListImpl::KWQValueListPrivate::copyList):
2152 (KWQValueListImpl::clear):
2153 (KWQValueListImpl::appendNode):
2154 (KWQValueListImpl::prependNode):
2155 (KWQValueListImpl::removeEqualNodes):
2156 (KWQValueListImpl::containsEqualNodes):
2157 (KWQValueListImpl::removeIterator):
2158 (KWQValueListImpl::lastNode):
2159 * kwq/WebCoreBridge.mm:
2160 (-[WebCoreBridge nodesFromList:]): use iterator, not at()
2162 2004-09-28 Richard Williamson <rjw@apple.com>
2164 More dashboard region changes for John.
2166 <rdar://problem/3817421> add getter for dashboard regions (debugging)
2168 <rdar://problem/3817417> NSScrollView need autoregions for dashboard
2170 <rdar://problem/3817388> should have short form form control regions
2172 <rdar://problem/3817477> visibility does not work with dashboard control regions
2176 * WebCore-combined.exp:
2178 * khtml/css/cssparser.cpp:
2179 (skipCommaInDashboardRegion):
2180 (CSSParser::parseDashboardRegions):
2181 * khtml/khtmlview.cpp:
2182 (KHTMLView::updateDashboardRegions):
2183 * khtml/rendering/render_object.cpp:
2184 (RenderObject::setStyle):
2185 (RenderObject::addDashboardRegions):
2186 * khtml/xml/dom_docimpl.cpp:
2187 (DocumentImpl::DocumentImpl):
2188 (DocumentImpl::setDashboardRegions):
2189 * khtml/xml/dom_docimpl.h:
2190 (DOM::DocumentImpl::setDashboardRegionsDirty):
2191 (DOM::DocumentImpl::dashboardRegionsDirty):
2192 * kwq/KWQKHTMLPart.h:
2193 * kwq/KWQKHTMLPart.mm:
2194 (KWQKHTMLPart::paint):
2195 (KWQKHTMLPart::dashboardRegionsDictionary):
2196 (KWQKHTMLPart::dashboardRegionsChanged):
2197 * kwq/WebCoreBridge.h:
2198 * kwq/WebCoreBridge.mm:
2199 (-[WebCoreBridge dashboardRegions]):
2200 * kwq/WebDashboardRegion.h:
2201 * kwq/WebDashboardRegion.m:
2202 (-[WebDashboardRegion description]):
2204 2004-09-28 John Sullivan <sullivan@apple.com>
2208 - fixed <rdar://problem/3818558> REGRESSION: "Installed Plug-ins" is blank
2209 because of <script type="application/x-javascript">
2211 * khtml/html/htmltokenizer.cpp:
2212 (khtml::HTMLTokenizer::parseTag):
2213 add "application/x-javascript" to the list of legal scripting types. Mozilla
2214 accepts this, but WinIE doesn't.
2216 * layout-tests/fast/tokenizer/004.html:
2217 updated layout test to test some application/xxxx types
2219 2004-09-27 David Hyatt <hyatt@apple.com>
2221 Reworked lists to work well with RTL text. Specifically the following bugs have been fixed:
2223 (1) All bullets use the same offset constant now (a padding of 7 pixels). Before, images used 5 and others used 7.
2224 (2) Line height now works properly, so that list items with no content aren't squished (and missing the line descent).
2225 (3) Punctuation now works correctly with inside and outside style ordered lists in RTL.
2226 (4) RTL lists now properly apply padding and margin to the right side rather than the left. This was done by adding
2227 -khtml-margin-start and -khtml-padding-start properties that are just mapped to left/right based off the direction.
2231 * khtml/css/cssparser.cpp:
2232 (CSSParser::parseValue):
2233 * khtml/css/cssproperties.c:
2236 * khtml/css/cssproperties.h:
2237 * khtml/css/cssproperties.in:
2238 * khtml/css/cssstyleselector.cpp:
2239 (khtml::CSSStyleSelector::applyDeclarations):
2240 (khtml::CSSStyleSelector::applyProperty):
2241 * khtml/css/html4.css:
2242 * khtml/rendering/bidi.cpp:
2243 (khtml::BidiIterator::direction):
2244 * khtml/rendering/render_list.cpp:
2245 (RenderListItem::getAbsoluteRepaintRect):
2246 (RenderListMarker::paint):
2247 (RenderListMarker::calcMinMaxWidth):
2248 (RenderListMarker::lineHeight):
2249 (RenderListMarker::baselinePosition):
2251 2004-09-28 Ken Kocienda <kocienda@apple.com>
2255 Mark the VisiblePosition taking (Position &, EAffinity=DOWNSTREAM) explicit. Recently, when I added
2256 the EAffinity argument, I left this constructor implicit. Darin pointed out to me that this is
2257 undesirable since implicit use of the the constructor involved making the affinity choice, something
2258 which should be done explicitly.
2260 * khtml/editing/selection.cpp:
2261 (khtml::Selection::modifyExtendingRightForward): Make explicit use of constructor mentioned above.
2262 (khtml::Selection::modifyMovingRightForward): Ditto.
2263 (khtml::Selection::modifyExtendingLeftBackward): Ditto.
2264 (khtml::Selection::modifyMovingLeftBackward): Ditto.
2265 (khtml::Selection::modify): Ditto.
2266 (khtml::Selection::validate): Ditto.
2267 * khtml/editing/visible_position.h: Make constructor taking (Position &, EAffinity) explicit.
2268 * khtml/editing/visible_units.cpp: Ditto.
2269 (khtml::previousWordBoundary): Make explicit use of constructor mentioned above.
2270 (khtml::nextWordBoundary): Ditto.
2271 (khtml::previousLinePosition): Ditto.
2272 (khtml::nextLinePosition): Ditto.
2273 * kwq/KWQKHTMLPart.mm: Ditto.
2274 (KWQKHTMLPart::findString): Ditto.
2275 (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
2276 (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
2277 (KWQKHTMLPart::updateSpellChecking): Ditto.
2279 2004-09-28 Darin Adler <darin@apple.com>
2283 - fixed a storage leak discovered by code inspection
2285 * khtml/html/htmlparser.cpp: (KHTMLParser::~KHTMLParser): Call setCurrent(0) to deref
2286 the parser's current node in the rare case where it still has one.
2288 2004-09-27 David Hyatt <hyatt@apple.com>
2290 Don't allow nested headers when only inlines are in between them. Fixes a hang related to pathological nesting
2291 on magicmethodsonline.com.
2295 * khtml/html/htmlparser.cpp:
2296 (KHTMLParser::parseToken):
2297 (KHTMLParser::processCloseTag):
2298 (KHTMLParser::isHeaderTag):
2299 (KHTMLParser::popNestedHeaderTag):
2300 * khtml/html/htmlparser.h:
2302 2004-09-27 Kevin Decker <kdecker@apple.com>
2306 * khtml/css/css_base.cpp:
2307 (CSSSelector::selectorText): changed another ATTR_CLASS case to properly return class selector names.
2309 2004-09-27 David Hyatt <hyatt@apple.com>
2311 Fix style sharing so that it doesn't share when it shouldn't. Partially fixes 3671516, table cells don't update
2312 their color on macosx.apple.com.
2314 Fix 3521639, iframe mispositioned on bidi page. Make sure that when the width of a line exceeds the available line
2315 width that the spillage out of the block is determined by the direction of the block and not by the text-align value.
2317 Partial fix for 3762962, make sure the image cells with specified widths but percentage heights don't just get a minwidth
2320 Fix for 3533878, framesets that use percentages that add up to a value > 100% should normalize those percentages.
2324 * khtml/css/cssstyleselector.cpp:
2325 (khtml::CSSStyleSelector::locateCousinList):
2326 (khtml::CSSStyleSelector::elementsCanShareStyle):
2327 (khtml::CSSStyleSelector::locateSharedStyle):
2328 * khtml/css/cssstyleselector.h:
2329 * khtml/html/html_elementimpl.h:
2330 (DOM::HTMLNamedAttrMapImpl::hasMappedAttributes):
2331 (DOM::HTMLElementImpl::inlineStyleDecl):
2332 * khtml/rendering/bidi.cpp:
2333 (khtml::RenderBlock::computeHorizontalPositionsForLine):
2334 * khtml/rendering/render_frames.cpp:
2335 (RenderFrameSet::layout):
2336 * khtml/rendering/render_replaced.cpp:
2337 (RenderReplaced::calcMinMaxWidth):
2338 * khtml/xml/dom_elementimpl.h:
2339 (DOM::ElementImpl::inlineStyleDecl):
2340 (DOM::ElementImpl::hasMappedAttributes):
2342 2004-09-27 Ken Kocienda <kocienda@apple.com>
2346 Removed closestRenderedPosition function from Position class and gave this work
2347 to VisiblePosition instead. However, in order to make the transfer possible,
2348 VisiblePosition needed upstream and downstream affinities added to its
2349 constructors. Also moved the EAffinity enum into its own file. Also moved it
2350 to the khtml namespace.
2352 Updated several functions which used closestRenderedPosition to use VisiblePosition
2355 Also deleted Position::equivalentShallowPosition. This was unused.
2357 * ForwardingHeaders/editing/text_affinity.h: Added.
2358 * ForwardingHeaders/editing/visible_position.h: Added.
2359 * WebCore.pbproj/project.pbxproj: Added new files.
2360 * khtml/editing/selection.cpp:
2361 (khtml::Selection::validate): Use VisiblePosition instead of closestRenderedPosition.
2362 * khtml/editing/selection.h:
2363 * khtml/editing/text_affinity.h: Added.
2364 * khtml/editing/visible_position.cpp:
2365 (khtml::VisiblePosition::VisiblePosition):
2366 (khtml::VisiblePosition::initUpstream): New helper for finding upstream visible position.
2367 (khtml::VisiblePosition::initDownstream): Was old init function that unconditionally did
2368 downstream checks for visible position. Renamed to describe this more clearly.
2369 * khtml/editing/visible_position.h:
2370 * khtml/editing/visible_units.cpp:
2371 (khtml::previousWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
2372 (khtml::nextWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
2373 * khtml/xml/dom_docimpl.cpp:
2374 (DocumentImpl::updateSelection): Use VisiblePosition instead of closestRenderedPosition.
2375 * khtml/xml/dom_position.cpp:
2376 (DOM::Position::closestRenderedPosition): Removed.
2377 * khtml/xml/dom_position.h: Removed two functions mentioned above.
2378 * kwq/KWQKHTMLPart.mm:
2379 (KWQKHTMLPart::fontForSelection) Use VisiblePosition instead of closestRenderedPosition.:
2380 * kwq/WebCoreBridge.mm:
2381 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Use VisiblePosition instead of closestRenderedPosition.
2382 * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Updated expected results.
2383 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Ditto.
2384 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
2385 * layout-tests/editing/selection/move-by-character-004-expected.txt: Ditto.
2387 2004-09-27 Ken Kocienda <kocienda@apple.com>
2389 Reviewed by Darin and Maciej
2391 Removed EditCommand smart pointer wrappers from htmlediting.cpp/.h, save for the one
2392 at the root of the hierarchy, and this one has been renamed EditCommandPtr. Renamed
2393 each of the XXXCommandImpl classes, removing the Impl suffix from each, and rolled
2394 these into the htmlediting.cpp/.h files. The htmlediting_impl.cpp/.h files have
2395 been emptied and are being removed.
2397 For the remainder of files, perform the mechanical changes necessary to make everything
2398 compile and run as before.
2400 * WebCore.pbproj/project.pbxproj
2401 * khtml/editing/htmlediting.cpp
2402 * khtml/editing/htmlediting.h
2403 * khtml/editing/htmlediting_impl.cpp: Removed.
2404 * khtml/editing/htmlediting_impl.h: Removed.
2405 * khtml/editing/jsediting.cpp
2406 * khtml/khtml_part.cpp
2407 (KHTMLPart::openURL)
2408 (KHTMLPart::lastEditCommand)
2409 (KHTMLPart::appliedEditing)
2410 (KHTMLPart::unappliedEditing)
2411 (KHTMLPart::reappliedEditing)
2412 (KHTMLPart::applyStyle):
2413 * khtml/khtml_part.h
2414 * khtml/khtmlpart_p.h
2415 * kwq/KWQEditCommand.h
2416 * kwq/KWQEditCommand.mm
2417 (-[KWQEditCommand initWithEditCommandImpl:])
2418 (+[KWQEditCommand commandWithEditCommandImpl:])
2419 (-[KWQEditCommand impl])
2420 * kwq/KWQKHTMLPart.h
2421 * kwq/KWQKHTMLPart.mm
2422 (KWQKHTMLPart::registerCommandForUndo)
2423 (KWQKHTMLPart::registerCommandForRedo)
2424 * kwq/WebCoreBridge.mm
2425 (-[WebCoreBridge undoEditing:])
2426 (-[WebCoreBridge redoEditing:])
2427 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
2428 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:])
2429 (-[WebCoreBridge deleteSelectionWithSmartDelete:])
2431 2004-09-26 Darin Adler <darin@apple.com>
2435 - fixed <rdar://problem/3816170> image.width/height not available from Image objects (works in Firefox)
2437 * khtml/ecma/kjs_html.h: Added width and height.
2438 * khtml/ecma/kjs_html.cpp: (Image::getValueProperty): Added width and height.
2439 * khtml/ecma/kjs_html.lut.h: Regenerated.
2441 - unrelated change; changed ordering of use count manipulation just in case we decide some day to do
2442 something when the use count hits 0
2444 * khtml/rendering/render_image.cpp: (RenderImage::setPixmap): Increment use count on new object before
2445 decrementing use count on old object.
2447 2004-09-26 Darin Adler <darin@apple.com>
2451 - fixed <rdar://problem/3812771> document.implementation.hasFeature returns false for a lot of features we implement
2453 * khtml/xml/dom_docimpl.cpp: (DOMImplementationImpl::hasFeature): Added all the DOM features that we implemented
2454 as part of the HTML editing work.
2456 * khtml/dom/dom_node.cpp: (Node::isSupported): Changed this to call DOMImplementationImpl::hasFeature to share
2457 code. Later this might need to be different per-node, but at the moment that does not seem to be so.
2459 * khtml/ecma/kjs_dom.cpp:
2460 (DOMNodeProtoFunc::tryCall): Pass a null string if the parameter is omitted, undefined, or null. This is better than
2461 having a special case for the string "null" in the DOM implementation.
2462 (DOMDOMImplementationProtoFunc::tryCall): Ditto.
2464 - fixed <rdar://problem/3814605> REGRESSION: fast/table/039 layout test is failing due to extra trailing whitespace in innerText
2466 * khtml/editing/visible_text.cpp: (khtml::TextIterator::advance): Check for the case where we are at the end of
2467 iteration, and don't call exitNode in that case. This prevents us from getting some unwanted trailing \n characters.
2469 - fixed <rdar://problem/3813253> method cloneNode() does not clone dynamically-set style attributes correctly
2471 * khtml/html/html_elementimpl.h: Added cloneNode override.
2472 * khtml/html/html_elementimpl.cpp:
2473 (HTMLElementImpl::cloneNode): Added. Copies m_inlineStyleDecl.
2474 (HTMLElementImpl::parseHTMLAttribute): Changed to use getInlineStyleDecl().
2475 (HTMLElementImpl::innerText): Changed to do the same thing with fewer lines of code.
2476 (HTMLElementImpl::outerText): Tweaked comment.
2480 * khtml/xml/dom_elementimpl.cpp:
2481 (ElementImpl::cloneNode): Removed an uneeded type cast.
2482 (XMLElementImpl::cloneNode): Ditto.
2484 2004-09-24 Kevin Decker <kdecker@apple.com>
2488 <rdar://problem/3799334> DIG: Safari does not properly return style names [DigCSS.htm]
2490 * khtml/css/css_base.cpp:
2491 (CSSSelector::selectorText): Properly returns Class Selector names.
2492 Before we would get *[CLASS"foo"] instead of .foo
2494 2004-09-24 Ken Kocienda <kocienda@apple.com>
2500 <rdar://problem/3814660> REGRESSION (8A200-8A259): Select All has no effect on livepage.apple.com
2502 * khtml/xml/dom_docimpl.cpp:
2503 (DocumentImpl::updateSelection): Move the selection start and end to rendered positions
2504 before passing off to the RenderCanvas for drawing.
2505 * layout-tests/editing/selection/select-all-004-expected.txt: Added.
2506 * layout-tests/editing/selection/select-all-004.html: Added.
2508 2004-09-24 John Sullivan <sullivan@apple.com>
2512 - fixed <rdar://problem/3528339> Turn on full keyboard access shows
2513 invisible <input> elements
2515 * khtml/html/html_formimpl.cpp:
2516 (DOM::HTMLGenericFormElementImpl::isFocusable):
2517 reject elements that have zero width or height, even if they aren't hidden
2519 2004-09-24 Maciej Stachowiak <mjs@apple.com>
2521 - fixed deployment build
2525 * khtml/dom/dom_string.cpp: put implementation of ascii() in #ifdef !NDEBUG
2528 2004-09-24 David Hyatt <hyatt@apple.com>
2530 Fix for 3800316, test 37 for tables is failing on the layout tests. Make sure we don't incorrectly match
2531 non-HTML elements with HTML tag selectors in CSS.
2535 * khtml/css/cssstyleselector.cpp:
2536 (khtml::CSSStyleSelector::checkOneSelector):
2538 2004-09-23 David Hyatt <hyatt@apple.com>
2540 Fix for 3601920, CSS "tabs" not switching properly on zen garden design. Improve the repainting to account
2541 for layer changes of z-index that necessitate an invalidation.
2543 Reviewed by kocienda
2545 * khtml/rendering/render_object.cpp:
2546 (RenderObject::setStyle):
2547 * khtml/rendering/render_style.cpp:
2548 (RenderStyle::diff):
2549 * khtml/rendering/render_style.h:
2550 (khtml::RenderStyle::):
2552 2004-09-24 Chris Blumenberg <cblu@apple.com>
2554 Made markup copying 5 times faster. Unfortunately, this still doesn't fix:
2555 <rdar://problem/3794799> Tiger8A252: copying a bunch o' text is so slow it seems like a hang
2559 * khtml/dom/dom_string.h:
2560 * khtml/xml/dom2_rangeimpl.cpp:
2561 (DOM::RangeImpl::toHTML): serialize the range by iterating through the range
2562 * khtml/xml/dom_nodeimpl.cpp:
2563 (NodeImpl::startMarkup): new, factored out from recursive_toString
2564 (NodeImpl::endMarkup): ditto
2565 (NodeImpl::recursive_toString): call factored out methods
2566 * khtml/xml/dom_nodeimpl.h:
2570 2004-09-24 Ken Kocienda <kocienda@apple.com>
2572 Hyatt made an improvement in the render tree which caused the results
2573 to get a little thinner.
2575 * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt
2576 * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt
2578 2004-09-24 Ken Kocienda <kocienda@apple.com>
2584 <rdar://problem/3812939> REGRESSION: move-between-blocks-no-001 editing layout test fails in DeleteSelectionCommandImpl
2586 * khtml/rendering/render_block.cpp:
2587 (khtml::RenderBlock::removeChild): Hyatt said this regression was caused by a bad merge.
2588 Found by code inspection.
2590 2004-09-23 John Sullivan <sullivan@apple.com>
2594 - fixed <rdar://problem/3551850> hang caused by interpreting bad javascript
2595 guarded by a deliberately bogus "language" attribute (www.riibe.com)
2597 * khtml/html/htmltokenizer.cpp:
2598 (khtml::HTMLTokenizer::parseTag):
2599 Check for language attribute of <script> tag in a way that matches WinIE.
2600 Previously we were far too permissive.
2602 2004-09-23 David Hyatt <hyatt@apple.com>
2604 Fix for 3685234 and 3548444, the x-offset for frame borders was off by 1 pixel, causing mojibake to occur when
2605 repainting happened.
2607 * khtml/rendering/render_canvas.cpp:
2608 (RenderCanvas::repaintViewRectangle):
2610 2004-09-23 Richard Williamson <rjw@apple.com>
2612 Fixed <rdar://problem/3813271> dashboard-region-circle and dashboard-region-rectangle should be collapsed into dashboard-region
2613 Fixed <rdar://problem/3813289> dashboard regions need to correctly account for overflow/scrolling
2617 * khtml/css/css_valueimpl.cpp:
2618 (CSSPrimitiveValueImpl::cssText):
2619 * khtml/css/css_valueimpl.h:
2620 * khtml/css/cssparser.cpp:
2621 (CSSParser::parseValue):
2622 (skipCommaInDashboardRegion):
2623 (CSSParser::parseDashboardRegions):
2624 * khtml/khtmlview.cpp:
2625 (KHTMLView::layout):
2626 (KHTMLView::updateDashboardRegions):
2627 * khtml/khtmlview.h:
2628 * khtml/rendering/render_layer.cpp:
2629 (RenderLayer::scrollToOffset):
2630 * khtml/rendering/render_object.cpp:
2631 (RenderObject::addDashboardRegions):
2632 * kwq/KWQKHTMLPart.mm:
2633 (KWQKHTMLPart::dashboardRegionsChanged):
2634 * kwq/WebDashboardRegion.h:
2635 * kwq/WebDashboardRegion.m:
2636 (-[WebDashboardRegion initWithRect:clip:type:]):
2637 (-[WebDashboardRegion dashboardRegionClip]):
2638 (-[WebDashboardRegion description]):
2640 2004-09-23 Ken Kocienda <kocienda@apple.com>
2644 * khtml/xml/dom_position.cpp:
2645 (DOM::Position::inRenderedContent): Make the "empty block" check the same as the one
2646 use in visible position. This fixes a recent regression which broke up and down
2647 arrowing between blocks with an empty block in between.
2649 2004-09-23 Maciej Stachowiak <mjs@apple.com>
2653 <rdar://problem/3685235> REGRESSION (Mail): links are not properly editable
2655 * khtml/html/html_inlineimpl.cpp:
2656 (HTMLAnchorElementImpl::isFocusable): If this element is editable, then follow
2657 the normal focus rules so the link does not swallow focus when you arrow key
2658 or drag-select into it.
2660 2004-09-23 Darin Adler <darin@apple.com>
2662 - added test for the DOM::Range bug fixed recently
2664 * layout-tests/fast/dom/clone-contents-0-end-offset-expected.txt: Added.
2665 * layout-tests/fast/dom/clone-contents-0-end-offset.html: Added.
2667 2004-09-23 David Hyatt <hyatt@apple.com>
2669 Fix for hitlist bug, crash when deleting.
2671 Also fix repaint bug when inlines are inside overflow:auto/scroll regions.
2673 Reviewed by kocienda
2675 * khtml/editing/htmlediting_impl.cpp:
2676 (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
2677 (khtml::DeleteSelectionCommandImpl::doApply):
2678 * khtml/rendering/render_block.cpp:
2679 (khtml::RenderBlock::removeChild):
2680 * khtml/rendering/render_flow.cpp:
2681 (RenderFlow::getAbsoluteRepaintRect):
2683 2004-09-23 John Sullivan <sullivan@apple.com>
2687 - fixed <rdar://problem/3527840> reproducible crash at johnbrown.v32.qikker.com
2688 (nil-deref in NodeImpl::dispatchEvent)
2690 * khtml/xml/dom_nodeimpl.cpp:
2691 (NodeImpl::dispatchEvent):
2692 guard against document or document->document() being nil
2694 2004-09-23 Darin Adler <darin@apple.com>
2698 - added new VisibleRange class; not used yet
2700 * WebCore.pbproj/project.pbxproj: Added visible_range.h and visible_range.cpp.
2701 * khtml/editing/visible_range.cpp: Added.
2702 * khtml/editing/visible_range.h: Added.
2706 * kwq/WebCoreBridge.mm: (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
2707 Use switch statement instead of if statement so we get a warning if we ever add a new
2710 * khtml/editing/selection.h: khtml, not DOM, namespace
2711 * khtml/editing/visible_position.h: Ditto.
2713 2004-09-23 Darin Adler <darin@apple.com>
2717 - fixed <rdar://problem/3812758> 8S266: attaching mutation events to an editable div crashes Safari
2719 * khtml/xml/dom_nodeimpl.cpp:
2720 (NodeImpl::dispatchEvent): Added ref/deref so this works if passed a "floating" event object.
2721 (NodeImpl::dispatchGenericEvent): Ditto.
2722 (NodeImpl::dispatchHTMLEvent): Removed unneeded ref/deref now that dispatchEvent takes care of it.
2723 (NodeImpl::dispatchMouseEvent): Ditto.
2724 (NodeImpl::dispatchUIEvent): Ditto.
2726 2004-09-23 Darin Adler <darin@apple.com>
2730 - fixed some minor mistakes discovered by code inspection
2732 * khtml/khtml_part.cpp:
2733 (KHTMLPart::setSelection): Changed to not grab focus if clearing the selection.
2734 Grabbing focus when we get the selection is also probably something that should be
2735 conditional, since you can use a WebView in a mode where it can have selection even
2736 when not first responder, ala NSTextView.
2737 (KHTMLPart::setCaretVisible): Changed to not grab focus if making the caret invisible.
2738 Not sure if it's ever important to grab focus when making the caret visible, but by
2739 code inspection it seemed that was unlikely to do harm.
2741 2004-09-23 Darin Adler <darin@apple.com>
2745 - fixed <rdar://problem/3790595> "ERROR: unimplemented propertyID: 97" logged to console when copying selection (table-layout)
2747 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2748 Added CSS_PROP_TABLE_LAYOUT case.
2750 2004-09-23 Darin Adler <darin@apple.com>
2754 - fixed <rdar://problem/3809600> REGRESSION: text in search field doesn't disappear when clicked at developer.apple.com
2756 Reversing the order of scope caused us to get and set too many properties in the window
2757 object; in the case of this bug setting value ended up setting a window.value property
2758 instead of the value of the <input> element.
2760 * khtml/ecma/kjs_window.h: Removed bogus hasProperty function that always returns true.
2761 Testing shows that MacIE and Gecko match our behavior when we remove this, despite the
2762 "need this to match IE behavior" comment in the file, which I believe is incorrect.
2763 * khtml/ecma/kjs_window.cpp: Ditto.
2765 2004-09-23 Darin Adler <darin@apple.com>
2769 - fixed <rdar://problem/3812471> -[DOMRange cloneContents] clones too much in some cases where endOffset is 0
2771 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Added some nil
2772 checks to prevent this function from crashing if offsets are greater than the
2773 number of child nodes. Added a special case for offset 0 in one case that has a loop
2774 that won't work correctly for that case.
2776 2004-09-23 Darin Adler <darin@apple.com>
2780 - fixed <rdar://problem/3811890> when selecting and moving the caret, some words aren't spell-checked (test case included)
2782 This was mostly fixed by changes I made recently, but using the test case in the bug
2783 I discovered one regression I introduced and another problem that wasn't fixed yet.
2784 This change fixes both.
2786 * kwq/KWQKHTMLPart.mm:
2787 (KWQKHTMLPart::markMisspellingsInSelection): Removed unneeded inRenderedContent() check. It was returning false
2788 in cases involving a <br> at the end of line, and the check isn't all that helpful now that we use VisiblePosition,
2789 which takes care of that sort of thing for you. Changed code to determine the range to check to use the two
2790 different flavors of word boundary to expand to words we touch in both directions.
2791 (KWQKHTMLPart::updateSpellChecking): Changed to use the same logic about word boundaries. By being consistent,
2792 the anomalies reported in the bug report go away.
2794 2004-09-23 Darin Adler <darin@apple.com>
2798 - fixed <rdar://problem/3811584> REGRESSION (85-125): iframe.document undefined in function called from button onclick; works from img onclick
2800 Since we are doing a bit less "defers callbacks" work, when testing I ran into this code path.
2802 * khtml/xml/dom2_eventsimpl.cpp: (MouseEventImpl::computeLayerPos): Check for document without renderer.
2804 2004-09-23 Darin Adler <darin@apple.com>
2806 - checked in a new file I forgot
2808 * khtml/editing/text_granularity.h: Added.
2810 2004-09-22 Darin Adler <darin@apple.com>
2814 DOM::CaretPosition -> khtml::VisibleRange
2815 DOM::Selection -> khtml::Selection
2817 - moved all the functions in visible_units.h from DOM to khtml namespace
2818 - moved the one thing from Selection that KHTMLPart uses into its own header
2820 * WebCore.pbproj/project.pbxproj: Added text_granularity.h.
2822 * ForwardingHeaders/editing/selection.h: Added.
2823 * WebCore-combined.exp: Regenerated.
2824 * WebCore-tests.exp: Updated symbol for DOM::Selection debugging.
2826 * khtml/ecma/kjs_window.cpp: Update names and namespaces.
2827 * khtml/editing/htmlediting.cpp: Ditto.
2828 * khtml/editing/htmlediting.h: Ditto.
2829 * khtml/editing/htmlediting_impl.cpp: Ditto.
2830 * khtml/editing/htmlediting_impl.h: Ditto.
2831 * khtml/editing/jsediting.cpp: Ditto.
2832 * khtml/editing/selection.cpp: Ditto.
2833 * khtml/editing/selection.h: Ditto.
2834 * khtml/editing/visible_position.cpp: Ditto.
2835 * khtml/editing/visible_position.h: Ditto.
2836 * khtml/editing/visible_text.h: Ditto.
2837 * khtml/editing/visible_units.cpp: Ditto.
2838 * khtml/editing/visible_units.h: Ditto.
2839 * khtml/khtml_part.cpp: Ditto.
2840 * khtml/khtml_part.h: Ditto.
2841 * khtml/khtmlpart_p.h: Ditto.
2842 * khtml/rendering/render_block.cpp: Ditto.
2843 * khtml/xml/dom_docimpl.h: Ditto.
2844 * khtml/xml/dom_nodeimpl.cpp: Ditto.
2845 * kwq/KWQKHTMLPart.h: Ditto.
2846 * kwq/KWQKHTMLPart.mm: Ditto.
2847 * kwq/KWQRenderTreeDebug.cpp: Ditto.
2848 * kwq/WebCoreBridge.mm: Ditto.
2850 2004-09-22 Darin Adler <darin@apple.com>
2852 * ForwardingHeaders/*: Use import instead of include.
2854 2004-09-22 Darin Adler <darin@apple.com>
2856 - renamed these files:
2858 misc/khtml_text_operations.h -> editing/visible_text.h
2859 misc/khtml_text_operations.cpp -> editing/visible_text.cpp
2860 xml/dom_caretposition.cpp -> editing/visible_position.cpp
2861 xml/dom_caretposition.h -> editing/visible_position.h
2862 xml/dom_selection.cpp -> editing/selection.cpp
2863 xml/dom_selection.h -> editing/selection.h
2865 - broke out the word/line/paragraph part of visible_position.h into visible_units.h
2866 - removed some unnecessary includes from some header files to reduce the number of
2867 files that trigger "building the world"
2869 * WebCore.pbproj/project.pbxproj: Added the files under new names, removed the old ones.
2871 * ForwardingHeaders/editing/jsediting.h: Added.
2872 * ForwardingHeaders/editing/visible_text.h: Added.
2873 * ForwardingHeaders/misc/khtml_text_operations.h: Removed.
2874 * ForwardingHeaders/xml/dom_caretposition.h: Removed.
2875 * ForwardingHeaders/xml/dom_selection.h: Removed.
2877 * khtml/ecma/kjs_window.cpp: Updated or removed #include lines.
2878 * khtml/editing/htmlediting.cpp: Ditto.
2879 * khtml/editing/htmlediting.h: Ditto.
2880 * khtml/editing/htmlediting_impl.cpp: Ditto.
2881 * khtml/editing/htmlediting_impl.h: Ditto.
2882 * khtml/editing/jsediting.cpp: Ditto.
2883 * khtml/editing/selection.cpp: Ditto.
2884 * khtml/editing/selection.h: Ditto.
2885 * khtml/editing/visible_position.cpp: Ditto.
2886 * khtml/editing/visible_position.h: Ditto.
2887 * khtml/editing/visible_text.cpp: Ditto.
2888 * khtml/editing/visible_text.h: Ditto.
2889 * khtml/editing/visible_units.cpp: Added.
2890 * khtml/editing/visible_units.h: Added.
2891 * khtml/html/html_elementimpl.cpp: Updated or removed #include lines.
2892 * khtml/khtml_part.cpp: Ditto.
2893 * khtml/khtml_part.h: Ditto.
2894 * khtml/khtmlpart_p.h: Ditto.
2895 * khtml/khtmlview.cpp: Ditto.
2896 * khtml/misc/khtml_text_operations.cpp: Removed.
2897 * khtml/misc/khtml_text_operations.h: Removed.
2898 * khtml/rendering/render_block.cpp: Updated or removed #include lines.
2899 * khtml/xml/dom2_rangeimpl.cpp: Ditto.
2900 * khtml/xml/dom_caretposition.cpp: Removed.
2901 * khtml/xml/dom_caretposition.h: Removed.
2902 * khtml/xml/dom_docimpl.cpp: Updated or removed #include lines.
2903 * khtml/xml/dom_docimpl.h: Ditto.
2904 * khtml/xml/dom_elementimpl.cpp: Ditto.
2905 * khtml/xml/dom_nodeimpl.cpp: Ditto.
2906 * khtml/xml/dom_position.cpp: Ditto.
2907 * khtml/xml/dom_selection.cpp: Removed.
2908 * khtml/xml/dom_selection.h: Removed.
2909 * kwq/KWQKHTMLPart.mm: Updated or removed #include lines.
2910 * kwq/KWQKHTMLPart.h: Ditto.
2911 * kwq/KWQRenderTreeDebug.cpp: Ditto.
2912 * kwq/WebCoreBridge.mm: Ditto.
2914 2004-09-22 Richard Williamson <rjw@apple.com>
2916 Pass dashboard regions up to WebKit.
2918 Don't collect regions from RenderTexts.
2920 Made more args and return types references to avoid
2921 copying value lists.
2925 * WebCore.pbproj/project.pbxproj:
2926 * khtml/khtmlview.cpp:
2927 (KHTMLView::layout):
2928 * khtml/rendering/render_object.cpp:
2929 (RenderObject::collectDashboardRegions):
2930 * khtml/xml/dom_docimpl.cpp:
2931 (DocumentImpl::dashboardRegions):
2932 (DocumentImpl::setDashboardRegions):
2933 * khtml/xml/dom_docimpl.h:
2934 * kwq/KWQKHTMLPart.h:
2935 * kwq/KWQKHTMLPart.mm:
2936 (KWQKHTMLPart::didFirstLayout):
2937 (KWQKHTMLPart::dashboardRegionsChanged):
2938 * kwq/WebCoreBridge.h:
2939 * kwq/WebDashboardRegion.h: Added.
2940 * kwq/WebDashboardRegion.m: Added.
2941 (-[WebDashboardRegion initWithRect:type:]):
2942 (-[WebDashboardRegion copyWithZone:]):
2943 (-[WebDashboardRegion dashboardRegionRect]):
2944 (-[WebDashboardRegion dashboardRegionType]):
2945 (-[WebDashboardRegion description]):
2947 2004-09-22 Ken Kocienda <kocienda@apple.com>
2951 Fix for this hitlist bug:
2953 <rdar://problem/3805486> REGRESSION (Mail): Empty block elements can cause the caret to get "stuck" in one spot
2955 * khtml/xml/dom_caretposition.cpp:
2956 (DOM::CaretPosition::isCandidate): You can no longer caret into empty blocks with no height.
2957 Also did a little clean up in this function.
2958 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Regenerated expected results.
2959 This test was actually failing and had bogus results checked in!
2960 * layout-tests/editing/selection/select-all-003-expected.txt: Regenerated expected results.
2962 2004-09-22 Chris Blumenberg <cblu@apple.com>
2964 Fixed: <rdar://problem/3812091> REGRESSION (Mail): double-clicked word is not smart inserted on drag
2968 * khtml/editing/htmlediting.cpp:
2969 (khtml::MoveSelectionCommand::MoveSelectionCommand): take smartMove arg
2970 * khtml/editing/htmlediting.h:
2971 * khtml/editing/htmlediting_impl.cpp:
2972 (khtml::CompositeEditCommandImpl::deleteSelection): take smartDelete arg
2973 (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): take smartMove arg
2974 (khtml::MoveSelectionCommandImpl::doApply): pass smartMove for smartDelete and smartReplace
2975 * khtml/editing/htmlediting_impl.h:
2976 * kwq/WebCoreBridge.h:
2977 * kwq/WebCoreBridge.mm:
2978 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): take smartMove arg
2980 2004-09-22 Ken Kocienda <kocienda@apple.com>
2984 * khtml/css/css_computedstyle.cpp:
2985 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): New overloaded
2986 version of this function, one that takes a flag to determine whether to
2987 perform a document updateLayout() call before querying the style system.
2988 * khtml/css/css_computedstyle.h:
2989 (DOM::EUpdateLayout): Give a symbolic constant to true/false for the
2990 purpose of the new call to getPropertyCSSValue.
2991 * khtml/editing/htmlediting_impl.cpp:
2992 (khtml::StyleChange::currentlyHasStyle): Pass DoNotUpdateLayout to call to
2993 getPropertyCSSValue.
2994 (khtml::CompositeEditCommandImpl::applyTypingStyle): Add in top-level calls
2995 to updateLayout before doing style changes that now do not update styles
2997 (khtml::ApplyStyleCommandImpl::doApply): Ditto.
2998 (khtml::ApplyStyleCommandImpl::removeCSSStyle): Pass DoNotUpdateLayout to call to
2999 getPropertyCSSValue.
3000 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Remove this dead code.
3001 * khtml/editing/htmlediting_impl.h: Ditto.
3003 2004-09-22 Ken Kocienda <kocienda@apple.com>
3007 * WebCore.pbproj/project.pbxproj: New files added.
3008 * khtml/khtml_part.cpp:
3009 (KHTMLPart::clearSelection): No longer calls setFocusIfNeeded.
3010 (KHTMLPart::slotClearSelection): Merged old implementation from this function to
3011 clearSelection. Now just calls clearSelection. Also put in !APPLE_CHANGES since
3013 * khtml/xml/dom_docimpl.cpp:
3014 (DocumentImpl::setFocusNode): Add some code to determine when setting the focus should
3015 clear the selection.
3017 (QWidget::hasFocus): Call _webcore_effectiveFirstResponder to get view to check for focus.
3018 (QWidget::setFocus): Ditto.
3019 * kwq/WebCoreBridge.mm:
3020 (-[WebCoreBridge deselectText]): Called slotClearSelection and should have been. Now calls
3022 * kwq/WebCoreView.h: Added.
3023 * kwq/WebCoreView.m: Added.
3024 (-[NSView _webcore_effectiveFirstResponder]): New method to yield the correct responder
3025 to check for firstResponder-ness before calling makeFirstResonder. This helps to prevent
3026 unwanted firstResponder switching.
3027 (-[NSClipView _webcore_effectiveFirstResponder]): Ditto.
3028 (-[NSScrollView _webcore_effectiveFirstResponder]): Ditto.
3030 2004-09-21 Maciej Stachowiak <mjs@apple.com>
3034 <rdar://problem/3805137> REGRESSION: Cannot search on pricetool.com
3036 The problem here is that residual style handling can cause an
3037 element associated with a misnested form to lose the association,
3038 because it can become detached and then reattached in this
3039 case. So we need to maintain the association.
3041 * khtml/html/html_formimpl.h: Added list of dormant elements to form,
3042 and dormant bit to generic form element.
3043 * khtml/html/html_formimpl.cpp:
3044 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl): Clear m_form field for
3045 dormant elements too.
3046 (DOM::HTMLFormElementImpl::registerFormElement): Remove from dormant list
3047 in addition to adding to main list.
3048 (DOM::HTMLFormElementImpl::removeFormElement): Remove from both lists.
3049 (DOM::HTMLFormElementImpl::makeFormElementDormant): New method, remove from
3050 main list, add to dormant list.
3051 (DOM::HTMLGenericFormElementImpl::HTMLGenericFormElementImpl): Initialize
3052 dormant bit to false.
3053 (DOM::HTMLGenericFormElementImpl::insertedIntoDocument): If the element is
3054 dormant and has a form, re-register it and clear the dormant bit.
3055 (DOM::HTMLGenericFormElementImpl::removedFromDocument): If the document has
3056 a form, tell the form it is dormant and set the dormant bit.
3058 2004-09-22 Chris Blumenberg <cblu@apple.com>
3060 Fixed: <rdar://problem/3811187> REGRESSION (Mail): Control-click past end of document does not spell check last word
3062 Reviewed by kocienda.
3064 * khtml/xml/dom_selection.cpp:
3065 (DOM::Selection::validate): if at the end of the document, expand to the left.
3067 2004-09-22 Maciej Stachowiak <mjs@apple.com>
3069 Reviewed by Ken and John.
3071 <rdar://problem/3759228> REGRESSION (Mail): stray characters when entering text via input method right after newline
3073 * khtml/editing/htmlediting_impl.cpp:
3074 (khtml::CompositeEditCommandImpl::inputText): Add an optional
3075 selectInsertedText parameter.
3076 (khtml::ReplaceSelectionCommandImpl::doApply): Let the inputText operation
3077 select the text when inserting plain text, because it already knows all the right
3078 information to do so, and this function doesn't (sometimes text is inserted
3079 before the start of the old selection, not after!)
3080 * khtml/editing/htmlediting_impl.h:
3082 2004-09-22 Richard Williamson <rjw@apple.com>
3084 More tweaks to dashboard regions.
3086 Move dashboard regions list into css3NonInheritedData so it will be shared
3087 by all styles that don't modify the empty region list.
3089 Make the initial value for dashboard region list a static to minimize allocations
3092 Make marquee and flex style accessor functions const.
3096 * khtml/rendering/render_style.cpp:
3097 (RenderStyle::diff):
3098 * khtml/rendering/render_style.h:
3099 (khtml::RenderStyle::opacity):
3100 (khtml::RenderStyle::boxAlign):
3101 (khtml::RenderStyle::boxDirection):
3102 (khtml::RenderStyle::boxFlexGroup):
3103 (khtml::RenderStyle::boxOrdinalGroup):
3104 (khtml::RenderStyle::boxOrient):
3105 (khtml::RenderStyle::boxPack):
3106 (khtml::RenderStyle::marqueeIncrement):
3107 (khtml::RenderStyle::marqueeSpeed):
3108 (khtml::RenderStyle::marqueeLoopCount):
3109 (khtml::RenderStyle::marqueeBehavior):
3110 (khtml::RenderStyle::marqueeDirection):
3111 (khtml::RenderStyle::dashboardRegions):
3112 (khtml::RenderStyle::setDashboardRegions):
3113 (khtml::RenderStyle::setDashboardRegion):
3114 (khtml::RenderStyle::initialDashboardRegions):
3116 2004-09-22 David Hyatt <hyatt@apple.com>
3118 Fix for 3802766, entire view redrawn in Blot while typing. Don't needlessly create text nodes just to find
3119 out the font for the caret position.
3123 * kwq/KWQKHTMLPart.mm:
3124 (KWQKHTMLPart::fontForSelection):
3126 2004-09-21 Chris Blumenberg <cblu@apple.com>
3129 <rdar://problem/3735071> REGRESSION (Mail): WebCore Editing must do smart paste
3130 <rdar://problem/3799163> REGRESSION (Mail): Deleting a word doesn't delete whitespace
3134 * khtml/editing/htmlediting.cpp:
3135 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): take smartDelete parameter
3136 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take smartReplace parameter
3137 * khtml/editing/htmlediting.h:
3138 * khtml/editing/htmlediting_impl.cpp:
3139 (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl): take smartDelete parameter
3140 (khtml::DeleteSelectionCommandImpl::doApply): delete whitespace before and after selection if necessary
3141 (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl): take smartReplace parameter
3142 (khtml::ReplaceSelectionCommandImpl::doApply): add whitespace before and after the replacement if necessary
3143 * khtml/editing/htmlediting_impl.h:
3144 * kwq/WebCoreBridge.h:
3145 * kwq/WebCoreBridge.mm:
3146 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): take smartReplace parameter
3147 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): ditto
3148 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): ditto
3149 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): ditto
3150 (-[WebCoreBridge deleteSelectionWithSmartDelete:]): take smartDelete parameter
3152 2004-09-21 Richard Williamson <rjw@apple.com>
3154 More dashboard region work.
3156 Added support for computed style and cssText for new region property.
3157 Added restriction on length types allowed in region functions.
3158 Added initial and inheritance support for -apple-dashboard-region.
3162 * khtml/css/css_computedstyle.cpp:
3163 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3164 * khtml/css/css_valueimpl.cpp:
3165 (CSSPrimitiveValueImpl::cssText):
3166 * khtml/css/cssparser.cpp:
3167 (CSSParser::parseDashboardRegions):
3168 * khtml/css/cssstyleselector.cpp:
3169 (khtml::CSSStyleSelector::applyProperty):
3170 * khtml/rendering/render_object.cpp:
3171 (RenderObject::addDashboardRegions):
3172 * khtml/rendering/render_style.cpp:
3173 (RenderStyle::diff):
3174 * khtml/rendering/render_style.h:
3175 (khtml::StyleDashboardRegion::operator==):
3176 (khtml::RenderStyle::dashboardRegions):
3177 (khtml::RenderStyle::setDashboardRegions):
3178 (khtml::RenderStyle::initialDashboardRegions):
3180 2004-09-21 Darin Adler <darin@apple.com>
3184 - fixed problem where our updateLayout call ignores pending stylesheets all the time
3186 * khtml/xml/dom_docimpl.h: Added updateLayoutIgnorePendingStylesheets.
3187 * khtml/xml/dom_docimpl.cpp:
3188 (DocumentImpl::updateLayout): Took out the "ignore pending stylesheets" business here.
3189 (DocumentImpl::updateLayoutIgnorePendingStylesheets): Put it in here.
3191 * khtml/ecma/kjs_dom.cpp: (DOMNode::getValueProperty): Call the new
3192 updateLayoutIgnorePendingStylesheets function.
3193 * khtml/ecma/kjs_html.cpp:
3194 (KJS::HTMLElement::getValueProperty): Ditto.
3195 (KJS::HTMLElement::putValue): Ditto.
3196 * khtml/ecma/kjs_views.cpp: (DOMAbstractViewFunc::tryCall): Ditto.
3197 * khtml/ecma/kjs_window.cpp:
3198 (Window::updateLayout): Ditto.
3199 (Selection::get): Ditto.
3200 (SelectionFunc::tryCall): Ditto.
3202 * khtml/html/html_imageimpl.h: Add ignorePendingStylesheets boolean parameter.
3203 * khtml/html/html_imageimpl.cpp:
3204 (HTMLImageElementImpl::width): Respect new parameter.
3205 (HTMLImageElementImpl::height): Ditto.
3209 * kwq/WebCoreBridge.mm:
3210 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Removed unneeded
3211 explicit "true" parameter to setSelection.
3212 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto.
3214 2004-09-21 Darin Adler <darin@apple.com>
3218 - fix crash when pasting text at the end of the document and then doing an undo
3220 * khtml/editing/htmlediting_impl.cpp:
3221 (khtml::EditCommandImpl::apply): Call markMisspellingsInSelection before doing
3222 the editing operation, and we'll tell setSelection not to unmark the old selection.
3223 Also call updateLayout before calling appliedEditing so DOM operations in the
3224 code responding to the selection change will work.
3225 (khtml::EditCommandImpl::unapply): Ditto.
3226 (khtml::EditCommandImpl::reapply): Ditto.
3228 * khtml/khtml_part.h: Added a third parameter to setSelection to tell it whether
3229 to unmark the old selection. We must pass false when editing, because the old
3230 selection might have now-invalid offsets inside it.
3231 * khtml/khtml_part.cpp:
3232 (KHTMLPart::setSelection): Add unmarkOldSelection parameter, and respect it.
3233 (KHTMLPart::appliedEditing): Pass false for unmarkOldSelection.
3234 (KHTMLPart::unappliedEditing): Ditto.
3235 (KHTMLPart::reappliedEditing): Ditto.
3237 2004-09-21 Richard Williamson <rjw@apple.com>
3239 Part 2 of the feature requested in
3240 <rdar://problem/3752791> Dashboard: Need a better solution for control regions
3242 This patch actually collections the regions and converts to absolute coordinates.
3243 Only remaining piece is to pass over the bridge and up the alley to WebKit
3248 * khtml/css/css_valueimpl.h:
3249 (DOM::CSSPrimitiveValueImpl::getDashboardRegionValue):
3250 * khtml/css/cssparser.cpp:
3251 (CSSParser::parseValue):
3252 (CSSParser::parseDashboardRegions):
3253 * khtml/css/cssproperties.c:
3254 * khtml/css/cssproperties.h:
3255 * khtml/css/cssproperties.in:
3256 * khtml/css/cssstyleselector.cpp:
3257 (khtml::CSSStyleSelector::applyProperty):
3258 * khtml/khtmlview.cpp:
3259 (KHTMLView::layout):
3260 * khtml/rendering/render_object.cpp:
3261 (RenderObject::computeDashboardRegions):
3262 (RenderObject::addDashboardRegions):
3263 (RenderObject::collectDashboardRegions):
3264 * khtml/rendering/render_object.h:
3265 (khtml::DashboardRegionValue::operator==):
3266 * khtml/rendering/render_style.cpp:
3267 * khtml/rendering/render_style.h:
3268 (khtml::StyleDashboardRegion::):
3269 (khtml::RenderStyle::dashboardRegions):
3270 (khtml::RenderStyle::setDashboardRegion):
3271 * khtml/xml/dom_docimpl.cpp:
3272 (DocumentImpl::DocumentImpl):
3273 (DocumentImpl::updateLayout):
3274 (DocumentImpl::acceptsEditingFocus):
3275 (DocumentImpl::dashboardRegions):
3276 (DocumentImpl::setDashboardRegions):
3277 * khtml/xml/dom_docimpl.h:
3278 (DOM::DocumentImpl::hasDashboardRegions):
3279 (DOM::DocumentImpl::setHasDashboardRegions):
3281 2004-09-21 John Sullivan <sullivan@apple.com>
3285 - WebCore part of fix for <rdar://problem/3618274> REGRESSION (125-135):
3286 Option-tab doesn't always work as expected
3288 * kwq/KWQKHTMLPart.mm:
3289 (KWQKHTMLPart::tabsToAllControls):
3290 reworked logic to match what we promise in the UI; this worked correctly
3291 before for regular tabbing, but not for option-tabbing.
3294 (QButton::focusPolicy):
3295 check tabsToAllControls() rather than just WebCoreKeyboardAccessFull
3297 * kwq/KWQComboBox.mm:
3298 (QComboBox::focusPolicy):
3301 * kwq/KWQFileButton.mm:
3302 (KWQFileButton::focusPolicy):
3305 * kwq/KWQListBox.mm:
3306 (QListBox::focusPolicy):
3309 2004-09-21 John Sullivan <sullivan@apple.com>
3311 * khtml/xml/dom_selection.cpp:
3312 (DOM::Selection::modify):
3313 initialize xPos to make compiler happy in deployment builds
3315 2004-09-21 Darin Adler <darin@apple.com>
3319 - some small mechanical improvements to the position and selection classes
3321 * khtml/xml/dom_position.h: Added clear(), startPosition(), and endPosition().
3322 * khtml/xml/dom_position.cpp:
3323 (DOM::Position::clear): Added.
3324 (DOM::startPosition): Added.
3325 (DOM::endPosition): Added.
3327 * khtml/xml/dom_caretposition.h: Changed m_position to m_deepPosition. Added clear(),
3328 removed node() and offset().
3329 * khtml/xml/dom_caretposition.cpp:
3330 (DOM::CaretPosition::init): Updated for name change of m_position to m_deepPosition.
3331 (DOM::CaretPosition::isLastInBlock): Ditto.
3332 (DOM::CaretPosition::next): Ditto.
3333 (DOM::CaretPosition::previous): Ditto.
3334 (DOM::CaretPosition::debugPosition): Ditto.
3335 (DOM::CaretPosition::formatForDebugger): Ditto.
3337 * khtml/xml/dom_selection.h: Remove setStart, setEnd, setStartAndEnd, rangeStart, rangeEnd,
3338 and all the assignXXX functions.
3339 * khtml/xml/dom_selection.cpp:
3340 (DOM::Selection::Selection): Wean from assign functions, get and set data members directly.
3341 (DOM::Selection::init): Don't clear base, extent, start, and end, since they have constructors.
3342 (DOM::Selection::operator=): Wean from assign functions, get and set data members directly.
3343 (DOM::Selection::moveTo): Ditto.
3344 (DOM::Selection::setModifyBias): Ditto.
3345 (DOM::Selection::modifyExtendingRightForward): Ditto.
3346 (DOM::Selection::modifyMovingRightForward): Ditto.
3347 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
3348 (DOM::Selection::modifyMovingLeftBackward): Ditto.
3349 (DOM::Selection::modify): Ditto.
3350 (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
3351 (DOM::Selection::clear): Ditto.
3352 (DOM::Selection::setBase): Ditto.
3353 (DOM::Selection::setExtent): Ditto.
3354 (DOM::Selection::setBaseAndExtent): Ditto.
3355 (DOM::Selection::toRange): Ditto.
3356 (DOM::Selection::layoutCaret): Ditto.
3357 (DOM::Selection::needsCaretRepaint): Ditto.
3358 (DOM::Selection::validate): Ditto.
3359 (DOM::Selection::debugRenderer): Ditto.
3360 (DOM::Selection::debugPosition): Ditto.
3361 (DOM::Selection::end):
3363 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::advanceToNextMisspelling): Tweaked whitespace.
3365 2004-09-21 Chris Blumenberg <cblu@apple.com>
3367 Fixed: <rdar://problem/3647229> Safari does not play inline Windows Media Content on some sites (miggy.net and ministryofsound.com)
3371 * khtml/rendering/render_frames.cpp:
3372 (RenderPartObject::updateWidget): when no MIME type is specified map from the WMP CLASSID to the WMP MIME type, look for the URL of the content in the URL PARAM tag
3374 2004-09-20 Darin Adler <darin@apple.com>
3378 - fixed regression from my recent check-in where misspelled words do not get unmarked when moving the caret
3379 - changed CaretPosition to hold a Position instead of a node and offset
3380 - renamed isEmpty to isNull, etc.
3382 * kwq/KWQKHTMLPart.mm:
3383 (KWQKHTMLPart::jumpToSelection): Updated for name changes.
3384 (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
3385 (KWQKHTMLPart::fontForSelection): Ditto.
3386 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Ditto.
3387 (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
3388 (KWQKHTMLPart::updateSpellChecking): Fixed bug by using LeftWordIfOnBoundary.
3390 * khtml/xml/dom_position.h: Updated for name changes.
3391 * khtml/xml/dom_position.cpp:
3392 (DOM::Position::element): Change to not use a separate null check.
3393 (DOM::Position::computedStyle): Updated for name changes.
3394 (DOM::Position::previousCharacterPosition): Ditto.
3395 (DOM::Position::nextCharacterPosition): Ditto.
3396 (DOM::Position::equivalentRangeCompliantPosition): Ditto.
3397 (DOM::Position::equivalentShallowPosition): Ditto.
3398 (DOM::Position::equivalentDeepPosition): Ditto.
3399 (DOM::Position::closestRenderedPosition): Ditto.
3400 (DOM::Position::inRenderedContent): Ditto.
3401 (DOM::Position::inRenderedText): Ditto.
3402 (DOM::Position::isRenderedCharacter): Ditto.
3403 (DOM::Position::rendersInDifferentPosition): Ditto.
3404 (DOM::Position::isFirstRenderedPositionOnLine): Ditto.
3405 (DOM::Position::isLastRenderedPositionOnLine): Ditto.
3406 (DOM::Position::inFirstEditableInRootEditableElement): Ditto.
3407 (DOM::Position::leadingWhitespacePosition): Ditto.
3408 (DOM::Position::trailingWhitespacePosition): Ditto.
3409 (DOM::Position::debugPosition): Ditto.
3410 (DOM::Position::formatForDebugger): Ditto.
3412 * khtml/xml/dom_caretposition.h: Change to use m_position, and change names.
3413 * khtml/xml/dom_caretposition.cpp:
3414 (DOM::CaretPosition::CaretPosition): Remove code to set up m_node.
3415 (DOM::CaretPosition::init): Set m_position directly.
3416 (DOM::CaretPosition::isLastInBlock): Updated for name changes.
3417 (DOM::CaretPosition::next): Set m_position directly.
3418 (DOM::CaretPosition::previous): Set m_position directly.
3419 (DOM::CaretPosition::previousCaretPosition): Updated for name changes.
3420 (DOM::CaretPosition::nextCaretPosition): Ditto.
3421 (DOM::CaretPosition::previousPosition): Ditto.
3422 (DOM::CaretPosition::nextPosition): Ditto.
3423 (DOM::CaretPosition::atStart): Ditto.
3424 (DOM::CaretPosition::atEnd): Ditto.
3425 (DOM::CaretPosition::isCandidate): Ditto.
3426 (DOM::CaretPosition::debugPosition): Ditto.
3427 (DOM::CaretPosition::formatForDebugger): Ditto.
3428 (DOM::startOfWord): Ditto.
3429 (DOM::endOfWord): Ditto.
3430 (DOM::previousParagraphPosition): Ditto.
3431 (DOM::nextParagraphPosition): Ditto.
3433 * khtml/xml/dom_selection.h: Updated names. Added isCaret and isRange.
3434 * khtml/xml/dom_selection.cpp:
3435 (DOM::Selection::modifyMovingRightForward): Updated for name changes.
3436 (DOM::Selection::modifyMovingLeftBackward): Ditto.
3437 (DOM::Selection::modify): Ditto.
3438 (DOM::Selection::expandUsingGranularity): Ditto.
3439 (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
3440 (DOM::Selection::toRange): Ditto.
3441 (DOM::Selection::layoutCaret): Ditto.
3442 (DOM::Selection::needsCaretRepaint): Ditto.
3443 (DOM::Selection::validate): Ditto.
3444 (DOM::startOfFirstRunAt): Ditto.
3445 (DOM::endOfLastRunAt): Ditto.
3446 (DOM::selectionForLine): Ditto.
3447 (DOM::Selection::formatForDebugger): Ditto.
3449 * khtml/ecma/kjs_window.cpp:
3450 (Selection::get): Updated for name changes.
3451 (Selection::toString): Ditto.
3452 * khtml/editing/htmlediting_impl.cpp:
3453 (khtml::debugPosition): Ditto.
3454 (khtml::StyleChange::init): Ditto.
3455 (khtml::StyleChange::currentlyHasStyle): Ditto.
3456 (khtml::CompositeEditCommandImpl::deleteSelection): Ditto.
3457 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): Ditto.
3458 (khtml::ApplyStyleCommandImpl::doApply): Ditto.
3459 (khtml::DeleteSelectionCommandImpl::doApply): Ditto.
3460 (khtml::InputNewlineCommandImpl::doApply): Ditto.
3461 (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
3462 (khtml::InputTextCommandImpl::input): Ditto.
3463 (khtml::ReplaceSelectionCommandImpl::doApply): Ditto.
3464 (khtml::MoveSelectionCommandImpl::doApply): Ditto.
3465 (khtml::TypingCommandImpl::doApply): Ditto.
3466 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Ditto.
3467 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Ditto.
3468 * khtml/editing/jsediting.cpp:
3469 (enabledAnySelection): Ditto.
3470 (enabledRangeSelection): Ditto.
3471 * khtml/khtml_part.cpp:
3472 (KHTMLPart::hasSelection): Ditto.
3473 (KHTMLPart::setFocusNodeIfNeeded): Ditto.
3474 (KHTMLPart::selectionLayoutChanged): Ditto.
3475 (KHTMLPart::timerEvent): Ditto.
3476 (KHTMLPart::isPointInsideSelection): Ditto.
3477 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
3478 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
3479 (KHTMLPart::handleMousePressEventSingleClick): Ditto.
3480 (KHTMLPart::handleMouseMoveEventSelection): Ditto.
3481 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
3482 (KHTMLPart::selectionHasStyle): Ditto.
3483 (KHTMLPart::selectionComputedStyle): Ditto.
3484 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::updateSelection): Ditto.
3485 * khtml/xml/dom_positioniterator.cpp:
3486 (DOM::PositionIterator::peekPrevious): Ditto.
3487 (DOM::PositionIterator::peekNext): Ditto.
3488 (DOM::PositionIterator::atStart): Ditto.
3489 (DOM::PositionIterator::atEnd): Ditto.
3490 * khtml/xml/dom_positioniterator.h:
3491 (DOM::PositionIterator::isEmpty): Ditto.
3492 * kwq/KWQRenderTreeDebug.cpp:
3493 (writeSelection): Ditto.
3494 * kwq/WebCoreBridge.mm:
3495 (-[WebCoreBridge editableDOMRangeForPoint:]): Ditto.
3496 (-[WebCoreBridge deleteSelection]): Ditto.
3497 (-[WebCoreBridge ensureCaretVisible]): Ditto.
3498 (-[WebCoreBridge rangeOfCharactersAroundCaret]): Ditto.
3500 2004-09-20 Darin Adler <darin@apple.com>
3504 - fixed <rdar://problem/3808073> find is broken
3506 * khtml/misc/khtml_text_operations.h: Add m_pastEndNode and change name of m_endNode to
3507 m_endContainer to more accurately reflect its purpose.
3508 * khtml/misc/khtml_text_operations.cpp:
3509 (khtml::TextIterator::TextIterator): Use pastEnd() for end of iteration, and change to
3510 handle bad ranges better: just return an empty iterator instead of raising an exception.
3511 (khtml::TextIterator::advance): Change to use m_pastEndNode to detect the end of iteration.
3512 (khtml::TextIterator::handleTextNode): Update for name change.
3513 (khtml::TextIterator::handleTextBox): Ditto.
3514 (khtml::TextIterator::range): Handle case where m_endContainer is nil.
3516 * khtml/xml/dom2_rangeimpl.cpp:
3517 (DOM::RangeImpl::surroundContents): Use offsetInCharacters.
3518 (DOM::RangeImpl::startNode): Added check for nil start container and use offsetInCharacters.
3519 (DOM::RangeImpl::pastEndNode): Ditto.
3521 2004-09-20 Chris Blumenberg <cblu@apple.com>
3523 Fixed: <rdar://problem/3781290> REGRESSION (Mail): Crash in ReplaceSelectionCommandImpl attaching file to new message
3525 Reviewed by kocienda.
3527 * khtml/khtml_part.cpp:
3528 (KHTMLPart::setSelection): setFocusNodeIfNeeded now works on the current selection so call setFocusNodeIfNeeded after setting the selection
3529 (KHTMLPart::clearSelection): don't call setFocusNodeIfNeeded with the current selection
3530 (KHTMLPart::setCaretVisible): ditto
3531 (KHTMLPart::setFocusNodeIfNeeded): do nothing if the part isn't focused, work with the current selection
3532 * khtml/khtml_part.h:
3533 * khtml/khtmlpart_p.h:
3534 (KHTMLPartPrivate::KHTMLPartPrivate): added m_isFocused
3535 * kwq/KWQKHTMLPart.h:
3536 * kwq/KWQKHTMLPart.mm:
3537 (KWQKHTMLPart::KWQKHTMLPart): removed _displaysWithFocusAttributes this is replaced by m_isFocused
3538 (KWQKHTMLPart::setSelectionFromNone): new, code factored out from setDisplaysWithFocusAttributes
3539 (KWQKHTMLPart::setDisplaysWithFocusAttributes): call setSelectionFromNone
3540 (KWQKHTMLPart::displaysWithFocusAttributes): now returns m_isFocused
3541 * kwq/WebCoreBridge.h:
3542 * kwq/WebCoreBridge.mm:
3543 (-[WebCoreBridge setSelectionFromNone]): new
3545 2004-09-20 Darin Adler <darin@apple.com>
3549 - fixed nil-deref happening often in Mail when I delete
3551 * khtml/rendering/render_br.cpp: (RenderBR::selectionRect): Check for nil lastLeafChild.
3552 Dave may want to figure out why it's nil and do a different fix later.
3554 2004-09-20 Maciej Stachowiak <mjs@apple.com>
3556 Reviewed by Richard.
3558 <rdar://problem/3672101> HANG: typing into login field at dws-direkt.deutsche-bank.de (infinite recursion)
3560 * khtml/xml/dom_docimpl.cpp:
3561 (DocumentImpl::defaultEventHandler): Copy the list of handlers
3562 before firing any of them, in case a handler affects the list of
3565 2004-09-20 Chris Blumenberg <cblu@apple.com>
3568 <rdar://problem/3429921> obey PARAM tags inside of OBJECT tags when necessary
3569 <rdar://problem/3515685> Object tag in Java 1.4.1 / Safari doesn't recognize params
3573 * khtml/khtml_part.cpp:
3574 (KHTMLPart::requestFrame): take 2 parameter arrays rather than 1 which will have to be parsed
3575 (KHTMLPart::requestObject): ditto
3576 * khtml/khtml_part.h:
3577 * khtml/khtmlpart_p.h:
3578 * khtml/rendering/render_frames.cpp:
3579 (RenderPartObject::updateWidget): use PARAM tags when there is no EMBED specified
3580 * kwq/KWQKHTMLPart.h:
3581 * kwq/KWQKHTMLPart.mm:
3582 (KWQKHTMLPart::createPart): call renamed bridge method
3583 * kwq/KWQKJavaAppletWidget.mm:
3584 (KJavaAppletWidget::KJavaAppletWidget): ditto
3585 * kwq/KWQStringList.h:
3586 * kwq/KWQStringList.mm:
3587 (QStringList::getNSArray): return a const array
3588 * kwq/WebCoreBridge.h:
3589 * kwq/WebCoreBridge.mm:
3590 (-[WebCoreBridge URLWithAttributeString:]): renamed to match API
3592 2004-09-20 Darin Adler <darin@apple.com>
3596 - fixed <rdar://problem/3655360> REGRESSION (Mail): Ctrl-V emacs key binding, -pageDown: method, unimplemented (and pageUp, and selection-modifying versions)
3597 - fixed <rdar://problem/3735055> REGRESSION (Mail): WebCore double click rules treat style change as a boundary
3598 - fixed <rdar://problem/3789939> REGRESSION (Mail): double-clicking on border whitespace selects space plus word before/after
3599 - fixed <rdar://problem/3792138> REGRESSION (Mail): Spell checker doesn't check current selected word
3600 - fixed <rdar://problem/3806604> REGRESSION (164): Triple-click sometimes selects extra characters
3601 - fixed <rdar://problem/3806996> REGRESSION (125-162): Triple-click in <pre> tagged text behaves oddly (leuf.net)
3603 * khtml/xml/dom_caretposition.h: Added a lot of new functions. Removed implicit conversion operator
3604 that converts from CaretPosition to Position.
3605 * khtml/xml/dom_caretposition.cpp:
3606 (DOM::CaretPosition::CaretPosition): Change to call deepEquivalent so it works without the implicit
3607 Position conversion operator.
3608 (DOM::CaretPosition::operator=): Ditto.
3609 (DOM::CaretPosition::next): Ditto.
3610 (DOM::CaretPosition::previous): Ditto.
3611 (DOM::CaretPosition::setPosition): Added an assertion.
3612 (DOM::start): Added.
3614 (DOM::setStart): Added.
3615 (DOM::setEnd): Added.
3616 (DOM::previousWordBoundary): Added.
3617 (DOM::nextWordBoundary): Added.
3618 (DOM::startWordBoundary): Added.
3619 (DOM::startOfWord): Added.
3620 (DOM::endWordBoundary): Added.
3621 (DOM::endOfWord): Added.
3622 (DOM::previousWordPositionBoundary): Added.
3623 (DOM::previousWordPosition): Added.
3624 (DOM::nextWordPositionBoundary): Added.
3625 (DOM::nextWordPosition): Added.
3626 (DOM::previousLinePosition): Added.
3627 (DOM::nextLinePosition): Added.
3628 (DOM::startOfParagraph): Changed function name.
3629 (DOM::endOfParagraph): Changed function name. Fixed code in includeLineBreak to work around
3630 the CaretPosition constructor issue for <br>, pass the right parameter for the block flow case,
3631 and handle <pre> properly.
3632 (DOM::inSameParagraph): Added.
3633 (DOM::previousParagraphPosition): Added.
3634 (DOM::nextParagraphPosition): Added.
3636 * khtml/xml/dom_position.h: Removed a number of functions no longer used; also made some private.
3637 * khtml/xml/dom_position.cpp: Removed a number of functions no longer used.
3639 * khtml/xml/dom_selection.h: Replaced DOCUMENT with DOCUMENT_BOUNDARY. Added overloads of lots
3640 of functions that take CaretPosition directly. Added overload of modify that takes a parameter
3641 for vertical distance to help implement pageDown: and friends. Replaced getRepaintRect with
3642 two new functions named caretRect and caretRepaintRect. Removed nodeIsBeforeNode.
3643 * khtml/xml/dom_selection.cpp:
3644 (DOM::Selection::Selection): Added constructor that takes two CaretPosition objects.
3645 (DOM::Selection::setModifyBias): Added. Helper function.
3646 (DOM::Selection::modifyExtendingRightForward): Don't set modify bias, since that's now the caller's
3647 responsibility. Reimplement WORD and LINE in terms of new CaretPosition functions. Implement PARAGRAPH
3648 and change PARAGRAPH_BOUNDARY to use CaretPosition function by its new name.
3649 (DOM::Selection::modifyMovingRightForward): Ditto.
3650 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
3651 (DOM::Selection::modifyMovingLeftBackward): Ditto.
3652 (DOM::Selection::modify): Call setModifyBias, and use a switch statement instead of if.
3653 (DOM::caretY): Added. Helper for the new modify function that implements moving a pixel distance,
3654 used by pageDown: and friends.
3655 (DOM::Selection::modify): Added.
3656 (DOM::Selection::toRange): Use RangeImpl::compareBoundaryPoints instead of nodeIsBeforeNode.
3657 (DOM::Selection::caretRect): Added. Replaces getRepaintRect, but does not add slop.
3658 (DOM::Selection::caretRepaintRect): Added. Replaces getRepaintRect; still adds slop.
3659 (DOM::Selection::needsCaretRepaint): Call caretRepaintRect.
3660 (DOM::Selection::validate): Use RangeImpl::compareBoundaryPoints instead of nodeIsBeforeNode.
3661 Reimplement WORD to use new CaretPosition functions; this fixes the double-clicking problems.
3662 Change paragraph calls to use new names.
3664 * ForwardingHeaders/dom/dom_position.h: Removed. This was in the wrong location.
3665 * khtml/editing/htmlediting.cpp: Fixed include that said "dom/dom_position.h".
3666 * khtml/editing/htmlediting_impl.cpp: Fixed include that said "dom/dom_position.h".
3667 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Rewrote this to use the new CaretPosition
3668 functions instead of the old Position functions.
3670 * khtml/misc/helper.h: Added const to character pointer parameter. Also put invertedColor inside
3671 an !APPLE_CHANGES since it doesn't do us any good.
3672 * khtml/misc/helper.cpp:
3673 (khtml::findWordBoundary): Added const to character pointer parameter.
3674 (khtml::nextWordFromIndex): Ditto.
3676 * kwq/KWQTextUtilities.h: Change parameters to const.
3677 * kwq/KWQTextUtilities.cpp: (KWQFindWordBoundary): Change parameter to const.
3678 * kwq/KWQTextUtilities.mm: (KWQFindNextWordFromIndex): Change parameter to const.
3680 * khtml/css/cssstyleselector.cpp: Disable code that uses invertedColor when APPLE_CHANGES, since it
3683 * khtml/rendering/render_canvas.cpp: (RenderCanvas::setSelection): Added checks for selection end
3684 so we can set the selection end to nodes that are not leaf nodes and it will still work. Also took
3685 out bogus firstChild/lastChild loops for the same reason.
3687 * kwq/KWQKHTMLPart.h: Add "start before selection" flag to advanceToNextMisspelling.
3688 Needed to fix bug with spell checking.
3689 * kwq/KWQKHTMLPart.mm:
3690 (KWQKHTMLPart::findString): Changed to use CaretPosition.
3691 (KWQKHTMLPart::advanceToNextMisspelling): Added code to handle "start before selection" flag
3692 and changed to use CaretPosition and new helper functions.
3693 (KWQKHTMLPart::markMisspellingsInSelection): More changes to use CaretPosition.
3694 (KWQKHTMLPart::updateSpellChecking): Ditto.
3696 * kwq/WebCoreBridge.h: Replaced WebSelectByDocument with WebSelectToDocumentBoundary.
3697 Added advanceToNextMisspellingStartingJustBeforeSelection,
3698 rangeByAlteringCurrentSelection:verticalDistance:, and
3699 alterCurrentSelection:verticalDistance:.
3701 * kwq/WebCoreBridge.mm:
3702 (-[WebCoreBridge advanceToNextMisspellingStartingJustBeforeSelection]): Added.
3703 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Added case for selecting by
3704 paragraph to save X position.
3705 (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:]): Added.
3706 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Added.
3707 (-[WebCoreBridge ensureCaretVisible]): Call caretRect instead of getRepaintRect.
3709 2004-09-20 Darin Adler <darin@apple.com>
3713 - cleaned up DOM::RangeImpl a little so compareBoundaryPoints can be used outside the class
3715 * khtml/xml/dom2_rangeimpl.h: Added const to many of the member functions and made the
3716 compareBoundaryPoints that works on parameters be a const member function.
3717 * khtml/xml/dom2_rangeimpl.cpp:
3718 (DOM::RangeImpl::commonAncestorContainer): Added const.
3719 (DOM::RangeImpl::compareBoundaryPoints): Added const.
3720 (DOM::RangeImpl::boundaryPointsValid): Added const, and wrote cleaner version.
3721 (DOM::RangeImpl::insertNode): Simplified by calling containedByReadOnly.
3722 (DOM::RangeImpl::toString): Added const.
3723 (DOM::RangeImpl::toHTML): Added const.
3724 (DOM::RangeImpl::createContextualFragment): Added const.
3725 (DOM::RangeImpl::cloneRange): Added const.
3726 (DOM::RangeImpl::surroundContents): Simplified by calling containedByReadOnly.
3728 2004-09-20 Darin Adler <darin@apple.com>
3732 - fixed <rdar://problem/3806990> REGRESSION (125-162): Crash on Select All at http://leuf.net/cgi/wikidn?PerlConvertEolScript
3734 * khtml/rendering/render_replaced.cpp: (RenderWidget::setSelectionState): Added nil check for the
3737 2004-09-20 Darin Adler <darin@apple.com>
3741 - fixed <rdar://problem/3773740> calling addEventListener on a frame that hasn't loaded yet crashes
3743 * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Add nil checks for the document.
3744 The nil check prevents the crash but there's still a bug here; I filed 3807059 about that.
3746 2004-09-20 Darin Adler <darin@apple.com>
3750 - fixed problem where up and down arrow keys are not preserving X position
3752 * khtml/khtml_part.cpp:
3753 (KHTMLPart::selectionLayoutChanged): Moved code to clear m_xPosForVerticalArrowNavigation out of here.
3754 (KHTMLPart::notifySelectionChanged): Moved it into here.
3756 2004-09-18 Darin Adler <darin@apple.com>
3760 - fixed <rdar://problem/3805627> -[DOMRange _text] sometimes includes all text to the end of the document for certain ranges
3762 * khtml/misc/khtml_text_operations.cpp: (khtml::TextIterator::advance):
3763 Correctly handle the case when we are already on m_endNode. The concept here is that
3764 m_endNode is a node you must never "leave" when iterating.
3768 2004-09-17 Ken Kocienda <kocienda@apple.com>
3770 * layout-tests/editing/selection/unrendered-004-expected.txt: Updated expected results.
3772 2004-09-17 Ken Kocienda <kocienda@apple.com>
3778 <rdar://problem/3780245> REGRESSION (Mail): some lines are skipped when doing arrow navigation
3780 * khtml/xml/dom_position.cpp:
3781 (DOM::Position::previousLinePosition): One-line fix. Make sure that BRs at the end of blocks
3784 2004-09-17 Ken Kocienda <kocienda@apple.com>
3790 <rdar://problem/3805594> REGRESSION (Mail): Second return key stroke does not work when first was in blockquote
3792 * khtml/xml/dom_selection.cpp:
3793 (DOM::Selection::toRange): Code to convert caret positions moved the position upstream
3794 before making a range-compliant position, but erroneously would allow the position
3795 to cross blocks. Now it will no longer do so.
3797 2004-09-16 Richard Williamson <rjw@apple.com>
3799 Part 1 of the feature requested in
3800 <rdar://problem/3752791> Dashboard: Need a better solution for control regions
3802 This patch implements the CSS parsing necessary for dashboard regions.
3803 Here's an example of the syntax we support:
3807 -apple-dashboard-region:
3808 dashboard-region-circle(control 0 0 80 0)
3809 dashboard-region-rectangle(control,20,0,20,0)
3810 dashboard-region-circle(control 80 0 0 0);
3815 Part 2 will determine the appropriate regions.
3819 * khtml/css/css_valueimpl.cpp:
3820 (CSSPrimitiveValueImpl::CSSPrimitiveValueImpl):
3821 * khtml/css/css_valueimpl.h:
3822 (DOM::CSSPrimitiveValueImpl::):
3823 (DOM::DashboardRegionImpl::DashboardRegionImpl):
3824 (DOM::DashboardRegionImpl::~DashboardRegionImpl):
3825 (DOM::DashboardRegionImpl::setNext):
3826 (DOM::DashboardRegionImpl::setLabel):
3827 * khtml/css/cssparser.cpp:
3828 (CSSParser::parseValue):
3829 (CSSParser::parseContent):
3830 (skipCommaInDashboardRegion):
3831 (CSSParser::parseDashboardRegions):
3832 * khtml/css/cssparser.h:
3833 * khtml/css/cssproperties.c:
3836 * khtml/css/cssproperties.h:
3837 * khtml/css/cssproperties.in:
3838 * khtml/dom/css_value.h:
3839 (DOM::CSSPrimitiveValue::):
3841 2004-09-16 Darin Adler <darin@apple.com>
3843 - fixed caret-drawing regression from my last patch
3845 * khtml/xml/dom_selection.cpp:
3846 (DOM::Selection::xPosForVerticalArrowNavigation): Pass false, meaning "vertical line caret"
3847 rather than true meaning "big box for overtyping".
3848 (DOM::Selection::layoutCaret): Ditto.
3850 2004-09-16 Darin Adler <darin@apple.com>
3854 - fixed <rdar://problem/3803280> crash in selectAll on page with no contents
3856 * khtml/khtml_part.cpp: (KHTMLPart::selectAll): Handle case of 0 for documentElement().
3857 * khtml/xml/dom_position.cpp:
3858 (DOM::Position::previousWordPosition): Ditto.
3859 (DOM::Position::nextWordPosition): Ditto.
3861 - cleaned up caret code
3862 - changed DOM::Selection to use CaretPosition more
3864 * khtml/rendering/render_box.cpp: (RenderBox::caretRect): Change to use empty rectangles
3865 instead of an X value of -1 to mean no rectangle.
3866 * khtml/rendering/render_image.cpp: (RenderImage::selectionRect): Take advantage of the
3867 fixed QRect constructor.
3868 * khtml/rendering/render_object.cpp: (RenderObject::caretRect): Change to use empty
3869 rectangle instead of an X value of -1 to mean no rectangle.
3870 * khtml/rendering/render_text.cpp: (RenderText::caretRect): Cleaned up, and changed to use
3871 an empty rectangle instead of an X value of -1 to mean no rectangle.
3873 * khtml/xml/dom_caretposition.h: Made conversion from Position to CaretPosition something you
3874 can do implicitly, since it's an unambiguous conversion. Conversion in the other direction
3875 needs to be done explicitly. Moved EIncludeLineBreak here, and added startParagraphBoundary
3876 and endParagraphBoundary functions.
3877 * khtml/xml/dom_caretposition.cpp:
3878 (DOM::startParagraphBoundary): Added. Replaces, and made from, member function of DOM::Position.
3879 (DOM::endParagraphBoundary): Ditto.
3881 * khtml/xml/dom_position.h: Removed EIncludeLineBreak and startParagraphBoundary and
3882 endParagraphBoundary.
3883 * khtml/xml/dom_position.cpp: Removed startParagraphBoundary and endParagraphBoundary.