1 2004-10-25 Ken Kocienda <kocienda@apple.com>
5 Oops. These two test results changed with my last checkin, for the better.
7 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
8 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
10 2004-10-25 Ken Kocienda <kocienda@apple.com>
16 <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
18 * khtml/editing/htmlediting.cpp:
19 (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
20 expand the selection outwards when the selection is on the visible boundary of a root
21 editable element. This fixes the bug. Note that this function also contains a little code
22 I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
23 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
24 (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
25 * khtml/editing/htmlediting.h: Declare new helpers.
26 * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
27 * layout-tests/editing/deleting/delete-select-all-001.html: Added.
28 * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
29 * layout-tests/editing/deleting/delete-select-all-002.html: Added.
30 * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
31 * layout-tests/editing/deleting/delete-select-all-003.html: Added.
33 2004-10-25 Ken Kocienda <kocienda@apple.com>
37 Added some more editing layout tests.
39 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
40 * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
41 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
42 * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
43 * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
44 * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
45 * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
46 * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
47 * layout-tests/editing/inserting/typing-003-expected.txt: Added.
48 * layout-tests/editing/inserting/typing-003.html: Added.
50 2004-10-25 Ken Kocienda <kocienda@apple.com>
54 * khtml/rendering/bidi.cpp:
55 (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
56 yesterday quite right: words that should have been placed on the next line were instead
57 appearing on the line before, beyond the right margin. This was a one-word only error
58 based on moving the line break object when it should have stayed put. Here is the rule:
59 The line break object only moves to after the whitespace on the end of a line if that
60 whitespace caused line overflow when its width is added in.
62 2004-10-25 Adele Amchan <adele@apple.com>
66 Fix for <rdar://problem/3619890> Feature request: designMode
68 This change implements the designMode property of a document. This is an IE property that is also supported by Mozilla.
69 This will enable more JS editing compatibility.
71 * khtml/ecma/kjs_html.cpp:
72 (KJS::HTMLDocument::tryGet): added case for designMode
73 (KJS::HTMLDocument::putValue): added case for designMode
74 * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
75 * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
76 * khtml/xml/dom_docimpl.cpp:
77 (DocumentImpl::DocumentImpl): initialize m_designMode member variable
78 (DocumentImpl::setDesignMode): added function to assign m_designMode value
79 (DocumentImpl::getDesignMode): return m_designMode value
80 (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value.
81 Otherwise, it will just return the m_designMode value.
82 (DocumentImpl::parentDocument):
83 * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
84 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
86 2004-10-22 Ken Kocienda <kocienda@apple.com>
92 <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
94 * khtml/editing/htmlediting.cpp:
95 (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
96 everything that could be affected.
97 (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
98 braces, making it act as a comma operator, with a zero value as the right value!!! This made
99 an important check always fail!!! It turns out that we do not want the constant at all, since
100 that constant is only needed when checking a computed style, not an inline style as is being
102 (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
103 (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
104 RangeImpl::compareBoundaryPoints to perform the required check.
105 * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
107 2004-10-22 Ken Kocienda <kocienda@apple.com>
113 <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
114 <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
116 * khtml/rendering/bidi.cpp:
117 (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
118 it is when we are editing, add in the space of the current character when calculating the width
119 of committed plus uncommitted characters. If this value exceeds the width of the line, move up
120 the line break object and call skipWhitespace to move past the end of the whitespace.
124 2004-10-22 Ken Kocienda <kocienda@apple.com>
128 * WebCore.pbproj/project.pbxproj:
129 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
131 2004-10-21 David Hyatt <hyatt@apple.com>
135 Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
137 <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
138 <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
140 * khtml/rendering/render_block.cpp:
141 (khtml::getInlineRun):
142 (khtml::RenderBlock::makeChildrenNonInline):
144 2004-10-21 David Hyatt <hyatt@apple.com>
146 Fix for 3810389, crash because of continuation() craziness. Revert back to the old behavior of
147 making sure that all line boxes get deleted and recreated when inlines are split because of a block.
151 * khtml/rendering/render_inline.cpp:
152 (RenderInline::splitFlow):
154 2004-10-21 Ken Kocienda <kocienda@apple.com>
158 Significant improvement to the way that whitespace is handled during editing.
160 * khtml/editing/htmlediting.cpp:
161 (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
162 two being added with this name) that delete "insignificant" unrendered text.
163 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
164 calculates the downstream position to use as the endpoint for the deletion, and
165 then calls deleteInsignificantText with this start and end.
166 (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
167 (khtml::InputNewlineCommand::doApply): Ditto.
168 (khtml::InputTextCommand::input): Ditto.
169 * khtml/editing/htmlediting.h: Add new declarations.
171 Modified layout test results:
172 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
173 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
174 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
175 * layout-tests/editing/deleting/delete-selection-001-expected.txt:
176 * layout-tests/editing/deleting/delete-tab-001-expected.txt:
177 * layout-tests/editing/deleting/delete-tab-004-expected.txt:
178 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
179 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
180 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
181 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
182 * layout-tests/editing/inserting/insert-br-001-expected.txt:
183 * layout-tests/editing/inserting/insert-br-004-expected.txt:
184 * layout-tests/editing/inserting/insert-br-005-expected.txt:
185 * layout-tests/editing/inserting/insert-br-006-expected.txt:
186 * layout-tests/editing/inserting/insert-tab-001-expected.txt:
187 * layout-tests/editing/inserting/insert-tab-002-expected.txt:
188 * layout-tests/editing/inserting/insert-tab-004-expected.txt:
189 * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
190 * layout-tests/editing/inserting/typing-001-expected.txt:
191 * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
192 * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
193 * layout-tests/editing/style/typing-style-003-expected.txt:
194 * layout-tests/editing/undo/redo-typing-001-expected.txt:
195 * layout-tests/editing/undo/undo-typing-001-expected.txt:
197 2004-10-21 David Hyatt <hyatt@apple.com>
199 Fix for 3847054, assertion failure in RenderText::layout() on news.com page. Fix getInlineRun so that
200 it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
204 * khtml/rendering/render_block.cpp:
205 (khtml::getInlineRun):
207 2004-10-20 David Hyatt <hyatt@apple.com>
209 Add better dumping of overflow information for scrolling regions.
211 Fix for 3726524, crash in updateLayerPosition. Make sure anonymous elements properly remove themselves
212 from the render tree so that layers and so forth are cleaned up.
216 * khtml/rendering/render_container.cpp:
217 (RenderContainer::detach):
218 * khtml/rendering/render_layer.h:
219 (khtml::RenderLayer::scrollXOffset):
220 (khtml::RenderLayer::scrollYOffset):
221 * kwq/KWQRenderTreeDebug.cpp:
224 2004-10-20 David Hyatt <hyatt@apple.com>
226 Fix for 3791146, make sure all lines are checked when computing overflow.
230 * khtml/rendering/bidi.cpp:
231 (khtml::RenderBlock::computeHorizontalPositionsForLine):
232 (khtml::RenderBlock::layoutInlineChildren):
233 (khtml::RenderBlock::findNextLineBreak):
234 (khtml::RenderBlock::checkLinesForOverflow):
235 * khtml/rendering/render_block.h:
237 2004-10-20 David Hyatt <hyatt@apple.com>
239 Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
243 * khtml/rendering/break_lines.cpp:
244 (khtml::isBreakable):
246 2004-10-20 Darin Adler <darin@apple.com>
250 - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
252 * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
253 Create a palette with the background and foreground colors in it and set it on the widget.
255 * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
256 with APPLE_CHANGES. Removed palette and palette-related function members.
257 * khtml/rendering/render_style.cpp:
258 (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
259 (RenderStyle::diff): No palette to compare.
261 * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
262 * kwq/KWQLineEdit.mm:
263 (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
264 (QLineEdit::text): Made const.
266 * kwq/KWQTextEdit.h: Added setPalette override.
267 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
270 * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
271 per color group, and only a single color group per palette.
272 * kwq/KWQColorGroup.mm: Removed.
273 * kwq/KWQPalette.mm: Removed.
274 * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
276 * kwq/KWQApplication.h: Removed unused palette function.
277 * kwq/KWQApplication.mm: Ditto.
279 * kwq/KWQWidget.h: Removed unsetPalette.
280 * kwq/KWQWidget.mm: Ditto.
284 * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
285 Roll in storage leak fix from KDE guys.
287 2004-10-19 David Hyatt <hyatt@apple.com>
291 More cleanup of block layout. Eliminates the separate step for tables that dont fit on a line with a float
292 and consolidates it with clearing.
294 Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
296 * khtml/rendering/render_block.cpp:
297 (khtml::getInlineRun):
298 (khtml::RenderBlock::layoutBlock):
299 (khtml::RenderBlock::adjustFloatingBlock):
300 (khtml::RenderBlock::collapseMargins):
301 (khtml::RenderBlock::clearFloatsIfNeeded):
302 (khtml::RenderBlock::estimateVerticalPosition):
303 (khtml::RenderBlock::layoutBlockChildren):
304 (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
305 (khtml::RenderBlock::getClearDelta):
306 (khtml::RenderBlock::calcBlockMinMaxWidth):
307 * khtml/rendering/render_block.h:
308 * khtml/rendering/render_frames.cpp:
309 (RenderFrameSet::layout):
310 * khtml/xml/dom_textimpl.cpp:
311 (TextImpl::rendererIsNeeded):
313 Fix for 3841060, regression with * in frames. Reviewed by kocienda.
315 * layout-tests/fast/frames/002-expected.txt: Added.
316 * layout-tests/fast/frames/002.html: Added.
318 2004-10-19 Darin Adler <darin@apple.com>
322 - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
324 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
325 scripts being loaded here. If the current code being run is the external script itself, then we don't want
326 to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
327 assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
328 wrong since there can be a script loading in that case too. Layout tests check for both problems.
330 * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
331 * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
332 * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
334 * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
336 2004-10-18 Darin Adler <darin@apple.com>
338 Reviewed by Dave Hyatt.
340 - 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)
342 * khtml/html/htmltokenizer.cpp:
343 (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
344 (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
345 we only want to look at loadingExtScript if m_executingScript is 0.
347 2004-10-18 Ken Kocienda <kocienda@apple.com>
353 <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
355 * khtml/css/css_valueimpl.cpp:
356 (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
357 Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the
358 lifecycle issues associated with creating a string to be returned in the ident case.
359 * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
360 * khtml/css/cssstyleselector.cpp:
361 (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
363 2004-10-18 Chris Blumenberg <cblu@apple.com>
365 Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
367 Reviewed by kocienda.
369 * khtml/rendering/render_frames.cpp:
370 (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
372 2004-10-15 Chris Blumenberg <cblu@apple.com>
374 Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
379 (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
382 2004-10-15 Ken Kocienda <kocienda@apple.com>
386 * khtml/rendering/bidi.cpp:
387 (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
388 skipping after a clean line break, in addition to the cases already
390 * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
391 * layout-tests/editing/inserting/insert-br-007.html: Added.
392 * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
393 * layout-tests/editing/inserting/insert-br-008.html: Added.
397 2004-10-14 Ken Kocienda <kocienda@apple.com>
403 <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
405 * khtml/editing/visible_position.cpp:
406 (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
407 position code to new-style VisiblePosition code. In retrospect, this code was misguided.
408 Since we do a good job of insulating external code from the internal workings of
409 VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
410 in the case of this bug, was doing harm. Simply removing this code makes the bug
411 go away and does not cause any editing layout test regresssions.
413 2004-10-14 Ken Kocienda <kocienda@apple.com>
417 * khtml/rendering/bidi.cpp:
418 (khtml::skipNonBreakingSpace): New helper.
419 (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
420 at the start of a block. This was preventing users from typing spaces in empty
422 * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
423 * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
425 2004-10-14 Adele Amchan <adele@apple.com>
427 Reviewed by Darin and Ken.
429 fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
431 This change shifts some code around so that the code that determines what typing style
432 is in effect is called before deleteUnrenderedText is called. Two asserts are also added
433 to ensure that start and end nodes of the selection are in the document.
435 * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
437 2004-10-14 Adele Amchan <adele@apple.com>
441 This change makes these three functions virtual so that the work is being done in KWQHTMLPart
442 instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
444 * khtml/khtml_part.cpp:
445 (KHTMLPart::shouldBeginEditing):
446 (KHTMLPart::shouldEndEditing):
447 (KHTMLPart::isContentEditable):
448 * khtml/khtml_part.h:
449 * kwq/KWQKHTMLPart.h:
451 2004-10-14 Ken Kocienda <kocienda@apple.com>
455 Final fix for these bugs:
457 <rdar://problem/3806306> HTML editing puts spaces at start of line
458 <rdar://problem/3814252> HTML editing groups space with word causing wrapping
460 This change sets some new CSS properties that have been added to WebCore to
461 enable whitespace-handling and line-breaking features that make WebView work
462 more like a text editor.
464 * khtml/css/cssstyleselector.cpp:
465 (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties
466 based on property value.
467 * khtml/html/html_elementimpl.cpp:
468 (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties
469 based on attribute value.
470 * khtml/khtml_part.cpp:
471 (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
473 (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
475 (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
476 (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
477 * khtml/khtml_part.h: Add new declarations.
478 * kwq/WebCoreBridge.h: Ditto.
479 * kwq/WebCoreBridge.mm:
480 (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
481 (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
482 (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
483 (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
485 2004-10-14 John Sullivan <sullivan@apple.com>
489 - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
491 * khtml/editing/htmlediting.cpp:
492 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
493 needed a nil check to handle empty document case
495 2004-10-13 Maciej Stachowiak <mjs@apple.com>
499 <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
501 - I fixed this by turning off all colormatching for WebKit
502 content. We might turn it back on later. For now, it's possible to
503 turn it on temporarily by defining COLORMATCH_EVERYTHING.
506 * khtml/ecma/kjs_html.cpp:
507 (KJS::Context2DFunction::tryCall):
508 (Context2D::colorRefFromValue):
509 (Gradient::getShading):
510 * khtml/rendering/render_canvasimage.cpp:
511 (RenderCanvasImage::createDrawingContext):
513 (QColor::getNSColor):
516 (CGColorFromNSColor):
517 (QPainter::selectedTextBackgroundColor):
518 (QPainter::rgbColorSpace):
519 (QPainter::grayColorSpace):
520 (QPainter::cmykColorSpace):
521 * kwq/WebCoreGraphicsBridge.h:
522 * kwq/WebCoreGraphicsBridge.m:
523 (-[WebCoreGraphicsBridge createRGBColorSpace]):
524 (-[WebCoreGraphicsBridge createGrayColorSpace]):
525 (-[WebCoreGraphicsBridge createCMYKColorSpace]):
527 2004-10-13 Ken Kocienda <kocienda@apple.com>
531 * khtml/css/css_valueimpl.cpp:
532 (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
533 is non-null before appending.
535 2004-10-13 Ken Kocienda <kocienda@apple.com>
539 Update expected results for improved behavior as a result of fix to 3816768.
541 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
542 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
543 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
545 2004-10-13 Ken Kocienda <kocienda@apple.com>
549 * khtml/css/css_computedstyle.cpp:
550 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
551 for getting -khtml-line-break and -khml-nbsp-mode.
553 2004-10-13 Ken Kocienda <kocienda@apple.com>
559 <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly
560 moves caret out of block.
562 The issue here is that an empty block with no explicit height set by style collapses
563 to zero height, and does so immediately after the last bit of content is removed from
564 it (as a result of deleting text with the delete key for instance). Since zero-height
565 blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
567 The fix is to detect when a block has not been removed itself, but has had all its
568 contents removed. In this case, a BR element is placed in the block, one that is
569 specially marked as a placeholder. Later, if the block ever receives content, this
570 placeholder is removed.
572 * khtml/editing/htmlediting.cpp:
573 (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
574 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
575 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
576 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
577 Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong
578 (it's very clear that we needs to be able to move more than just text nodes). This may expose
579 bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
580 made the test case in the bug work.
581 (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
582 removeBlockPlaceholderIfNeeded.
583 (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
584 (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
585 * khtml/editing/htmlediting.h: Declare new functions.
587 2004-10-13 Richard Williamson <rjw@apple.com>
589 Added support for -apple-dashboard-region:none. And fixed
590 a few computed style problems.
592 Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
595 * khtml/css/css_computedstyle.cpp:
596 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
597 * khtml/css/css_valueimpl.cpp:
598 (CSSPrimitiveValueImpl::cssText):
599 * khtml/css/cssparser.cpp:
600 (CSSParser::parseValue):
601 (CSSParser::parseDashboardRegions):
602 * khtml/css/cssstyleselector.cpp:
603 (khtml::CSSStyleSelector::applyProperty):
604 * khtml/rendering/render_style.cpp:
605 (RenderStyle::noneDashboardRegions):
606 * khtml/rendering/render_style.h:
607 * kwq/KWQKHTMLPart.mm:
608 (KWQKHTMLPart::dashboardRegionsDictionary):
610 2004-10-13 David Hyatt <hyatt@apple.com>
612 Rework block layout to clean it up and simplify it (r=kocienda).
614 Also fixing the style sharing bug (r=mjs).
616 * khtml/rendering/render_block.cpp:
617 (khtml::RenderBlock::MarginInfo::MarginInfo):
618 (khtml::RenderBlock::layoutBlock):
619 (khtml::RenderBlock::adjustPositionedBlock):
620 (khtml::RenderBlock::adjustFloatingBlock):
621 (khtml::RenderBlock::handleSpecialChild):
622 (khtml::RenderBlock::handleFloatingOrPositionedChild):
623 (khtml::RenderBlock::handleCompactChild):
624 (khtml::RenderBlock::insertCompactIfNeeded):
625 (khtml::RenderBlock::handleRunInChild):
626 (khtml::RenderBlock::collapseMargins):
627 (khtml::RenderBlock::clearFloatsIfNeeded):
628 (khtml::RenderBlock::estimateVerticalPosition):
629 (khtml::RenderBlock::determineHorizontalPosition):
630 (khtml::RenderBlock::setCollapsedBottomMargin):
631 (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
632 (khtml::RenderBlock::handleBottomOfBlock):
633 (khtml::RenderBlock::layoutBlockChildren):
634 (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
635 (khtml::RenderBlock::addOverHangingFloats):
636 * khtml/rendering/render_block.h:
637 (khtml::RenderBlock::maxTopMargin):
638 (khtml::RenderBlock::maxBottomMargin):
639 (khtml::RenderBlock::CompactInfo::compact):
640 (khtml::RenderBlock::CompactInfo::block):
641 (khtml::RenderBlock::CompactInfo::matches):
642 (khtml::RenderBlock::CompactInfo::clear):
643 (khtml::RenderBlock::CompactInfo::set):
644 (khtml::RenderBlock::CompactInfo::CompactInfo):
645 (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
646 (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
647 (khtml::RenderBlock::MarginInfo::clearMargin):
648 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
649 (khtml::RenderBlock::MarginInfo::setTopQuirk):
650 (khtml::RenderBlock::MarginInfo::setBottomQuirk):
651 (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
652 (khtml::RenderBlock::MarginInfo::setPosMargin):
653 (khtml::RenderBlock::MarginInfo::setNegMargin):
654 (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
655 (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
656 (khtml::RenderBlock::MarginInfo::setMargin):
657 (khtml::RenderBlock::MarginInfo::atTopOfBlock):
658 (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
659 (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
660 (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
661 (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
662 (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
663 (khtml::RenderBlock::MarginInfo::quirkContainer):
664 (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
665 (khtml::RenderBlock::MarginInfo::topQuirk):
666 (khtml::RenderBlock::MarginInfo::bottomQuirk):
667 (khtml::RenderBlock::MarginInfo::posMargin):
668 (khtml::RenderBlock::MarginInfo::negMargin):
669 (khtml::RenderBlock::MarginInfo::margin):
670 * khtml/rendering/render_box.cpp:
671 (RenderBox::calcAbsoluteVertical):
672 * khtml/rendering/render_box.h:
673 (khtml::RenderBox::marginTop):
674 (khtml::RenderBox::marginBottom):
675 (khtml::RenderBox::marginLeft):
676 (khtml::RenderBox::marginRight):
677 * khtml/rendering/render_image.cpp:
678 (RenderImage::setImage):
679 * khtml/rendering/render_object.cpp:
680 (RenderObject::sizesToMaxWidth):
681 * khtml/rendering/render_object.h:
682 (khtml::RenderObject::collapsedMarginTop):
683 (khtml::RenderObject::collapsedMarginBottom):
684 (khtml::RenderObject::maxTopMargin):
685 (khtml::RenderObject::maxBottomMargin):
686 (khtml::RenderObject::marginTop):
687 (khtml::RenderObject::marginBottom):
688 (khtml::RenderObject::marginLeft):
689 (khtml::RenderObject::marginRight):
690 * khtml/rendering/render_text.h:
691 (khtml::RenderText::marginLeft):
692 (khtml::RenderText::marginRight):
693 * khtml/xml/dom_elementimpl.cpp:
694 (ElementImpl::recalcStyle):
696 2004-10-12 Ken Kocienda <kocienda@apple.com>
702 <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line
704 * khtml/editing/selection.cpp:
705 (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
706 This will make it seem like the run ends on the next line.
708 2004-10-12 Ken Kocienda <kocienda@apple.com>
714 <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages
716 * khtml/editing/htmlediting.cpp:
717 (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
718 row, section, or column.
719 (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
720 of table structure when doing deletes, rather than deleting the structure elements themselves.
721 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
722 of table structure. We may want to revisit this some day, but this seems like the best behavior
724 (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
726 * khtml/editing/htmlediting.h: Add declarations for new functions.
728 2004-10-12 Richard Williamson <rjw@apple.com>
730 Fixed access to DOM object via WebScriptObject API.
731 The execution context for DOM objects wasn't being found.
732 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
735 Fixed <rdar://problem/3831063> regions use left offset instead of top offset
738 * khtml/khtml_part.h:
739 * khtml/rendering/render_object.cpp:
740 (RenderObject::addDashboardRegions):
742 (-[DOMNode isContentEditable]):
743 (-[DOMNode KJS::Bindings::]):
744 * kwq/KWQKHTMLPart.h:
745 * kwq/KWQKHTMLPart.mm:
746 (KWQKHTMLPart::executionContextForDOM):
748 2004-10-12 Ken Kocienda <kocienda@apple.com>
754 <rdar://problem/3834779> Mail crashes when editing HTML message - khtml::Selection::layout()
756 * kwq/KWQKHTMLPart.mm:
757 (KWQKHTMLPart::styleForSelectionStart): Table code seems to be more robust when the call to
758 insert our style-checking node is done with an appendChild rather than an insertBefore. Note
759 that this table-related problem was exposed by fixing Selection::layout(), which I did
760 yesterday. This change simply improves things even more so that we do not crash in the
761 scenario described in the bug.
763 2004-10-11 Ken Kocienda <kocienda@apple.com>
767 This is a partial fix to this bug:
769 <rdar://problem/3832886> increase quote level on new mail document leads to immediate
770 crash in caret painting code
772 To eliminate the bad behavior for good, I have done some investigations in Mail code,
773 and I have sent a suggested code change on to Grant. Basically, Mail can't add empty
774 blocks (like blockquote elements used for quoting) to documents without giving those
775 blocks some content (so they have a height).
777 I added some other crash protections below.
779 * khtml/editing/selection.cpp:
780 (khtml::Selection::layout): Check for non-null position after calls to VisiblePosition, since
781 the VisiblePosition constructors may fail to find a visible spot in the document. Also, add
782 a couple position-has-renderer assertion checks.
783 * kwq/KWQKHTMLPart.mm:
784 (KWQKHTMLPart::styleForSelectionStart): Take out pos.isNotNull() assertion since VisiblePosition
785 may not yield a position. This assertion is a holdover from before we had VisiblePosition.
786 (KWQKHTMLPart::fontForSelection): Rearrange the code a little to deal with possible null results from
789 2004-10-11 Darin Adler <darin@apple.com>
793 - fixed <rdar://problem/3834230> empty table can result in division by 0
795 * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows):
796 Added 0 check; rolled in from KDE.
798 2004-10-11 Darin Adler <darin@apple.com>
802 - fixed <rdar://problem/3818712> form checkbox value property is read only
804 The underlying problem was that we were storing two separate values for all
805 form elements; one for the value property (JavaScript) and the other for the
806 value attribute (DOM). This is a good idea for text input, but not for other types.
808 * khtml/html/html_formimpl.h: Changed setValue to take a const DOMString reference.
809 Added private storesValueSeparateFromAttribute function.
810 * khtml/html/html_formimpl.cpp:
811 (DOM::HTMLInputElementImpl::setType): Handle type changes, including detaching and re-attaching
812 if type changed, and moving value from m_value to ATTR_VALUE and vice versa.
813 (DOM::HTMLInputElementImpl::type): Added a case for ISINDEX and moved the default out of the
814 switch so that we will get a warning if a type is left out.
815 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Tweaked comment format.
816 (DOM::HTMLInputElementImpl::reset): Changed to only nuke the value if the value property is stored
817 separately from the attribute. Otherwise, we just want to lave it alone
818 (DOM::HTMLInputElementImpl::value): Changed to always use m_value if it's not null, then fall back
819 on the attribute, and finally fall back to the "on" for the checkbox only if both are null.
820 (DOM::HTMLInputElementImpl::setValue): Changed to set the attribute unless the value property is
821 supposed to be stored separate from the attribute.
822 (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute): Added. Returns true for text-type
823 input elements, and false for the others.
825 2004-10-11 Darin Adler <darin@apple.com>
829 - fixed <rdar://problem/3296652> checkbox input type does not respond to onchange
831 * khtml/rendering/render_form.cpp:
832 (RenderFormElement::updateFromElement): Some new code, commented out, for form element colors.
833 (RenderCheckBox::slotStateChanged): Added call to onChange.
835 2004-10-11 Ken Kocienda <kocienda@apple.com>
839 Finish selection affinity implementation. This includes code to set the
840 affinity correctly when clicking with the mouse, and clearing the
841 affinity when altering the selection using any of the Selection object
844 Each instance of the positionForCoordinates, inlineBox and caretRect
845 functions have been changed to include an EAffinity argument to give results
846 which take this bit into account.
848 * khtml/editing/selection.cpp:
849 (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
850 (khtml::Selection::modifyAffinity): New function to compute affinity based on
851 modification constants.
852 (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
853 (khtml::Selection::modifyExtendingRightForward): Ditto.
854 (khtml::Selection::modifyMovingRightForward): Ditto.
855 (khtml::Selection::modifyExtendingLeftBackward): Ditto.
856 (khtml::Selection::modifyMovingLeftBackward): Ditto.
857 (khtml::Selection::modify): Support saving, restoring, and then calculating new
858 affinity value as needed.
859 (khtml::Selection::xPosForVerticalArrowNavigation):
860 (khtml::Selection::clear): Reset affinity to UPSTREAM.
861 (khtml::Selection::setBase): Ditto.
862 (khtml::Selection::setExtent): Ditto.
863 (khtml::Selection::setBaseAndExtent): Ditto.
864 (khtml::Selection::layout): Pass affinity to caretRect().
865 (khtml::Selection::validate): Pass along affinity parameter to new functions that
867 (khtml::startOfFirstRunAt): Changed the way that the y-coordinate search is done, to
868 keep this code working with changes made in selectionForLine().
869 (khtml::endOfLastRunAt): Ditto.
870 (khtml::selectionForLine): Make this function work for all renderers, not just text
872 * khtml/editing/selection.h:
873 (khtml::operator==): Consider affinity in equality check.
874 * khtml/editing/visible_units.cpp:
875 (khtml::previousLinePosition): Pass affinity argument to function so it can take this
876 information into account while processing.
877 (khtml::nextLinePosition): Ditto.
878 (khtml::previousParagraphPosition): Ditto.
879 (khtml::nextParagraphPosition): Ditto.
880 * khtml/editing/visible_units.h: Ditto, for each of the functions listed.
881 * khtml/khtml_events.cpp:
882 (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
883 as this function is being removed.
884 * khtml/khtml_part.cpp:
885 (KHTMLPart::isPointInsideSelection): Ditto.
886 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
887 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
888 (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
889 call to positionForCoordinates, and set resulting affinity on the selection.
890 (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on
891 NodeImpl::positionForCoordinates, as this function is being removed.
892 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
893 * khtml/rendering/render_block.cpp:
894 (khtml::RenderBlock::positionForCoordinates): Now takes an affinity argument.
895 * khtml/rendering/render_block.h:
896 * khtml/rendering/render_box.cpp:
897 (RenderBox::caretRect): Ditto.
898 * khtml/rendering/render_box.h:
899 * khtml/rendering/render_br.cpp:
900 (RenderBR::positionForCoordinates): Ditto.
901 (RenderBR::caretRect): Ditto.
902 (RenderBR::inlineBox): Ditto.
903 * khtml/rendering/render_br.h:
904 * khtml/rendering/render_container.cpp:
905 (RenderContainer::positionForCoordinates): Ditto.
906 * khtml/rendering/render_container.h:
907 * khtml/rendering/render_flow.cpp:
908 (RenderFlow::caretRect): Ditto.
909 * khtml/rendering/render_flow.h:
910 * khtml/rendering/render_inline.cpp:
911 (RenderInline::positionForCoordinates): Ditto.
912 * khtml/rendering/render_inline.h:
913 * khtml/rendering/render_object.cpp:
914 (RenderObject::caretRect): Ditto.
915 (RenderObject::positionForCoordinates): Ditto.
916 (RenderObject::inlineBox): Ditto.
917 * khtml/rendering/render_object.h:
918 * khtml/rendering/render_replaced.cpp:
919 (RenderReplaced::positionForCoordinates): Ditto.
920 * khtml/rendering/render_replaced.h:
921 * khtml/rendering/render_text.cpp:
922 (RenderText::positionForCoordinates): Ditto.
923 (firstRendererOnNextLine): New helper used by caretRect().
924 (RenderText::caretRect): Now takes an affinity argument.
925 (RenderText::inlineBox): Ditto.
926 * khtml/rendering/render_text.h:
927 * khtml/xml/dom_nodeimpl.cpp: Remove positionForCoordinates helper.
928 * khtml/xml/dom_nodeimpl.h: Ditto.
929 * khtml/xml/dom_position.cpp:
930 (DOM::Position::previousLinePosition): Now takes an affinity argument.
931 (DOM::Position::nextLinePosition): Ditto.
932 * khtml/xml/dom_position.h:
933 * kwq/WebCoreBridge.h:
934 * kwq/WebCoreBridge.mm:
935 (-[WebCoreBridge caretRectAtNode:offset:affinity:]): Ditto.
936 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
937 (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on
938 NodeImpl::positionForCoordinates, as this function is being removed.
940 2004-10-11 Darin Adler <darin@apple.com>
944 - fixed <rdar://problem/3670280> scroll position on overflowed textareas resets when leaving the tab
946 * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView becomeFirstResponder]):
947 Scroll to reveal the text area, don't scroll to reveal the text view itself.
948 Scrolling the text view ended up putting it at the top left, regardless of
949 where the insertion point is.
951 2004-10-11 Darin Adler <darin@apple.com>
955 - fixed <rdar://problem/3831546> More text is copied than is visually selected
957 The bug here is that upstream was moving a position too far.
959 * khtml/xml/dom_position.cpp:
960 (DOM::Position::upstream): Use the "deep equivalent" node rather than the original node passed
961 in for various checks. Also use local variables a bit more for slightly more efficiency.
962 (DOM::Position::downstream): Ditto.
964 2004-10-11 Darin Adler <darin@apple.com>
968 - fixed <rdar://problem/3833841> adding an event listener for keypress events does not work
970 * khtml/xml/dom2_eventsimpl.h: Added numEventIds and made typeToId take a const DOMString &.
971 * khtml/xml/dom2_eventsimpl.cpp:
972 (EventImpl::typeToId): Changed to use table. Added "keypress", otherwise, the same as before.
973 (EventImpl::idToType): Changed to use table.
975 2004-10-10 John Sullivan <sullivan@apple.com>
977 - fixed <rdar://problem/3664375> repro crash in -[KWQAccObject accessibilityAttributeNames]
979 (-[KWQAccObject accessibilityActionNames]):
980 check for nil m_renderer
982 2004-10-09 Darin Adler <darin@apple.com>
986 - fixed <rdar://problem/3828147> REGRESSION: textareas with wrap="off" show their contents in a thin vertical line of text
988 * kwq/KWQTextArea.h: Added setTextColor and setBackgroundColor methods. This is really for another fix
989 I'm landing later, but it does no harm to add these now.
990 * kwq/KWQTextArea.mm:
991 (-[KWQTextArea _configureTextViewForWordWrapMode]): Set the container size after changing the flag that
992 determines if the width tracks the text view. Otherwise, we won't successfully set the width in the case
993 where we don't want it to track the text view. This caused the bug.
994 (-[KWQTextArea _createTextView]): Remove unneeded call to setMaxSize. The above method already does that.
995 (-[KWQTextArea setTextColor:]): Added.
996 (-[KWQTextArea setBackgroundColor:]): Added.
998 2004-10-09 Darin Adler <darin@apple.com>
1002 - fixed <rdar://problem/3829452> REGRESSION (156-157): onload handler doesn't run on page with meta refresh of 0 duration (new Apple start page)
1004 The fix for <rdar://problem/3773150> made it so <meta> redirects prevent tokenizing the rest of the page.
1005 This is incorrect; the reason the JavaScript-triggered loads prevent tokenizing is that they take place
1006 "right away" in other browsers, but that is not true of <meta> redirect. We fixed this by using a separate
1007 call for <meta> redirect and not preventing tokenizing when that's in effect.
1009 * khtml/khtml_part.h: Removed userGesture parameter from scheduleRedirection. Renamed
1010 isImmediateRedirectPending to isScheduledLocationChangePending. Added scheduleLocationChange.
1011 * khtml/khtml_part.cpp:
1012 (KHTMLPart::openURL): Updated for new constant name.
1013 (KHTMLPart::scheduleRedirection): Removed now-unneeded userGesture parameter, and removed code that
1014 does the special case for redirection during load; a <meta> refresh can never be one of those special
1015 redirects during a load because it redirects the frame itself, not another frame. Also tightened up
1016 the logic by always stopping the redirect timer even if we aren't restarting it.
1017 (KHTMLPart::scheduleLocationChange): Added. Like scheduleRedirection, but with a different constant
1018 so we can tell it apart and always a delay of 0. The "redirection during load" case was moved in here
1019 and renamed to locationChangeScheduledDuringLoad.
1020 (KHTMLPart::isScheduledLocationChangePending): Renamed from isImmediateRedirectPending. This now
1021 returns true only for location changes and history navigation, not <meta> redirects.
1022 (KHTMLPart::scheduleHistoryNavigation): Tightened up logic to do the stop() outside the if as above,
1023 and got rid of a silly timer delay computation that always resulted in 0.
1025 * khtml/khtmlpart_p.h: Added a new value to the RedirectionScheduled enum for scheduleLocationChange
1026 and also renamed one of the existing values.
1028 * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::write): Changed to use isScheduledLocationChangePending instead
1029 of isImmediateRedirectPending, because we do want to continue tokenizing if it's actually a redirect.
1031 * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Changed to call the new scheduleLocationChange
1032 instead of calling scheduleRedirection with delay of 0.
1033 * khtml/ecma/kjs_window.cpp:
1034 (Window::put): Ditto.
1035 (WindowFunc::tryCall): Ditto.
1036 (Location::put): Ditto.
1037 (LocationFunc::tryCall): Ditto.
1039 2004-10-09 Darin Adler <darin@apple.com>
1043 - 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
1045 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::click): Use 0,0 for the coordinates.
1047 2004-10-09 Darin Adler <darin@apple.com>
1051 - fixed <rdar://problem/3804665> REGRESSION: WebCore framework now has many init routines
1053 * khtml/xml/dom_nodeimpl.h: Changed anyQName declaration to not use the inline function
1054 makeId. Surprisingly, the inline function was not "constant-folded" and we ended up with
1055 a copy of the function in each file as an init routine for the framework.
1057 * khtml/ecma/kjs_html.cpp: (Gradient::colorStops): Get rid of initialized ColorStop
1058 globals; their constructors were showing up as init routines for the framework.
1060 * khtml/rendering/render_style.h: Got rid of inline initialDashboardRegions function.
1061 * khtml/rendering/render_style.cpp: (RenderStyle::initialDashboardRegions): Made this
1062 a normal function. When it was an inline function, the constructors for the per-file
1063 copies of the globals were showing up as init routines for the framework.
1065 2004-10-09 Chris Blumenberg <cblu@apple.com>
1068 <rdar://problem/3625352> up and down arrow and page up/down keys don't work to scroll overflow:auto/scroll/overlay areas
1069 <rdar://problem/3397658> scroll wheel does not work to scroll overflow:auto/scroll/overlay areas (RSS)
1070 <rdar://problem/3822027> REGRESSION (Mail): When selection moves out of visible area, should center as NSText does
1072 Reviewed by hyatt, kocienda.
1074 * khtml/rendering/render_layer.cpp:
1075 (RenderLayer::scroll): new
1076 * khtml/rendering/render_layer.h:
1077 * khtml/rendering/render_object.cpp:
1078 (RenderObject::scroll): new
1079 * khtml/rendering/render_object.h:
1080 * kwq/KWQKHTMLPart.h:
1081 * kwq/KWQKHTMLPart.mm:
1082 (KWQKHTMLPart::scrollOverflow): new
1083 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent): new
1084 (KWQKHTMLPart::khtmlMousePressEvent): store pressed node so we know where the focus is
1085 * kwq/KWQScrollBar.h:
1086 * kwq/KWQScrollBar.mm:
1087 (QScrollBar::setValue): return a bool
1088 (QScrollBar::scrollbarHit): ditto
1089 (QScrollBar::scroll): new
1090 * kwq/WebCoreBridge.h:
1091 * kwq/WebCoreBridge.mm:
1092 (-[WebCoreBridge scrollOverflowInDirection:granularity:]): new
1093 (-[WebCoreBridge scrollOverflowWithScrollWheelEvent:]): new
1094 (-[WebCoreBridge ensureSelectionVisible]): visually center the extent of the selection
1096 2004-10-06 David Hyatt <hyatt@apple.com>
1098 Back out style sharing perf fix.
1100 * khtml/css/cssstyleselector.cpp:
1101 (khtml::CSSStyleSelector::locateCousinList):
1102 (khtml::CSSStyleSelector::canShareStyleWithElement):
1103 (khtml::CSSStyleSelector::locateSharedStyle):
1104 * khtml/css/cssstyleselector.h:
1105 * khtml/html/html_elementimpl.h:
1106 (DOM::HTMLElementImpl::inlineStyleDecl):
1107 * khtml/xml/dom_elementimpl.cpp:
1108 (ElementImpl::recalcStyle):
1109 * khtml/xml/dom_elementimpl.h:
1113 2004-10-05 David Hyatt <hyatt@apple.com>
1115 Fix a bug in the iteration of locateCousinList and clean up the style sharing stats code.
1117 * khtml/css/cssstyleselector.cpp:
1118 (khtml::CSSStyleSelector::locateCousinList):
1119 (khtml::CSSStyleSelector::elementsCanShareStyle):
1120 (khtml::CSSStyleSelector::locateSharedStyle):
1121 (khtml::CSSStyleSelector::styleForElement):
1123 2004-10-05 Ken Kocienda <kocienda@apple.com>
1127 * khtml/rendering/bidi.cpp:
1128 (khtml::RenderBlock::computeHorizontalPositionsForLine): Fix coding mistake that
1129 broke layout tests involving compacts.
1131 2004-10-05 Ken Kocienda <kocienda@apple.com>
1135 Finish selection affinity implementation. This includes code to set the
1136 affinity correctly when clicking with the mouse, and clearing the
1137 affinity when altering the selection using any of the Selection object
1140 Each instance of the positionForCoordinates function in the render tree
1141 has been changed to include an EAffinity argument. It is now the job of this
1142 function to set the selection affinity.
1144 * khtml/editing/selection.cpp:
1145 (khtml::Selection::moveTo): Set affinity to DOWNSTREAM.
1146 (khtml::Selection::modify): Ditto.
1147 (khtml::Selection::clear): Ditto.
1148 (khtml::Selection::setBase): Ditto.
1149 (khtml::Selection::setExtent): Ditto.
1150 (khtml::Selection::setBaseAndExtent): Ditto.
1151 * khtml/editing/selection.h:
1152 (khtml::operator==): Consider affinity in equality check.
1153 * khtml/khtml_events.cpp:
1154 (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
1155 as this function is being removed.
1156 * khtml/khtml_part.cpp:
1157 (KHTMLPart::isPointInsideSelection): Ditto.
1158 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
1159 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1160 (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
1161 call to positionForCoordinates, and set resulting affinity on the selection.
1162 (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on
1163 NodeImpl::positionForCoordinates, as this function is being removed.
1164 (KHTMLPart::khtmlMouseReleaseEvent):
1165 * khtml/rendering/render_block.cpp:
1166 (khtml::RenderBlock::positionForCoordinates): Changed, as described above.
1167 * khtml/rendering/render_block.h:
1168 * khtml/rendering/render_br.cpp:
1169 (RenderBR::positionForCoordinates): Ditto.
1170 * khtml/rendering/render_br.h:
1171 * khtml/rendering/render_container.cpp:
1172 (RenderContainer::positionForCoordinates): Ditto.
1173 * khtml/rendering/render_container.h:
1174 * khtml/rendering/render_inline.cpp:
1175 (RenderInline::positionForCoordinates): Ditto.
1176 * khtml/rendering/render_inline.h:
1177 * khtml/rendering/render_object.cpp:
1178 (RenderObject::positionForCoordinates): Ditto.
1179 * khtml/rendering/render_object.h:
1180 * khtml/rendering/render_replaced.cpp:
1181 (RenderReplaced::positionForCoordinates): Ditto.
1182 * khtml/rendering/render_replaced.h:
1183 * khtml/rendering/render_text.cpp:
1184 (RenderText::positionForCoordinates): Ditto.
1185 * khtml/rendering/render_text.h:
1186 * khtml/xml/dom_nodeimpl.cpp: Removed positionForCoordinates convenience.
1187 * khtml/xml/dom_nodeimpl.h: Ditto.
1188 * kwq/WebCoreBridge.mm:
1189 (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on
1190 NodeImpl::positionForCoordinates, as this function is being removed.
1192 2004-10-05 David Hyatt <hyatt@apple.com>
1194 Fix style sharing optimization to be fast again. Go back to using pointer comparisons when looking for
1199 * khtml/css/cssstyleselector.cpp:
1200 (khtml::CSSStyleSelector::locateCousinList):
1201 * khtml/rendering/render_object.cpp:
1202 (RenderObject::setStyleInternal):
1203 * khtml/rendering/render_object.h:
1204 * khtml/xml/dom_elementimpl.cpp:
1205 (ElementImpl::recalcStyle):
1207 2004-10-05 David Hyatt <hyatt@apple.com>
1209 Fix lists so that they properly participate in line layout as though they are text (when text bullets are
1210 used) and as images (when image bullets are used).
1212 Reviewed by kocienda
1214 * khtml/rendering/render_list.cpp:
1215 (RenderListMarker::createInlineBox):
1216 * khtml/rendering/render_list.h:
1217 (khtml::ListMarkerBox:::InlineBox):
1218 (khtml::ListMarkerBox::isText):
1220 2004-10-05 Ken Kocienda <kocienda@apple.com>
1224 Recent checkin adding upstreamDeepEquivalent had it backwards. The helper
1225 we want is downstreamDeepEquivalent, as the deepEquivalent function returns
1226 an upstream position.
1228 * khtml/editing/selection.cpp:
1229 (khtml::Selection::layout): DOWNSTREAM case now uses downstreamDeepEquivalent.
1230 UPSTREAM uses deepEquivalent.
1231 * khtml/editing/visible_position.cpp:
1232 (khtml::VisiblePosition::downstreamDeepEquivalent): New helper, replacing
1233 upstreamDeepEquivalent.
1234 * khtml/editing/visible_position.h
1236 2004-10-05 David Hyatt <hyatt@apple.com>
1238 New selection gap-filling architecture. Makes the gap-filling much more like NSTextView and puts the responsibility
1239 for gap-filling in the block. Fixes numerous bugs with selection drawing including bidi issues, incorrect old
1240 horizontal gap filling, and selection performance issues.
1242 Reviewed by kocienda
1244 * khtml/html/html_imageimpl.cpp:
1245 (HTMLImageLoader::notifyFinished):
1246 * khtml/misc/khtmllayout.h:
1247 (khtml::GapRects::left):
1248 (khtml::GapRects::center):
1249 (khtml::GapRects::right):
1250 (khtml::GapRects::uniteLeft):
1251 (khtml::GapRects::uniteCenter):
1252 (khtml::GapRects::uniteRight):
1253 (khtml::GapRects::unite):
1254 (khtml::GapRects::operator QRect):
1255 (khtml::GapRects::operator==):
1256 (khtml::GapRects::operator!=):
1257 * khtml/rendering/font.cpp:
1258 (Font::drawHighlightForText):
1259 * khtml/rendering/font.h:
1260 * khtml/rendering/render_block.cpp:
1261 (khtml:::RenderFlow):
1262 (khtml::RenderBlock::removeChild):
1263 (khtml::RenderBlock::paintObject):
1264 (khtml::RenderBlock::paintEllipsisBoxes):
1265 (khtml::RenderBlock::setSelectionState):
1266 (khtml::RenderBlock::shouldPaintSelectionGaps):
1267 (khtml::RenderBlock::isSelectionRoot):
1268 (khtml::RenderBlock::selectionGapRects):
1269 (khtml::RenderBlock::paintSelection):
1270 (khtml::RenderBlock::fillSelectionGaps):
1271 (khtml::RenderBlock::fillInlineSelectionGaps):
1272 (khtml::RenderBlock::fillBlockSelectionGaps):
1273 (khtml::RenderBlock::fillHorizontalSelectionGap):
1274 (khtml::RenderBlock::fillVerticalSelectionGap):
1275 (khtml::RenderBlock::fillLeftSelectionGap):
1276 (khtml::RenderBlock::fillRightSelectionGap):
1277 (khtml::RenderBlock::getHorizontalSelectionGapInfo):
1278 (khtml::RenderBlock::leftSelectionOffset):
1279 (khtml::RenderBlock::rightSelectionOffset):
1280 * khtml/rendering/render_block.h:
1281 (khtml::RenderBlock::hasSelectedChildren):
1282 (khtml::RenderBlock::selectionState):
1283 (khtml::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
1284 (khtml::RenderBlock::BlockSelectionInfo::rects):
1285 (khtml::RenderBlock::BlockSelectionInfo::state):
1286 (khtml::RenderBlock::BlockSelectionInfo::block):
1287 (khtml::RenderBlock::selectionRect):
1288 * khtml/rendering/render_box.cpp:
1289 (RenderBox::position):
1290 * khtml/rendering/render_br.cpp:
1291 (RenderBR::inlineBox):
1292 * khtml/rendering/render_br.h:
1293 (khtml::RenderBR::selectionRect):
1294 (khtml::RenderBR::paint):
1295 * khtml/rendering/render_canvas.cpp:
1296 (RenderCanvas::selectionRect):
1297 (RenderCanvas::setSelection):
1298 * khtml/rendering/render_canvasimage.cpp:
1299 (RenderCanvasImage::paint):
1300 * khtml/rendering/render_image.cpp:
1301 (RenderImage::paint):
1302 * khtml/rendering/render_image.h:
1303 * khtml/rendering/render_line.cpp:
1304 (khtml::InlineBox::nextLeafChild):
1305 (khtml::InlineBox::prevLeafChild):
1306 (khtml::InlineBox::selectionState):
1307 (khtml::InlineFlowBox::addToLine):
1308 (khtml::InlineFlowBox::firstLeafChild):
1309 (khtml::InlineFlowBox::lastLeafChild):
1310 (khtml::InlineFlowBox::firstLeafChildAfterBox):
1311 (khtml::InlineFlowBox::lastLeafChildBeforeBox):
1312 (khtml::InlineFlowBox::selectionState):
1313 (khtml::RootInlineBox::fillLineSelectionGap):
1314 (khtml::RootInlineBox::setHasSelectedChildren):
1315 (khtml::RootInlineBox::selectionState):
1316 (khtml::RootInlineBox::firstSelectedBox):
1317 (khtml::RootInlineBox::lastSelectedBox):
1318 (khtml::RootInlineBox::selectionTop):
1319 (khtml::RootInlineBox::block):
1320 * khtml/rendering/render_line.h:
1321 (khtml::RootInlineBox::RootInlineBox):
1322 (khtml::RootInlineBox::hasSelectedChildren):
1323 (khtml::RootInlineBox::selectionHeight):
1324 * khtml/rendering/render_object.cpp:
1325 (RenderObject::selectionColor):
1326 * khtml/rendering/render_object.h:
1327 (khtml::RenderObject::):
1328 (khtml::RenderObject::selectionState):
1329 (khtml::RenderObject::setSelectionState):
1330 (khtml::RenderObject::selectionRect):
1331 (khtml::RenderObject::canBeSelectionLeaf):
1332 (khtml::RenderObject::hasSelectedChildren):
1333 (khtml::RenderObject::hasDirtySelectionState):
1334 (khtml::RenderObject::setHasDirtySelectionState):
1335 (khtml::RenderObject::shouldPaintSelectionGaps):
1336 (khtml::RenderObject::SelectionInfo::SelectionInfo):
1337 * khtml/rendering/render_replaced.cpp:
1338 (RenderReplaced::RenderReplaced):
1339 (RenderReplaced::shouldPaint):
1340 (RenderReplaced::selectionRect):
1341 (RenderReplaced::setSelectionState):
1342 (RenderReplaced::selectionColor):
1343 (RenderWidget::paint):
1344 (RenderWidget::setSelectionState):
1345 * khtml/rendering/render_replaced.h:
1346 (khtml::RenderReplaced::canBeSelectionLeaf):
1347 (khtml::RenderReplaced::selectionState):
1348 * khtml/rendering/render_text.cpp:
1349 (InlineTextBox::checkVerticalPoint):
1350 (InlineTextBox::isSelected):
1351 (InlineTextBox::selectionState):
1352 (InlineTextBox::selectionRect):
1353 (InlineTextBox::paintSelection):
1354 (InlineTextBox::paintMarkedTextBackground):
1355 (RenderText::paint):
1356 (RenderText::setSelectionState):
1357 (RenderText::selectionRect):
1358 * khtml/rendering/render_text.h:
1359 (khtml::RenderText::canBeSelectionLeaf):
1361 * kwq/KWQPainter.mm:
1362 (QPainter::drawHighlightForText):
1364 (QPtrDictIterator::toFirst):
1367 * kwq/WebCoreTextRenderer.h:
1368 * kwq/WebCoreTextRendererFactory.mm:
1369 (WebCoreInitializeEmptyTextGeometry):
1371 2004-10-05 Ken Kocienda <kocienda@apple.com>
1375 Use the new CSS properties I added with my previous check-in. Also makes
1376 some changes to caret positioning and drawing to make the proper editing
1377 end-of-line behavior work correctly.
1379 * khtml/editing/selection.cpp:
1380 (khtml::Selection::layout): Caret drawing now takes affinity into account
1381 when deciding where to paint the caret (finally!).
1382 * khtml/editing/visible_position.cpp:
1383 (khtml::VisiblePosition::previousVisiblePosition): Move off Position::rendersInDifferentPosition
1384 to determine the result. Use a simpler test involving comparisons between
1385 downstream positions while iterating. This is cheaper to do and easier to understand.
1386 (khtml::VisiblePosition::nextVisiblePosition): Ditto.
1387 * khtml/rendering/bidi.cpp:
1388 (khtml::BidiIterator::current): Do not return non-breaking spaces for empty
1389 text renderers and for non-text renderers. Return a null Qchar instead. Returning
1390 non-breaking spaces was causing errors when the new -khtml-nbsp-mode was set to "space".
1391 (khtml::RenderBlock::computeHorizontalPositionsForLine): Shrink line boxes that
1392 contain with more spaces than can fit on the end of a line.
1393 (khtml::RenderBlock::skipWhitespace): Factor this out from findNextLineBreak.
1394 (khtml::RenderBlock::findNextLineBreak): Use new skipWhitespace function. Add
1395 in code to check and use new CSS properties.
1396 * khtml/rendering/break_lines.cpp:
1397 (khtml::isBreakable): Consider a non-breaking space a breakable character based
1398 on setting of new -khtml-nbsp-mode property.
1399 * khtml/rendering/break_lines.h: Ditto.
1400 * khtml/rendering/render_block.h: Declare skipWhitespace function.
1401 * khtml/rendering/render_text.cpp:
1402 (RenderText::caretRect): Do not draw the caret beyond the right edge of the
1403 window when in white-space normal mode.
1405 2004-10-05 Ken Kocienda <kocienda@apple.com>
1411 In this patch, I add two new CSS properties and their associated behavior.
1412 This is to support end-of-line and word-wrapping features that match the
1413 conventions of text editors.
1415 There are also some other small changes here which begin to lay the groundwork
1416 for using these new properties to bring about the desired editing behavior.
1418 * khtml/css/cssparser.cpp:
1419 (CSSParser::parseValue): Add support for new CSS properties.
1420 * khtml/css/cssproperties.c: Generated file.
1421 * khtml/css/cssproperties.h: Ditto.
1422 * khtml/css/cssproperties.in: Add new properties.
1423 * khtml/css/cssstyleselector.cpp:
1424 (khtml::CSSStyleSelector::applyProperty): Add support for new CSS properties.
1425 * khtml/css/cssvalues.c: Generated file.
1426 * khtml/css/cssvalues.h: Ditto.
1427 * khtml/css/cssvalues.in: Add support for new CSS properties.
1428 * khtml/editing/visible_position.cpp:
1429 (khtml::VisiblePosition::upstreamDeepEquivalent): Added new helper.
1430 * khtml/editing/visible_position.h:
1431 * khtml/rendering/render_box.cpp:
1432 (RenderBox::deleteLineBoxWrapper): Zero out inlineBoxWrapper.
1433 * khtml/rendering/render_replaced.cpp:
1434 (RenderWidget::detach): Zero out inlineBoxWrapper.
1435 * khtml/rendering/render_style.cpp:
1436 (StyleCSS3InheritedData):
1437 (StyleCSS3InheritedData::operator==): Add support for new CSS properties.
1438 (RenderStyle::diff): Ditto.
1439 * khtml/rendering/render_style.h:
1440 (khtml::RenderStyle::nbspMode): Ditto.
1441 (khtml::RenderStyle::khtmlLineBreak): Ditto.
1442 (khtml::RenderStyle::setNBSPMode): Ditto.
1443 (khtml::RenderStyle::setKHTMLLineBreak): Ditto.
1444 (khtml::RenderStyle::initialNBSPMode): Ditto.
1445 (khtml::RenderStyle::initialKHTMLLineBreak): Ditto.
1447 2004-10-05 Darin Adler <darin@apple.com>
1451 - fixed <rdar://problem/3673150> Pasting string from clipboard that is longer than input box will accept fails rather than truncating
1453 * kwq/KWQTextField.mm:
1454 (-[KWQTextFieldFormatter isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:]):
1455 Wrote a new version of this method that truncates incoming strings rather than rejecting them
1458 2004-10-04 Darin Adler <darin@apple.com>
1462 - fixed <rdar://problem/3826343> crash in KHTMLParser::setCurrent parsing document fragment (happens in Calendar widget)
1464 * khtml/html/htmlparser.cpp:
1465 (KHTMLParser::KHTMLParser): Initialized currentIsReferenced to false (fixes bug).
1466 (KHTMLParser::reset): Use doc() to make code easier to read.
1467 (KHTMLParser::setCurrent): Ditto.
1468 (KHTMLParser::parseToken): Ditto.
1469 (KHTMLParser::insertNode): Ditto.
1470 (KHTMLParser::getElement): Ditto.
1471 (KHTMLParser::popOneBlock): Ditto.
1473 - fixed <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window
1475 * kwq/KWQKHTMLPart.h: Added fontAttributesForSelectionStart.
1476 * kwq/KWQKHTMLPart.mm:
1477 (KWQKHTMLPart::styleForSelectionStart): Factored out most of fontForSelection.
1478 (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
1479 (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
1480 (KWQKHTMLPart::registerCommandForUndo): Updated for name change (see below).
1481 (KWQKHTMLPart::registerCommandForRedo): Ditto.
1483 * kwq/WebCoreBridge.h: Added fontAttributesForSelectionStart.
1484 * kwq/WebCoreBridge.mm:
1485 (-[WebCoreBridge undoEditing:]): Updated for name change (see below).
1486 (-[WebCoreBridge redoEditing:]): Ditto.
1487 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Got rid of named temporary
1488 EditCommandPtr variable to make things slightly more terse.
1489 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): Ditto.
1490 (-[WebCoreBridge deleteSelectionWithSmartDelete:]): Ditto.
1491 (-[WebCoreBridge fontAttributesForSelectionStart]): Added.
1493 - fix compile on Panther and other cleanup
1495 * khtml/khtml_part.cpp: Removed unneeded include.
1496 * kwq/KWQEditCommand.h: Got rid of use of "impl" when referring to EditCommand pointers.
1497 * kwq/KWQEditCommand.mm: Added include so we compile on Panther.
1498 (-[KWQEditCommand initWithEditCommand:]): Changed name.
1499 (-[KWQEditCommand dealloc]): Updated for m_impl change to m_command.
1500 (-[KWQEditCommand finalize]): Ditto.
1501 (+[KWQEditCommand commandWithEditCommand:]): Changed name.
1502 (-[KWQEditCommand command]): Changed name.
1504 2004-10-04 Darin Adler <darin@apple.com>
1508 - did a more-robust version of the fix I just landed
1510 * khtml/html/htmlparser.h: Added currentIsReferenced boolean.
1511 * khtml/html/htmlparser.cpp:
1512 (KHTMLParser::KHTMLParser): Initializes currentIsReferenced.
1513 (KHTMLParser::setCurrent): Changed to respect and set currentIsReferenced.
1515 2004-10-04 Darin Adler <darin@apple.com>
1519 - fixed <rdar://problem/3824393> REGRESSION (165-TOT): Crash in KHTMLParser::popOneBlock closing window (bose.com)
1521 * khtml/html/htmlparser.cpp:
1522 (KHTMLParser::~KHTMLParser): Move call to setCurrent(0) after the call to freeBlock, since freeBlock doesn't
1523 work well when current is 0, and there's no reason we need to reset the current block first.
1524 (KHTMLParser::setCurrent): Don't ever hold a reference to the document. This prevents a situation where there
1525 would be a reference cycle. In the test case from the bug above, this cycle actually happened and resulted
1526 in a double-delete of the document, tokenizer, and parser.
1528 2004-10-04 Darin Adler <darin@apple.com>
1532 - fixed <rdar://problem/3825429> onclick handler called when mouse down on another element (affects Dashboard Movies widget, test case enclosed)
1534 * khtml/khtmlview.cpp:
1535 (KHTMLViewPrivate::KHTMLViewPrivate): Initialize the click node to 0.
1536 (KHTMLViewPrivate::~KHTMLViewPrivate): Deref the click node.
1537 (KHTMLViewPrivate::reset): Clear the click node.
1538 (KHTMLView::viewportMousePressEvent): Call invalidateClick when we pass the event to a subframe to
1539 reduce the chance that we'll hold on to an old click node for a long time. Set the click node to
1540 the node we we are clicking on.
1541 (KHTMLView::viewportMouseDoubleClickEvent): Only send a click even if the node is the same one from
1542 the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
1543 old click node for a long time.
1544 (KHTMLView::invalidateClick): Clear the click node.
1545 (KHTMLView::viewportMouseReleaseEvent): Only send a click even if the node is the same one from
1546 the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
1547 old click node for a long time.
1548 (KHTMLView::keyPressEvent): Remove code that sets the originalNode field, which is never used.
1550 2004-10-04 Ken Kocienda <kocienda@apple.com>
1556 <rdar://problem/3825289> REGRESSION (Mail): Crash in fontForSelection in empty window
1558 * khtml/editing/visible_position.cpp:
1559 (khtml::VisiblePosition::previousPosition): Switch to node iteration instead "leaf"
1560 iteration. I have been wanting to make this change for a long time, but couldn't
1561 since other code relied on the leaf behavior. That is no longer true. Plus, the
1562 bug fix requires the new behavior.
1563 (khtml::VisiblePosition::nextPosition): Ditto.
1564 (khtml::VisiblePosition::isCandidate): Empty blocks needed a height to be a candidate,
1565 but we make a special case for the body element. This fixes the bug.
1567 2004-10-04 Darin Adler <darin@apple.com>
1571 - fixed <rdar://problem/3800667> REGRESSION (Mail): double-clicking multiple spaces only selects two spaces
1573 * kwq/KWQTextUtilities.mm: (KWQFindWordBoundary): Moved here from the .cpp file. Changed to use the
1574 doubleClickAtIndex: method from NSAttributedString rather than using Unicode Utilities.
1575 * kwq/KWQTextUtilities.cpp: Removed.
1576 * WebCore.pbproj/project.pbxproj: Removed KWQTextUtilities.cpp.
1578 - fixed a problem that would show up using HTML editing under garbage collection
1580 * kwq/KWQEditCommand.mm: (-[KWQEditCommand finalize]): Fixed a [super dealloc] that should have been a
1583 - another small change
1585 * khtml/editing/visible_units.cpp: (khtml::nextWordBoundary): Tweaked a comment.
1587 2004-10-01 Darin Adler <darin@apple.com>
1589 Reviewed by Ken (or arguably done by Ken, reviewed by Darin).
1591 - fixed <rdar://problem/3823828> REGRESSION (Mail): Clicking past end of any line puts insertion point at beginning of next line
1593 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::VisiblePosition):
1594 Check for an offset of 0 and a <br> and use UPSTREAM affinity in that case.
1595 This is a short term fix for something that needs a better longer-term fix.
1597 - fixed <rdar://problem/3823816> REGRESSION (Mail): double-clicking first word on line also selects previous empty line
1599 * khtml/editing/visible_units.cpp: (khtml::previousWordBoundary): Added a special
1600 case for <br>. While I'm not sure why this regressed, I'm sure this fix is good.
1602 2004-10-01 Darin Adler <darin@apple.com>
1606 - fixed <rdar://problem/3782117> CrashTracer: ..722 crashes at com.apple.WebCore: DOM::HTMLBodyElementImpl::insertedIntoDocument + 0x2c (AOL website)
1608 * khtml/html/html_baseimpl.cpp:
1609 (HTMLBodyElementImpl::insertedIntoDocument): Check for nil document case.
1610 (HTMLFrameElementImpl::isURLAllowed): Ditto.
1611 (HTMLFrameElementImpl::openURL): Ditto.
1613 2004-10-01 Darin Adler <darin@apple.com>
1617 - fixed <rdar://problem/3822218> REGRESSION (164-165): images don't update on rollover on directv.com page
1619 I introduced a major regression where various JavaScript window properties would not be found when I
1622 * khtml/ecma/kjs_window.h: Added hasProperty.
1623 * khtml/ecma/kjs_window.cpp: (Window::hasProperty): Return true in all the cases where get returns something.
1625 2004-09-30 Darin Adler <darin@apple.com>
1629 - fixed <rdar://problem/3461499> JavaScript function document.open() is buggy with 2nd argument "replace"
1631 Experiments with Firefox indicate that document.open() should not be treated as window.open() unless there
1632 are more than two parameters. Also, Firefox does not implement the "replace" behavior, so we don't have
1633 to worry about it either.
1635 * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): Only forward to window if there are more than
1636 two parameters, rather than if there are more than one.
1638 - fixed <rdar://problem/3672933> oninput is firing at page load time for <input type=range>
1640 * kwq/KWQSlider.mm: (QSlider::setValue): Don't emit a signal here. This follows the usual pattern, where
1641 a signal is only emitted for changes that are not explicitly requested by the caller.
1643 - fixed <rdar://problem/3821167> leaks of something allocated by recalcStyle after loading altavista page from cvs-base
1645 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Ref and deref the style we allocate so it's
1646 not left floating if setStyle decides not to ref it.
1648 - fixed <rdar://problem/3821172> leak of HTML attribute string after loading the ESPN page from cvs-base
1650 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Use the DOMString version of
1651 the lower() operation so we don't end up leaving a DOMStringImpl * floating if AtomicString decides not
1654 2004-09-30 Richard Williamson <rjw@apple.com>
1656 Fixed <rdar://problem/3822330> REGRESSION: crash on launch when homepage is set to about:blank
1660 * kwq/KWQKHTMLPart.mm:
1661 (KWQKHTMLPart::setDisplaysWithFocusAttributes):
1663 2004-09-30 Chris Blumenberg <cblu@apple.com>
1665 Fixed: <rdar://problem/3792822> Safari is calling the Cocoa QuickTime plugin twice for the OBJECT and EMBED tags
1669 * khtml/html/html_objectimpl.cpp:
1670 (HTMLObjectElementImpl::attach): call dispatchHTMLEvent after updateWidget instead of every time this method is called
1671 (HTMLObjectElementImpl::recalcStyle): ditto
1673 2004-09-30 Darin Adler <darin@apple.com>
1675 - rolled out bad image change that caused performance regression
1677 * khtml/rendering/render_image.cpp: (RenderImage::setPixmap):
1678 Don't reference the new image before doing the assignment.
1679 This forced an unwanted.
1681 2004-09-30 Ken Kocienda <kocienda@apple.com>
1683 Reviewed by me, coded by Darin
1685 - fixed <rdar://problem/3818305> REGRESSION (Mail): Shift + page up has no effect; should modify selection
1687 * khtml/editing/selection.cpp: (khtml::Selection::modify): Fix problem where vertical distance
1688 was used as a distance threshold, but was a negative number. Now make it positive at the start
1689 of the function (and make a couple related changes).
1691 2004-09-29 Richard Williamson <rjw@apple.com>
1693 Fixed <rdar://problem/3779998> bringing window to front or sending to back does not send focus/blur events to JavaScript window object
1695 The fix has two parts, 1) make onblur and onfocus work for windows,
1696 and 2), allow the dashboard to override WebKit's special key/non-key
1701 * kwq/KWQKHTMLPart.mm:
1702 (KWQKHTMLPart::setDisplaysWithFocusAttributes):
1704 2004-09-29 Ken Kocienda <kocienda@apple.com>
1710 <rdar://problem/3705894> REGRESSION (Mail): if a single word is wider than the window,
1711 it doesn't break and just runs off the right side
1713 * khtml/css/css_computedstyle.cpp:
1714 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support for CSS_PROP_WORD_WRAP.
1715 * khtml/css/cssparser.cpp:
1716 (CSSParser::parseValue): Ditto.
1717 * khtml/css/cssproperties.c: Generated file.
1718 * khtml/css/cssproperties.h: Ditto.
1719 * khtml/css/cssproperties.in: Add word-wrap property.
1720 * khtml/css/cssstyleselector.cpp:
1721 (khtml::CSSStyleSelector::applyProperty): Add support for CSS_PROP_WORD_WRAP.
1722 * khtml/css/cssvalues.c: Generated file.
1723 * khtml/css/cssvalues.h: Ditto.
1724 * khtml/css/cssvalues.in: Add break-word value.
1725 * khtml/rendering/bidi.cpp:
1726 (khtml::RenderBlock::findNextLineBreak): Add code to implement new word wrapping feature.
1727 * khtml/rendering/render_style.cpp:
1728 (StyleCSS3InheritedData): Add support for new wordWrap property.
1729 (StyleCSS3InheritedData::operator==): Ditto.
1730 (RenderStyle::diff): Ditto.
1731 * khtml/rendering/render_style.h:
1732 (khtml::RenderStyle::wordWrap): Ditto.
1733 (khtml::RenderStyle::setWordWrap): Ditto.
1734 (khtml::RenderStyle::initialWordWrap): Ditto.
1736 2004-09-29 Maciej Stachowiak <mjs@apple.com>
1740 - consolidated OS version checks into prefix header
1743 * khtml/rendering/render_canvasimage.cpp:
1744 * kwq/KWQAccObject.mm:
1745 (-[KWQAccObject roleDescription]):
1746 (-[KWQAccObject accessibilityActionDescription:]):
1747 * kwq/KWQComboBox.mm:
1748 (QComboBox::QComboBox):
1749 * kwq/KWQFoundationExtras.h:
1751 2004-09-29 David Hyatt <hyatt@apple.com>
1753 Make sure <br>s always get line boxes. Also prevent the creation of RenderTexts for whitespace normal/nowrap nodes
1756 Reviewed by kocienda
1758 * khtml/editing/visible_position.cpp:
1759 (khtml::VisiblePosition::isCandidate):
1760 * khtml/rendering/render_br.cpp:
1761 (RenderBR::RenderBR):
1762 (RenderBR::createInlineBox):
1763 (RenderBR::baselinePosition):
1764 (RenderBR::lineHeight):
1765 * khtml/rendering/render_br.h:
1766 * khtml/rendering/render_line.cpp:
1767 (khtml::InlineFlowBox::placeBoxesVertically):
1768 * khtml/rendering/render_line.h:
1769 (khtml::InlineBox::isText):
1770 (khtml::InlineFlowBox::addToLine):
1771 * khtml/rendering/render_text.cpp:
1772 (RenderText::detach):
1773 * khtml/rendering/render_text.h:
1774 (khtml::InlineTextBox:::InlineRunBox):
1775 (khtml::InlineTextBox::isInlineTextBox):
1776 (khtml::InlineTextBox::isText):
1777 (khtml::InlineTextBox::setIsText):
1778 * khtml/xml/dom_textimpl.cpp:
1779 (TextImpl::rendererIsNeeded):
1780 * kwq/KWQRenderTreeDebug.cpp:
1783 2004-09-29 Ken Kocienda <kocienda@apple.com>
1789 <rdar://problem/3815895> exception inside fontForSelection causes Mail to abort when selection hits bottom
1791 * khtml/editing/selection.cpp:
1792 (khtml::Selection::toRange): Use RangeImpl calls to detect exceptions when creating a Range
1793 from a Selection. Return an empty Range when there is an exception.
1797 <rdar://problem/3817268> REGRESSION (Mail): Window does not scroll when selecting out of
1798 visible area of view with arrow keys
1800 * khtml/editing/selection.cpp: Did some name changing. m_needsCaretLayout -> m_needsLayout.
1801 Added m_expectedVisibleRect which supplies the right rectangle to update when scrolling.
1802 (khtml::Selection::Selection): m_needsCaretLayout -> m_needsLayout name change.
1803 (khtml::Selection::init): Handle m_expectedVisibleRect in initialization.
1804 (khtml::Selection::operator=): Handle m_expectedVisibleRect in assignment.
1805 (khtml::Selection::setNeedsLayout): m_needsCaretLayout -> m_needsLayout name change.
1806 (khtml::Selection::layout): Changed name from layoutCaret, since m_expectedVisibleRect
1807 is also calculated here.
1808 (khtml::Selection::caretRect): m_needsCaretLayout -> m_needsLayout name change.
1809 (khtml::Selection::expectedVisibleRect): New. Returns m_expectedVisibleRect, doing a
1811 (khtml::Selection::needsCaretRepaint): m_needsCaretLayout -> m_needsLayout name change.
1812 (khtml::Selection::paintCaret): Ditto.
1813 (khtml::Selection::validate): Ditto.
1814 * khtml/editing/selection.h: Add m_expectedVisibleRect member variable and
1815 expectedVisibleRect accessor.
1816 * kwq/WebCoreBridge.h: Change name of ensureCaretVisible to ensureSelectionVisible, since
1817 this is not only about making the caret visible anymore. Now it can reveal the varying
1818 end of the selection when scrolling with arrow keys.
1819 * kwq/WebCoreBridge.mm:
1820 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): ensureCaretVisible to
1821 ensureSelectionVisible name change.
1822 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto
1823 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Ditto
1824 (-[WebCoreBridge insertNewline]): Ditto
1825 (-[WebCoreBridge insertText:selectInsertedText:]): Ditto
1826 (-[WebCoreBridge deleteKeyPressed]): Ditto
1827 (-[WebCoreBridge ensureSelectionVisible]): Ditto
1829 2004-09-29 Ken Kocienda <kocienda@apple.com>
1835 <rdar://problem/3818296> REGRESSION (Mail): centerSelectionInVisibleArea does not work correctly
1837 * kwq/KWQKHTMLPart.h:
1838 * kwq/KWQKHTMLPart.mm:
1839 (KWQKHTMLPart::centerSelectionInVisibleArea): New function. Handles both caret
1840 and range selections correctly.
1841 * kwq/KWQNSViewExtras.h: Add forceCentering boolean to some methods in this file.
1842 * kwq/KWQNSViewExtras.m: Ditto. This addition has been done since the AppKit
1843 method we use to do the centering, -[NSView scrollRectToVisible:], does not alter
1844 the view if the rectangle passed to it is already in view. When forceCentering is
1845 true, extra math is done to make scrollRectToVisible center the rectangle we want.
1846 (-[NSView _KWQ_scrollFrameToVisible]): Pass NO for forceCentering in call through to
1847 _KWQ_scrollRectToVisible:forceCentering:
1848 (-[NSView _KWQ_scrollRectToVisible:forceCentering:]): Add forceCentering argument.
1849 (-[NSView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto.
1850 (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto. Do extra
1851 math to implement the forceCentering effect.
1852 * kwq/KWQScrollView.h: Add forceCentering default argument to ensureRectVisibleCentered.
1853 * kwq/KWQScrollView.mm:
1854 (QScrollView::ensureRectVisibleCentered): Ditto.
1855 * kwq/WebCoreBridge.h:
1856 * kwq/WebCoreBridge.mm:
1857 (-[WebCoreBridge centerSelectionInVisibleArea]): New function. Call through to KWQKHTMLPart.
1859 2004-09-28 Chris Blumenberg <cblu@apple.com>
1861 Fixed: WebArchives begin with "<#document/>"
1865 * khtml/xml/dom_nodeimpl.cpp:
1866 (NodeImpl::startMarkup): don't return markup if this is a document node, forgot this when factoring this method out from toHTML
1868 2004-09-28 Chris Blumenberg <cblu@apple.com>
1870 Removed range parameter from recursive_toHTML and friends since that code path is no longer used.
1874 * khtml/xml/dom2_rangeimpl.cpp:
1875 (DOM::RangeImpl::toHTML):
1876 * khtml/xml/dom_nodeimpl.cpp:
1877 (NodeImpl::recursive_toString):
1878 (NodeImpl::recursive_toHTML):
1879 * khtml/xml/dom_nodeimpl.h:
1880 * kwq/WebCoreBridge.mm:
1881 (-[WebCoreBridge markupStringFromNode:nodes:]):
1883 2004-09-28 Darin Adler <darin@apple.com>
1887 - improve spell checking so it doesn't unmark and remark as you move the cursor with the arrow
1889 * khtml/editing/htmlediting.h: Remove obsolete markMisspellingsInSelection private function.
1890 * khtml/editing/htmlediting.cpp:
1891 (khtml::EditCommand::EditCommand): Blow away the selection when starting an edit command.
1892 (khtml::EditCommand::apply): Remove code to mark misspellings because that's now done as part
1893 of blowing away the selection.
1894 (khtml::EditCommand::unapply): Blow away the selection instead of marking mispellings.
1895 (khtml::EditCommand::reapply): Ditto.
1896 (khtml::ReplaceSelectionCommand::doApply): Removed incorrect code that does spell checking
1897 on inserted text; this doesn't match NSText behavior.
1898 (khtml::TypingCommand::markMisspellingsAfterTyping): Use markMisspellingsInAdjacentWords
1899 function for greater clarity on what this actually does.
1901 * khtml/khtml_part.h: Replaced setSelection's "unmarkOldSelection" boolean parameter with a
1902 "keepTypingStyle" boolean parameter. Removed notifySelectionChanged.
1903 * khtml/khtml_part.cpp:
1904 (KHTMLPart::setSelection): Replaced the "unmarkOldSelection" boolean with a new "keepTypingStyle"
1905 boolean. This is a step on the way to simplifying how this works. Moved the code from the
1906 notifySelectionChanged function here, since there was no clear line between the two functions.
1907 (KHTMLPart::clearSelection): Call setSelection rather that having special case code here for
1908 the case of an empty selection.
1909 (KHTMLPart::appliedEditing): Remove the explicit "false" for "unmarkOldSelection".
1910 (KHTMLPart::unappliedEditing): Ditto.
1911 (KHTMLPart::reappliedEditing): Ditto.
1913 * kwq/KWQKHTMLPart.h: Replaced markMisspellingsInSelection and updateSpellChecking with
1914 markMisspellings and markMisspellingsInAdjacentWords. Added parameters to respondToChangedSelection.
1915 * kwq/KWQKHTMLPart.mm:
1916 (KWQKHTMLPart::markMisspellingsInAdjacentWords): Added.
1917 (KWQKHTMLPart::markMisspellings): New name for markMisspellingsInSelection. Simplified logic a
1918 bit and made it the caller's responsibility to expand the selection passed in to word boundaries.
1919 (KWQKHTMLPart::respondToChangedSelection): Added parameter that identifies the old selection,
1920 and changed logic so it won't mark mispellings in a word if the selection still starts in that word.
1922 - implemented empty-cells property in computed style
1924 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1925 Added code for CSS_PROP_EMPTY_CELLS. I think the HTML converter in AppKit uses this.
1927 2004-09-28 Chris Blumenberg <cblu@apple.com>
1929 Fixed n-squared issues with appending to KWQValueListImpl. This fixes the hang in 3794799.
1931 Fixed by Darin, reviewed by me.
1933 * khtml/xml/dom2_rangeimpl.cpp:
1934 (DOM::RangeImpl::toHTML): tweaks
1935 * kwq/KWQValueListImpl.mm:
1936 (KWQValueListImpl::KWQValueListPrivate::KWQValueListPrivate):
1937 (KWQValueListImpl::KWQValueListPrivate::copyList):
1938 (KWQValueListImpl::clear):
1939 (KWQValueListImpl::appendNode):
1940 (KWQValueListImpl::prependNode):
1941 (KWQValueListImpl::removeEqualNodes):
1942 (KWQValueListImpl::containsEqualNodes):
1943 (KWQValueListImpl::removeIterator):
1944 (KWQValueListImpl::lastNode):
1945 * kwq/WebCoreBridge.mm:
1946 (-[WebCoreBridge nodesFromList:]): use iterator, not at()
1948 2004-09-28 Richard Williamson <rjw@apple.com>
1950 More dashboard region changes for John.
1952 <rdar://problem/3817421> add getter for dashboard regions (debugging)
1954 <rdar://problem/3817417> NSScrollView need autoregions for dashboard
1956 <rdar://problem/3817388> should have short form form control regions
1958 <rdar://problem/3817477> visibility does not work with dashboard control regions
1962 * WebCore-combined.exp:
1964 * khtml/css/cssparser.cpp:
1965 (skipCommaInDashboardRegion):
1966 (CSSParser::parseDashboardRegions):
1967 * khtml/khtmlview.cpp:
1968 (KHTMLView::updateDashboardRegions):
1969 * khtml/rendering/render_object.cpp:
1970 (RenderObject::setStyle):
1971 (RenderObject::addDashboardRegions):
1972 * khtml/xml/dom_docimpl.cpp:
1973 (DocumentImpl::DocumentImpl):
1974 (DocumentImpl::setDashboardRegions):
1975 * khtml/xml/dom_docimpl.h:
1976 (DOM::DocumentImpl::setDashboardRegionsDirty):
1977 (DOM::DocumentImpl::dashboardRegionsDirty):
1978 * kwq/KWQKHTMLPart.h:
1979 * kwq/KWQKHTMLPart.mm:
1980 (KWQKHTMLPart::paint):
1981 (KWQKHTMLPart::dashboardRegionsDictionary):
1982 (KWQKHTMLPart::dashboardRegionsChanged):
1983 * kwq/WebCoreBridge.h:
1984 * kwq/WebCoreBridge.mm:
1985 (-[WebCoreBridge dashboardRegions]):
1986 * kwq/WebDashboardRegion.h:
1987 * kwq/WebDashboardRegion.m:
1988 (-[WebDashboardRegion description]):
1990 2004-09-28 John Sullivan <sullivan@apple.com>
1994 - fixed <rdar://problem/3818558> REGRESSION: "Installed Plug-ins" is blank
1995 because of <script type="application/x-javascript">
1997 * khtml/html/htmltokenizer.cpp:
1998 (khtml::HTMLTokenizer::parseTag):
1999 add "application/x-javascript" to the list of legal scripting types. Mozilla
2000 accepts this, but WinIE doesn't.
2002 * layout-tests/fast/tokenizer/004.html:
2003 updated layout test to test some application/xxxx types
2005 2004-09-27 David Hyatt <hyatt@apple.com>
2007 Reworked lists to work well with RTL text. Specifically the following bugs have been fixed:
2009 (1) All bullets use the same offset constant now (a padding of 7 pixels). Before, images used 5 and others used 7.
2010 (2) Line height now works properly, so that list items with no content aren't squished (and missing the line descent).
2011 (3) Punctuation now works correctly with inside and outside style ordered lists in RTL.
2012 (4) RTL lists now properly apply padding and margin to the right side rather than the left. This was done by adding
2013 -khtml-margin-start and -khtml-padding-start properties that are just mapped to left/right based off the direction.
2017 * khtml/css/cssparser.cpp:
2018 (CSSParser::parseValue):
2019 * khtml/css/cssproperties.c:
2022 * khtml/css/cssproperties.h:
2023 * khtml/css/cssproperties.in:
2024 * khtml/css/cssstyleselector.cpp:
2025 (khtml::CSSStyleSelector::applyDeclarations):
2026 (khtml::CSSStyleSelector::applyProperty):
2027 * khtml/css/html4.css:
2028 * khtml/rendering/bidi.cpp:
2029 (khtml::BidiIterator::direction):
2030 * khtml/rendering/render_list.cpp:
2031 (RenderListItem::getAbsoluteRepaintRect):
2032 (RenderListMarker::paint):
2033 (RenderListMarker::calcMinMaxWidth):
2034 (RenderListMarker::lineHeight):
2035 (RenderListMarker::baselinePosition):
2037 2004-09-28 Ken Kocienda <kocienda@apple.com>
2041 Mark the VisiblePosition taking (Position &, EAffinity=DOWNSTREAM) explicit. Recently, when I added
2042 the EAffinity argument, I left this constructor implicit. Darin pointed out to me that this is
2043 undesirable since implicit use of the the constructor involved making the affinity choice, something
2044 which should be done explicitly.
2046 * khtml/editing/selection.cpp:
2047 (khtml::Selection::modifyExtendingRightForward): Make explicit use of constructor mentioned above.
2048 (khtml::Selection::modifyMovingRightForward): Ditto.
2049 (khtml::Selection::modifyExtendingLeftBackward): Ditto.
2050 (khtml::Selection::modifyMovingLeftBackward): Ditto.
2051 (khtml::Selection::modify): Ditto.
2052 (khtml::Selection::validate): Ditto.
2053 * khtml/editing/visible_position.h: Make constructor taking (Position &, EAffinity) explicit.
2054 * khtml/editing/visible_units.cpp: Ditto.
2055 (khtml::previousWordBoundary): Make explicit use of constructor mentioned above.
2056 (khtml::nextWordBoundary): Ditto.
2057 (khtml::previousLinePosition): Ditto.
2058 (khtml::nextLinePosition): Ditto.
2059 * kwq/KWQKHTMLPart.mm: Ditto.
2060 (KWQKHTMLPart::findString): Ditto.
2061 (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
2062 (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
2063 (KWQKHTMLPart::updateSpellChecking): Ditto.
2065 2004-09-28 Darin Adler <darin@apple.com>
2069 - fixed a storage leak discovered by code inspection
2071 * khtml/html/htmlparser.cpp: (KHTMLParser::~KHTMLParser): Call setCurrent(0) to deref
2072 the parser's current node in the rare case where it still has one.
2074 2004-09-27 David Hyatt <hyatt@apple.com>
2076 Don't allow nested headers when only inlines are in between them. Fixes a hang related to pathological nesting
2077 on magicmethodsonline.com.
2081 * khtml/html/htmlparser.cpp:
2082 (KHTMLParser::parseToken):
2083 (KHTMLParser::processCloseTag):
2084 (KHTMLParser::isHeaderTag):
2085 (KHTMLParser::popNestedHeaderTag):
2086 * khtml/html/htmlparser.h:
2088 2004-09-27 Kevin Decker <kdecker@apple.com>
2092 * khtml/css/css_base.cpp:
2093 (CSSSelector::selectorText): changed another ATTR_CLASS case to properly return class selector names.
2095 2004-09-27 David Hyatt <hyatt@apple.com>
2097 Fix style sharing so that it doesn't share when it shouldn't. Partially fixes 3671516, table cells don't update
2098 their color on macosx.apple.com.
2100 Fix 3521639, iframe mispositioned on bidi page. Make sure that when the width of a line exceeds the available line
2101 width that the spillage out of the block is determined by the direction of the block and not by the text-align value.
2103 Partial fix for 3762962, make sure the image cells with specified widths but percentage heights don't just get a minwidth
2106 Fix for 3533878, framesets that use percentages that add up to a value > 100% should normalize those percentages.
2110 * khtml/css/cssstyleselector.cpp:
2111 (khtml::CSSStyleSelector::locateCousinList):
2112 (khtml::CSSStyleSelector::elementsCanShareStyle):
2113 (khtml::CSSStyleSelector::locateSharedStyle):
2114 * khtml/css/cssstyleselector.h:
2115 * khtml/html/html_elementimpl.h:
2116 (DOM::HTMLNamedAttrMapImpl::hasMappedAttributes):
2117 (DOM::HTMLElementImpl::inlineStyleDecl):
2118 * khtml/rendering/bidi.cpp:
2119 (khtml::RenderBlock::computeHorizontalPositionsForLine):
2120 * khtml/rendering/render_frames.cpp:
2121 (RenderFrameSet::layout):
2122 * khtml/rendering/render_replaced.cpp:
2123 (RenderReplaced::calcMinMaxWidth):
2124 * khtml/xml/dom_elementimpl.h:
2125 (DOM::ElementImpl::inlineStyleDecl):
2126 (DOM::ElementImpl::hasMappedAttributes):
2128 2004-09-27 Ken Kocienda <kocienda@apple.com>
2132 Removed closestRenderedPosition function from Position class and gave this work
2133 to VisiblePosition instead. However, in order to make the transfer possible,
2134 VisiblePosition needed upstream and downstream affinities added to its
2135 constructors. Also moved the EAffinity enum into its own file. Also moved it
2136 to the khtml namespace.
2138 Updated several functions which used closestRenderedPosition to use VisiblePosition
2141 Also deleted Position::equivalentShallowPosition. This was unused.
2143 * ForwardingHeaders/editing/text_affinity.h: Added.
2144 * ForwardingHeaders/editing/visible_position.h: Added.
2145 * WebCore.pbproj/project.pbxproj: Added new files.
2146 * khtml/editing/selection.cpp:
2147 (khtml::Selection::validate): Use VisiblePosition instead of closestRenderedPosition.
2148 * khtml/editing/selection.h:
2149 * khtml/editing/text_affinity.h: Added.
2150 * khtml/editing/visible_position.cpp:
2151 (khtml::VisiblePosition::VisiblePosition):
2152 (khtml::VisiblePosition::initUpstream): New helper for finding upstream visible position.
2153 (khtml::VisiblePosition::initDownstream): Was old init function that unconditionally did
2154 downstream checks for visible position. Renamed to describe this more clearly.
2155 * khtml/editing/visible_position.h:
2156 * khtml/editing/visible_units.cpp:
2157 (khtml::previousWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
2158 (khtml::nextWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
2159 * khtml/xml/dom_docimpl.cpp:
2160 (DocumentImpl::updateSelection): Use VisiblePosition instead of closestRenderedPosition.
2161 * khtml/xml/dom_position.cpp:
2162 (DOM::Position::closestRenderedPosition): Removed.
2163 * khtml/xml/dom_position.h: Removed two functions mentioned above.
2164 * kwq/KWQKHTMLPart.mm:
2165 (KWQKHTMLPart::fontForSelection) Use VisiblePosition instead of closestRenderedPosition.:
2166 * kwq/WebCoreBridge.mm:
2167 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Use VisiblePosition instead of closestRenderedPosition.
2168 * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Updated expected results.
2169 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Ditto.
2170 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
2171 * layout-tests/editing/selection/move-by-character-004-expected.txt: Ditto.
2173 2004-09-27 Ken Kocienda <kocienda@apple.com>
2175 Reviewed by Darin and Maciej
2177 Removed EditCommand smart pointer wrappers from htmlediting.cpp/.h, save for the one
2178 at the root of the hierarchy, and this one has been renamed EditCommandPtr. Renamed
2179 each of the XXXCommandImpl classes, removing the Impl suffix from each, and rolled
2180 these into the htmlediting.cpp/.h files. The htmlediting_impl.cpp/.h files have
2181 been emptied and are being removed.
2183 For the remainder of files, perform the mechanical changes necessary to make everything
2184 compile and run as before.
2186 * WebCore.pbproj/project.pbxproj
2187 * khtml/editing/htmlediting.cpp
2188 * khtml/editing/htmlediting.h
2189 * khtml/editing/htmlediting_impl.cpp: Removed.
2190 * khtml/editing/htmlediting_impl.h: Removed.
2191 * khtml/editing/jsediting.cpp
2192 * khtml/khtml_part.cpp
2193 (KHTMLPart::openURL)
2194 (KHTMLPart::lastEditCommand)
2195 (KHTMLPart::appliedEditing)
2196 (KHTMLPart::unappliedEditing)
2197 (KHTMLPart::reappliedEditing)
2198 (KHTMLPart::applyStyle):
2199 * khtml/khtml_part.h
2200 * khtml/khtmlpart_p.h
2201 * kwq/KWQEditCommand.h
2202 * kwq/KWQEditCommand.mm
2203 (-[KWQEditCommand initWithEditCommandImpl:])
2204 (+[KWQEditCommand commandWithEditCommandImpl:])
2205 (-[KWQEditCommand impl])
2206 * kwq/KWQKHTMLPart.h
2207 * kwq/KWQKHTMLPart.mm
2208 (KWQKHTMLPart::registerCommandForUndo)
2209 (KWQKHTMLPart::registerCommandForRedo)
2210 * kwq/WebCoreBridge.mm
2211 (-[WebCoreBridge undoEditing:])
2212 (-[WebCoreBridge redoEditing:])
2213 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
2214 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:])
2215 (-[WebCoreBridge deleteSelectionWithSmartDelete:])
2217 2004-09-26 Darin Adler <darin@apple.com>
2221 - fixed <rdar://problem/3816170> image.width/height not available from Image objects (works in Firefox)
2223 * khtml/ecma/kjs_html.h: Added width and height.
2224 * khtml/ecma/kjs_html.cpp: (Image::getValueProperty): Added width and height.
2225 * khtml/ecma/kjs_html.lut.h: Regenerated.
2227 - unrelated change; changed ordering of use count manipulation just in case we decide some day to do
2228 something when the use count hits 0
2230 * khtml/rendering/render_image.cpp: (RenderImage::setPixmap): Increment use count on new object before
2231 decrementing use count on old object.
2233 2004-09-26 Darin Adler <darin@apple.com>
2237 - fixed <rdar://problem/3812771> document.implementation.hasFeature returns false for a lot of features we implement
2239 * khtml/xml/dom_docimpl.cpp: (DOMImplementationImpl::hasFeature): Added all the DOM features that we implemented
2240 as part of the HTML editing work.
2242 * khtml/dom/dom_node.cpp: (Node::isSupported): Changed this to call DOMImplementationImpl::hasFeature to share
2243 code. Later this might need to be different per-node, but at the moment that does not seem to be so.
2245 * khtml/ecma/kjs_dom.cpp:
2246 (DOMNodeProtoFunc::tryCall): Pass a null string if the parameter is omitted, undefined, or null. This is better than
2247 having a special case for the string "null" in the DOM implementation.
2248 (DOMDOMImplementationProtoFunc::tryCall): Ditto.
2250 - fixed <rdar://problem/3814605> REGRESSION: fast/table/039 layout test is failing due to extra trailing whitespace in innerText
2252 * khtml/editing/visible_text.cpp: (khtml::TextIterator::advance): Check for the case where we are at the end of
2253 iteration, and don't call exitNode in that case. This prevents us from getting some unwanted trailing \n characters.
2255 - fixed <rdar://problem/3813253> method cloneNode() does not clone dynamically-set style attributes correctly
2257 * khtml/html/html_elementimpl.h: Added cloneNode override.
2258 * khtml/html/html_elementimpl.cpp:
2259 (HTMLElementImpl::cloneNode): Added. Copies m_inlineStyleDecl.
2260 (HTMLElementImpl::parseHTMLAttribute): Changed to use getInlineStyleDecl().
2261 (HTMLElementImpl::innerText): Changed to do the same thing with fewer lines of code.
2262 (HTMLElementImpl::outerText): Tweaked comment.
2266 * khtml/xml/dom_elementimpl.cpp:
2267 (ElementImpl::cloneNode): Removed an uneeded type cast.
2268 (XMLElementImpl::cloneNode): Ditto.
2270 2004-09-24 Kevin Decker <kdecker@apple.com>
2274 <rdar://problem/3799334> DIG: Safari does not properly return style names [DigCSS.htm]
2276 * khtml/css/css_base.cpp:
2277 (CSSSelector::selectorText): Properly returns Class Selector names.
2278 Before we would get *[CLASS"foo"] instead of .foo
2280 2004-09-24 Ken Kocienda <kocienda@apple.com>
2286 <rdar://problem/3814660> REGRESSION (8A200-8A259): Select All has no effect on livepage.apple.com
2288 * khtml/xml/dom_docimpl.cpp:
2289 (DocumentImpl::updateSelection): Move the selection start and end to rendered positions
2290 before passing off to the RenderCanvas for drawing.
2291 * layout-tests/editing/selection/select-all-004-expected.txt: Added.
2292 * layout-tests/editing/selection/select-all-004.html: Added.
2294 2004-09-24 John Sullivan <sullivan@apple.com>
2298 - fixed <rdar://problem/3528339> Turn on full keyboard access shows
2299 invisible <input> elements
2301 * khtml/html/html_formimpl.cpp:
2302 (DOM::HTMLGenericFormElementImpl::isFocusable):
2303 reject elements that have zero width or height, even if they aren't hidden
2305 2004-09-24 Maciej Stachowiak <mjs@apple.com>
2307 - fixed deployment build
2311 * khtml/dom/dom_string.cpp: put implementation of ascii() in #ifdef !NDEBUG
2314 2004-09-24 David Hyatt <hyatt@apple.com>
2316 Fix for 3800316, test 37 for tables is failing on the layout tests. Make sure we don't incorrectly match
2317 non-HTML elements with HTML tag selectors in CSS.
2321 * khtml/css/cssstyleselector.cpp:
2322 (khtml::CSSStyleSelector::checkOneSelector):
2324 2004-09-23 David Hyatt <hyatt@apple.com>
2326 Fix for 3601920, CSS "tabs" not switching properly on zen garden design. Improve the repainting to account
2327 for layer changes of z-index that necessitate an invalidation.
2329 Reviewed by kocienda
2331 * khtml/rendering/render_object.cpp:
2332 (RenderObject::setStyle):
2333 * khtml/rendering/render_style.cpp:
2334 (RenderStyle::diff):
2335 * khtml/rendering/render_style.h:
2336 (khtml::RenderStyle::):
2338 2004-09-24 Chris Blumenberg <cblu@apple.com>
2340 Made markup copying 5 times faster. Unfortunately, this still doesn't fix:
2341 <rdar://problem/3794799> Tiger8A252: copying a bunch o' text is so slow it seems like a hang
2345 * khtml/dom/dom_string.h:
2346 * khtml/xml/dom2_rangeimpl.cpp:
2347 (DOM::RangeImpl::toHTML): serialize the range by iterating through the range
2348 * khtml/xml/dom_nodeimpl.cpp:
2349 (NodeImpl::startMarkup): new, factored out from recursive_toString
2350 (NodeImpl::endMarkup): ditto
2351 (NodeImpl::recursive_toString): call factored out methods
2352 * khtml/xml/dom_nodeimpl.h:
2356 2004-09-24 Ken Kocienda <kocienda@apple.com>
2358 Hyatt made an improvement in the render tree which caused the results
2359 to get a little thinner.
2361 * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt
2362 * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt
2364 2004-09-24 Ken Kocienda <kocienda@apple.com>
2370 <rdar://problem/3812939> REGRESSION: move-between-blocks-no-001 editing layout test fails in DeleteSelectionCommandImpl
2372 * khtml/rendering/render_block.cpp:
2373 (khtml::RenderBlock::removeChild): Hyatt said this regression was caused by a bad merge.
2374 Found by code inspection.
2376 2004-09-23 John Sullivan <sullivan@apple.com>
2380 - fixed <rdar://problem/3551850> hang caused by interpreting bad javascript
2381 guarded by a deliberately bogus "language" attribute (www.riibe.com)
2383 * khtml/html/htmltokenizer.cpp:
2384 (khtml::HTMLTokenizer::parseTag):
2385 Check for language attribute of <script> tag in a way that matches WinIE.
2386 Previously we were far too permissive.
2388 2004-09-23 David Hyatt <hyatt@apple.com>
2390 Fix for 3685234 and 3548444, the x-offset for frame borders was off by 1 pixel, causing mojibake to occur when
2391 repainting happened.
2393 * khtml/rendering/render_canvas.cpp:
2394 (RenderCanvas::repaintViewRectangle):
2396 2004-09-23 Richard Williamson <rjw@apple.com>
2398 Fixed <rdar://problem/3813271> dashboard-region-circle and dashboard-region-rectangle should be collapsed into dashboard-region
2399 Fixed <rdar://problem/3813289> dashboard regions need to correctly account for overflow/scrolling
2403 * khtml/css/css_valueimpl.cpp:
2404 (CSSPrimitiveValueImpl::cssText):
2405 * khtml/css/css_valueimpl.h:
2406 * khtml/css/cssparser.cpp:
2407 (CSSParser::parseValue):
2408 (skipCommaInDashboardRegion):
2409 (CSSParser::parseDashboardRegions):
2410 * khtml/khtmlview.cpp:
2411 (KHTMLView::layout):
2412 (KHTMLView::updateDashboardRegions):
2413 * khtml/khtmlview.h:
2414 * khtml/rendering/render_layer.cpp:
2415 (RenderLayer::scrollToOffset):
2416 * khtml/rendering/render_object.cpp:
2417 (RenderObject::addDashboardRegions):
2418 * kwq/KWQKHTMLPart.mm:
2419 (KWQKHTMLPart::dashboardRegionsChanged):
2420 * kwq/WebDashboardRegion.h:
2421 * kwq/WebDashboardRegion.m:
2422 (-[WebDashboardRegion initWithRect:clip:type:]):
2423 (-[WebDashboardRegion dashboardRegionClip]):
2424 (-[WebDashboardRegion description]):
2426 2004-09-23 Ken Kocienda <kocienda@apple.com>
2430 * khtml/xml/dom_position.cpp:
2431 (DOM::Position::inRenderedContent): Make the "empty block" check the same as the one
2432 use in visible position. This fixes a recent regression which broke up and down
2433 arrowing between blocks with an empty block in between.
2435 2004-09-23 Maciej Stachowiak <mjs@apple.com>
2439 <rdar://problem/3685235> REGRESSION (Mail): links are not properly editable
2441 * khtml/html/html_inlineimpl.cpp:
2442 (HTMLAnchorElementImpl::isFocusable): If this element is editable, then follow
2443 the normal focus rules so the link does not swallow focus when you arrow key
2444 or drag-select into it.
2446 2004-09-23 Darin Adler <darin@apple.com>
2448 - added test for the DOM::Range bug fixed recently
2450 * layout-tests/fast/dom/clone-contents-0-end-offset-expected.txt: Added.
2451 * layout-tests/fast/dom/clone-contents-0-end-offset.html: Added.
2453 2004-09-23 David Hyatt <hyatt@apple.com>
2455 Fix for hitlist bug, crash when deleting.
2457 Also fix repaint bug when inlines are inside overflow:auto/scroll regions.
2459 Reviewed by kocienda
2461 * khtml/editing/htmlediting_impl.cpp:
2462 (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
2463 (khtml::DeleteSelectionCommandImpl::doApply):
2464 * khtml/rendering/render_block.cpp:
2465 (khtml::RenderBlock::removeChild):
2466 * khtml/rendering/render_flow.cpp:
2467 (RenderFlow::getAbsoluteRepaintRect):
2469 2004-09-23 John Sullivan <sullivan@apple.com>
2473 - fixed <rdar://problem/3527840> reproducible crash at johnbrown.v32.qikker.com
2474 (nil-deref in NodeImpl::dispatchEvent)
2476 * khtml/xml/dom_nodeimpl.cpp:
2477 (NodeImpl::dispatchEvent):
2478 guard against document or document->document() being nil
2480 2004-09-23 Darin Adler <darin@apple.com>
2484 - added new VisibleRange class; not used yet
2486 * WebCore.pbproj/project.pbxproj: Added visible_range.h and visible_range.cpp.
2487 * khtml/editing/visible_range.cpp: Added.
2488 * khtml/editing/visible_range.h: Added.
2492 * kwq/WebCoreBridge.mm: (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
2493 Use switch statement instead of if statement so we get a warning if we ever add a new
2496 * khtml/editing/selection.h: khtml, not DOM, namespace
2497 * khtml/editing/visible_position.h: Ditto.
2499 2004-09-23 Darin Adler <darin@apple.com>
2503 - fixed <rdar://problem/3812758> 8S266: attaching mutation events to an editable div crashes Safari
2505 * khtml/xml/dom_nodeimpl.cpp:
2506 (NodeImpl::dispatchEvent): Added ref/deref so this works if passed a "floating" event object.
2507 (NodeImpl::dispatchGenericEvent): Ditto.
2508 (NodeImpl::dispatchHTMLEvent): Removed unneeded ref/deref now that dispatchEvent takes care of it.
2509 (NodeImpl::dispatchMouseEvent): Ditto.
2510 (NodeImpl::dispatchUIEvent): Ditto.
2512 2004-09-23 Darin Adler <darin@apple.com>
2516 - fixed some minor mistakes discovered by code inspection
2518 * khtml/khtml_part.cpp:
2519 (KHTMLPart::setSelection): Changed to not grab focus if clearing the selection.
2520 Grabbing focus when we get the selection is also probably something that should be
2521 conditional, since you can use a WebView in a mode where it can have selection even
2522 when not first responder, ala NSTextView.
2523 (KHTMLPart::setCaretVisible): Changed to not grab focus if making the caret invisible.
2524 Not sure if it's ever important to grab focus when making the caret visible, but by
2525 code inspection it seemed that was unlikely to do harm.
2527 2004-09-23 Darin Adler <darin@apple.com>
2531 - fixed <rdar://problem/3790595> "ERROR: unimplemented propertyID: 97" logged to console when copying selection (table-layout)
2533 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2534 Added CSS_PROP_TABLE_LAYOUT case.
2536 2004-09-23 Darin Adler <darin@apple.com>
2540 - fixed <rdar://problem/3809600> REGRESSION: text in search field doesn't disappear when clicked at developer.apple.com
2542 Reversing the order of scope caused us to get and set too many properties in the window
2543 object; in the case of this bug setting value ended up setting a window.value property
2544 instead of the value of the <input> element.
2546 * khtml/ecma/kjs_window.h: Removed bogus hasProperty function that always returns true.
2547 Testing shows that MacIE and Gecko match our behavior when we remove this, despite the
2548 "need this to match IE behavior" comment in the file, which I believe is incorrect.
2549 * khtml/ecma/kjs_window.cpp: Ditto.
2551 2004-09-23 Darin Adler <darin@apple.com>
2555 - fixed <rdar://problem/3812471> -[DOMRange cloneContents] clones too much in some cases where endOffset is 0
2557 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Added some nil
2558 checks to prevent this function from crashing if offsets are greater than the
2559 number of child nodes. Added a special case for offset 0 in one case that has a loop
2560 that won't work correctly for that case.
2562 2004-09-23 Darin Adler <darin@apple.com>
2566 - fixed <rdar://problem/3811890> when selecting and moving the caret, some words aren't spell-checked (test case included)
2568 This was mostly fixed by changes I made recently, but using the test case in the bug
2569 I discovered one regression I introduced and another problem that wasn't fixed yet.
2570 This change fixes both.
2572 * kwq/KWQKHTMLPart.mm:
2573 (KWQKHTMLPart::markMisspellingsInSelection): Removed unneeded inRenderedContent() check. It was returning false
2574 in cases involving a <br> at the end of line, and the check isn't all that helpful now that we use VisiblePosition,
2575 which takes care of that sort of thing for you. Changed code to determine the range to check to use the two
2576 different flavors of word boundary to expand to words we touch in both directions.
2577 (KWQKHTMLPart::updateSpellChecking): Changed to use the same logic about word boundaries. By being consistent,
2578 the anomalies reported in the bug report go away.
2580 2004-09-23 Darin Adler <darin@apple.com>
2584 - fixed <rdar://problem/3811584> REGRESSION (85-125): iframe.document undefined in function called from button onclick; works from img onclick
2586 Since we are doing a bit less "defers callbacks" work, when testing I ran into this code path.
2588 * khtml/xml/dom2_eventsimpl.cpp: (MouseEventImpl::computeLayerPos): Check for document without renderer.
2590 2004-09-23 Darin Adler <darin@apple.com>
2592 - checked in a new file I forgot
2594 * khtml/editing/text_granularity.h: Added.
2596 2004-09-22 Darin Adler <darin@apple.com>
2600 DOM::CaretPosition -> khtml::VisibleRange
2601 DOM::Selection -> khtml::Selection
2603 - moved all the functions in visible_units.h from DOM to khtml namespace
2604 - moved the one thing from Selection that KHTMLPart uses into its own header
2606 * WebCore.pbproj/project.pbxproj: Added text_granularity.h.
2608 * ForwardingHeaders/editing/selection.h: Added.
2609 * WebCore-combined.exp: Regenerated.
2610 * WebCore-tests.exp: Updated symbol for DOM::Selection debugging.
2612 * khtml/ecma/kjs_window.cpp: Update names and namespaces.
2613 * khtml/editing/htmlediting.cpp: Ditto.
2614 * khtml/editing/htmlediting.h: Ditto.
2615 * khtml/editing/htmlediting_impl.cpp: Ditto.
2616 * khtml/editing/htmlediting_impl.h: Ditto.
2617 * khtml/editing/jsediting.cpp: Ditto.
2618 * khtml/editing/selection.cpp: Ditto.
2619 * khtml/editing/selection.h: Ditto.
2620 * khtml/editing/visible_position.cpp: Ditto.
2621 * khtml/editing/visible_position.h: Ditto.
2622 * khtml/editing/visible_text.h: Ditto.
2623 * khtml/editing/visible_units.cpp: Ditto.
2624 * khtml/editing/visible_units.h: Ditto.
2625 * khtml/khtml_part.cpp: Ditto.
2626 * khtml/khtml_part.h: Ditto.
2627 * khtml/khtmlpart_p.h: Ditto.
2628 * khtml/rendering/render_block.cpp: Ditto.
2629 * khtml/xml/dom_docimpl.h: Ditto.
2630 * khtml/xml/dom_nodeimpl.cpp: Ditto.
2631 * kwq/KWQKHTMLPart.h: Ditto.
2632 * kwq/KWQKHTMLPart.mm: Ditto.
2633 * kwq/KWQRenderTreeDebug.cpp: Ditto.
2634 * kwq/WebCoreBridge.mm: Ditto.
2636 2004-09-22 Darin Adler <darin@apple.com>
2638 * ForwardingHeaders/*: Use import instead of include.
2640 2004-09-22 Darin Adler <darin@apple.com>
2642 - renamed these files:
2644 misc/khtml_text_operations.h -> editing/visible_text.h
2645 misc/khtml_text_operations.cpp -> editing/visible_text.cpp
2646 xml/dom_caretposition.cpp -> editing/visible_position.cpp
2647 xml/dom_caretposition.h -> editing/visible_position.h
2648 xml/dom_selection.cpp -> editing/selection.cpp
2649 xml/dom_selection.h -> editing/selection.h
2651 - broke out the word/line/paragraph part of visible_position.h into visible_units.h
2652 - removed some unnecessary includes from some header files to reduce the number of
2653 files that trigger "building the world"
2655 * WebCore.pbproj/project.pbxproj: Added the files under new names, removed the old ones.
2657 * ForwardingHeaders/editing/jsediting.h: Added.
2658 * ForwardingHeaders/editing/visible_text.h: Added.
2659 * ForwardingHeaders/misc/khtml_text_operations.h: Removed.
2660 * ForwardingHeaders/xml/dom_caretposition.h: Removed.
2661 * ForwardingHeaders/xml/dom_selection.h: Removed.
2663 * khtml/ecma/kjs_window.cpp: Updated or removed #include lines.
2664 * khtml/editing/htmlediting.cpp: Ditto.
2665 * khtml/editing/htmlediting.h: Ditto.
2666 * khtml/editing/htmlediting_impl.cpp: Ditto.
2667 * khtml/editing/htmlediting_impl.h: Ditto.
2668 * khtml/editing/jsediting.cpp: Ditto.
2669 * khtml/editing/selection.cpp: Ditto.
2670 * khtml/editing/selection.h: Ditto.
2671 * khtml/editing/visible_position.cpp: Ditto.
2672 * khtml/editing/visible_position.h: Ditto.
2673 * khtml/editing/visible_text.cpp: Ditto.
2674 * khtml/editing/visible_text.h: Ditto.
2675 * khtml/editing/visible_units.cpp: Added.
2676 * khtml/editing/visible_units.h: Added.
2677 * khtml/html/html_elementimpl.cpp: Updated or removed #include lines.
2678 * khtml/khtml_part.cpp: Ditto.
2679 * khtml/khtml_part.h: Ditto.
2680 * khtml/khtmlpart_p.h: Ditto.
2681 * khtml/khtmlview.cpp: Ditto.
2682 * khtml/misc/khtml_text_operations.cpp: Removed.
2683 * khtml/misc/khtml_text_operations.h: Removed.
2684 * khtml/rendering/render_block.cpp: Updated or removed #include lines.
2685 * khtml/xml/dom2_rangeimpl.cpp: Ditto.
2686 * khtml/xml/dom_caretposition.cpp: Removed.
2687 * khtml/xml/dom_caretposition.h: Removed.
2688 * khtml/xml/dom_docimpl.cpp: Updated or removed #include lines.
2689 * khtml/xml/dom_docimpl.h: Ditto.
2690 * khtml/xml/dom_elementimpl.cpp: Ditto.
2691 * khtml/xml/dom_nodeimpl.cpp: Ditto.
2692 * khtml/xml/dom_position.cpp: Ditto.
2693 * khtml/xml/dom_selection.cpp: Removed.
2694 * khtml/xml/dom_selection.h: Removed.
2695 * kwq/KWQKHTMLPart.mm: Updated or removed #include lines.
2696 * kwq/KWQKHTMLPart.h: Ditto.
2697 * kwq/KWQRenderTreeDebug.cpp: Ditto.
2698 * kwq/WebCoreBridge.mm: Ditto.
2700 2004-09-22 Richard Williamson <rjw@apple.com>
2702 Pass dashboard regions up to WebKit.
2704 Don't collect regions from RenderTexts.
2706 Made more args and return types references to avoid
2707 copying value lists.
2711 * WebCore.pbproj/project.pbxproj:
2712 * khtml/khtmlview.cpp:
2713 (KHTMLView::layout):
2714 * khtml/rendering/render_object.cpp:
2715 (RenderObject::collectDashboardRegions):
2716 * khtml/xml/dom_docimpl.cpp:
2717 (DocumentImpl::dashboardRegions):
2718 (DocumentImpl::setDashboardRegions):
2719 * khtml/xml/dom_docimpl.h:
2720 * kwq/KWQKHTMLPart.h:
2721 * kwq/KWQKHTMLPart.mm:
2722 (KWQKHTMLPart::didFirstLayout):
2723 (KWQKHTMLPart::dashboardRegionsChanged):
2724 * kwq/WebCoreBridge.h:
2725 * kwq/WebDashboardRegion.h: Added.
2726 * kwq/WebDashboardRegion.m: Added.
2727 (-[WebDashboardRegion initWithRect:type:]):
2728 (-[WebDashboardRegion copyWithZone:]):
2729 (-[WebDashboardRegion dashboardRegionRect]):
2730 (-[WebDashboardRegion dashboardRegionType]):
2731 (-[WebDashboardRegion description]):
2733 2004-09-22 Ken Kocienda <kocienda@apple.com>
2737 Fix for this hitlist bug:
2739 <rdar://problem/3805486> REGRESSION (Mail): Empty block elements can cause the caret to get "stuck" in one spot
2741 * khtml/xml/dom_caretposition.cpp:
2742 (DOM::CaretPosition::isCandidate): You can no longer caret into empty blocks with no height.
2743 Also did a little clean up in this function.
2744 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Regenerated expected results.
2745 This test was actually failing and had bogus results checked in!
2746 * layout-tests/editing/selection/select-all-003-expected.txt: Regenerated expected results.
2748 2004-09-22 Chris Blumenberg <cblu@apple.com>
2750 Fixed: <rdar://problem/3812091> REGRESSION (Mail): double-clicked word is not smart inserted on drag
2754 * khtml/editing/htmlediting.cpp:
2755 (khtml::MoveSelectionCommand::MoveSelectionCommand): take smartMove arg
2756 * khtml/editing/htmlediting.h:
2757 * khtml/editing/htmlediting_impl.cpp:
2758 (khtml::CompositeEditCommandImpl::deleteSelection): take smartDelete arg
2759 (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): take smartMove arg
2760 (khtml::MoveSelectionCommandImpl::doApply): pass smartMove for smartDelete and smartReplace
2761 * khtml/editing/htmlediting_impl.h:
2762 * kwq/WebCoreBridge.h:
2763 * kwq/WebCoreBridge.mm:
2764 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): take smartMove arg
2766 2004-09-22 Ken Kocienda <kocienda@apple.com>
2770 * khtml/css/css_computedstyle.cpp:
2771 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): New overloaded
2772 version of this function, one that takes a flag to determine whether to
2773 perform a document updateLayout() call before querying the style system.
2774 * khtml/css/css_computedstyle.h:
2775 (DOM::EUpdateLayout): Give a symbolic constant to true/false for the
2776 purpose of the new call to getPropertyCSSValue.
2777 * khtml/editing/htmlediting_impl.cpp:
2778 (khtml::StyleChange::currentlyHasStyle): Pass DoNotUpdateLayout to call to
2779 getPropertyCSSValue.
2780 (khtml::CompositeEditCommandImpl::applyTypingStyle): Add in top-level calls
2781 to updateLayout before doing style changes that now do not update styles
2783 (khtml::ApplyStyleCommandImpl::doApply): Ditto.
2784 (khtml::ApplyStyleCommandImpl::removeCSSStyle): Pass DoNotUpdateLayout to call to
2785 getPropertyCSSValue.
2786 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Remove this dead code.
2787 * khtml/editing/htmlediting_impl.h: Ditto.
2789 2004-09-22 Ken Kocienda <kocienda@apple.com>
2793 * WebCore.pbproj/project.pbxproj: New files added.
2794 * khtml/khtml_part.cpp:
2795 (KHTMLPart::clearSelection): No longer calls setFocusIfNeeded.
2796 (KHTMLPart::slotClearSelection): Merged old implementation from this function to
2797 clearSelection. Now just calls clearSelection. Also put in !APPLE_CHANGES since
2799 * khtml/xml/dom_docimpl.cpp:
2800 (DocumentImpl::setFocusNode): Add some code to determine when setting the focus should
2801 clear the selection.
2803 (QWidget::hasFocus): Call _webcore_effectiveFirstResponder to get view to check for focus.
2804 (QWidget::setFocus): Ditto.
2805 * kwq/WebCoreBridge.mm:
2806 (-[WebCoreBridge deselectText]): Called slotClearSelection and should have been. Now calls
2808 * kwq/WebCoreView.h: Added.
2809 * kwq/WebCoreView.m: Added.
2810 (-[NSView _webcore_effectiveFirstResponder]): New method to yield the correct responder
2811 to check for firstResponder-ness before calling makeFirstResonder. This helps to prevent
2812 unwanted firstResponder switching.
2813 (-[NSClipView _webcore_effectiveFirstResponder]): Ditto.
2814 (-[NSScrollView _webcore_effectiveFirstResponder]): Ditto.
2816 2004-09-21 Maciej Stachowiak <mjs@apple.com>
2820 <rdar://problem/3805137> REGRESSION: Cannot search on pricetool.com
2822 The problem here is that residual style handling can cause an
2823 element associated with a misnested form to lose the association,
2824 because it can become detached and then reattached in this
2825 case. So we need to maintain the association.
2827 * khtml/html/html_formimpl.h: Added list of dormant elements to form,
2828 and dormant bit to generic form element.
2829 * khtml/html/html_formimpl.cpp:
2830 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl): Clear m_form field for
2831 dormant elements too.
2832 (DOM::HTMLFormElementImpl::registerFormElement): Remove from dormant list
2833 in addition to adding to main list.
2834 (DOM::HTMLFormElementImpl::removeFormElement): Remove from both lists.
2835 (DOM::HTMLFormElementImpl::makeFormElementDormant): New method, remove from
2836 main list, add to dormant list.
2837 (DOM::HTMLGenericFormElementImpl::HTMLGenericFormElementImpl): Initialize
2838 dormant bit to false.
2839 (DOM::HTMLGenericFormElementImpl::insertedIntoDocument): If the element is
2840 dormant and has a form, re-register it and clear the dormant bit.
2841 (DOM::HTMLGenericFormElementImpl::removedFromDocument): If the document has
2842 a form, tell the form it is dormant and set the dormant bit.
2844 2004-09-22 Chris Blumenberg <cblu@apple.com>
2846 Fixed: <rdar://problem/3811187> REGRESSION (Mail): Control-click past end of document does not spell check last word
2848 Reviewed by kocienda.
2850 * khtml/xml/dom_selection.cpp:
2851 (DOM::Selection::validate): if at the end of the document, expand to the left.
2853 2004-09-22 Maciej Stachowiak <mjs@apple.com>
2855 Reviewed by Ken and John.
2857 <rdar://problem/3759228> REGRESSION (Mail): stray characters when entering text via input method right after newline
2859 * khtml/editing/htmlediting_impl.cpp:
2860 (khtml::CompositeEditCommandImpl::inputText): Add an optional
2861 selectInsertedText parameter.
2862 (khtml::ReplaceSelectionCommandImpl::doApply): Let the inputText operation
2863 select the text when inserting plain text, because it already knows all the right
2864 information to do so, and this function doesn't (sometimes text is inserted
2865 before the start of the old selection, not after!)
2866 * khtml/editing/htmlediting_impl.h:
2868 2004-09-22 Richard Williamson <rjw@apple.com>
2870 More tweaks to dashboard regions.
2872 Move dashboard regions list into css3NonInheritedData so it will be shared
2873 by all styles that don't modify the empty region list.
2875 Make the initial value for dashboard region list a static to minimize allocations
2878 Make marquee and flex style accessor functions const.
2882 * khtml/rendering/render_style.cpp:
2883 (RenderStyle::diff):
2884 * khtml/rendering/render_style.h:
2885 (khtml::RenderStyle::opacity):
2886 (khtml::RenderStyle::boxAlign):
2887 (khtml::RenderStyle::boxDirection):
2888 (khtml::RenderStyle::boxFlexGroup):
2889 (khtml::RenderStyle::boxOrdinalGroup):
2890 (khtml::RenderStyle::boxOrient):
2891 (khtml::RenderStyle::boxPack):
2892 (khtml::RenderStyle::marqueeIncrement):
2893 (khtml::RenderStyle::marqueeSpeed):
2894 (khtml::RenderStyle::marqueeLoopCount):
2895 (khtml::RenderStyle::marqueeBehavior):
2896 (khtml::RenderStyle::marqueeDirection):
2897 (khtml::RenderStyle::dashboardRegions):
2898 (khtml::RenderStyle::setDashboardRegions):
2899 (khtml::RenderStyle::setDashboardRegion):
2900 (khtml::RenderStyle::initialDashboardRegions):
2902 2004-09-22 David Hyatt <hyatt@apple.com>
2904 Fix for 3802766, entire view redrawn in Blot while typing. Don't needlessly create text nodes just to find
2905 out the font for the caret position.
2909 * kwq/KWQKHTMLPart.mm:
2910 (KWQKHTMLPart::fontForSelection):
2912 2004-09-21 Chris Blumenberg <cblu@apple.com>
2915 <rdar://problem/3735071> REGRESSION (Mail): WebCore Editing must do smart paste
2916 <rdar://problem/3799163> REGRESSION (Mail): Deleting a word doesn't delete whitespace
2920 * khtml/editing/htmlediting.cpp:
2921 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): take smartDelete parameter
2922 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take smartReplace parameter
2923 * khtml/editing/htmlediting.h:
2924 * khtml/editing/htmlediting_impl.cpp:
2925 (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl): take smartDelete parameter
2926 (khtml::DeleteSelectionCommandImpl::doApply): delete whitespace before and after selection if necessary
2927 (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl): take smartReplace parameter
2928 (khtml::ReplaceSelectionCommandImpl::doApply): add whitespace before and after the replacement if necessary
2929 * khtml/editing/htmlediting_impl.h:
2930 * kwq/WebCoreBridge.h:
2931 * kwq/WebCoreBridge.mm:
2932 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): take smartReplace parameter
2933 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): ditto
2934 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): ditto
2935 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): ditto
2936 (-[WebCoreBridge deleteSelectionWithSmartDelete:]): take smartDelete parameter
2938 2004-09-21 Richard Williamson <rjw@apple.com>
2940 More dashboard region work.
2942 Added support for computed style and cssText for new region property.
2943 Added restriction on length types allowed in region functions.
2944 Added initial and inheritance support for -apple-dashboard-region.
2948 * khtml/css/css_computedstyle.cpp:
2949 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2950 * khtml/css/css_valueimpl.cpp:
2951 (CSSPrimitiveValueImpl::cssText):
2952 * khtml/css/cssparser.cpp:
2953 (CSSParser::parseDashboardRegions):
2954 * khtml/css/cssstyleselector.cpp:
2955 (khtml::CSSStyleSelector::applyProperty):
2956 * khtml/rendering/render_object.cpp:
2957 (RenderObject::addDashboardRegions):
2958 * khtml/rendering/render_style.cpp:
2959 (RenderStyle::diff):
2960 * khtml/rendering/render_style.h:
2961 (khtml::StyleDashboardRegion::operator==):
2962 (khtml::RenderStyle::dashboardRegions):
2963 (khtml::RenderStyle::setDashboardRegions):
2964 (khtml::RenderStyle::initialDashboardRegions):
2966 2004-09-21 Darin Adler <darin@apple.com>
2970 - fixed problem where our updateLayout call ignores pending stylesheets all the time
2972 * khtml/xml/dom_docimpl.h: Added updateLayoutIgnorePendingStylesheets.
2973 * khtml/xml/dom_docimpl.cpp:
2974 (DocumentImpl::updateLayout): Took out the "ignore pending stylesheets" business here.
2975 (DocumentImpl::updateLayoutIgnorePendingStylesheets): Put it in here.
2977 * khtml/ecma/kjs_dom.cpp: (DOMNode::getValueProperty): Call the new
2978 updateLayoutIgnorePendingStylesheets function.
2979 * khtml/ecma/kjs_html.cpp:
2980 (KJS::HTMLElement::getValueProperty): Ditto.
2981 (KJS::HTMLElement::putValue): Ditto.
2982 * khtml/ecma/kjs_views.cpp: (DOMAbstractViewFunc::tryCall): Ditto.
2983 * khtml/ecma/kjs_window.cpp:
2984 (Window::updateLayout): Ditto.
2985 (Selection::get): Ditto.
2986 (SelectionFunc::tryCall): Ditto.
2988 * khtml/html/html_imageimpl.h: Add ignorePendingStylesheets boolean parameter.
2989 * khtml/html/html_imageimpl.cpp:
2990 (HTMLImageElementImpl::width): Respect new parameter.
2991 (HTMLImageElementImpl::height): Ditto.
2995 * kwq/WebCoreBridge.mm:
2996 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Removed unneeded
2997 explicit "true" parameter to setSelection.
2998 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto.
3000 2004-09-21 Darin Adler <darin@apple.com>
3004 - fix crash when pasting text at the end of the document and then doing an undo
3006 * khtml/editing/htmlediting_impl.cpp:
3007 (khtml::EditCommandImpl::apply): Call markMisspellingsInSelection before doing
3008 the editing operation, and we'll tell setSelection not to unmark the old selection.
3009 Also call updateLayout before calling appliedEditing so DOM operations in the
3010 code responding to the selection change will work.
3011 (khtml::EditCommandImpl::unapply): Ditto.
3012 (khtml::EditCommandImpl::reapply): Ditto.
3014 * khtml/khtml_part.h: Added a third parameter to setSelection to tell it whether
3015 to unmark the old selection. We must pass false when editing, because the old
3016 selection might have now-invalid offsets inside it.
3017 * khtml/khtml_part.cpp:
3018 (KHTMLPart::setSelection): Add unmarkOldSelection parameter, and respect it.
3019 (KHTMLPart::appliedEditing): Pass false for unmarkOldSelection.
3020 (KHTMLPart::unappliedEditing): Ditto.
3021 (KHTMLPart::reappliedEditing): Ditto.
3023 2004-09-21 Richard Williamson <rjw@apple.com>
3025 Part 2 of the feature requested in
3026 <rdar://problem/3752791> Dashboard: Need a better solution for control regions
3028 This patch actually collections the regions and converts to absolute coordinates.
3029 Only remaining piece is to pass over the bridge and up the alley to WebKit
3034 * khtml/css/css_valueimpl.h:
3035 (DOM::CSSPrimitiveValueImpl::getDashboardRegionValue):
3036 * khtml/css/cssparser.cpp:
3037 (CSSParser::parseValue):
3038 (CSSParser::parseDashboardRegions):
3039 * khtml/css/cssproperties.c:
3040 * khtml/css/cssproperties.h:
3041 * khtml/css/cssproperties.in:
3042 * khtml/css/cssstyleselector.cpp:
3043 (khtml::CSSStyleSelector::applyProperty):
3044 * khtml/khtmlview.cpp:
3045 (KHTMLView::layout):
3046 * khtml/rendering/render_object.cpp:
3047 (RenderObject::computeDashboardRegions):
3048 (RenderObject::addDashboardRegions):
3049 (RenderObject::collectDashboardRegions):
3050 * khtml/rendering/render_object.h:
3051 (khtml::DashboardRegionValue::operator==):
3052 * khtml/rendering/render_style.cpp:
3053 * khtml/rendering/render_style.h:
3054 (khtml::StyleDashboardRegion::):
3055 (khtml::RenderStyle::dashboardRegions):
3056 (khtml::RenderStyle::setDashboardRegion):
3057 * khtml/xml/dom_docimpl.cpp:
3058 (DocumentImpl::DocumentImpl):
3059 (DocumentImpl::updateLayout):
3060 (DocumentImpl::acceptsEditingFocus):
3061 (DocumentImpl::dashboardRegions):
3062 (DocumentImpl::setDashboardRegions):
3063 * khtml/xml/dom_docimpl.h:
3064 (DOM::DocumentImpl::hasDashboardRegions):
3065 (DOM::DocumentImpl::setHasDashboardRegions):
3067 2004-09-21 John Sullivan <sullivan@apple.com>
3071 - WebCore part of fix for <rdar://problem/3618274> REGRESSION (125-135):
3072 Option-tab doesn't always work as expected
3074 * kwq/KWQKHTMLPart.mm:
3075 (KWQKHTMLPart::tabsToAllControls):
3076 reworked logic to match what we promise in the UI; this worked correctly
3077 before for regular tabbing, but not for option-tabbing.
3080 (QButton::focusPolicy):
3081 check tabsToAllControls() rather than just WebCoreKeyboardAccessFull
3083 * kwq/KWQComboBox.mm:
3084 (QComboBox::focusPolicy):
3087 * kwq/KWQFileButton.mm:
3088 (KWQFileButton::focusPolicy):
3091 * kwq/KWQListBox.mm:
3092 (QListBox::focusPolicy):
3095 2004-09-21 John Sullivan <sullivan@apple.com>
3097 * khtml/xml/dom_selection.cpp:
3098 (DOM::Selection::modify):
3099 initialize xPos to make compiler happy in deployment builds
3101 2004-09-21 Darin Adler <darin@apple.com>
3105 - some small mechanical improvements to the position and selection classes
3107 * khtml/xml/dom_position.h: Added clear(), startPosition(), and endPosition().
3108 * khtml/xml/dom_position.cpp:
3109 (DOM::Position::clear): Added.
3110 (DOM::startPosition): Added.
3111 (DOM::endPosition): Added.
3113 * khtml/xml/dom_caretposition.h: Changed m_position to m_deepPosition. Added clear(),
3114 removed node() and offset().
3115 * khtml/xml/dom_caretposition.cpp:
3116 (DOM::CaretPosition::init): Updated for name change of m_position to m_deepPosition.
3117 (DOM::CaretPosition::isLastInBlock): Ditto.
3118 (DOM::CaretPosition::next): Ditto.
3119 (DOM::CaretPosition::previous): Ditto.
3120 (DOM::CaretPosition::debugPosition): Ditto.
3121 (DOM::CaretPosition::formatForDebugger): Ditto.
3123 * khtml/xml/dom_selection.h: Remove setStart, setEnd, setStartAndEnd, rangeStart, rangeEnd,
3124 and all the assignXXX functions.
3125 * khtml/xml/dom_selection.cpp:
3126 (DOM::Selection::Selection): Wean from assign functions, get and set data members directly.
3127 (DOM::Selection::init): Don't clear base, extent, start, and end, since they have constructors.
3128 (DOM::Selection::operator=): Wean from assign functions, get and set data members directly.
3129 (DOM::Selection::moveTo): Ditto.
3130 (DOM::Selection::setModifyBias): Ditto.
3131 (DOM::Selection::modifyExtendingRightForward): Ditto.
3132 (DOM::Selection::modifyMovingRightForward): Ditto.
3133 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
3134 (DOM::Selection::modifyMovingLeftBackward): Ditto.
3135 (DOM::Selection::modify): Ditto.
3136 (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
3137 (DOM::Selection::clear): Ditto.
3138 (DOM::Selection::setBase): Ditto.
3139 (DOM::Selection::setExtent): Ditto.
3140 (DOM::Selection::setBaseAndExtent): Ditto.
3141 (DOM::Selection::toRange): Ditto.
3142 (DOM::Selection::layoutCaret): Ditto.
3143 (DOM::Selection::needsCaretRepaint): Ditto.
3144 (DOM::Selection::validate): Ditto.
3145 (DOM::Selection::debugRenderer): Ditto.
3146 (DOM::Selection::debugPosition): Ditto.
3147 (DOM::Selection::end):
3149 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::advanceToNextMisspelling): Tweaked whitespace.
3151 2004-09-21 Chris Blumenberg <cblu@apple.com>
3153 Fixed: <rdar://problem/3647229> Safari does not play inline Windows Media Content on some sites (miggy.net and ministryofsound.com)
3157 * khtml/rendering/render_frames.cpp:
3158 (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
3160 2004-09-20 Darin Adler <darin@apple.com>
3164 - fixed regression from my recent check-in where misspelled words do not get unmarked when moving the caret
3165 - changed CaretPosition to hold a Position instead of a node and offset
3166 - renamed isEmpty to isNull, etc.
3168 * kwq/KWQKHTMLPart.mm:
3169 (KWQKHTMLPart::jumpToSelection): Updated for name changes.
3170 (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
3171 (KWQKHTMLPart::fontForSelection): Ditto.
3172 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Ditto.
3173 (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
3174 (KWQKHTMLPart::updateSpellChecking): Fixed bug by using LeftWordIfOnBoundary.
3176 * khtml/xml/dom_position.h: Updated for name changes.
3177 * khtml/xml/dom_position.cpp:
3178 (DOM::Position::element): Change to not use a separate null check.
3179 (DOM::Position::computedStyle): Updated for name changes.
3180 (DOM::Position::previousCharacterPosition): Ditto.
3181 (DOM::Position::nextCharacterPosition): Ditto.
3182 (DOM::Position::equivalentRangeCompliantPosition): Ditto.
3183 (DOM::Position::equivalentShallowPosition): Ditto.
3184 (DOM::Position::equivalentDeepPosition): Ditto.
3185 (DOM::Position::closestRenderedPosition): Ditto.
3186 (DOM::Position::inRenderedContent): Ditto.
3187 (DOM::Position::inRenderedText): Ditto.
3188 (DOM::Position::isRenderedCharacter): Ditto.
3189 (DOM::Position::rendersInDifferentPosition): Ditto.
3190 (DOM::Position::isFirstRenderedPositionOnLine): Ditto.
3191 (DOM::Position::isLastRenderedPositionOnLine): Ditto.
3192 (DOM::Position::inFirstEditableInRootEditableElement): Ditto.
3193 (DOM::Position::leadingWhitespacePosition): Ditto.
3194 (DOM::Position::trailingWhitespacePosition): Ditto.
3195 (DOM::Position::debugPosition): Ditto.
3196 (DOM::Position::formatForDebugger): Ditto.
3198 * khtml/xml/dom_caretposition.h: Change to use m_position, and change names.
3199 * khtml/xml/dom_caretposition.cpp:
3200 (DOM::CaretPosition::CaretPosition): Remove code to set up m_node.
3201 (DOM::CaretPosition::init): Set m_position directly.
3202 (DOM::CaretPosition::isLastInBlock): Updated for name changes.
3203 (DOM::CaretPosition::next): Set m_position directly.
3204 (DOM::CaretPosition::previous): Set m_position directly.
3205 (DOM::CaretPosition::previousCaretPosition): Updated for name changes.
3206 (DOM::CaretPosition::nextCaretPosition): Ditto.
3207 (DOM::CaretPosition::previousPosition): Ditto.
3208 (DOM::CaretPosition::nextPosition): Ditto.
3209 (DOM::CaretPosition::atStart): Ditto.
3210 (DOM::CaretPosition::atEnd): Ditto.
3211 (DOM::CaretPosition::isCandidate): Ditto.
3212 (DOM::CaretPosition::debugPosition): Ditto.
3213 (DOM::CaretPosition::formatForDebugger): Ditto.
3214 (DOM::startOfWord): Ditto.
3215 (DOM::endOfWord): Ditto.
3216 (DOM::previousParagraphPosition): Ditto.
3217 (DOM::nextParagraphPosition): Ditto.
3219 * khtml/xml/dom_selection.h: Updated names. Added isCaret and isRange.
3220 * khtml/xml/dom_selection.cpp:
3221 (DOM::Selection::modifyMovingRightForward): Updated for name changes.
3222 (DOM::Selection::modifyMovingLeftBackward): Ditto.
3223 (DOM::Selection::modify): Ditto.
3224 (DOM::Selection::expandUsingGranularity): Ditto.
3225 (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
3226 (DOM::Selection::toRange): Ditto.
3227 (DOM::Selection::layoutCaret): Ditto.
3228 (DOM::Selection::needsCaretRepaint): Ditto.
3229 (DOM::Selection::validate): Ditto.
3230 (DOM::startOfFirstRunAt): Ditto.
3231 (DOM::endOfLastRunAt): Ditto.
3232 (DOM::selectionForLine): Ditto.
3233 (DOM::Selection::formatForDebugger): Ditto.
3235 * khtml/ecma/kjs_window.cpp:
3236 (Selection::get): Updated for name changes.
3237 (Selection::toString): Ditto.
3238 * khtml/editing/htmlediting_impl.cpp:
3239 (khtml::debugPosition): Ditto.
3240 (khtml::StyleChange::init): Ditto.
3241 (khtml::StyleChange::currentlyHasStyle): Ditto.
3242 (khtml::CompositeEditCommandImpl::deleteSelection): Ditto.
3243 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): Ditto.
3244 (khtml::ApplyStyleCommandImpl::doApply): Ditto.
3245 (khtml::DeleteSelectionCommandImpl::doApply): Ditto.
3246 (khtml::InputNewlineCommandImpl::doApply): Ditto.
3247 (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
3248 (khtml::InputTextCommandImpl::input): Ditto.
3249 (khtml::ReplaceSelectionCommandImpl::doApply): Ditto.
3250 (khtml::MoveSelectionCommandImpl::doApply): Ditto.
3251 (khtml::TypingCommandImpl::doApply): Ditto.
3252 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Ditto.
3253 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Ditto.
3254 * khtml/editing/jsediting.cpp:
3255 (enabledAnySelection): Ditto.
3256 (enabledRangeSelection): Ditto.
3257 * khtml/khtml_part.cpp:
3258 (KHTMLPart::hasSelection): Ditto.
3259 (KHTMLPart::setFocusNodeIfNeeded): Ditto.
3260 (KHTMLPart::selectionLayoutChanged): Ditto.
3261 (KHTMLPart::timerEvent): Ditto.
3262 (KHTMLPart::isPointInsideSelection): Ditto.
3263 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
3264 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
3265 (KHTMLPart::handleMousePressEventSingleClick): Ditto.
3266 (KHTMLPart::handleMouseMoveEventSelection): Ditto.
3267 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
3268 (KHTMLPart::selectionHasStyle): Ditto.
3269 (KHTMLPart::selectionComputedStyle): Ditto.
3270 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::updateSelection): Ditto.
3271 * khtml/xml/dom_positioniterator.cpp:
3272 (DOM::PositionIterator::peekPrevious): Ditto.
3273 (DOM::PositionIterator::peekNext): Ditto.
3274 (DOM::PositionIterator::atStart): Ditto.
3275 (DOM::PositionIterator::atEnd): Ditto.
3276 * khtml/xml/dom_positioniterator.h:
3277 (DOM::PositionIterator::isEmpty): Ditto.
3278 * kwq/KWQRenderTreeDebug.cpp:
3279 (writeSelection): Ditto.
3280 * kwq/WebCoreBridge.mm:
3281 (-[WebCoreBridge editableDOMRangeForPoint:]): Ditto.
3282 (-[WebCoreBridge deleteSelection]): Ditto.
3283 (-[WebCoreBridge ensureCaretVisible]): Ditto.
3284 (-[WebCoreBridge rangeOfCharactersAroundCaret]): Ditto.
3286 2004-09-20 Darin Adler <darin@apple.com>
3290 - fixed <rdar://problem/3808073> find is broken
3292 * khtml/misc/khtml_text_operations.h: Add m_pastEndNode and change name of m_endNode to
3293 m_endContainer to more accurately reflect its purpose.
3294 * khtml/misc/khtml_text_operations.cpp:
3295 (khtml::TextIterator::TextIterator): Use pastEnd() for end of iteration, and change to
3296 handle bad ranges better: just return an empty iterator instead of raising an exception.
3297 (khtml::TextIterator::advance): Change to use m_pastEndNode to detect the end of iteration.
3298 (khtml::TextIterator::handleTextNode): Update for name change.
3299 (khtml::TextIterator::handleTextBox): Ditto.
3300 (khtml::TextIterator::range): Handle case where m_endContainer is nil.
3302 * khtml/xml/dom2_rangeimpl.cpp:
3303 (DOM::RangeImpl::surroundContents): Use offsetInCharacters.
3304 (DOM::RangeImpl::startNode): Added check for nil start container and use offsetInCharacters.
3305 (DOM::RangeImpl::pastEndNode): Ditto.
3307 2004-09-20 Chris Blumenberg <cblu@apple.com>
3309 Fixed: <rdar://problem/3781290> REGRESSION (Mail): Crash in ReplaceSelectionCommandImpl attaching file to new message
3311 Reviewed by kocienda.
3313 * khtml/khtml_part.cpp:
3314 (KHTMLPart::setSelection): setFocusNodeIfNeeded now works on the current selection so call setFocusNodeIfNeeded after setting the selection
3315 (KHTMLPart::clearSelection): don't call setFocusNodeIfNeeded with the current selection
3316 (KHTMLPart::setCaretVisible): ditto
3317 (KHTMLPart::setFocusNodeIfNeeded): do nothing if the part isn't focused, work with the current selection
3318 * khtml/khtml_part.h:
3319 * khtml/khtmlpart_p.h:
3320 (KHTMLPartPrivate::KHTMLPartPrivate): added m_isFocused
3321 * kwq/KWQKHTMLPart.h:
3322 * kwq/KWQKHTMLPart.mm:
3323 (KWQKHTMLPart::KWQKHTMLPart): removed _displaysWithFocusAttributes this is replaced by m_isFocused
3324 (KWQKHTMLPart::setSelectionFromNone): new, code factored out from setDisplaysWithFocusAttributes
3325 (KWQKHTMLPart::setDisplaysWithFocusAttributes): call setSelectionFromNone
3326 (KWQKHTMLPart::displaysWithFocusAttributes): now returns m_isFocused
3327 * kwq/WebCoreBridge.h:
3328 * kwq/WebCoreBridge.mm:
3329 (-[WebCoreBridge setSelectionFromNone]): new
3331 2004-09-20 Darin Adler <darin@apple.com>
3335 - fixed nil-deref happening often in Mail when I delete
3337 * khtml/rendering/render_br.cpp: (RenderBR::selecti