1 2004-10-25 Ken Kocienda <kocienda@apple.com>
7 <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
9 * khtml/editing/htmlediting.cpp:
10 (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
11 expand the selection outwards when the selection is on the visible boundary of a root
12 editable element. This fixes the bug. Note that this function also contains a little code
13 I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
14 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
15 (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
16 * khtml/editing/htmlediting.h: Declare new helpers.
17 * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
18 * layout-tests/editing/deleting/delete-select-all-001.html: Added.
19 * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
20 * layout-tests/editing/deleting/delete-select-all-002.html: Added.
21 * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
22 * layout-tests/editing/deleting/delete-select-all-003.html: Added.
24 2004-10-25 Ken Kocienda <kocienda@apple.com>
28 Added some more editing layout tests.
30 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
31 * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
32 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
33 * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
34 * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
35 * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
36 * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
37 * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
38 * layout-tests/editing/inserting/typing-003-expected.txt: Added.
39 * layout-tests/editing/inserting/typing-003.html: Added.
41 2004-10-25 Ken Kocienda <kocienda@apple.com>
45 * khtml/rendering/bidi.cpp:
46 (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
47 yesterday quite right: words that should have been placed on the next line were instead
48 appearing on the line before, beyond the right margin. This was a one-word only error
49 based on moving the line break object when it should have stayed put. Here is the rule:
50 The line break object only moves to after the whitespace on the end of a line if that
51 whitespace caused line overflow when its width is added in.
53 2004-10-25 Adele Amchan <adele@apple.com>
57 Fix for <rdar://problem/3619890> Feature request: designMode
59 This change implements the designMode property of a document. This is an IE property that is also supported by Mozilla.
60 This will enable more JS editing compatibility.
62 * khtml/ecma/kjs_html.cpp:
63 (KJS::HTMLDocument::tryGet): added case for designMode
64 (KJS::HTMLDocument::putValue): added case for designMode
65 * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
66 * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
67 * khtml/xml/dom_docimpl.cpp:
68 (DocumentImpl::DocumentImpl): initialize m_designMode member variable
69 (DocumentImpl::setDesignMode): added function to assign m_designMode value
70 (DocumentImpl::getDesignMode): return m_designMode value
71 (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value.
72 Otherwise, it will just return the m_designMode value.
73 (DocumentImpl::parentDocument):
74 * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
75 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
77 2004-10-22 Ken Kocienda <kocienda@apple.com>
83 <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
85 * khtml/editing/htmlediting.cpp:
86 (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
87 everything that could be affected.
88 (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
89 braces, making it act as a comma operator, with a zero value as the right value!!! This made
90 an important check always fail!!! It turns out that we do not want the constant at all, since
91 that constant is only needed when checking a computed style, not an inline style as is being
93 (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
94 (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
95 RangeImpl::compareBoundaryPoints to perform the required check.
96 * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
98 2004-10-22 Ken Kocienda <kocienda@apple.com>
104 <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
105 <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
107 * khtml/rendering/bidi.cpp:
108 (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
109 it is when we are editing, add in the space of the current character when calculating the width
110 of committed plus uncommitted characters. If this value exceeds the width of the line, move up
111 the line break object and call skipWhitespace to move past the end of the whitespace.
115 2004-10-22 Ken Kocienda <kocienda@apple.com>
119 * WebCore.pbproj/project.pbxproj:
120 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
122 2004-10-21 David Hyatt <hyatt@apple.com>
126 Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
128 <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
129 <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
131 * khtml/rendering/render_block.cpp:
132 (khtml::getInlineRun):
133 (khtml::RenderBlock::makeChildrenNonInline):
135 2004-10-21 David Hyatt <hyatt@apple.com>
137 Fix for 3810389, crash because of continuation() craziness. Revert back to the old behavior of
138 making sure that all line boxes get deleted and recreated when inlines are split because of a block.
142 * khtml/rendering/render_inline.cpp:
143 (RenderInline::splitFlow):
145 2004-10-21 Ken Kocienda <kocienda@apple.com>
149 Significant improvement to the way that whitespace is handled during editing.
151 * khtml/editing/htmlediting.cpp:
152 (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
153 two being added with this name) that delete "insignificant" unrendered text.
154 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
155 calculates the downstream position to use as the endpoint for the deletion, and
156 then calls deleteInsignificantText with this start and end.
157 (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
158 (khtml::InputNewlineCommand::doApply): Ditto.
159 (khtml::InputTextCommand::input): Ditto.
160 * khtml/editing/htmlediting.h: Add new declarations.
162 Modified layout test results:
163 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
164 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
165 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
166 * layout-tests/editing/deleting/delete-selection-001-expected.txt:
167 * layout-tests/editing/deleting/delete-tab-001-expected.txt:
168 * layout-tests/editing/deleting/delete-tab-004-expected.txt:
169 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
170 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
171 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
172 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
173 * layout-tests/editing/inserting/insert-br-001-expected.txt:
174 * layout-tests/editing/inserting/insert-br-004-expected.txt:
175 * layout-tests/editing/inserting/insert-br-005-expected.txt:
176 * layout-tests/editing/inserting/insert-br-006-expected.txt:
177 * layout-tests/editing/inserting/insert-tab-001-expected.txt:
178 * layout-tests/editing/inserting/insert-tab-002-expected.txt:
179 * layout-tests/editing/inserting/insert-tab-004-expected.txt:
180 * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
181 * layout-tests/editing/inserting/typing-001-expected.txt:
182 * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
183 * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
184 * layout-tests/editing/style/typing-style-003-expected.txt:
185 * layout-tests/editing/undo/redo-typing-001-expected.txt:
186 * layout-tests/editing/undo/undo-typing-001-expected.txt:
188 2004-10-21 David Hyatt <hyatt@apple.com>
190 Fix for 3847054, assertion failure in RenderText::layout() on news.com page. Fix getInlineRun so that
191 it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
195 * khtml/rendering/render_block.cpp:
196 (khtml::getInlineRun):
198 2004-10-20 David Hyatt <hyatt@apple.com>
200 Add better dumping of overflow information for scrolling regions.
202 Fix for 3726524, crash in updateLayerPosition. Make sure anonymous elements properly remove themselves
203 from the render tree so that layers and so forth are cleaned up.
207 * khtml/rendering/render_container.cpp:
208 (RenderContainer::detach):
209 * khtml/rendering/render_layer.h:
210 (khtml::RenderLayer::scrollXOffset):
211 (khtml::RenderLayer::scrollYOffset):
212 * kwq/KWQRenderTreeDebug.cpp:
215 2004-10-20 David Hyatt <hyatt@apple.com>
217 Fix for 3791146, make sure all lines are checked when computing overflow.
221 * khtml/rendering/bidi.cpp:
222 (khtml::RenderBlock::computeHorizontalPositionsForLine):
223 (khtml::RenderBlock::layoutInlineChildren):
224 (khtml::RenderBlock::findNextLineBreak):
225 (khtml::RenderBlock::checkLinesForOverflow):
226 * khtml/rendering/render_block.h:
228 2004-10-20 David Hyatt <hyatt@apple.com>
230 Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
234 * khtml/rendering/break_lines.cpp:
235 (khtml::isBreakable):
237 2004-10-20 Darin Adler <darin@apple.com>
241 - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
243 * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
244 Create a palette with the background and foreground colors in it and set it on the widget.
246 * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
247 with APPLE_CHANGES. Removed palette and palette-related function members.
248 * khtml/rendering/render_style.cpp:
249 (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
250 (RenderStyle::diff): No palette to compare.
252 * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
253 * kwq/KWQLineEdit.mm:
254 (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
255 (QLineEdit::text): Made const.
257 * kwq/KWQTextEdit.h: Added setPalette override.
258 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
261 * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
262 per color group, and only a single color group per palette.
263 * kwq/KWQColorGroup.mm: Removed.
264 * kwq/KWQPalette.mm: Removed.
265 * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
267 * kwq/KWQApplication.h: Removed unused palette function.
268 * kwq/KWQApplication.mm: Ditto.
270 * kwq/KWQWidget.h: Removed unsetPalette.
271 * kwq/KWQWidget.mm: Ditto.
275 * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
276 Roll in storage leak fix from KDE guys.
278 2004-10-19 David Hyatt <hyatt@apple.com>
282 More cleanup of block layout. Eliminates the separate step for tables that dont fit on a line with a float
283 and consolidates it with clearing.
285 Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
287 * khtml/rendering/render_block.cpp:
288 (khtml::getInlineRun):
289 (khtml::RenderBlock::layoutBlock):
290 (khtml::RenderBlock::adjustFloatingBlock):
291 (khtml::RenderBlock::collapseMargins):
292 (khtml::RenderBlock::clearFloatsIfNeeded):
293 (khtml::RenderBlock::estimateVerticalPosition):
294 (khtml::RenderBlock::layoutBlockChildren):
295 (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
296 (khtml::RenderBlock::getClearDelta):
297 (khtml::RenderBlock::calcBlockMinMaxWidth):
298 * khtml/rendering/render_block.h:
299 * khtml/rendering/render_frames.cpp:
300 (RenderFrameSet::layout):
301 * khtml/xml/dom_textimpl.cpp:
302 (TextImpl::rendererIsNeeded):
304 Fix for 3841060, regression with * in frames. Reviewed by kocienda.
306 * layout-tests/fast/frames/002-expected.txt: Added.
307 * layout-tests/fast/frames/002.html: Added.
309 2004-10-19 Darin Adler <darin@apple.com>
313 - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
315 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
316 scripts being loaded here. If the current code being run is the external script itself, then we don't want
317 to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
318 assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
319 wrong since there can be a script loading in that case too. Layout tests check for both problems.
321 * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
322 * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
323 * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
325 * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
327 2004-10-18 Darin Adler <darin@apple.com>
329 Reviewed by Dave Hyatt.
331 - 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)
333 * khtml/html/htmltokenizer.cpp:
334 (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
335 (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
336 we only want to look at loadingExtScript if m_executingScript is 0.
338 2004-10-18 Ken Kocienda <kocienda@apple.com>
344 <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
346 * khtml/css/css_valueimpl.cpp:
347 (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
348 Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the
349 lifecycle issues associated with creating a string to be returned in the ident case.
350 * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
351 * khtml/css/cssstyleselector.cpp:
352 (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
354 2004-10-18 Chris Blumenberg <cblu@apple.com>
356 Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
358 Reviewed by kocienda.
360 * khtml/rendering/render_frames.cpp:
361 (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
363 2004-10-15 Chris Blumenberg <cblu@apple.com>
365 Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
370 (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
373 2004-10-15 Ken Kocienda <kocienda@apple.com>
377 * khtml/rendering/bidi.cpp:
378 (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
379 skipping after a clean line break, in addition to the cases already
381 * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
382 * layout-tests/editing/inserting/insert-br-007.html: Added.
383 * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
384 * layout-tests/editing/inserting/insert-br-008.html: Added.
388 2004-10-14 Ken Kocienda <kocienda@apple.com>
394 <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
396 * khtml/editing/visible_position.cpp:
397 (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
398 position code to new-style VisiblePosition code. In retrospect, this code was misguided.
399 Since we do a good job of insulating external code from the internal workings of
400 VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
401 in the case of this bug, was doing harm. Simply removing this code makes the bug
402 go away and does not cause any editing layout test regresssions.
404 2004-10-14 Ken Kocienda <kocienda@apple.com>
408 * khtml/rendering/bidi.cpp:
409 (khtml::skipNonBreakingSpace): New helper.
410 (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
411 at the start of a block. This was preventing users from typing spaces in empty
413 * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
414 * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
416 2004-10-14 Adele Amchan <adele@apple.com>
418 Reviewed by Darin and Ken.
420 fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
422 This change shifts some code around so that the code that determines what typing style
423 is in effect is called before deleteUnrenderedText is called. Two asserts are also added
424 to ensure that start and end nodes of the selection are in the document.
426 * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
428 2004-10-14 Adele Amchan <adele@apple.com>
432 This change makes these three functions virtual so that the work is being done in KWQHTMLPart
433 instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
435 * khtml/khtml_part.cpp:
436 (KHTMLPart::shouldBeginEditing):
437 (KHTMLPart::shouldEndEditing):
438 (KHTMLPart::isContentEditable):
439 * khtml/khtml_part.h:
440 * kwq/KWQKHTMLPart.h:
442 2004-10-14 Ken Kocienda <kocienda@apple.com>
446 Final fix for these bugs:
448 <rdar://problem/3806306> HTML editing puts spaces at start of line
449 <rdar://problem/3814252> HTML editing groups space with word causing wrapping
451 This change sets some new CSS properties that have been added to WebCore to
452 enable whitespace-handling and line-breaking features that make WebView work
453 more like a text editor.
455 * khtml/css/cssstyleselector.cpp:
456 (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties
457 based on property value.
458 * khtml/html/html_elementimpl.cpp:
459 (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties
460 based on attribute value.
461 * khtml/khtml_part.cpp:
462 (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
464 (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
466 (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
467 (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
468 * khtml/khtml_part.h: Add new declarations.
469 * kwq/WebCoreBridge.h: Ditto.
470 * kwq/WebCoreBridge.mm:
471 (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
472 (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
473 (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
474 (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
476 2004-10-14 John Sullivan <sullivan@apple.com>
480 - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
482 * khtml/editing/htmlediting.cpp:
483 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
484 needed a nil check to handle empty document case
486 2004-10-13 Maciej Stachowiak <mjs@apple.com>
490 <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
492 - I fixed this by turning off all colormatching for WebKit
493 content. We might turn it back on later. For now, it's possible to
494 turn it on temporarily by defining COLORMATCH_EVERYTHING.
497 * khtml/ecma/kjs_html.cpp:
498 (KJS::Context2DFunction::tryCall):
499 (Context2D::colorRefFromValue):
500 (Gradient::getShading):
501 * khtml/rendering/render_canvasimage.cpp:
502 (RenderCanvasImage::createDrawingContext):
504 (QColor::getNSColor):
507 (CGColorFromNSColor):
508 (QPainter::selectedTextBackgroundColor):
509 (QPainter::rgbColorSpace):
510 (QPainter::grayColorSpace):
511 (QPainter::cmykColorSpace):
512 * kwq/WebCoreGraphicsBridge.h:
513 * kwq/WebCoreGraphicsBridge.m:
514 (-[WebCoreGraphicsBridge createRGBColorSpace]):
515 (-[WebCoreGraphicsBridge createGrayColorSpace]):
516 (-[WebCoreGraphicsBridge createCMYKColorSpace]):
518 2004-10-13 Ken Kocienda <kocienda@apple.com>
522 * khtml/css/css_valueimpl.cpp:
523 (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
524 is non-null before appending.
526 2004-10-13 Ken Kocienda <kocienda@apple.com>
530 Update expected results for improved behavior as a result of fix to 3816768.
532 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
533 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
534 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
536 2004-10-13 Ken Kocienda <kocienda@apple.com>
540 * khtml/css/css_computedstyle.cpp:
541 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
542 for getting -khtml-line-break and -khml-nbsp-mode.
544 2004-10-13 Ken Kocienda <kocienda@apple.com>
550 <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly
551 moves caret out of block.
553 The issue here is that an empty block with no explicit height set by style collapses
554 to zero height, and does so immediately after the last bit of content is removed from
555 it (as a result of deleting text with the delete key for instance). Since zero-height
556 blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
558 The fix is to detect when a block has not been removed itself, but has had all its
559 contents removed. In this case, a BR element is placed in the block, one that is
560 specially marked as a placeholder. Later, if the block ever receives content, this
561 placeholder is removed.
563 * khtml/editing/htmlediting.cpp:
564 (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
565 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
566 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
567 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
568 Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong
569 (it's very clear that we needs to be able to move more than just text nodes). This may expose
570 bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
571 made the test case in the bug work.
572 (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
573 removeBlockPlaceholderIfNeeded.
574 (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
575 (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
576 * khtml/editing/htmlediting.h: Declare new functions.
578 2004-10-13 Richard Williamson <rjw@apple.com>
580 Added support for -apple-dashboard-region:none. And fixed
581 a few computed style problems.
583 Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
586 * khtml/css/css_computedstyle.cpp:
587 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
588 * khtml/css/css_valueimpl.cpp:
589 (CSSPrimitiveValueImpl::cssText):
590 * khtml/css/cssparser.cpp:
591 (CSSParser::parseValue):
592 (CSSParser::parseDashboardRegions):
593 * khtml/css/cssstyleselector.cpp:
594 (khtml::CSSStyleSelector::applyProperty):
595 * khtml/rendering/render_style.cpp:
596 (RenderStyle::noneDashboardRegions):
597 * khtml/rendering/render_style.h:
598 * kwq/KWQKHTMLPart.mm:
599 (KWQKHTMLPart::dashboardRegionsDictionary):
601 2004-10-13 David Hyatt <hyatt@apple.com>
603 Rework block layout to clean it up and simplify it (r=kocienda).
605 Also fixing the style sharing bug (r=mjs).
607 * khtml/rendering/render_block.cpp:
608 (khtml::RenderBlock::MarginInfo::MarginInfo):
609 (khtml::RenderBlock::layoutBlock):
610 (khtml::RenderBlock::adjustPositionedBlock):
611 (khtml::RenderBlock::adjustFloatingBlock):
612 (khtml::RenderBlock::handleSpecialChild):
613 (khtml::RenderBlock::handleFloatingOrPositionedChild):
614 (khtml::RenderBlock::handleCompactChild):
615 (khtml::RenderBlock::insertCompactIfNeeded):
616 (khtml::RenderBlock::handleRunInChild):
617 (khtml::RenderBlock::collapseMargins):
618 (khtml::RenderBlock::clearFloatsIfNeeded):
619 (khtml::RenderBlock::estimateVerticalPosition):
620 (khtml::RenderBlock::determineHorizontalPosition):
621 (khtml::RenderBlock::setCollapsedBottomMargin):
622 (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
623 (khtml::RenderBlock::handleBottomOfBlock):
624 (khtml::RenderBlock::layoutBlockChildren):
625 (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
626 (khtml::RenderBlock::addOverHangingFloats):
627 * khtml/rendering/render_block.h:
628 (khtml::RenderBlock::maxTopMargin):
629 (khtml::RenderBlock::maxBottomMargin):
630 (khtml::RenderBlock::CompactInfo::compact):
631 (khtml::RenderBlock::CompactInfo::block):
632 (khtml::RenderBlock::CompactInfo::matches):
633 (khtml::RenderBlock::CompactInfo::clear):
634 (khtml::RenderBlock::CompactInfo::set):
635 (khtml::RenderBlock::CompactInfo::CompactInfo):
636 (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
637 (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
638 (khtml::RenderBlock::MarginInfo::clearMargin):
639 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
640 (khtml::RenderBlock::MarginInfo::setTopQuirk):
641 (khtml::RenderBlock::MarginInfo::setBottomQuirk):
642 (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
643 (khtml::RenderBlock::MarginInfo::setPosMargin):
644 (khtml::RenderBlock::MarginInfo::setNegMargin):
645 (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
646 (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
647 (khtml::RenderBlock::MarginInfo::setMargin):
648 (khtml::RenderBlock::MarginInfo::atTopOfBlock):
649 (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
650 (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
651 (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
652 (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
653 (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
654 (khtml::RenderBlock::MarginInfo::quirkContainer):
655 (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
656 (khtml::RenderBlock::MarginInfo::topQuirk):
657 (khtml::RenderBlock::MarginInfo::bottomQuirk):
658 (khtml::RenderBlock::MarginInfo::posMargin):
659 (khtml::RenderBlock::MarginInfo::negMargin):
660 (khtml::RenderBlock::MarginInfo::margin):
661 * khtml/rendering/render_box.cpp:
662 (RenderBox::calcAbsoluteVertical):
663 * khtml/rendering/render_box.h:
664 (khtml::RenderBox::marginTop):
665 (khtml::RenderBox::marginBottom):
666 (khtml::RenderBox::marginLeft):
667 (khtml::RenderBox::marginRight):
668 * khtml/rendering/render_image.cpp:
669 (RenderImage::setImage):
670 * khtml/rendering/render_object.cpp:
671 (RenderObject::sizesToMaxWidth):
672 * khtml/rendering/render_object.h:
673 (khtml::RenderObject::collapsedMarginTop):
674 (khtml::RenderObject::collapsedMarginBottom):
675 (khtml::RenderObject::maxTopMargin):
676 (khtml::RenderObject::maxBottomMargin):
677 (khtml::RenderObject::marginTop):
678 (khtml::RenderObject::marginBottom):
679 (khtml::RenderObject::marginLeft):
680 (khtml::RenderObject::marginRight):
681 * khtml/rendering/render_text.h:
682 (khtml::RenderText::marginLeft):
683 (khtml::RenderText::marginRight):
684 * khtml/xml/dom_elementimpl.cpp:
685 (ElementImpl::recalcStyle):
687 2004-10-12 Ken Kocienda <kocienda@apple.com>
693 <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line
695 * khtml/editing/selection.cpp:
696 (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
697 This will make it seem like the run ends on the next line.
699 2004-10-12 Ken Kocienda <kocienda@apple.com>
705 <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages
707 * khtml/editing/htmlediting.cpp:
708 (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
709 row, section, or column.
710 (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
711 of table structure when doing deletes, rather than deleting the structure elements themselves.
712 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
713 of table structure. We may want to revisit this some day, but this seems like the best behavior
715 (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
717 * khtml/editing/htmlediting.h: Add declarations for new functions.
719 2004-10-12 Richard Williamson <rjw@apple.com>
721 Fixed access to DOM object via WebScriptObject API.
722 The execution context for DOM objects wasn't being found.
723 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
726 Fixed <rdar://problem/3831063> regions use left offset instead of top offset
729 * khtml/khtml_part.h:
730 * khtml/rendering/render_object.cpp:
731 (RenderObject::addDashboardRegions):
733 (-[DOMNode isContentEditable]):
734 (-[DOMNode KJS::Bindings::]):
735 * kwq/KWQKHTMLPart.h:
736 * kwq/KWQKHTMLPart.mm:
737 (KWQKHTMLPart::executionContextForDOM):
739 2004-10-12 Ken Kocienda <kocienda@apple.com>
745 <rdar://problem/3834779> Mail crashes when editing HTML message - khtml::Selection::layout()
747 * kwq/KWQKHTMLPart.mm:
748 (KWQKHTMLPart::styleForSelectionStart): Table code seems to be more robust when the call to
749 insert our style-checking node is done with an appendChild rather than an insertBefore. Note
750 that this table-related problem was exposed by fixing Selection::layout(), which I did
751 yesterday. This change simply improves things even more so that we do not crash in the
752 scenario described in the bug.
754 2004-10-11 Ken Kocienda <kocienda@apple.com>
758 This is a partial fix to this bug:
760 <rdar://problem/3832886> increase quote level on new mail document leads to immediate
761 crash in caret painting code
763 To eliminate the bad behavior for good, I have done some investigations in Mail code,
764 and I have sent a suggested code change on to Grant. Basically, Mail can't add empty
765 blocks (like blockquote elements used for quoting) to documents without giving those
766 blocks some content (so they have a height).
768 I added some other crash protections below.
770 * khtml/editing/selection.cpp:
771 (khtml::Selection::layout): Check for non-null position after calls to VisiblePosition, since
772 the VisiblePosition constructors may fail to find a visible spot in the document. Also, add
773 a couple position-has-renderer assertion checks.
774 * kwq/KWQKHTMLPart.mm:
775 (KWQKHTMLPart::styleForSelectionStart): Take out pos.isNotNull() assertion since VisiblePosition
776 may not yield a position. This assertion is a holdover from before we had VisiblePosition.
777 (KWQKHTMLPart::fontForSelection): Rearrange the code a little to deal with possible null results from
780 2004-10-11 Darin Adler <darin@apple.com>
784 - fixed <rdar://problem/3834230> empty table can result in division by 0
786 * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows):
787 Added 0 check; rolled in from KDE.
789 2004-10-11 Darin Adler <darin@apple.com>
793 - fixed <rdar://problem/3818712> form checkbox value property is read only
795 The underlying problem was that we were storing two separate values for all
796 form elements; one for the value property (JavaScript) and the other for the
797 value attribute (DOM). This is a good idea for text input, but not for other types.
799 * khtml/html/html_formimpl.h: Changed setValue to take a const DOMString reference.
800 Added private storesValueSeparateFromAttribute function.
801 * khtml/html/html_formimpl.cpp:
802 (DOM::HTMLInputElementImpl::setType): Handle type changes, including detaching and re-attaching
803 if type changed, and moving value from m_value to ATTR_VALUE and vice versa.
804 (DOM::HTMLInputElementImpl::type): Added a case for ISINDEX and moved the default out of the
805 switch so that we will get a warning if a type is left out.
806 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Tweaked comment format.
807 (DOM::HTMLInputElementImpl::reset): Changed to only nuke the value if the value property is stored
808 separately from the attribute. Otherwise, we just want to lave it alone
809 (DOM::HTMLInputElementImpl::value): Changed to always use m_value if it's not null, then fall back
810 on the attribute, and finally fall back to the "on" for the checkbox only if both are null.
811 (DOM::HTMLInputElementImpl::setValue): Changed to set the attribute unless the value property is
812 supposed to be stored separate from the attribute.
813 (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute): Added. Returns true for text-type
814 input elements, and false for the others.
816 2004-10-11 Darin Adler <darin@apple.com>
820 - fixed <rdar://problem/3296652> checkbox input type does not respond to onchange
822 * khtml/rendering/render_form.cpp:
823 (RenderFormElement::updateFromElement): Some new code, commented out, for form element colors.
824 (RenderCheckBox::slotStateChanged): Added call to onChange.
826 2004-10-11 Ken Kocienda <kocienda@apple.com>
830 Finish selection affinity implementation. This includes code to set the
831 affinity correctly when clicking with the mouse, and clearing the
832 affinity when altering the selection using any of the Selection object
835 Each instance of the positionForCoordinates, inlineBox and caretRect
836 functions have been changed to include an EAffinity argument to give results
837 which take this bit into account.
839 * khtml/editing/selection.cpp:
840 (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
841 (khtml::Selection::modifyAffinity): New function to compute affinity based on
842 modification constants.
843 (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
844 (khtml::Selection::modifyExtendingRightForward): Ditto.
845 (khtml::Selection::modifyMovingRightForward): Ditto.
846 (khtml::Selection::modifyExtendingLeftBackward): Ditto.
847 (khtml::Selection::modifyMovingLeftBackward): Ditto.
848 (khtml::Selection::modify): Support saving, restoring, and then calculating new
849 affinity value as needed.
850 (khtml::Selection::xPosForVerticalArrowNavigation):
851 (khtml::Selection::clear): Reset affinity to UPSTREAM.
852 (khtml::Selection::setBase): Ditto.
853 (khtml::Selection::setExtent): Ditto.
854 (khtml::Selection::setBaseAndExtent): Ditto.
855 (khtml::Selection::layout): Pass affinity to caretRect().
856 (khtml::Selection::validate): Pass along affinity parameter to new functions that
858 (khtml::startOfFirstRunAt): Changed the way that the y-coordinate search is done, to
859 keep this code working with changes made in selectionForLine().
860 (khtml::endOfLastRunAt): Ditto.
861 (khtml::selectionForLine): Make this function work for all renderers, not just text
863 * khtml/editing/selection.h:
864 (khtml::operator==): Consider affinity in equality check.
865 * khtml/editing/visible_units.cpp:
866 (khtml::previousLinePosition): Pass affinity argument to function so it can take this
867 information into account while processing.
868 (khtml::nextLinePosition): Ditto.
869 (khtml::previousParagraphPosition): Ditto.
870 (khtml::nextParagraphPosition): Ditto.
871 * khtml/editing/visible_units.h: Ditto, for each of the functions listed.
872 * khtml/khtml_events.cpp:
873 (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
874 as this function is being removed.
875 * khtml/khtml_part.cpp:
876 (KHTMLPart::isPointInsideSelection): Ditto.
877 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
878 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
879 (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
880 call to positionForCoordinates, and set resulting affinity on the selection.
881 (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on
882 NodeImpl::positionForCoordinates, as this function is being removed.
883 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
884 * khtml/rendering/render_block.cpp:
885 (khtml::RenderBlock::positionForCoordinates): Now takes an affinity argument.
886 * khtml/rendering/render_block.h:
887 * khtml/rendering/render_box.cpp:
888 (RenderBox::caretRect): Ditto.
889 * khtml/rendering/render_box.h:
890 * khtml/rendering/render_br.cpp:
891 (RenderBR::positionForCoordinates): Ditto.
892 (RenderBR::caretRect): Ditto.
893 (RenderBR::inlineBox): Ditto.
894 * khtml/rendering/render_br.h:
895 * khtml/rendering/render_container.cpp:
896 (RenderContainer::positionForCoordinates): Ditto.
897 * khtml/rendering/render_container.h:
898 * khtml/rendering/render_flow.cpp:
899 (RenderFlow::caretRect): Ditto.
900 * khtml/rendering/render_flow.h:
901 * khtml/rendering/render_inline.cpp:
902 (RenderInline::positionForCoordinates): Ditto.
903 * khtml/rendering/render_inline.h:
904 * khtml/rendering/render_object.cpp:
905 (RenderObject::caretRect): Ditto.
906 (RenderObject::positionForCoordinates): Ditto.
907 (RenderObject::inlineBox): Ditto.
908 * khtml/rendering/render_object.h:
909 * khtml/rendering/render_replaced.cpp:
910 (RenderReplaced::positionForCoordinates): Ditto.
911 * khtml/rendering/render_replaced.h:
912 * khtml/rendering/render_text.cpp:
913 (RenderText::positionForCoordinates): Ditto.
914 (firstRendererOnNextLine): New helper used by caretRect().
915 (RenderText::caretRect): Now takes an affinity argument.
916 (RenderText::inlineBox): Ditto.
917 * khtml/rendering/render_text.h:
918 * khtml/xml/dom_nodeimpl.cpp: Remove positionForCoordinates helper.
919 * khtml/xml/dom_nodeimpl.h: Ditto.
920 * khtml/xml/dom_position.cpp:
921 (DOM::Position::previousLinePosition): Now takes an affinity argument.
922 (DOM::Position::nextLinePosition): Ditto.
923 * khtml/xml/dom_position.h:
924 * kwq/WebCoreBridge.h:
925 * kwq/WebCoreBridge.mm:
926 (-[WebCoreBridge caretRectAtNode:offset:affinity:]): Ditto.
927 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
928 (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on
929 NodeImpl::positionForCoordinates, as this function is being removed.
931 2004-10-11 Darin Adler <darin@apple.com>
935 - fixed <rdar://problem/3670280> scroll position on overflowed textareas resets when leaving the tab
937 * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView becomeFirstResponder]):
938 Scroll to reveal the text area, don't scroll to reveal the text view itself.
939 Scrolling the text view ended up putting it at the top left, regardless of
940 where the insertion point is.
942 2004-10-11 Darin Adler <darin@apple.com>
946 - fixed <rdar://problem/3831546> More text is copied than is visually selected
948 The bug here is that upstream was moving a position too far.
950 * khtml/xml/dom_position.cpp:
951 (DOM::Position::upstream): Use the "deep equivalent" node rather than the original node passed
952 in for various checks. Also use local variables a bit more for slightly more efficiency.
953 (DOM::Position::downstream): Ditto.
955 2004-10-11 Darin Adler <darin@apple.com>
959 - fixed <rdar://problem/3833841> adding an event listener for keypress events does not work
961 * khtml/xml/dom2_eventsimpl.h: Added numEventIds and made typeToId take a const DOMString &.
962 * khtml/xml/dom2_eventsimpl.cpp:
963 (EventImpl::typeToId): Changed to use table. Added "keypress", otherwise, the same as before.
964 (EventImpl::idToType): Changed to use table.
966 2004-10-10 John Sullivan <sullivan@apple.com>
968 - fixed <rdar://problem/3664375> repro crash in -[KWQAccObject accessibilityAttributeNames]
970 (-[KWQAccObject accessibilityActionNames]):
971 check for nil m_renderer
973 2004-10-09 Darin Adler <darin@apple.com>
977 - fixed <rdar://problem/3828147> REGRESSION: textareas with wrap="off" show their contents in a thin vertical line of text
979 * kwq/KWQTextArea.h: Added setTextColor and setBackgroundColor methods. This is really for another fix
980 I'm landing later, but it does no harm to add these now.
981 * kwq/KWQTextArea.mm:
982 (-[KWQTextArea _configureTextViewForWordWrapMode]): Set the container size after changing the flag that
983 determines if the width tracks the text view. Otherwise, we won't successfully set the width in the case
984 where we don't want it to track the text view. This caused the bug.
985 (-[KWQTextArea _createTextView]): Remove unneeded call to setMaxSize. The above method already does that.
986 (-[KWQTextArea setTextColor:]): Added.
987 (-[KWQTextArea setBackgroundColor:]): Added.
989 2004-10-09 Darin Adler <darin@apple.com>
993 - fixed <rdar://problem/3829452> REGRESSION (156-157): onload handler doesn't run on page with meta refresh of 0 duration (new Apple start page)
995 The fix for <rdar://problem/3773150> made it so <meta> redirects prevent tokenizing the rest of the page.
996 This is incorrect; the reason the JavaScript-triggered loads prevent tokenizing is that they take place
997 "right away" in other browsers, but that is not true of <meta> redirect. We fixed this by using a separate
998 call for <meta> redirect and not preventing tokenizing when that's in effect.
1000 * khtml/khtml_part.h: Removed userGesture parameter from scheduleRedirection. Renamed
1001 isImmediateRedirectPending to isScheduledLocationChangePending. Added scheduleLocationChange.
1002 * khtml/khtml_part.cpp:
1003 (KHTMLPart::openURL): Updated for new constant name.
1004 (KHTMLPart::scheduleRedirection): Removed now-unneeded userGesture parameter, and removed code that
1005 does the special case for redirection during load; a <meta> refresh can never be one of those special
1006 redirects during a load because it redirects the frame itself, not another frame. Also tightened up
1007 the logic by always stopping the redirect timer even if we aren't restarting it.
1008 (KHTMLPart::scheduleLocationChange): Added. Like scheduleRedirection, but with a different constant
1009 so we can tell it apart and always a delay of 0. The "redirection during load" case was moved in here
1010 and renamed to locationChangeScheduledDuringLoad.
1011 (KHTMLPart::isScheduledLocationChangePending): Renamed from isImmediateRedirectPending. This now
1012 returns true only for location changes and history navigation, not <meta> redirects.
1013 (KHTMLPart::scheduleHistoryNavigation): Tightened up logic to do the stop() outside the if as above,
1014 and got rid of a silly timer delay computation that always resulted in 0.
1016 * khtml/khtmlpart_p.h: Added a new value to the RedirectionScheduled enum for scheduleLocationChange
1017 and also renamed one of the existing values.
1019 * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::write): Changed to use isScheduledLocationChangePending instead
1020 of isImmediateRedirectPending, because we do want to continue tokenizing if it's actually a redirect.
1022 * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Changed to call the new scheduleLocationChange
1023 instead of calling scheduleRedirection with delay of 0.
1024 * khtml/ecma/kjs_window.cpp:
1025 (Window::put): Ditto.
1026 (WindowFunc::tryCall): Ditto.
1027 (Location::put): Ditto.
1028 (LocationFunc::tryCall): Ditto.
1030 2004-10-09 Darin Adler <darin@apple.com>
1034 - 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
1036 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::click): Use 0,0 for the coordinates.
1038 2004-10-09 Darin Adler <darin@apple.com>
1042 - fixed <rdar://problem/3804665> REGRESSION: WebCore framework now has many init routines
1044 * khtml/xml/dom_nodeimpl.h: Changed anyQName declaration to not use the inline function
1045 makeId. Surprisingly, the inline function was not "constant-folded" and we ended up with
1046 a copy of the function in each file as an init routine for the framework.
1048 * khtml/ecma/kjs_html.cpp: (Gradient::colorStops): Get rid of initialized ColorStop
1049 globals; their constructors were showing up as init routines for the framework.
1051 * khtml/rendering/render_style.h: Got rid of inline initialDashboardRegions function.
1052 * khtml/rendering/render_style.cpp: (RenderStyle::initialDashboardRegions): Made this
1053 a normal function. When it was an inline function, the constructors for the per-file
1054 copies of the globals were showing up as init routines for the framework.
1056 2004-10-09 Chris Blumenberg <cblu@apple.com>
1059 <rdar://problem/3625352> up and down arrow and page up/down keys don't work to scroll overflow:auto/scroll/overlay areas
1060 <rdar://problem/3397658> scroll wheel does not work to scroll overflow:auto/scroll/overlay areas (RSS)
1061 <rdar://problem/3822027> REGRESSION (Mail): When selection moves out of visible area, should center as NSText does
1063 Reviewed by hyatt, kocienda.
1065 * khtml/rendering/render_layer.cpp:
1066 (RenderLayer::scroll): new
1067 * khtml/rendering/render_layer.h:
1068 * khtml/rendering/render_object.cpp:
1069 (RenderObject::scroll): new
1070 * khtml/rendering/render_object.h:
1071 * kwq/KWQKHTMLPart.h:
1072 * kwq/KWQKHTMLPart.mm:
1073 (KWQKHTMLPart::scrollOverflow): new
1074 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent): new
1075 (KWQKHTMLPart::khtmlMousePressEvent): store pressed node so we know where the focus is
1076 * kwq/KWQScrollBar.h:
1077 * kwq/KWQScrollBar.mm:
1078 (QScrollBar::setValue): return a bool
1079 (QScrollBar::scrollbarHit): ditto
1080 (QScrollBar::scroll): new
1081 * kwq/WebCoreBridge.h:
1082 * kwq/WebCoreBridge.mm:
1083 (-[WebCoreBridge scrollOverflowInDirection:granularity:]): new
1084 (-[WebCoreBridge scrollOverflowWithScrollWheelEvent:]): new
1085 (-[WebCoreBridge ensureSelectionVisible]): visually center the extent of the selection
1087 2004-10-06 David Hyatt <hyatt@apple.com>
1089 Back out style sharing perf fix.
1091 * khtml/css/cssstyleselector.cpp:
1092 (khtml::CSSStyleSelector::locateCousinList):
1093 (khtml::CSSStyleSelector::canShareStyleWithElement):
1094 (khtml::CSSStyleSelector::locateSharedStyle):
1095 * khtml/css/cssstyleselector.h:
1096 * khtml/html/html_elementimpl.h:
1097 (DOM::HTMLElementImpl::inlineStyleDecl):
1098 * khtml/xml/dom_elementimpl.cpp:
1099 (ElementImpl::recalcStyle):
1100 * khtml/xml/dom_elementimpl.h:
1104 2004-10-05 David Hyatt <hyatt@apple.com>
1106 Fix a bug in the iteration of locateCousinList and clean up the style sharing stats code.
1108 * khtml/css/cssstyleselector.cpp:
1109 (khtml::CSSStyleSelector::locateCousinList):
1110 (khtml::CSSStyleSelector::elementsCanShareStyle):
1111 (khtml::CSSStyleSelector::locateSharedStyle):
1112 (khtml::CSSStyleSelector::styleForElement):
1114 2004-10-05 Ken Kocienda <kocienda@apple.com>
1118 * khtml/rendering/bidi.cpp:
1119 (khtml::RenderBlock::computeHorizontalPositionsForLine): Fix coding mistake that
1120 broke layout tests involving compacts.
1122 2004-10-05 Ken Kocienda <kocienda@apple.com>
1126 Finish selection affinity implementation. This includes code to set the
1127 affinity correctly when clicking with the mouse, and clearing the
1128 affinity when altering the selection using any of the Selection object
1131 Each instance of the positionForCoordinates function in the render tree
1132 has been changed to include an EAffinity argument. It is now the job of this
1133 function to set the selection affinity.
1135 * khtml/editing/selection.cpp:
1136 (khtml::Selection::moveTo): Set affinity to DOWNSTREAM.
1137 (khtml::Selection::modify): Ditto.
1138 (khtml::Selection::clear): Ditto.
1139 (khtml::Selection::setBase): Ditto.
1140 (khtml::Selection::setExtent): Ditto.
1141 (khtml::Selection::setBaseAndExtent): Ditto.
1142 * khtml/editing/selection.h:
1143 (khtml::operator==): Consider affinity in equality check.
1144 * khtml/khtml_events.cpp:
1145 (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
1146 as this function is being removed.
1147 * khtml/khtml_part.cpp:
1148 (KHTMLPart::isPointInsideSelection): Ditto.
1149 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
1150 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1151 (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
1152 call to positionForCoordinates, and set resulting affinity on the selection.
1153 (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on
1154 NodeImpl::positionForCoordinates, as this function is being removed.
1155 (KHTMLPart::khtmlMouseReleaseEvent):
1156 * khtml/rendering/render_block.cpp:
1157 (khtml::RenderBlock::positionForCoordinates): Changed, as described above.
1158 * khtml/rendering/render_block.h:
1159 * khtml/rendering/render_br.cpp:
1160 (RenderBR::positionForCoordinates): Ditto.
1161 * khtml/rendering/render_br.h:
1162 * khtml/rendering/render_container.cpp:
1163 (RenderContainer::positionForCoordinates): Ditto.
1164 * khtml/rendering/render_container.h:
1165 * khtml/rendering/render_inline.cpp:
1166 (RenderInline::positionForCoordinates): Ditto.
1167 * khtml/rendering/render_inline.h:
1168 * khtml/rendering/render_object.cpp:
1169 (RenderObject::positionForCoordinates): Ditto.
1170 * khtml/rendering/render_object.h:
1171 * khtml/rendering/render_replaced.cpp:
1172 (RenderReplaced::positionForCoordinates): Ditto.
1173 * khtml/rendering/render_replaced.h:
1174 * khtml/rendering/render_text.cpp:
1175 (RenderText::positionForCoordinates): Ditto.
1176 * khtml/rendering/render_text.h:
1177 * khtml/xml/dom_nodeimpl.cpp: Removed positionForCoordinates convenience.
1178 * khtml/xml/dom_nodeimpl.h: Ditto.
1179 * kwq/WebCoreBridge.mm:
1180 (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on
1181 NodeImpl::positionForCoordinates, as this function is being removed.
1183 2004-10-05 David Hyatt <hyatt@apple.com>
1185 Fix style sharing optimization to be fast again. Go back to using pointer comparisons when looking for
1190 * khtml/css/cssstyleselector.cpp:
1191 (khtml::CSSStyleSelector::locateCousinList):
1192 * khtml/rendering/render_object.cpp:
1193 (RenderObject::setStyleInternal):
1194 * khtml/rendering/render_object.h:
1195 * khtml/xml/dom_elementimpl.cpp:
1196 (ElementImpl::recalcStyle):
1198 2004-10-05 David Hyatt <hyatt@apple.com>
1200 Fix lists so that they properly participate in line layout as though they are text (when text bullets are
1201 used) and as images (when image bullets are used).
1203 Reviewed by kocienda
1205 * khtml/rendering/render_list.cpp:
1206 (RenderListMarker::createInlineBox):
1207 * khtml/rendering/render_list.h:
1208 (khtml::ListMarkerBox:::InlineBox):
1209 (khtml::ListMarkerBox::isText):
1211 2004-10-05 Ken Kocienda <kocienda@apple.com>
1215 Recent checkin adding upstreamDeepEquivalent had it backwards. The helper
1216 we want is downstreamDeepEquivalent, as the deepEquivalent function returns
1217 an upstream position.
1219 * khtml/editing/selection.cpp:
1220 (khtml::Selection::layout): DOWNSTREAM case now uses downstreamDeepEquivalent.
1221 UPSTREAM uses deepEquivalent.
1222 * khtml/editing/visible_position.cpp:
1223 (khtml::VisiblePosition::downstreamDeepEquivalent): New helper, replacing
1224 upstreamDeepEquivalent.
1225 * khtml/editing/visible_position.h
1227 2004-10-05 David Hyatt <hyatt@apple.com>
1229 New selection gap-filling architecture. Makes the gap-filling much more like NSTextView and puts the responsibility
1230 for gap-filling in the block. Fixes numerous bugs with selection drawing including bidi issues, incorrect old
1231 horizontal gap filling, and selection performance issues.
1233 Reviewed by kocienda
1235 * khtml/html/html_imageimpl.cpp:
1236 (HTMLImageLoader::notifyFinished):
1237 * khtml/misc/khtmllayout.h:
1238 (khtml::GapRects::left):
1239 (khtml::GapRects::center):
1240 (khtml::GapRects::right):
1241 (khtml::GapRects::uniteLeft):
1242 (khtml::GapRects::uniteCenter):
1243 (khtml::GapRects::uniteRight):
1244 (khtml::GapRects::unite):
1245 (khtml::GapRects::operator QRect):
1246 (khtml::GapRects::operator==):
1247 (khtml::GapRects::operator!=):
1248 * khtml/rendering/font.cpp:
1249 (Font::drawHighlightForText):
1250 * khtml/rendering/font.h:
1251 * khtml/rendering/render_block.cpp:
1252 (khtml:::RenderFlow):
1253 (khtml::RenderBlock::removeChild):
1254 (khtml::RenderBlock::paintObject):
1255 (khtml::RenderBlock::paintEllipsisBoxes):
1256 (khtml::RenderBlock::setSelectionState):
1257 (khtml::RenderBlock::shouldPaintSelectionGaps):
1258 (khtml::RenderBlock::isSelectionRoot):
1259 (khtml::RenderBlock::selectionGapRects):
1260 (khtml::RenderBlock::paintSelection):
1261 (khtml::RenderBlock::fillSelectionGaps):
1262 (khtml::RenderBlock::fillInlineSelectionGaps):
1263 (khtml::RenderBlock::fillBlockSelectionGaps):
1264 (khtml::RenderBlock::fillHorizontalSelectionGap):
1265 (khtml::RenderBlock::fillVerticalSelectionGap):
1266 (khtml::RenderBlock::fillLeftSelectionGap):
1267 (khtml::RenderBlock::fillRightSelectionGap):
1268 (khtml::RenderBlock::getHorizontalSelectionGapInfo):
1269 (khtml::RenderBlock::leftSelectionOffset):
1270 (khtml::RenderBlock::rightSelectionOffset):
1271 * khtml/rendering/render_block.h:
1272 (khtml::RenderBlock::hasSelectedChildren):
1273 (khtml::RenderBlock::selectionState):
1274 (khtml::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
1275 (khtml::RenderBlock::BlockSelectionInfo::rects):
1276 (khtml::RenderBlock::BlockSelectionInfo::state):
1277 (khtml::RenderBlock::BlockSelectionInfo::block):
1278 (khtml::RenderBlock::selectionRect):
1279 * khtml/rendering/render_box.cpp:
1280 (RenderBox::position):
1281 * khtml/rendering/render_br.cpp:
1282 (RenderBR::inlineBox):
1283 * khtml/rendering/render_br.h:
1284 (khtml::RenderBR::selectionRect):
1285 (khtml::RenderBR::paint):
1286 * khtml/rendering/render_canvas.cpp:
1287 (RenderCanvas::selectionRect):
1288 (RenderCanvas::setSelection):
1289 * khtml/rendering/render_canvasimage.cpp:
1290 (RenderCanvasImage::paint):
1291 * khtml/rendering/render_image.cpp:
1292 (RenderImage::paint):
1293 * khtml/rendering/render_image.h:
1294 * khtml/rendering/render_line.cpp:
1295 (khtml::InlineBox::nextLeafChild):
1296 (khtml::InlineBox::prevLeafChild):
1297 (khtml::InlineBox::selectionState):
1298 (khtml::InlineFlowBox::addToLine):
1299 (khtml::InlineFlowBox::firstLeafChild):
1300 (khtml::InlineFlowBox::lastLeafChild):
1301 (khtml::InlineFlowBox::firstLeafChildAfterBox):
1302 (khtml::InlineFlowBox::lastLeafChildBeforeBox):
1303 (khtml::InlineFlowBox::selectionState):
1304 (khtml::RootInlineBox::fillLineSelectionGap):
1305 (khtml::RootInlineBox::setHasSelectedChildren):
1306 (khtml::RootInlineBox::selectionState):
1307 (khtml::RootInlineBox::firstSelectedBox):
1308 (khtml::RootInlineBox::lastSelectedBox):
1309 (khtml::RootInlineBox::selectionTop):
1310 (khtml::RootInlineBox::block):
1311 * khtml/rendering/render_line.h:
1312 (khtml::RootInlineBox::RootInlineBox):
1313 (khtml::RootInlineBox::hasSelectedChildren):
1314 (khtml::RootInlineBox::selectionHeight):
1315 * khtml/rendering/render_object.cpp:
1316 (RenderObject::selectionColor):
1317 * khtml/rendering/render_object.h:
1318 (khtml::RenderObject::):
1319 (khtml::RenderObject::selectionState):
1320 (khtml::RenderObject::setSelectionState):
1321 (khtml::RenderObject::selectionRect):
1322 (khtml::RenderObject::canBeSelectionLeaf):
1323 (khtml::RenderObject::hasSelectedChildren):
1324 (khtml::RenderObject::hasDirtySelectionState):
1325 (khtml::RenderObject::setHasDirtySelectionState):
1326 (khtml::RenderObject::shouldPaintSelectionGaps):
1327 (khtml::RenderObject::SelectionInfo::SelectionInfo):
1328 * khtml/rendering/render_replaced.cpp:
1329 (RenderReplaced::RenderReplaced):
1330 (RenderReplaced::shouldPaint):
1331 (RenderReplaced::selectionRect):
1332 (RenderReplaced::setSelectionState):
1333 (RenderReplaced::selectionColor):
1334 (RenderWidget::paint):
1335 (RenderWidget::setSelectionState):
1336 * khtml/rendering/render_replaced.h:
1337 (khtml::RenderReplaced::canBeSelectionLeaf):
1338 (khtml::RenderReplaced::selectionState):
1339 * khtml/rendering/render_text.cpp:
1340 (InlineTextBox::checkVerticalPoint):
1341 (InlineTextBox::isSelected):
1342 (InlineTextBox::selectionState):
1343 (InlineTextBox::selectionRect):
1344 (InlineTextBox::paintSelection):
1345 (InlineTextBox::paintMarkedTextBackground):
1346 (RenderText::paint):
1347 (RenderText::setSelectionState):
1348 (RenderText::selectionRect):
1349 * khtml/rendering/render_text.h:
1350 (khtml::RenderText::canBeSelectionLeaf):
1352 * kwq/KWQPainter.mm:
1353 (QPainter::drawHighlightForText):
1355 (QPtrDictIterator::toFirst):
1358 * kwq/WebCoreTextRenderer.h:
1359 * kwq/WebCoreTextRendererFactory.mm:
1360 (WebCoreInitializeEmptyTextGeometry):
1362 2004-10-05 Ken Kocienda <kocienda@apple.com>
1366 Use the new CSS properties I added with my previous check-in. Also makes
1367 some changes to caret positioning and drawing to make the proper editing
1368 end-of-line behavior work correctly.
1370 * khtml/editing/selection.cpp:
1371 (khtml::Selection::layout): Caret drawing now takes affinity into account
1372 when deciding where to paint the caret (finally!).
1373 * khtml/editing/visible_position.cpp:
1374 (khtml::VisiblePosition::previousVisiblePosition): Move off Position::rendersInDifferentPosition
1375 to determine the result. Use a simpler test involving comparisons between
1376 downstream positions while iterating. This is cheaper to do and easier to understand.
1377 (khtml::VisiblePosition::nextVisiblePosition): Ditto.
1378 * khtml/rendering/bidi.cpp:
1379 (khtml::BidiIterator::current): Do not return non-breaking spaces for empty
1380 text renderers and for non-text renderers. Return a null Qchar instead. Returning
1381 non-breaking spaces was causing errors when the new -khtml-nbsp-mode was set to "space".
1382 (khtml::RenderBlock::computeHorizontalPositionsForLine): Shrink line boxes that
1383 contain with more spaces than can fit on the end of a line.
1384 (khtml::RenderBlock::skipWhitespace): Factor this out from findNextLineBreak.
1385 (khtml::RenderBlock::findNextLineBreak): Use new skipWhitespace function. Add
1386 in code to check and use new CSS properties.
1387 * khtml/rendering/break_lines.cpp:
1388 (khtml::isBreakable): Consider a non-breaking space a breakable character based
1389 on setting of new -khtml-nbsp-mode property.
1390 * khtml/rendering/break_lines.h: Ditto.
1391 * khtml/rendering/render_block.h: Declare skipWhitespace function.
1392 * khtml/rendering/render_text.cpp:
1393 (RenderText::caretRect): Do not draw the caret beyond the right edge of the
1394 window when in white-space normal mode.
1396 2004-10-05 Ken Kocienda <kocienda@apple.com>
1402 In this patch, I add two new CSS properties and their associated behavior.
1403 This is to support end-of-line and word-wrapping features that match the
1404 conventions of text editors.
1406 There are also some other small changes here which begin to lay the groundwork
1407 for using these new properties to bring about the desired editing behavior.
1409 * khtml/css/cssparser.cpp:
1410 (CSSParser::parseValue): Add support for new CSS properties.
1411 * khtml/css/cssproperties.c: Generated file.
1412 * khtml/css/cssproperties.h: Ditto.
1413 * khtml/css/cssproperties.in: Add new properties.
1414 * khtml/css/cssstyleselector.cpp:
1415 (khtml::CSSStyleSelector::applyProperty): Add support for new CSS properties.
1416 * khtml/css/cssvalues.c: Generated file.
1417 * khtml/css/cssvalues.h: Ditto.
1418 * khtml/css/cssvalues.in: Add support for new CSS properties.
1419 * khtml/editing/visible_position.cpp:
1420 (khtml::VisiblePosition::upstreamDeepEquivalent): Added new helper.
1421 * khtml/editing/visible_position.h:
1422 * khtml/rendering/render_box.cpp:
1423 (RenderBox::deleteLineBoxWrapper): Zero out inlineBoxWrapper.
1424 * khtml/rendering/render_replaced.cpp:
1425 (RenderWidget::detach): Zero out inlineBoxWrapper.
1426 * khtml/rendering/render_style.cpp:
1427 (StyleCSS3InheritedData):
1428 (StyleCSS3InheritedData::operator==): Add support for new CSS properties.
1429 (RenderStyle::diff): Ditto.
1430 * khtml/rendering/render_style.h:
1431 (khtml::RenderStyle::nbspMode): Ditto.
1432 (khtml::RenderStyle::khtmlLineBreak): Ditto.
1433 (khtml::RenderStyle::setNBSPMode): Ditto.
1434 (khtml::RenderStyle::setKHTMLLineBreak): Ditto.
1435 (khtml::RenderStyle::initialNBSPMode): Ditto.
1436 (khtml::RenderStyle::initialKHTMLLineBreak): Ditto.
1438 2004-10-05 Darin Adler <darin@apple.com>
1442 - fixed <rdar://problem/3673150> Pasting string from clipboard that is longer than input box will accept fails rather than truncating
1444 * kwq/KWQTextField.mm:
1445 (-[KWQTextFieldFormatter isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:]):
1446 Wrote a new version of this method that truncates incoming strings rather than rejecting them
1449 2004-10-04 Darin Adler <darin@apple.com>
1453 - fixed <rdar://problem/3826343> crash in KHTMLParser::setCurrent parsing document fragment (happens in Calendar widget)
1455 * khtml/html/htmlparser.cpp:
1456 (KHTMLParser::KHTMLParser): Initialized currentIsReferenced to false (fixes bug).
1457 (KHTMLParser::reset): Use doc() to make code easier to read.
1458 (KHTMLParser::setCurrent): Ditto.
1459 (KHTMLParser::parseToken): Ditto.
1460 (KHTMLParser::insertNode): Ditto.
1461 (KHTMLParser::getElement): Ditto.
1462 (KHTMLParser::popOneBlock): Ditto.
1464 - fixed <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window
1466 * kwq/KWQKHTMLPart.h: Added fontAttributesForSelectionStart.
1467 * kwq/KWQKHTMLPart.mm:
1468 (KWQKHTMLPart::styleForSelectionStart): Factored out most of fontForSelection.
1469 (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
1470 (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
1471 (KWQKHTMLPart::registerCommandForUndo): Updated for name change (see below).
1472 (KWQKHTMLPart::registerCommandForRedo): Ditto.
1474 * kwq/WebCoreBridge.h: Added fontAttributesForSelectionStart.
1475 * kwq/WebCoreBridge.mm:
1476 (-[WebCoreBridge undoEditing:]): Updated for name change (see below).
1477 (-[WebCoreBridge redoEditing:]): Ditto.
1478 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Got rid of named temporary
1479 EditCommandPtr variable to make things slightly more terse.
1480 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): Ditto.
1481 (-[WebCoreBridge deleteSelectionWithSmartDelete:]): Ditto.
1482 (-[WebCoreBridge fontAttributesForSelectionStart]): Added.
1484 - fix compile on Panther and other cleanup
1486 * khtml/khtml_part.cpp: Removed unneeded include.
1487 * kwq/KWQEditCommand.h: Got rid of use of "impl" when referring to EditCommand pointers.
1488 * kwq/KWQEditCommand.mm: Added include so we compile on Panther.
1489 (-[KWQEditCommand initWithEditCommand:]): Changed name.
1490 (-[KWQEditCommand dealloc]): Updated for m_impl change to m_command.
1491 (-[KWQEditCommand finalize]): Ditto.
1492 (+[KWQEditCommand commandWithEditCommand:]): Changed name.
1493 (-[KWQEditCommand command]): Changed name.
1495 2004-10-04 Darin Adler <darin@apple.com>
1499 - did a more-robust version of the fix I just landed
1501 * khtml/html/htmlparser.h: Added currentIsReferenced boolean.
1502 * khtml/html/htmlparser.cpp:
1503 (KHTMLParser::KHTMLParser): Initializes currentIsReferenced.
1504 (KHTMLParser::setCurrent): Changed to respect and set currentIsReferenced.
1506 2004-10-04 Darin Adler <darin@apple.com>
1510 - fixed <rdar://problem/3824393> REGRESSION (165-TOT): Crash in KHTMLParser::popOneBlock closing window (bose.com)
1512 * khtml/html/htmlparser.cpp:
1513 (KHTMLParser::~KHTMLParser): Move call to setCurrent(0) after the call to freeBlock, since freeBlock doesn't
1514 work well when current is 0, and there's no reason we need to reset the current block first.
1515 (KHTMLParser::setCurrent): Don't ever hold a reference to the document. This prevents a situation where there
1516 would be a reference cycle. In the test case from the bug above, this cycle actually happened and resulted
1517 in a double-delete of the document, tokenizer, and parser.
1519 2004-10-04 Darin Adler <darin@apple.com>
1523 - fixed <rdar://problem/3825429> onclick handler called when mouse down on another element (affects Dashboard Movies widget, test case enclosed)
1525 * khtml/khtmlview.cpp:
1526 (KHTMLViewPrivate::KHTMLViewPrivate): Initialize the click node to 0.
1527 (KHTMLViewPrivate::~KHTMLViewPrivate): Deref the click node.
1528 (KHTMLViewPrivate::reset): Clear the click node.
1529 (KHTMLView::viewportMousePressEvent): Call invalidateClick when we pass the event to a subframe to
1530 reduce the chance that we'll hold on to an old click node for a long time. Set the click node to
1531 the node we we are clicking on.
1532 (KHTMLView::viewportMouseDoubleClickEvent): Only send a click even if the node is the same one from
1533 the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
1534 old click node for a long time.
1535 (KHTMLView::invalidateClick): Clear the click node.
1536 (KHTMLView::viewportMouseReleaseEvent): Only send a click even if the node is the same one from
1537 the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
1538 old click node for a long time.
1539 (KHTMLView::keyPressEvent): Remove code that sets the originalNode field, which is never used.
1541 2004-10-04 Ken Kocienda <kocienda@apple.com>
1547 <rdar://problem/3825289> REGRESSION (Mail): Crash in fontForSelection in empty window
1549 * khtml/editing/visible_position.cpp:
1550 (khtml::VisiblePosition::previousPosition): Switch to node iteration instead "leaf"
1551 iteration. I have been wanting to make this change for a long time, but couldn't
1552 since other code relied on the leaf behavior. That is no longer true. Plus, the
1553 bug fix requires the new behavior.
1554 (khtml::VisiblePosition::nextPosition): Ditto.
1555 (khtml::VisiblePosition::isCandidate): Empty blocks needed a height to be a candidate,
1556 but we make a special case for the body element. This fixes the bug.
1558 2004-10-04 Darin Adler <darin@apple.com>
1562 - fixed <rdar://problem/3800667> REGRESSION (Mail): double-clicking multiple spaces only selects two spaces
1564 * kwq/KWQTextUtilities.mm: (KWQFindWordBoundary): Moved here from the .cpp file. Changed to use the
1565 doubleClickAtIndex: method from NSAttributedString rather than using Unicode Utilities.
1566 * kwq/KWQTextUtilities.cpp: Removed.
1567 * WebCore.pbproj/project.pbxproj: Removed KWQTextUtilities.cpp.
1569 - fixed a problem that would show up using HTML editing under garbage collection
1571 * kwq/KWQEditCommand.mm: (-[KWQEditCommand finalize]): Fixed a [super dealloc] that should have been a
1574 - another small change
1576 * khtml/editing/visible_units.cpp: (khtml::nextWordBoundary): Tweaked a comment.
1578 2004-10-01 Darin Adler <darin@apple.com>
1580 Reviewed by Ken (or arguably done by Ken, reviewed by Darin).
1582 - fixed <rdar://problem/3823828> REGRESSION (Mail): Clicking past end of any line puts insertion point at beginning of next line
1584 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::VisiblePosition):
1585 Check for an offset of 0 and a <br> and use UPSTREAM affinity in that case.
1586 This is a short term fix for something that needs a better longer-term fix.
1588 - fixed <rdar://problem/3823816> REGRESSION (Mail): double-clicking first word on line also selects previous empty line
1590 * khtml/editing/visible_units.cpp: (khtml::previousWordBoundary): Added a special
1591 case for <br>. While I'm not sure why this regressed, I'm sure this fix is good.
1593 2004-10-01 Darin Adler <darin@apple.com>
1597 - fixed <rdar://problem/3782117> CrashTracer: ..722 crashes at com.apple.WebCore: DOM::HTMLBodyElementImpl::insertedIntoDocument + 0x2c (AOL website)
1599 * khtml/html/html_baseimpl.cpp:
1600 (HTMLBodyElementImpl::insertedIntoDocument): Check for nil document case.
1601 (HTMLFrameElementImpl::isURLAllowed): Ditto.
1602 (HTMLFrameElementImpl::openURL): Ditto.
1604 2004-10-01 Darin Adler <darin@apple.com>
1608 - fixed <rdar://problem/3822218> REGRESSION (164-165): images don't update on rollover on directv.com page
1610 I introduced a major regression where various JavaScript window properties would not be found when I
1613 * khtml/ecma/kjs_window.h: Added hasProperty.
1614 * khtml/ecma/kjs_window.cpp: (Window::hasProperty): Return true in all the cases where get returns something.
1616 2004-09-30 Darin Adler <darin@apple.com>
1620 - fixed <rdar://problem/3461499> JavaScript function document.open() is buggy with 2nd argument "replace"
1622 Experiments with Firefox indicate that document.open() should not be treated as window.open() unless there
1623 are more than two parameters. Also, Firefox does not implement the "replace" behavior, so we don't have
1624 to worry about it either.
1626 * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): Only forward to window if there are more than
1627 two parameters, rather than if there are more than one.
1629 - fixed <rdar://problem/3672933> oninput is firing at page load time for <input type=range>
1631 * kwq/KWQSlider.mm: (QSlider::setValue): Don't emit a signal here. This follows the usual pattern, where
1632 a signal is only emitted for changes that are not explicitly requested by the caller.
1634 - fixed <rdar://problem/3821167> leaks of something allocated by recalcStyle after loading altavista page from cvs-base
1636 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Ref and deref the style we allocate so it's
1637 not left floating if setStyle decides not to ref it.
1639 - fixed <rdar://problem/3821172> leak of HTML attribute string after loading the ESPN page from cvs-base
1641 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Use the DOMString version of
1642 the lower() operation so we don't end up leaving a DOMStringImpl * floating if AtomicString decides not
1645 2004-09-30 Richard Williamson <rjw@apple.com>
1647 Fixed <rdar://problem/3822330> REGRESSION: crash on launch when homepage is set to about:blank
1651 * kwq/KWQKHTMLPart.mm:
1652 (KWQKHTMLPart::setDisplaysWithFocusAttributes):
1654 2004-09-30 Chris Blumenberg <cblu@apple.com>
1656 Fixed: <rdar://problem/3792822> Safari is calling the Cocoa QuickTime plugin twice for the OBJECT and EMBED tags
1660 * khtml/html/html_objectimpl.cpp:
1661 (HTMLObjectElementImpl::attach): call dispatchHTMLEvent after updateWidget instead of every time this method is called
1662 (HTMLObjectElementImpl::recalcStyle): ditto
1664 2004-09-30 Darin Adler <darin@apple.com>
1666 - rolled out bad image change that caused performance regression
1668 * khtml/rendering/render_image.cpp: (RenderImage::setPixmap):
1669 Don't reference the new image before doing the assignment.
1670 This forced an unwanted.
1672 2004-09-30 Ken Kocienda <kocienda@apple.com>
1674 Reviewed by me, coded by Darin
1676 - fixed <rdar://problem/3818305> REGRESSION (Mail): Shift + page up has no effect; should modify selection
1678 * khtml/editing/selection.cpp: (khtml::Selection::modify): Fix problem where vertical distance
1679 was used as a distance threshold, but was a negative number. Now make it positive at the start
1680 of the function (and make a couple related changes).
1682 2004-09-29 Richard Williamson <rjw@apple.com>
1684 Fixed <rdar://problem/3779998> bringing window to front or sending to back does not send focus/blur events to JavaScript window object
1686 The fix has two parts, 1) make onblur and onfocus work for windows,
1687 and 2), allow the dashboard to override WebKit's special key/non-key
1692 * kwq/KWQKHTMLPart.mm:
1693 (KWQKHTMLPart::setDisplaysWithFocusAttributes):
1695 2004-09-29 Ken Kocienda <kocienda@apple.com>
1701 <rdar://problem/3705894> REGRESSION (Mail): if a single word is wider than the window,
1702 it doesn't break and just runs off the right side
1704 * khtml/css/css_computedstyle.cpp:
1705 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support for CSS_PROP_WORD_WRAP.
1706 * khtml/css/cssparser.cpp:
1707 (CSSParser::parseValue): Ditto.
1708 * khtml/css/cssproperties.c: Generated file.
1709 * khtml/css/cssproperties.h: Ditto.
1710 * khtml/css/cssproperties.in: Add word-wrap property.
1711 * khtml/css/cssstyleselector.cpp:
1712 (khtml::CSSStyleSelector::applyProperty): Add support for CSS_PROP_WORD_WRAP.
1713 * khtml/css/cssvalues.c: Generated file.
1714 * khtml/css/cssvalues.h: Ditto.
1715 * khtml/css/cssvalues.in: Add break-word value.
1716 * khtml/rendering/bidi.cpp:
1717 (khtml::RenderBlock::findNextLineBreak): Add code to implement new word wrapping feature.
1718 * khtml/rendering/render_style.cpp:
1719 (StyleCSS3InheritedData): Add support for new wordWrap property.
1720 (StyleCSS3InheritedData::operator==): Ditto.
1721 (RenderStyle::diff): Ditto.
1722 * khtml/rendering/render_style.h:
1723 (khtml::RenderStyle::wordWrap): Ditto.
1724 (khtml::RenderStyle::setWordWrap): Ditto.
1725 (khtml::RenderStyle::initialWordWrap): Ditto.
1727 2004-09-29 Maciej Stachowiak <mjs@apple.com>
1731 - consolidated OS version checks into prefix header
1734 * khtml/rendering/render_canvasimage.cpp:
1735 * kwq/KWQAccObject.mm:
1736 (-[KWQAccObject roleDescription]):
1737 (-[KWQAccObject accessibilityActionDescription:]):
1738 * kwq/KWQComboBox.mm:
1739 (QComboBox::QComboBox):
1740 * kwq/KWQFoundationExtras.h:
1742 2004-09-29 David Hyatt <hyatt@apple.com>
1744 Make sure <br>s always get line boxes. Also prevent the creation of RenderTexts for whitespace normal/nowrap nodes
1747 Reviewed by kocienda
1749 * khtml/editing/visible_position.cpp:
1750 (khtml::VisiblePosition::isCandidate):
1751 * khtml/rendering/render_br.cpp:
1752 (RenderBR::RenderBR):
1753 (RenderBR::createInlineBox):
1754 (RenderBR::baselinePosition):
1755 (RenderBR::lineHeight):
1756 * khtml/rendering/render_br.h:
1757 * khtml/rendering/render_line.cpp:
1758 (khtml::InlineFlowBox::placeBoxesVertically):
1759 * khtml/rendering/render_line.h:
1760 (khtml::InlineBox::isText):
1761 (khtml::InlineFlowBox::addToLine):
1762 * khtml/rendering/render_text.cpp:
1763 (RenderText::detach):
1764 * khtml/rendering/render_text.h:
1765 (khtml::InlineTextBox:::InlineRunBox):
1766 (khtml::InlineTextBox::isInlineTextBox):
1767 (khtml::InlineTextBox::isText):
1768 (khtml::InlineTextBox::setIsText):
1769 * khtml/xml/dom_textimpl.cpp:
1770 (TextImpl::rendererIsNeeded):
1771 * kwq/KWQRenderTreeDebug.cpp:
1774 2004-09-29 Ken Kocienda <kocienda@apple.com>
1780 <rdar://problem/3815895> exception inside fontForSelection causes Mail to abort when selection hits bottom
1782 * khtml/editing/selection.cpp:
1783 (khtml::Selection::toRange): Use RangeImpl calls to detect exceptions when creating a Range
1784 from a Selection. Return an empty Range when there is an exception.
1788 <rdar://problem/3817268> REGRESSION (Mail): Window does not scroll when selecting out of
1789 visible area of view with arrow keys
1791 * khtml/editing/selection.cpp: Did some name changing. m_needsCaretLayout -> m_needsLayout.
1792 Added m_expectedVisibleRect which supplies the right rectangle to update when scrolling.
1793 (khtml::Selection::Selection): m_needsCaretLayout -> m_needsLayout name change.
1794 (khtml::Selection::init): Handle m_expectedVisibleRect in initialization.
1795 (khtml::Selection::operator=): Handle m_expectedVisibleRect in assignment.
1796 (khtml::Selection::setNeedsLayout): m_needsCaretLayout -> m_needsLayout name change.
1797 (khtml::Selection::layout): Changed name from layoutCaret, since m_expectedVisibleRect
1798 is also calculated here.
1799 (khtml::Selection::caretRect): m_needsCaretLayout -> m_needsLayout name change.
1800 (khtml::Selection::expectedVisibleRect): New. Returns m_expectedVisibleRect, doing a
1802 (khtml::Selection::needsCaretRepaint): m_needsCaretLayout -> m_needsLayout name change.
1803 (khtml::Selection::paintCaret): Ditto.
1804 (khtml::Selection::validate): Ditto.
1805 * khtml/editing/selection.h: Add m_expectedVisibleRect member variable and
1806 expectedVisibleRect accessor.
1807 * kwq/WebCoreBridge.h: Change name of ensureCaretVisible to ensureSelectionVisible, since
1808 this is not only about making the caret visible anymore. Now it can reveal the varying
1809 end of the selection when scrolling with arrow keys.
1810 * kwq/WebCoreBridge.mm:
1811 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): ensureCaretVisible to
1812 ensureSelectionVisible name change.
1813 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto
1814 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Ditto
1815 (-[WebCoreBridge insertNewline]): Ditto
1816 (-[WebCoreBridge insertText:selectInsertedText:]): Ditto
1817 (-[WebCoreBridge deleteKeyPressed]): Ditto
1818 (-[WebCoreBridge ensureSelectionVisible]): Ditto
1820 2004-09-29 Ken Kocienda <kocienda@apple.com>
1826 <rdar://problem/3818296> REGRESSION (Mail): centerSelectionInVisibleArea does not work correctly
1828 * kwq/KWQKHTMLPart.h:
1829 * kwq/KWQKHTMLPart.mm:
1830 (KWQKHTMLPart::centerSelectionInVisibleArea): New function. Handles both caret
1831 and range selections correctly.
1832 * kwq/KWQNSViewExtras.h: Add forceCentering boolean to some methods in this file.
1833 * kwq/KWQNSViewExtras.m: Ditto. This addition has been done since the AppKit
1834 method we use to do the centering, -[NSView scrollRectToVisible:], does not alter
1835 the view if the rectangle passed to it is already in view. When forceCentering is
1836 true, extra math is done to make scrollRectToVisible center the rectangle we want.
1837 (-[NSView _KWQ_scrollFrameToVisible]): Pass NO for forceCentering in call through to
1838 _KWQ_scrollRectToVisible:forceCentering:
1839 (-[NSView _KWQ_scrollRectToVisible:forceCentering:]): Add forceCentering argument.
1840 (-[NSView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto.
1841 (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto. Do extra
1842 math to implement the forceCentering effect.
1843 * kwq/KWQScrollView.h: Add forceCentering default argument to ensureRectVisibleCentered.
1844 * kwq/KWQScrollView.mm:
1845 (QScrollView::ensureRectVisibleCentered): Ditto.
1846 * kwq/WebCoreBridge.h:
1847 * kwq/WebCoreBridge.mm:
1848 (-[WebCoreBridge centerSelectionInVisibleArea]): New function. Call through to KWQKHTMLPart.
1850 2004-09-28 Chris Blumenberg <cblu@apple.com>
1852 Fixed: WebArchives begin with "<#document/>"
1856 * khtml/xml/dom_nodeimpl.cpp:
1857 (NodeImpl::startMarkup): don't return markup if this is a document node, forgot this when factoring this method out from toHTML
1859 2004-09-28 Chris Blumenberg <cblu@apple.com>
1861 Removed range parameter from recursive_toHTML and friends since that code path is no longer used.
1865 * khtml/xml/dom2_rangeimpl.cpp:
1866 (DOM::RangeImpl::toHTML):
1867 * khtml/xml/dom_nodeimpl.cpp:
1868 (NodeImpl::recursive_toString):
1869 (NodeImpl::recursive_toHTML):
1870 * khtml/xml/dom_nodeimpl.h:
1871 * kwq/WebCoreBridge.mm:
1872 (-[WebCoreBridge markupStringFromNode:nodes:]):
1874 2004-09-28 Darin Adler <darin@apple.com>
1878 - improve spell checking so it doesn't unmark and remark as you move the cursor with the arrow
1880 * khtml/editing/htmlediting.h: Remove obsolete markMisspellingsInSelection private function.
1881 * khtml/editing/htmlediting.cpp:
1882 (khtml::EditCommand::EditCommand): Blow away the selection when starting an edit command.
1883 (khtml::EditCommand::apply): Remove code to mark misspellings because that's now done as part
1884 of blowing away the selection.
1885 (khtml::EditCommand::unapply): Blow away the selection instead of marking mispellings.
1886 (khtml::EditCommand::reapply): Ditto.
1887 (khtml::ReplaceSelectionCommand::doApply): Removed incorrect code that does spell checking
1888 on inserted text; this doesn't match NSText behavior.
1889 (khtml::TypingCommand::markMisspellingsAfterTyping): Use markMisspellingsInAdjacentWords
1890 function for greater clarity on what this actually does.
1892 * khtml/khtml_part.h: Replaced setSelection's "unmarkOldSelection" boolean parameter with a
1893 "keepTypingStyle" boolean parameter. Removed notifySelectionChanged.
1894 * khtml/khtml_part.cpp:
1895 (KHTMLPart::setSelection): Replaced the "unmarkOldSelection" boolean with a new "keepTypingStyle"
1896 boolean. This is a step on the way to simplifying how this works. Moved the code from the
1897 notifySelectionChanged function here, since there was no clear line between the two functions.
1898 (KHTMLPart::clearSelection): Call setSelection rather that having special case code here for
1899 the case of an empty selection.
1900 (KHTMLPart::appliedEditing): Remove the explicit "false" for "unmarkOldSelection".
1901 (KHTMLPart::unappliedEditing): Ditto.
1902 (KHTMLPart::reappliedEditing): Ditto.
1904 * kwq/KWQKHTMLPart.h: Replaced markMisspellingsInSelection and updateSpellChecking with
1905 markMisspellings and markMisspellingsInAdjacentWords. Added parameters to respondToChangedSelection.
1906 * kwq/KWQKHTMLPart.mm:
1907 (KWQKHTMLPart::markMisspellingsInAdjacentWords): Added.
1908 (KWQKHTMLPart::markMisspellings): New name for markMisspellingsInSelection. Simplified logic a
1909 bit and made it the caller's responsibility to expand the selection passed in to word boundaries.
1910 (KWQKHTMLPart::respondToChangedSelection): Added parameter that identifies the old selection,
1911 and changed logic so it won't mark mispellings in a word if the selection still starts in that word.
1913 - implemented empty-cells property in computed style
1915 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1916 Added code for CSS_PROP_EMPTY_CELLS. I think the HTML converter in AppKit uses this.
1918 2004-09-28 Chris Blumenberg <cblu@apple.com>
1920 Fixed n-squared issues with appending to KWQValueListImpl. This fixes the hang in 3794799.
1922 Fixed by Darin, reviewed by me.
1924 * khtml/xml/dom2_rangeimpl.cpp:
1925 (DOM::RangeImpl::toHTML): tweaks
1926 * kwq/KWQValueListImpl.mm:
1927 (KWQValueListImpl::KWQValueListPrivate::KWQValueListPrivate):
1928 (KWQValueListImpl::KWQValueListPrivate::copyList):
1929 (KWQValueListImpl::clear):
1930 (KWQValueListImpl::appendNode):
1931 (KWQValueListImpl::prependNode):
1932 (KWQValueListImpl::removeEqualNodes):
1933 (KWQValueListImpl::containsEqualNodes):
1934 (KWQValueListImpl::removeIterator):
1935 (KWQValueListImpl::lastNode):
1936 * kwq/WebCoreBridge.mm:
1937 (-[WebCoreBridge nodesFromList:]): use iterator, not at()
1939 2004-09-28 Richard Williamson <rjw@apple.com>
1941 More dashboard region changes for John.
1943 <rdar://problem/3817421> add getter for dashboard regions (debugging)
1945 <rdar://problem/3817417> NSScrollView need autoregions for dashboard
1947 <rdar://problem/3817388> should have short form form control regions
1949 <rdar://problem/3817477> visibility does not work with dashboard control regions
1953 * WebCore-combined.exp:
1955 * khtml/css/cssparser.cpp:
1956 (skipCommaInDashboardRegion):
1957 (CSSParser::parseDashboardRegions):
1958 * khtml/khtmlview.cpp:
1959 (KHTMLView::updateDashboardRegions):
1960 * khtml/rendering/render_object.cpp:
1961 (RenderObject::setStyle):
1962 (RenderObject::addDashboardRegions):
1963 * khtml/xml/dom_docimpl.cpp:
1964 (DocumentImpl::DocumentImpl):
1965 (DocumentImpl::setDashboardRegions):
1966 * khtml/xml/dom_docimpl.h:
1967 (DOM::DocumentImpl::setDashboardRegionsDirty):
1968 (DOM::DocumentImpl::dashboardRegionsDirty):
1969 * kwq/KWQKHTMLPart.h:
1970 * kwq/KWQKHTMLPart.mm:
1971 (KWQKHTMLPart::paint):
1972 (KWQKHTMLPart::dashboardRegionsDictionary):
1973 (KWQKHTMLPart::dashboardRegionsChanged):
1974 * kwq/WebCoreBridge.h:
1975 * kwq/WebCoreBridge.mm:
1976 (-[WebCoreBridge dashboardRegions]):
1977 * kwq/WebDashboardRegion.h:
1978 * kwq/WebDashboardRegion.m:
1979 (-[WebDashboardRegion description]):
1981 2004-09-28 John Sullivan <sullivan@apple.com>
1985 - fixed <rdar://problem/3818558> REGRESSION: "Installed Plug-ins" is blank
1986 because of <script type="application/x-javascript">
1988 * khtml/html/htmltokenizer.cpp:
1989 (khtml::HTMLTokenizer::parseTag):
1990 add "application/x-javascript" to the list of legal scripting types. Mozilla
1991 accepts this, but WinIE doesn't.
1993 * layout-tests/fast/tokenizer/004.html:
1994 updated layout test to test some application/xxxx types
1996 2004-09-27 David Hyatt <hyatt@apple.com>
1998 Reworked lists to work well with RTL text. Specifically the following bugs have been fixed:
2000 (1) All bullets use the same offset constant now (a padding of 7 pixels). Before, images used 5 and others used 7.
2001 (2) Line height now works properly, so that list items with no content aren't squished (and missing the line descent).
2002 (3) Punctuation now works correctly with inside and outside style ordered lists in RTL.
2003 (4) RTL lists now properly apply padding and margin to the right side rather than the left. This was done by adding
2004 -khtml-margin-start and -khtml-padding-start properties that are just mapped to left/right based off the direction.
2008 * khtml/css/cssparser.cpp:
2009 (CSSParser::parseValue):
2010 * khtml/css/cssproperties.c:
2013 * khtml/css/cssproperties.h:
2014 * khtml/css/cssproperties.in:
2015 * khtml/css/cssstyleselector.cpp:
2016 (khtml::CSSStyleSelector::applyDeclarations):
2017 (khtml::CSSStyleSelector::applyProperty):
2018 * khtml/css/html4.css:
2019 * khtml/rendering/bidi.cpp:
2020 (khtml::BidiIterator::direction):
2021 * khtml/rendering/render_list.cpp:
2022 (RenderListItem::getAbsoluteRepaintRect):
2023 (RenderListMarker::paint):
2024 (RenderListMarker::calcMinMaxWidth):
2025 (RenderListMarker::lineHeight):
2026 (RenderListMarker::baselinePosition):
2028 2004-09-28 Ken Kocienda <kocienda@apple.com>
2032 Mark the VisiblePosition taking (Position &, EAffinity=DOWNSTREAM) explicit. Recently, when I added
2033 the EAffinity argument, I left this constructor implicit. Darin pointed out to me that this is
2034 undesirable since implicit use of the the constructor involved making the affinity choice, something
2035 which should be done explicitly.
2037 * khtml/editing/selection.cpp:
2038 (khtml::Selection::modifyExtendingRightForward): Make explicit use of constructor mentioned above.
2039 (khtml::Selection::modifyMovingRightForward): Ditto.
2040 (khtml::Selection::modifyExtendingLeftBackward): Ditto.
2041 (khtml::Selection::modifyMovingLeftBackward): Ditto.
2042 (khtml::Selection::modify): Ditto.
2043 (khtml::Selection::validate): Ditto.
2044 * khtml/editing/visible_position.h: Make constructor taking (Position &, EAffinity) explicit.
2045 * khtml/editing/visible_units.cpp: Ditto.
2046 (khtml::previousWordBoundary): Make explicit use of constructor mentioned above.
2047 (khtml::nextWordBoundary): Ditto.
2048 (khtml::previousLinePosition): Ditto.
2049 (khtml::nextLinePosition): Ditto.
2050 * kwq/KWQKHTMLPart.mm: Ditto.
2051 (KWQKHTMLPart::findString): Ditto.
2052 (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
2053 (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
2054 (KWQKHTMLPart::updateSpellChecking): Ditto.
2056 2004-09-28 Darin Adler <darin@apple.com>
2060 - fixed a storage leak discovered by code inspection
2062 * khtml/html/htmlparser.cpp: (KHTMLParser::~KHTMLParser): Call setCurrent(0) to deref
2063 the parser's current node in the rare case where it still has one.
2065 2004-09-27 David Hyatt <hyatt@apple.com>
2067 Don't allow nested headers when only inlines are in between them. Fixes a hang related to pathological nesting
2068 on magicmethodsonline.com.
2072 * khtml/html/htmlparser.cpp:
2073 (KHTMLParser::parseToken):
2074 (KHTMLParser::processCloseTag):
2075 (KHTMLParser::isHeaderTag):
2076 (KHTMLParser::popNestedHeaderTag):
2077 * khtml/html/htmlparser.h:
2079 2004-09-27 Kevin Decker <kdecker@apple.com>
2083 * khtml/css/css_base.cpp:
2084 (CSSSelector::selectorText): changed another ATTR_CLASS case to properly return class selector names.
2086 2004-09-27 David Hyatt <hyatt@apple.com>
2088 Fix style sharing so that it doesn't share when it shouldn't. Partially fixes 3671516, table cells don't update
2089 their color on macosx.apple.com.
2091 Fix 3521639, iframe mispositioned on bidi page. Make sure that when the width of a line exceeds the available line
2092 width that the spillage out of the block is determined by the direction of the block and not by the text-align value.
2094 Partial fix for 3762962, make sure the image cells with specified widths but percentage heights don't just get a minwidth
2097 Fix for 3533878, framesets that use percentages that add up to a value > 100% should normalize those percentages.
2101 * khtml/css/cssstyleselector.cpp:
2102 (khtml::CSSStyleSelector::locateCousinList):
2103 (khtml::CSSStyleSelector::elementsCanShareStyle):
2104 (khtml::CSSStyleSelector::locateSharedStyle):
2105 * khtml/css/cssstyleselector.h:
2106 * khtml/html/html_elementimpl.h:
2107 (DOM::HTMLNamedAttrMapImpl::hasMappedAttributes):
2108 (DOM::HTMLElementImpl::inlineStyleDecl):
2109 * khtml/rendering/bidi.cpp:
2110 (khtml::RenderBlock::computeHorizontalPositionsForLine):
2111 * khtml/rendering/render_frames.cpp:
2112 (RenderFrameSet::layout):
2113 * khtml/rendering/render_replaced.cpp:
2114 (RenderReplaced::calcMinMaxWidth):
2115 * khtml/xml/dom_elementimpl.h:
2116 (DOM::ElementImpl::inlineStyleDecl):
2117 (DOM::ElementImpl::hasMappedAttributes):
2119 2004-09-27 Ken Kocienda <kocienda@apple.com>
2123 Removed closestRenderedPosition function from Position class and gave this work
2124 to VisiblePosition instead. However, in order to make the transfer possible,
2125 VisiblePosition needed upstream and downstream affinities added to its
2126 constructors. Also moved the EAffinity enum into its own file. Also moved it
2127 to the khtml namespace.
2129 Updated several functions which used closestRenderedPosition to use VisiblePosition
2132 Also deleted Position::equivalentShallowPosition. This was unused.
2134 * ForwardingHeaders/editing/text_affinity.h: Added.
2135 * ForwardingHeaders/editing/visible_position.h: Added.
2136 * WebCore.pbproj/project.pbxproj: Added new files.
2137 * khtml/editing/selection.cpp:
2138 (khtml::Selection::validate): Use VisiblePosition instead of closestRenderedPosition.
2139 * khtml/editing/selection.h:
2140 * khtml/editing/text_affinity.h: Added.
2141 * khtml/editing/visible_position.cpp:
2142 (khtml::VisiblePosition::VisiblePosition):
2143 (khtml::VisiblePosition::initUpstream): New helper for finding upstream visible position.
2144 (khtml::VisiblePosition::initDownstream): Was old init function that unconditionally did
2145 downstream checks for visible position. Renamed to describe this more clearly.
2146 * khtml/editing/visible_position.h:
2147 * khtml/editing/visible_units.cpp:
2148 (khtml::previousWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
2149 (khtml::nextWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
2150 * khtml/xml/dom_docimpl.cpp:
2151 (DocumentImpl::updateSelection): Use VisiblePosition instead of closestRenderedPosition.
2152 * khtml/xml/dom_position.cpp:
2153 (DOM::Position::closestRenderedPosition): Removed.
2154 * khtml/xml/dom_position.h: Removed two functions mentioned above.
2155 * kwq/KWQKHTMLPart.mm:
2156 (KWQKHTMLPart::fontForSelection) Use VisiblePosition instead of closestRenderedPosition.:
2157 * kwq/WebCoreBridge.mm:
2158 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Use VisiblePosition instead of closestRenderedPosition.
2159 * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Updated expected results.
2160 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Ditto.
2161 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
2162 * layout-tests/editing/selection/move-by-character-004-expected.txt: Ditto.
2164 2004-09-27 Ken Kocienda <kocienda@apple.com>
2166 Reviewed by Darin and Maciej
2168 Removed EditCommand smart pointer wrappers from htmlediting.cpp/.h, save for the one
2169 at the root of the hierarchy, and this one has been renamed EditCommandPtr. Renamed
2170 each of the XXXCommandImpl classes, removing the Impl suffix from each, and rolled
2171 these into the htmlediting.cpp/.h files. The htmlediting_impl.cpp/.h files have
2172 been emptied and are being removed.
2174 For the remainder of files, perform the mechanical changes necessary to make everything
2175 compile and run as before.
2177 * WebCore.pbproj/project.pbxproj
2178 * khtml/editing/htmlediting.cpp
2179 * khtml/editing/htmlediting.h
2180 * khtml/editing/htmlediting_impl.cpp: Removed.
2181 * khtml/editing/htmlediting_impl.h: Removed.
2182 * khtml/editing/jsediting.cpp
2183 * khtml/khtml_part.cpp
2184 (KHTMLPart::openURL)
2185 (KHTMLPart::lastEditCommand)
2186 (KHTMLPart::appliedEditing)
2187 (KHTMLPart::unappliedEditing)
2188 (KHTMLPart::reappliedEditing)
2189 (KHTMLPart::applyStyle):
2190 * khtml/khtml_part.h
2191 * khtml/khtmlpart_p.h
2192 * kwq/KWQEditCommand.h
2193 * kwq/KWQEditCommand.mm
2194 (-[KWQEditCommand initWithEditCommandImpl:])
2195 (+[KWQEditCommand commandWithEditCommandImpl:])
2196 (-[KWQEditCommand impl])
2197 * kwq/KWQKHTMLPart.h
2198 * kwq/KWQKHTMLPart.mm
2199 (KWQKHTMLPart::registerCommandForUndo)
2200 (KWQKHTMLPart::registerCommandForRedo)
2201 * kwq/WebCoreBridge.mm
2202 (-[WebCoreBridge undoEditing:])
2203 (-[WebCoreBridge redoEditing:])
2204 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
2205 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:])
2206 (-[WebCoreBridge deleteSelectionWithSmartDelete:])
2208 2004-09-26 Darin Adler <darin@apple.com>
2212 - fixed <rdar://problem/3816170> image.width/height not available from Image objects (works in Firefox)
2214 * khtml/ecma/kjs_html.h: Added width and height.
2215 * khtml/ecma/kjs_html.cpp: (Image::getValueProperty): Added width and height.
2216 * khtml/ecma/kjs_html.lut.h: Regenerated.
2218 - unrelated change; changed ordering of use count manipulation just in case we decide some day to do
2219 something when the use count hits 0
2221 * khtml/rendering/render_image.cpp: (RenderImage::setPixmap): Increment use count on new object before
2222 decrementing use count on old object.
2224 2004-09-26 Darin Adler <darin@apple.com>
2228 - fixed <rdar://problem/3812771> document.implementation.hasFeature returns false for a lot of features we implement
2230 * khtml/xml/dom_docimpl.cpp: (DOMImplementationImpl::hasFeature): Added all the DOM features that we implemented
2231 as part of the HTML editing work.
2233 * khtml/dom/dom_node.cpp: (Node::isSupported): Changed this to call DOMImplementationImpl::hasFeature to share
2234 code. Later this might need to be different per-node, but at the moment that does not seem to be so.
2236 * khtml/ecma/kjs_dom.cpp:
2237 (DOMNodeProtoFunc::tryCall): Pass a null string if the parameter is omitted, undefined, or null. This is better than
2238 having a special case for the string "null" in the DOM implementation.
2239 (DOMDOMImplementationProtoFunc::tryCall): Ditto.
2241 - fixed <rdar://problem/3814605> REGRESSION: fast/table/039 layout test is failing due to extra trailing whitespace in innerText
2243 * khtml/editing/visible_text.cpp: (khtml::TextIterator::advance): Check for the case where we are at the end of
2244 iteration, and don't call exitNode in that case. This prevents us from getting some unwanted trailing \n characters.
2246 - fixed <rdar://problem/3813253> method cloneNode() does not clone dynamically-set style attributes correctly
2248 * khtml/html/html_elementimpl.h: Added cloneNode override.
2249 * khtml/html/html_elementimpl.cpp:
2250 (HTMLElementImpl::cloneNode): Added. Copies m_inlineStyleDecl.
2251 (HTMLElementImpl::parseHTMLAttribute): Changed to use getInlineStyleDecl().
2252 (HTMLElementImpl::innerText): Changed to do the same thing with fewer lines of code.
2253 (HTMLElementImpl::outerText): Tweaked comment.
2257 * khtml/xml/dom_elementimpl.cpp:
2258 (ElementImpl::cloneNode): Removed an uneeded type cast.
2259 (XMLElementImpl::cloneNode): Ditto.
2261 2004-09-24 Kevin Decker <kdecker@apple.com>
2265 <rdar://problem/3799334> DIG: Safari does not properly return style names [DigCSS.htm]
2267 * khtml/css/css_base.cpp:
2268 (CSSSelector::selectorText): Properly returns Class Selector names.
2269 Before we would get *[CLASS"foo"] instead of .foo
2271 2004-09-24 Ken Kocienda <kocienda@apple.com>
2277 <rdar://problem/3814660> REGRESSION (8A200-8A259): Select All has no effect on livepage.apple.com
2279 * khtml/xml/dom_docimpl.cpp:
2280 (DocumentImpl::updateSelection): Move the selection start and end to rendered positions
2281 before passing off to the RenderCanvas for drawing.
2282 * layout-tests/editing/selection/select-all-004-expected.txt: Added.
2283 * layout-tests/editing/selection/select-all-004.html: Added.
2285 2004-09-24 John Sullivan <sullivan@apple.com>
2289 - fixed <rdar://problem/3528339> Turn on full keyboard access shows
2290 invisible <input> elements
2292 * khtml/html/html_formimpl.cpp:
2293 (DOM::HTMLGenericFormElementImpl::isFocusable):
2294 reject elements that have zero width or height, even if they aren't hidden
2296 2004-09-24 Maciej Stachowiak <mjs@apple.com>
2298 - fixed deployment build
2302 * khtml/dom/dom_string.cpp: put implementation of ascii() in #ifdef !NDEBUG
2305 2004-09-24 David Hyatt <hyatt@apple.com>
2307 Fix for 3800316, test 37 for tables is failing on the layout tests. Make sure we don't incorrectly match
2308 non-HTML elements with HTML tag selectors in CSS.
2312 * khtml/css/cssstyleselector.cpp:
2313 (khtml::CSSStyleSelector::checkOneSelector):
2315 2004-09-23 David Hyatt <hyatt@apple.com>
2317 Fix for 3601920, CSS "tabs" not switching properly on zen garden design. Improve the repainting to account
2318 for layer changes of z-index that necessitate an invalidation.
2320 Reviewed by kocienda
2322 * khtml/rendering/render_object.cpp:
2323 (RenderObject::setStyle):
2324 * khtml/rendering/render_style.cpp:
2325 (RenderStyle::diff):
2326 * khtml/rendering/render_style.h:
2327 (khtml::RenderStyle::):
2329 2004-09-24 Chris Blumenberg <cblu@apple.com>
2331 Made markup copying 5 times faster. Unfortunately, this still doesn't fix:
2332 <rdar://problem/3794799> Tiger8A252: copying a bunch o' text is so slow it seems like a hang
2336 * khtml/dom/dom_string.h:
2337 * khtml/xml/dom2_rangeimpl.cpp:
2338 (DOM::RangeImpl::toHTML): serialize the range by iterating through the range
2339 * khtml/xml/dom_nodeimpl.cpp:
2340 (NodeImpl::startMarkup): new, factored out from recursive_toString
2341 (NodeImpl::endMarkup): ditto
2342 (NodeImpl::recursive_toString): call factored out methods
2343 * khtml/xml/dom_nodeimpl.h:
2347 2004-09-24 Ken Kocienda <kocienda@apple.com>
2349 Hyatt made an improvement in the render tree which caused the results
2350 to get a little thinner.
2352 * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt
2353 * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt
2355 2004-09-24 Ken Kocienda <kocienda@apple.com>
2361 <rdar://problem/3812939> REGRESSION: move-between-blocks-no-001 editing layout test fails in DeleteSelectionCommandImpl
2363 * khtml/rendering/render_block.cpp:
2364 (khtml::RenderBlock::removeChild): Hyatt said this regression was caused by a bad merge.
2365 Found by code inspection.
2367 2004-09-23 John Sullivan <sullivan@apple.com>
2371 - fixed <rdar://problem/3551850> hang caused by interpreting bad javascript
2372 guarded by a deliberately bogus "language" attribute (www.riibe.com)
2374 * khtml/html/htmltokenizer.cpp:
2375 (khtml::HTMLTokenizer::parseTag):
2376 Check for language attribute of <script> tag in a way that matches WinIE.
2377 Previously we were far too permissive.
2379 2004-09-23 David Hyatt <hyatt@apple.com>
2381 Fix for 3685234 and 3548444, the x-offset for frame borders was off by 1 pixel, causing mojibake to occur when
2382 repainting happened.
2384 * khtml/rendering/render_canvas.cpp:
2385 (RenderCanvas::repaintViewRectangle):
2387 2004-09-23 Richard Williamson <rjw@apple.com>
2389 Fixed <rdar://problem/3813271> dashboard-region-circle and dashboard-region-rectangle should be collapsed into dashboard-region
2390 Fixed <rdar://problem/3813289> dashboard regions need to correctly account for overflow/scrolling
2394 * khtml/css/css_valueimpl.cpp:
2395 (CSSPrimitiveValueImpl::cssText):
2396 * khtml/css/css_valueimpl.h:
2397 * khtml/css/cssparser.cpp:
2398 (CSSParser::parseValue):
2399 (skipCommaInDashboardRegion):
2400 (CSSParser::parseDashboardRegions):
2401 * khtml/khtmlview.cpp:
2402 (KHTMLView::layout):
2403 (KHTMLView::updateDashboardRegions):
2404 * khtml/khtmlview.h:
2405 * khtml/rendering/render_layer.cpp:
2406 (RenderLayer::scrollToOffset):
2407 * khtml/rendering/render_object.cpp:
2408 (RenderObject::addDashboardRegions):
2409 * kwq/KWQKHTMLPart.mm:
2410 (KWQKHTMLPart::dashboardRegionsChanged):
2411 * kwq/WebDashboardRegion.h:
2412 * kwq/WebDashboardRegion.m:
2413 (-[WebDashboardRegion initWithRect:clip:type:]):
2414 (-[WebDashboardRegion dashboardRegionClip]):
2415 (-[WebDashboardRegion description]):
2417 2004-09-23 Ken Kocienda <kocienda@apple.com>
2421 * khtml/xml/dom_position.cpp:
2422 (DOM::Position::inRenderedContent): Make the "empty block" check the same as the one
2423 use in visible position. This fixes a recent regression which broke up and down
2424 arrowing between blocks with an empty block in between.
2426 2004-09-23 Maciej Stachowiak <mjs@apple.com>
2430 <rdar://problem/3685235> REGRESSION (Mail): links are not properly editable
2432 * khtml/html/html_inlineimpl.cpp:
2433 (HTMLAnchorElementImpl::isFocusable): If this element is editable, then follow
2434 the normal focus rules so the link does not swallow focus when you arrow key
2435 or drag-select into it.
2437 2004-09-23 Darin Adler <darin@apple.com>
2439 - added test for the DOM::Range bug fixed recently
2441 * layout-tests/fast/dom/clone-contents-0-end-offset-expected.txt: Added.
2442 * layout-tests/fast/dom/clone-contents-0-end-offset.html: Added.
2444 2004-09-23 David Hyatt <hyatt@apple.com>
2446 Fix for hitlist bug, crash when deleting.
2448 Also fix repaint bug when inlines are inside overflow:auto/scroll regions.
2450 Reviewed by kocienda
2452 * khtml/editing/htmlediting_impl.cpp:
2453 (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
2454 (khtml::DeleteSelectionCommandImpl::doApply):
2455 * khtml/rendering/render_block.cpp:
2456 (khtml::RenderBlock::removeChild):
2457 * khtml/rendering/render_flow.cpp:
2458 (RenderFlow::getAbsoluteRepaintRect):
2460 2004-09-23 John Sullivan <sullivan@apple.com>
2464 - fixed <rdar://problem/3527840> reproducible crash at johnbrown.v32.qikker.com
2465 (nil-deref in NodeImpl::dispatchEvent)
2467 * khtml/xml/dom_nodeimpl.cpp:
2468 (NodeImpl::dispatchEvent):
2469 guard against document or document->document() being nil
2471 2004-09-23 Darin Adler <darin@apple.com>
2475 - added new VisibleRange class; not used yet
2477 * WebCore.pbproj/project.pbxproj: Added visible_range.h and visible_range.cpp.
2478 * khtml/editing/visible_range.cpp: Added.
2479 * khtml/editing/visible_range.h: Added.
2483 * kwq/WebCoreBridge.mm: (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
2484 Use switch statement instead of if statement so we get a warning if we ever add a new
2487 * khtml/editing/selection.h: khtml, not DOM, namespace
2488 * khtml/editing/visible_position.h: Ditto.
2490 2004-09-23 Darin Adler <darin@apple.com>
2494 - fixed <rdar://problem/3812758> 8S266: attaching mutation events to an editable div crashes Safari
2496 * khtml/xml/dom_nodeimpl.cpp:
2497 (NodeImpl::dispatchEvent): Added ref/deref so this works if passed a "floating" event object.
2498 (NodeImpl::dispatchGenericEvent): Ditto.
2499 (NodeImpl::dispatchHTMLEvent): Removed unneeded ref/deref now that dispatchEvent takes care of it.
2500 (NodeImpl::dispatchMouseEvent): Ditto.
2501 (NodeImpl::dispatchUIEvent): Ditto.
2503 2004-09-23 Darin Adler <darin@apple.com>
2507 - fixed some minor mistakes discovered by code inspection
2509 * khtml/khtml_part.cpp:
2510 (KHTMLPart::setSelection): Changed to not grab focus if clearing the selection.
2511 Grabbing focus when we get the selection is also probably something that should be
2512 conditional, since you can use a WebView in a mode where it can have selection even
2513 when not first responder, ala NSTextView.
2514 (KHTMLPart::setCaretVisible): Changed to not grab focus if making the caret invisible.
2515 Not sure if it's ever important to grab focus when making the caret visible, but by
2516 code inspection it seemed that was unlikely to do harm.
2518 2004-09-23 Darin Adler <darin@apple.com>
2522 - fixed <rdar://problem/3790595> "ERROR: unimplemented propertyID: 97" logged to console when copying selection (table-layout)
2524 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2525 Added CSS_PROP_TABLE_LAYOUT case.
2527 2004-09-23 Darin Adler <darin@apple.com>
2531 - fixed <rdar://problem/3809600> REGRESSION: text in search field doesn't disappear when clicked at developer.apple.com
2533 Reversing the order of scope caused us to get and set too many properties in the window
2534 object; in the case of this bug setting value ended up setting a window.value property
2535 instead of the value of the <input> element.
2537 * khtml/ecma/kjs_window.h: Removed bogus hasProperty function that always returns true.
2538 Testing shows that MacIE and Gecko match our behavior when we remove this, despite the
2539 "need this to match IE behavior" comment in the file, which I believe is incorrect.
2540 * khtml/ecma/kjs_window.cpp: Ditto.
2542 2004-09-23 Darin Adler <darin@apple.com>
2546 - fixed <rdar://problem/3812471> -[DOMRange cloneContents] clones too much in some cases where endOffset is 0
2548 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Added some nil
2549 checks to prevent this function from crashing if offsets are greater than the
2550 number of child nodes. Added a special case for offset 0 in one case that has a loop
2551 that won't work correctly for that case.
2553 2004-09-23 Darin Adler <darin@apple.com>
2557 - fixed <rdar://problem/3811890> when selecting and moving the caret, some words aren't spell-checked (test case included)
2559 This was mostly fixed by changes I made recently, but using the test case in the bug
2560 I discovered one regression I introduced and another problem that wasn't fixed yet.
2561 This change fixes both.
2563 * kwq/KWQKHTMLPart.mm:
2564 (KWQKHTMLPart::markMisspellingsInSelection): Removed unneeded inRenderedContent() check. It was returning false
2565 in cases involving a <br> at the end of line, and the check isn't all that helpful now that we use VisiblePosition,
2566 which takes care of that sort of thing for you. Changed code to determine the range to check to use the two
2567 different flavors of word boundary to expand to words we touch in both directions.
2568 (KWQKHTMLPart::updateSpellChecking): Changed to use the same logic about word boundaries. By being consistent,
2569 the anomalies reported in the bug report go away.
2571 2004-09-23 Darin Adler <darin@apple.com>
2575 - fixed <rdar://problem/3811584> REGRESSION (85-125): iframe.document undefined in function called from button onclick; works from img onclick
2577 Since we are doing a bit less "defers callbacks" work, when testing I ran into this code path.
2579 * khtml/xml/dom2_eventsimpl.cpp: (MouseEventImpl::computeLayerPos): Check for document without renderer.
2581 2004-09-23 Darin Adler <darin@apple.com>
2583 - checked in a new file I forgot
2585 * khtml/editing/text_granularity.h: Added.
2587 2004-09-22 Darin Adler <darin@apple.com>
2591 DOM::CaretPosition -> khtml::VisibleRange
2592 DOM::Selection -> khtml::Selection
2594 - moved all the functions in visible_units.h from DOM to khtml namespace
2595 - moved the one thing from Selection that KHTMLPart uses into its own header
2597 * WebCore.pbproj/project.pbxproj: Added text_granularity.h.
2599 * ForwardingHeaders/editing/selection.h: Added.
2600 * WebCore-combined.exp: Regenerated.
2601 * WebCore-tests.exp: Updated symbol for DOM::Selection debugging.
2603 * khtml/ecma/kjs_window.cpp: Update names and namespaces.
2604 * khtml/editing/htmlediting.cpp: Ditto.
2605 * khtml/editing/htmlediting.h: Ditto.
2606 * khtml/editing/htmlediting_impl.cpp: Ditto.
2607 * khtml/editing/htmlediting_impl.h: Ditto.
2608 * khtml/editing/jsediting.cpp: Ditto.
2609 * khtml/editing/selection.cpp: Ditto.
2610 * khtml/editing/selection.h: Ditto.
2611 * khtml/editing/visible_position.cpp: Ditto.
2612 * khtml/editing/visible_position.h: Ditto.
2613 * khtml/editing/visible_text.h: Ditto.
2614 * khtml/editing/visible_units.cpp: Ditto.
2615 * khtml/editing/visible_units.h: Ditto.
2616 * khtml/khtml_part.cpp: Ditto.
2617 * khtml/khtml_part.h: Ditto.
2618 * khtml/khtmlpart_p.h: Ditto.
2619 * khtml/rendering/render_block.cpp: Ditto.
2620 * khtml/xml/dom_docimpl.h: Ditto.
2621 * khtml/xml/dom_nodeimpl.cpp: Ditto.
2622 * kwq/KWQKHTMLPart.h: Ditto.
2623 * kwq/KWQKHTMLPart.mm: Ditto.
2624 * kwq/KWQRenderTreeDebug.cpp: Ditto.
2625 * kwq/WebCoreBridge.mm: Ditto.
2627 2004-09-22 Darin Adler <darin@apple.com>
2629 * ForwardingHeaders/*: Use import instead of include.
2631 2004-09-22 Darin Adler <darin@apple.com>
2633 - renamed these files:
2635 misc/khtml_text_operations.h -> editing/visible_text.h
2636 misc/khtml_text_operations.cpp -> editing/visible_text.cpp
2637 xml/dom_caretposition.cpp -> editing/visible_position.cpp
2638 xml/dom_caretposition.h -> editing/visible_position.h
2639 xml/dom_selection.cpp -> editing/selection.cpp
2640 xml/dom_selection.h -> editing/selection.h
2642 - broke out the word/line/paragraph part of visible_position.h into visible_units.h
2643 - removed some unnecessary includes from some header files to reduce the number of
2644 files that trigger "building the world"
2646 * WebCore.pbproj/project.pbxproj: Added the files under new names, removed the old ones.
2648 * ForwardingHeaders/editing/jsediting.h: Added.
2649 * ForwardingHeaders/editing/visible_text.h: Added.
2650 * ForwardingHeaders/misc/khtml_text_operations.h: Removed.
2651 * ForwardingHeaders/xml/dom_caretposition.h: Removed.
2652 * ForwardingHeaders/xml/dom_selection.h: Removed.
2654 * khtml/ecma/kjs_window.cpp: Updated or removed #include lines.
2655 * khtml/editing/htmlediting.cpp: Ditto.
2656 * khtml/editing/htmlediting.h: Ditto.
2657 * khtml/editing/htmlediting_impl.cpp: Ditto.
2658 * khtml/editing/htmlediting_impl.h: Ditto.
2659 * khtml/editing/jsediting.cpp: Ditto.
2660 * khtml/editing/selection.cpp: Ditto.
2661 * khtml/editing/selection.h: Ditto.
2662 * khtml/editing/visible_position.cpp: Ditto.
2663 * khtml/editing/visible_position.h: Ditto.
2664 * khtml/editing/visible_text.cpp: Ditto.
2665 * khtml/editing/visible_text.h: Ditto.
2666 * khtml/editing/visible_units.cpp: Added.
2667 * khtml/editing/visible_units.h: Added.
2668 * khtml/html/html_elementimpl.cpp: Updated or removed #include lines.
2669 * khtml/khtml_part.cpp: Ditto.
2670 * khtml/khtml_part.h: Ditto.
2671 * khtml/khtmlpart_p.h: Ditto.
2672 * khtml/khtmlview.cpp: Ditto.
2673 * khtml/misc/khtml_text_operations.cpp: Removed.
2674 * khtml/misc/khtml_text_operations.h: Removed.
2675 * khtml/rendering/render_block.cpp: Updated or removed #include lines.
2676 * khtml/xml/dom2_rangeimpl.cpp: Ditto.
2677 * khtml/xml/dom_caretposition.cpp: Removed.
2678 * khtml/xml/dom_caretposition.h: Removed.
2679 * khtml/xml/dom_docimpl.cpp: Updated or removed #include lines.
2680 * khtml/xml/dom_docimpl.h: Ditto.
2681 * khtml/xml/dom_elementimpl.cpp: Ditto.
2682 * khtml/xml/dom_nodeimpl.cpp: Ditto.
2683 * khtml/xml/dom_position.cpp: Ditto.
2684 * khtml/xml/dom_selection.cpp: Removed.
2685 * khtml/xml/dom_selection.h: Removed.
2686 * kwq/KWQKHTMLPart.mm: Updated or removed #include lines.
2687 * kwq/KWQKHTMLPart.h: Ditto.
2688 * kwq/KWQRenderTreeDebug.cpp: Ditto.
2689 * kwq/WebCoreBridge.mm: Ditto.
2691 2004-09-22 Richard Williamson <rjw@apple.com>
2693 Pass dashboard regions up to WebKit.
2695 Don't collect regions from RenderTexts.
2697 Made more args and return types references to avoid
2698 copying value lists.
2702 * WebCore.pbproj/project.pbxproj:
2703 * khtml/khtmlview.cpp:
2704 (KHTMLView::layout):
2705 * khtml/rendering/render_object.cpp:
2706 (RenderObject::collectDashboardRegions):
2707 * khtml/xml/dom_docimpl.cpp:
2708 (DocumentImpl::dashboardRegions):
2709 (DocumentImpl::setDashboardRegions):
2710 * khtml/xml/dom_docimpl.h:
2711 * kwq/KWQKHTMLPart.h:
2712 * kwq/KWQKHTMLPart.mm:
2713 (KWQKHTMLPart::didFirstLayout):
2714 (KWQKHTMLPart::dashboardRegionsChanged):
2715 * kwq/WebCoreBridge.h:
2716 * kwq/WebDashboardRegion.h: Added.
2717 * kwq/WebDashboardRegion.m: Added.
2718 (-[WebDashboardRegion initWithRect:type:]):
2719 (-[WebDashboardRegion copyWithZone:]):
2720 (-[WebDashboardRegion dashboardRegionRect]):
2721 (-[WebDashboardRegion dashboardRegionType]):
2722 (-[WebDashboardRegion description]):
2724 2004-09-22 Ken Kocienda <kocienda@apple.com>
2728 Fix for this hitlist bug:
2730 <rdar://problem/3805486> REGRESSION (Mail): Empty block elements can cause the caret to get "stuck" in one spot
2732 * khtml/xml/dom_caretposition.cpp:
2733 (DOM::CaretPosition::isCandidate): You can no longer caret into empty blocks with no height.
2734 Also did a little clean up in this function.
2735 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Regenerated expected results.
2736 This test was actually failing and had bogus results checked in!
2737 * layout-tests/editing/selection/select-all-003-expected.txt: Regenerated expected results.
2739 2004-09-22 Chris Blumenberg <cblu@apple.com>
2741 Fixed: <rdar://problem/3812091> REGRESSION (Mail): double-clicked word is not smart inserted on drag
2745 * khtml/editing/htmlediting.cpp:
2746 (khtml::MoveSelectionCommand::MoveSelectionCommand): take smartMove arg
2747 * khtml/editing/htmlediting.h:
2748 * khtml/editing/htmlediting_impl.cpp:
2749 (khtml::CompositeEditCommandImpl::deleteSelection): take smartDelete arg
2750 (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): take smartMove arg
2751 (khtml::MoveSelectionCommandImpl::doApply): pass smartMove for smartDelete and smartReplace
2752 * khtml/editing/htmlediting_impl.h:
2753 * kwq/WebCoreBridge.h:
2754 * kwq/WebCoreBridge.mm:
2755 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): take smartMove arg
2757 2004-09-22 Ken Kocienda <kocienda@apple.com>
2761 * khtml/css/css_computedstyle.cpp:
2762 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): New overloaded
2763 version of this function, one that takes a flag to determine whether to
2764 perform a document updateLayout() call before querying the style system.
2765 * khtml/css/css_computedstyle.h:
2766 (DOM::EUpdateLayout): Give a symbolic constant to true/false for the
2767 purpose of the new call to getPropertyCSSValue.
2768 * khtml/editing/htmlediting_impl.cpp:
2769 (khtml::StyleChange::currentlyHasStyle): Pass DoNotUpdateLayout to call to
2770 getPropertyCSSValue.
2771 (khtml::CompositeEditCommandImpl::applyTypingStyle): Add in top-level calls
2772 to updateLayout before doing style changes that now do not update styles
2774 (khtml::ApplyStyleCommandImpl::doApply): Ditto.
2775 (khtml::ApplyStyleCommandImpl::removeCSSStyle): Pass DoNotUpdateLayout to call to
2776 getPropertyCSSValue.
2777 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Remove this dead code.
2778 * khtml/editing/htmlediting_impl.h: Ditto.
2780 2004-09-22 Ken Kocienda <kocienda@apple.com>
2784 * WebCore.pbproj/project.pbxproj: New files added.
2785 * khtml/khtml_part.cpp:
2786 (KHTMLPart::clearSelection): No longer calls setFocusIfNeeded.
2787 (KHTMLPart::slotClearSelection): Merged old implementation from this function to
2788 clearSelection. Now just calls clearSelection. Also put in !APPLE_CHANGES since
2790 * khtml/xml/dom_docimpl.cpp:
2791 (DocumentImpl::setFocusNode): Add some code to determine when setting the focus should
2792 clear the selection.
2794 (QWidget::hasFocus): Call _webcore_effectiveFirstResponder to get view to check for focus.
2795 (QWidget::setFocus): Ditto.
2796 * kwq/WebCoreBridge.mm:
2797 (-[WebCoreBridge deselectText]): Called slotClearSelection and should have been. Now calls
2799 * kwq/WebCoreView.h: Added.
2800 * kwq/WebCoreView.m: Added.
2801 (-[NSView _webcore_effectiveFirstResponder]): New method to yield the correct responder
2802 to check for firstResponder-ness before calling makeFirstResonder. This helps to prevent
2803 unwanted firstResponder switching.
2804 (-[NSClipView _webcore_effectiveFirstResponder]): Ditto.
2805 (-[NSScrollView _webcore_effectiveFirstResponder]): Ditto.
2807 2004-09-21 Maciej Stachowiak <mjs@apple.com>
2811 <rdar://problem/3805137> REGRESSION: Cannot search on pricetool.com
2813 The problem here is that residual style handling can cause an
2814 element associated with a misnested form to lose the association,
2815 because it can become detached and then reattached in this
2816 case. So we need to maintain the association.
2818 * khtml/html/html_formimpl.h: Added list of dormant elements to form,
2819 and dormant bit to generic form element.
2820 * khtml/html/html_formimpl.cpp:
2821 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl): Clear m_form field for
2822 dormant elements too.
2823 (DOM::HTMLFormElementImpl::registerFormElement): Remove from dormant list
2824 in addition to adding to main list.
2825 (DOM::HTMLFormElementImpl::removeFormElement): Remove from both lists.
2826 (DOM::HTMLFormElementImpl::makeFormElementDormant): New method, remove from
2827 main list, add to dormant list.
2828 (DOM::HTMLGenericFormElementImpl::HTMLGenericFormElementImpl): Initialize
2829 dormant bit to false.
2830 (DOM::HTMLGenericFormElementImpl::insertedIntoDocument): If the element is
2831 dormant and has a form, re-register it and clear the dormant bit.
2832 (DOM::HTMLGenericFormElementImpl::removedFromDocument): If the document has
2833 a form, tell the form it is dormant and set the dormant bit.
2835 2004-09-22 Chris Blumenberg <cblu@apple.com>
2837 Fixed: <rdar://problem/3811187> REGRESSION (Mail): Control-click past end of document does not spell check last word
2839 Reviewed by kocienda.
2841 * khtml/xml/dom_selection.cpp:
2842 (DOM::Selection::validate): if at the end of the document, expand to the left.
2844 2004-09-22 Maciej Stachowiak <mjs@apple.com>
2846 Reviewed by Ken and John.
2848 <rdar://problem/3759228> REGRESSION (Mail): stray characters when entering text via input method right after newline
2850 * khtml/editing/htmlediting_impl.cpp:
2851 (khtml::CompositeEditCommandImpl::inputText): Add an optional
2852 selectInsertedText parameter.
2853 (khtml::ReplaceSelectionCommandImpl::doApply): Let the inputText operation
2854 select the text when inserting plain text, because it already knows all the right
2855 information to do so, and this function doesn't (sometimes text is inserted
2856 before the start of the old selection, not after!)
2857 * khtml/editing/htmlediting_impl.h:
2859 2004-09-22 Richard Williamson <rjw@apple.com>
2861 More tweaks to dashboard regions.
2863 Move dashboard regions list into css3NonInheritedData so it will be shared
2864 by all styles that don't modify the empty region list.
2866 Make the initial value for dashboard region list a static to minimize allocations
2869 Make marquee and flex style accessor functions const.
2873 * khtml/rendering/render_style.cpp:
2874 (RenderStyle::diff):
2875 * khtml/rendering/render_style.h:
2876 (khtml::RenderStyle::opacity):
2877 (khtml::RenderStyle::boxAlign):
2878 (khtml::RenderStyle::boxDirection):
2879 (khtml::RenderStyle::boxFlexGroup):
2880 (khtml::RenderStyle::boxOrdinalGroup):
2881 (khtml::RenderStyle::boxOrient):
2882 (khtml::RenderStyle::boxPack):
2883 (khtml::RenderStyle::marqueeIncrement):
2884 (khtml::RenderStyle::marqueeSpeed):
2885 (khtml::RenderStyle::marqueeLoopCount):
2886 (khtml::RenderStyle::marqueeBehavior):
2887 (khtml::RenderStyle::marqueeDirection):
2888 (khtml::RenderStyle::dashboardRegions):
2889 (khtml::RenderStyle::setDashboardRegions):
2890 (khtml::RenderStyle::setDashboardRegion):
2891 (khtml::RenderStyle::initialDashboardRegions):
2893 2004-09-22 David Hyatt <hyatt@apple.com>
2895 Fix for 3802766, entire view redrawn in Blot while typing. Don't needlessly create text nodes just to find
2896 out the font for the caret position.
2900 * kwq/KWQKHTMLPart.mm:
2901 (KWQKHTMLPart::fontForSelection):
2903 2004-09-21 Chris Blumenberg <cblu@apple.com>
2906 <rdar://problem/3735071> REGRESSION (Mail): WebCore Editing must do smart paste
2907 <rdar://problem/3799163> REGRESSION (Mail): Deleting a word doesn't delete whitespace
2911 * khtml/editing/htmlediting.cpp:
2912 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): take smartDelete parameter
2913 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take smartReplace parameter
2914 * khtml/editing/htmlediting.h:
2915 * khtml/editing/htmlediting_impl.cpp:
2916 (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl): take smartDelete parameter
2917 (khtml::DeleteSelectionCommandImpl::doApply): delete whitespace before and after selection if necessary
2918 (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl): take smartReplace parameter
2919 (khtml::ReplaceSelectionCommandImpl::doApply): add whitespace before and after the replacement if necessary
2920 * khtml/editing/htmlediting_impl.h:
2921 * kwq/WebCoreBridge.h:
2922 * kwq/WebCoreBridge.mm:
2923 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): take smartReplace parameter
2924 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): ditto
2925 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): ditto
2926 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): ditto
2927 (-[WebCoreBridge deleteSelectionWithSmartDelete:]): take smartDelete parameter
2929 2004-09-21 Richard Williamson <rjw@apple.com>
2931 More dashboard region work.
2933 Added support for computed style and cssText for new region property.
2934 Added restriction on length types allowed in region functions.
2935 Added initial and inheritance support for -apple-dashboard-region.
2939 * khtml/css/css_computedstyle.cpp:
2940 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2941 * khtml/css/css_valueimpl.cpp:
2942 (CSSPrimitiveValueImpl::cssText):
2943 * khtml/css/cssparser.cpp:
2944 (CSSParser::parseDashboardRegions):
2945 * khtml/css/cssstyleselector.cpp:
2946 (khtml::CSSStyleSelector::applyProperty):
2947 * khtml/rendering/render_object.cpp:
2948 (RenderObject::addDashboardRegions):
2949 * khtml/rendering/render_style.cpp:
2950 (RenderStyle::diff):
2951 * khtml/rendering/render_style.h:
2952 (khtml::StyleDashboardRegion::operator==):
2953 (khtml::RenderStyle::dashboardRegions):
2954 (khtml::RenderStyle::setDashboardRegions):
2955 (khtml::RenderStyle::initialDashboardRegions):
2957 2004-09-21 Darin Adler <darin@apple.com>
2961 - fixed problem where our updateLayout call ignores pending stylesheets all the time
2963 * khtml/xml/dom_docimpl.h: Added updateLayoutIgnorePendingStylesheets.
2964 * khtml/xml/dom_docimpl.cpp:
2965 (DocumentImpl::updateLayout): Took out the "ignore pending stylesheets" business here.
2966 (DocumentImpl::updateLayoutIgnorePendingStylesheets): Put it in here.
2968 * khtml/ecma/kjs_dom.cpp: (DOMNode::getValueProperty): Call the new
2969 updateLayoutIgnorePendingStylesheets function.
2970 * khtml/ecma/kjs_html.cpp:
2971 (KJS::HTMLElement::getValueProperty): Ditto.
2972 (KJS::HTMLElement::putValue): Ditto.
2973 * khtml/ecma/kjs_views.cpp: (DOMAbstractViewFunc::tryCall): Ditto.
2974 * khtml/ecma/kjs_window.cpp:
2975 (Window::updateLayout): Ditto.
2976 (Selection::get): Ditto.
2977 (SelectionFunc::tryCall): Ditto.
2979 * khtml/html/html_imageimpl.h: Add ignorePendingStylesheets boolean parameter.
2980 * khtml/html/html_imageimpl.cpp:
2981 (HTMLImageElementImpl::width): Respect new parameter.
2982 (HTMLImageElementImpl::height): Ditto.
2986 * kwq/WebCoreBridge.mm:
2987 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Removed unneeded
2988 explicit "true" parameter to setSelection.
2989 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto.
2991 2004-09-21 Darin Adler <darin@apple.com>
2995 - fix crash when pasting text at the end of the document and then doing an undo
2997 * khtml/editing/htmlediting_impl.cpp:
2998 (khtml::EditCommandImpl::apply): Call markMisspellingsInSelection before doing
2999 the editing operation, and we'll tell setSelection not to unmark the old selection.
3000 Also call updateLayout before calling appliedEditing so DOM operations in the
3001 code responding to the selection change will work.
3002 (khtml::EditCommandImpl::unapply): Ditto.
3003 (khtml::EditCommandImpl::reapply): Ditto.
3005 * khtml/khtml_part.h: Added a third parameter to setSelection to tell it whether
3006 to unmark the old selection. We must pass false when editing, because the old
3007 selection might have now-invalid offsets inside it.
3008 * khtml/khtml_part.cpp:
3009 (KHTMLPart::setSelection): Add unmarkOldSelection parameter, and respect it.
3010 (KHTMLPart::appliedEditing): Pass false for unmarkOldSelection.
3011 (KHTMLPart::unappliedEditing): Ditto.
3012 (KHTMLPart::reappliedEditing): Ditto.
3014 2004-09-21 Richard Williamson <rjw@apple.com>
3016 Part 2 of the feature requested in
3017 <rdar://problem/3752791> Dashboard: Need a better solution for control regions
3019 This patch actually collections the regions and converts to absolute coordinates.
3020 Only remaining piece is to pass over the bridge and up the alley to WebKit
3025 * khtml/css/css_valueimpl.h:
3026 (DOM::CSSPrimitiveValueImpl::getDashboardRegionValue):
3027 * khtml/css/cssparser.cpp:
3028 (CSSParser::parseValue):
3029 (CSSParser::parseDashboardRegions):
3030 * khtml/css/cssproperties.c:
3031 * khtml/css/cssproperties.h:
3032 * khtml/css/cssproperties.in:
3033 * khtml/css/cssstyleselector.cpp:
3034 (khtml::CSSStyleSelector::applyProperty):
3035 * khtml/khtmlview.cpp:
3036 (KHTMLView::layout):
3037 * khtml/rendering/render_object.cpp:
3038 (RenderObject::computeDashboardRegions):
3039 (RenderObject::addDashboardRegions):
3040 (RenderObject::collectDashboardRegions):
3041 * khtml/rendering/render_object.h:
3042 (khtml::DashboardRegionValue::operator==):
3043 * khtml/rendering/render_style.cpp:
3044 * khtml/rendering/render_style.h:
3045 (khtml::StyleDashboardRegion::):
3046 (khtml::RenderStyle::dashboardRegions):
3047 (khtml::RenderStyle::setDashboardRegion):
3048 * khtml/xml/dom_docimpl.cpp:
3049 (DocumentImpl::DocumentImpl):
3050 (DocumentImpl::updateLayout):
3051 (DocumentImpl::acceptsEditingFocus):
3052 (DocumentImpl::dashboardRegions):
3053 (DocumentImpl::setDashboardRegions):
3054 * khtml/xml/dom_docimpl.h:
3055 (DOM::DocumentImpl::hasDashboardRegions):
3056 (DOM::DocumentImpl::setHasDashboardRegions):
3058 2004-09-21 John Sullivan <sullivan@apple.com>
3062 - WebCore part of fix for <rdar://problem/3618274> REGRESSION (125-135):
3063 Option-tab doesn't always work as expected
3065 * kwq/KWQKHTMLPart.mm:
3066 (KWQKHTMLPart::tabsToAllControls):
3067 reworked logic to match what we promise in the UI; this worked correctly
3068 before for regular tabbing, but not for option-tabbing.
3071 (QButton::focusPolicy):
3072 check tabsToAllControls() rather than just WebCoreKeyboardAccessFull
3074 * kwq/KWQComboBox.mm:
3075 (QComboBox::focusPolicy):
3078 * kwq/KWQFileButton.mm:
3079 (KWQFileButton::focusPolicy):
3082 * kwq/KWQListBox.mm:
3083 (QListBox::focusPolicy):
3086 2004-09-21 John Sullivan <sullivan@apple.com>
3088 * khtml/xml/dom_selection.cpp:
3089 (DOM::Selection::modify):
3090 initialize xPos to make compiler happy in deployment builds
3092 2004-09-21 Darin Adler <darin@apple.com>
3096 - some small mechanical improvements to the position and selection classes
3098 * khtml/xml/dom_position.h: Added clear(), startPosition(), and endPosition().
3099 * khtml/xml/dom_position.cpp:
3100 (DOM::Position::clear): Added.
3101 (DOM::startPosition): Added.
3102 (DOM::endPosition): Added.
3104 * khtml/xml/dom_caretposition.h: Changed m_position to m_deepPosition. Added clear(),
3105 removed node() and offset().
3106 * khtml/xml/dom_caretposition.cpp:
3107 (DOM::CaretPosition::init): Updated for name change of m_position to m_deepPosition.
3108 (DOM::CaretPosition::isLastInBlock): Ditto.
3109 (DOM::CaretPosition::next): Ditto.
3110 (DOM::CaretPosition::previous): Ditto.
3111 (DOM::CaretPosition::debugPosition): Ditto.
3112 (DOM::CaretPosition::formatForDebugger): Ditto.
3114 * khtml/xml/dom_selection.h: Remove setStart, setEnd, setStartAndEnd, rangeStart, rangeEnd,
3115 and all the assignXXX functions.
3116 * khtml/xml/dom_selection.cpp:
3117 (DOM::Selection::Selection): Wean from assign functions, get and set data members directly.
3118 (DOM::Selection::init): Don't clear base, extent, start, and end, since they have constructors.
3119 (DOM::Selection::operator=): Wean from assign functions, get and set data members directly.
3120 (DOM::Selection::moveTo): Ditto.
3121 (DOM::Selection::setModifyBias): Ditto.
3122 (DOM::Selection::modifyExtendingRightForward): Ditto.
3123 (DOM::Selection::modifyMovingRightForward): Ditto.
3124 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
3125 (DOM::Selection::modifyMovingLeftBackward): Ditto.
3126 (DOM::Selection::modify): Ditto.
3127 (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
3128 (DOM::Selection::clear): Ditto.
3129 (DOM::Selection::setBase): Ditto.
3130 (DOM::Selection::setExtent): Ditto.
3131 (DOM::Selection::setBaseAndExtent): Ditto.
3132 (DOM::Selection::toRange): Ditto.
3133 (DOM::Selection::layoutCaret): Ditto.
3134 (DOM::Selection::needsCaretRepaint): Ditto.
3135 (DOM::Selection::validate): Ditto.
3136 (DOM::Selection::debugRenderer): Ditto.
3137 (DOM::Selection::debugPosition): Ditto.
3138 (DOM::Selection::end):
3140 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::advanceToNextMisspelling): Tweaked whitespace.
3142 2004-09-21 Chris Blumenberg <cblu@apple.com>
3144 Fixed: <rdar://problem/3647229> Safari does not play inline Windows Media Content on some sites (miggy.net and ministryofsound.com)
3148 * khtml/rendering/render_frames.cpp:
3149 (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
3151 2004-09-20 Darin Adler <darin@apple.com>
3155 - fixed regression from my recent check-in where misspelled words do not get unmarked when moving the caret
3156 - changed CaretPosition to hold a Position instead of a node and offset
3157 - renamed isEmpty to isNull, etc.
3159 * kwq/KWQKHTMLPart.mm:
3160 (KWQKHTMLPart::jumpToSelection): Updated for name changes.
3161 (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
3162 (KWQKHTMLPart::fontForSelection): Ditto.
3163 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Ditto.
3164 (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
3165 (KWQKHTMLPart::updateSpellChecking): Fixed bug by using LeftWordIfOnBoundary.
3167 * khtml/xml/dom_position.h: Updated for name changes.
3168 * khtml/xml/dom_position.cpp:
3169 (DOM::Position::element): Change to not use a separate null check.
3170 (DOM::Position::computedStyle): Updated for name changes.
3171 (DOM::Position::previousCharacterPosition): Ditto.
3172 (DOM::Position::nextCharacterPosition): Ditto.
3173 (DOM::Position::equivalentRangeCompliantPosition): Ditto.
3174 (DOM::Position::equivalentShallowPosition): Ditto.
3175 (DOM::Position::equivalentDeepPosition): Ditto.
3176 (DOM::Position::closestRenderedPosition): Ditto.
3177 (DOM::Position::inRenderedContent): Ditto.
3178 (DOM::Position::inRenderedText): Ditto.
3179 (DOM::Position::isRenderedCharacter): Ditto.
3180 (DOM::Position::rendersInDifferentPosition): Ditto.
3181 (DOM::Position::isFirstRenderedPositionOnLine): Ditto.
3182 (DOM::Position::isLastRenderedPositionOnLine): Ditto.
3183 (DOM::Position::inFirstEditableInRootEditableElement): Ditto.
3184 (DOM::Position::leadingWhitespacePosition): Ditto.
3185 (DOM::Position::trailingWhitespacePosition): Ditto.
3186 (DOM::Position::debugPosition): Ditto.
3187 (DOM::Position::formatForDebugger): Ditto.
3189 * khtml/xml/dom_caretposition.h: Change to use m_position, and change names.
3190 * khtml/xml/dom_caretposition.cpp:
3191 (DOM::CaretPosition::CaretPosition): Remove code to set up m_node.
3192 (DOM::CaretPosition::init): Set m_position directly.
3193 (DOM::CaretPosition::isLastInBlock): Updated for name changes.
3194 (DOM::CaretPosition::next): Set m_position directly.
3195 (DOM::CaretPosition::previous): Set m_position directly.
3196 (DOM::CaretPosition::previousCaretPosition): Updated for name changes.
3197 (DOM::CaretPosition::nextCaretPosition): Ditto.
3198 (DOM::CaretPosition::previousPosition): Ditto.
3199 (DOM::CaretPosition::nextPosition): Ditto.
3200 (DOM::CaretPosition::atStart): Ditto.
3201 (DOM::CaretPosition::atEnd): Ditto.
3202 (DOM::CaretPosition::isCandidate): Ditto.
3203 (DOM::CaretPosition::debugPosition): Ditto.
3204 (DOM::CaretPosition::formatForDebugger): Ditto.
3205 (DOM::startOfWord): Ditto.
3206 (DOM::endOfWord): Ditto.
3207 (DOM::previousParagraphPosition): Ditto.
3208 (DOM::nextParagraphPosition): Ditto.
3210 * khtml/xml/dom_selection.h: Updated names. Added isCaret and isRange.
3211 * khtml/xml/dom_selection.cpp:
3212 (DOM::Selection::modifyMovingRightForward): Updated for name changes.
3213 (DOM::Selection::modifyMovingLeftBackward): Ditto.
3214 (DOM::Selection::modify): Ditto.
3215 (DOM::Selection::expandUsingGranularity): Ditto.
3216 (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
3217 (DOM::Selection::toRange): Ditto.
3218 (DOM::Selection::layoutCaret): Ditto.
3219 (DOM::Selection::needsCaretRepaint): Ditto.
3220 (DOM::Selection::validate): Ditto.
3221 (DOM::startOfFirstRunAt): Ditto.
3222 (DOM::endOfLastRunAt): Ditto.
3223 (DOM::selectionForLine): Ditto.
3224 (DOM::Selection::formatForDebugger): Ditto.
3226 * khtml/ecma/kjs_window.cpp:
3227 (Selection::get): Updated for name changes.
3228 (Selection::toString): Ditto.
3229 * khtml/editing/htmlediting_impl.cpp:
3230 (khtml::debugPosition): Ditto.
3231 (khtml::StyleChange::init): Ditto.
3232 (khtml::StyleChange::currentlyHasStyle): Ditto.
3233 (khtml::CompositeEditCommandImpl::deleteSelection): Ditto.
3234 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): Ditto.
3235 (khtml::ApplyStyleCommandImpl::doApply): Ditto.
3236 (khtml::DeleteSelectionCommandImpl::doApply): Ditto.
3237 (khtml::InputNewlineCommandImpl::doApply): Ditto.
3238 (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
3239 (khtml::InputTextCommandImpl::input): Ditto.
3240 (khtml::ReplaceSelectionCommandImpl::doApply): Ditto.
3241 (khtml::MoveSelectionCommandImpl::doApply): Ditto.
3242 (khtml::TypingCommandImpl::doApply): Ditto.
3243 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Ditto.
3244 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Ditto.
3245 * khtml/editing/jsediting.cpp:
3246 (enabledAnySelection): Ditto.
3247 (enabledRangeSelection): Ditto.
3248 * khtml/khtml_part.cpp:
3249 (KHTMLPart::hasSelection): Ditto.
3250 (KHTMLPart::setFocusNodeIfNeeded): Ditto.
3251 (KHTMLPart::selectionLayoutChanged): Ditto.
3252 (KHTMLPart::timerEvent): Ditto.
3253 (KHTMLPart::isPointInsideSelection): Ditto.
3254 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
3255 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
3256 (KHTMLPart::handleMousePressEventSingleClick): Ditto.
3257 (KHTMLPart::handleMouseMoveEventSelection): Ditto.
3258 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
3259 (KHTMLPart::selectionHasStyle): Ditto.
3260 (KHTMLPart::selectionComputedStyle): Ditto.
3261 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::updateSelection): Ditto.
3262 * khtml/xml/dom_positioniterator.cpp:
3263 (DOM::PositionIterator::peekPrevious): Ditto.
3264 (DOM::PositionIterator::peekNext): Ditto.
3265 (DOM::PositionIterator::atStart): Ditto.
3266 (DOM::PositionIterator::atEnd): Ditto.
3267 * khtml/xml/dom_positioniterator.h:
3268 (DOM::PositionIterator::isEmpty): Ditto.
3269 * kwq/KWQRenderTreeDebug.cpp:
3270 (writeSelection): Ditto.
3271 * kwq/WebCoreBridge.mm:
3272 (-[WebCoreBridge editableDOMRangeForPoint:]): Ditto.
3273 (-[WebCoreBridge deleteSelection]): Ditto.
3274 (-[WebCoreBridge ensureCaretVisible]): Ditto.
3275 (-[WebCoreBridge rangeOfCharactersAroundCaret]): Ditto.
3277 2004-09-20 Darin Adler <darin@apple.com>
3281 - fixed <rdar://problem/3808073> find is broken
3283 * khtml/misc/khtml_text_operations.h: Add m_pastEndNode and change name of m_endNode to
3284 m_endContainer to more accurately reflect its purpose.
3285 * khtml/misc/khtml_text_operations.cpp:
3286 (khtml::TextIterator::TextIterator): Use pastEnd() for end of iteration, and change to
3287 handle bad ranges better: just return an empty iterator instead of raising an exception.
3288 (khtml::TextIterator::advance): Change to use m_pastEndNode to detect the end of iteration.
3289 (khtml::TextIterator::handleTextNode): Update for name change.
3290 (khtml::TextIterator::handleTextBox): Ditto.
3291 (khtml::TextIterator::range): Handle case where m_endContainer is nil.
3293 * khtml/xml/dom2_rangeimpl.cpp:
3294 (DOM::RangeImpl::surroundContents): Use offsetInCharacters.
3295 (DOM::RangeImpl::startNode): Added check for nil start container and use offsetInCharacters.
3296 (DOM::RangeImpl::pastEndNode): Ditto.
3298 2004-09-20 Chris Blumenberg <cblu@apple.com>
3300 Fixed: <rdar://problem/3781290> REGRESSION (Mail): Crash in ReplaceSelectionCommandImpl attaching file to new message
3302 Reviewed by kocienda.
3304 * khtml/khtml_part.cpp:
3305 (KHTMLPart::setSelection): setFocusNodeIfNeeded now works on the current selection so call setFocusNodeIfNeeded after setting the selection
3306 (KHTMLPart::clearSelection): don't call setFocusNodeIfNeeded with the current selection
3307 (KHTMLPart::setCaretVisible): ditto
3308 (KHTMLPart::setFocusNodeIfNeeded): do nothing if the part isn't focused, work with the current selection
3309 * khtml/khtml_part.h:
3310 * khtml/khtmlpart_p.h:
3311 (KHTMLPartPrivate::KHTMLPartPrivate): added m_isFocused
3312 * kwq/KWQKHTMLPart.h:
3313 * kwq/KWQKHTMLPart.mm:
3314 (KWQKHTMLPart::KWQKHTMLPart): removed _displaysWithFocusAttributes this is replaced by m_isFocused
3315 (KWQKHTMLPart::setSelectionFromNone): new, code factored out from setDisplaysWithFocusAttributes
3316 (KWQKHTMLPart::setDisplaysWithFocusAttributes): call setSelectionFromNone
3317 (KWQKHTMLPart::displaysWithFocusAttributes): now returns m_isFocused
3318 * kwq/WebCoreBridge.h:
3319 * kwq/WebCoreBridge.mm:
3320 (-[WebCoreBridge setSelectionFromNone]): new
3322 2004-09-20 Darin Adler <darin@apple.com>
3326 - fixed nil-deref happening often in Mail when I delete
3328 * khtml/rendering/render_br.cpp: (RenderBR::selectionRect): Check for nil lastLeafChild.
3329 Dave may want to figure out why it's nil and do a different fix later.
3331 2004-09-20 Maciej Stachowiak <mjs@apple.com>
3333 Reviewed by Richard.
3335 <rdar://problem/3672101> HANG: typing into login field at dws-direkt.deutsche-bank.de (infinite recursion)
3337 * khtml/xml/dom_docimpl.cpp:
3338 (DocumentImpl::defaultEventHandler): Copy the list of handlers
3339 before firing any of them, in case a handler affects the list of
3342 2004-09-20 Chris Blumenberg <cblu@apple.com>
3345 <rdar://problem/3429921> obey PARAM tags inside of OBJECT tags when necessary
3346 <rdar://problem/3515685> Object tag in Java 1.4.1 / Safari doesn't recognize params
3350 * khtml/khtml_part.cpp:
3351 (KHTMLPart::requestFrame): take 2 parameter arrays rather than 1 which will have to be parsed
3352 (KHTMLPart::requestObject): ditto
3353 * khtml/khtml_part.h:
3354 * khtml/khtmlpart_p.h:
3355 * khtml/rendering/render_frames.cpp:
3356 (RenderPartObject::updateWidget): use PARAM tags when there is no EMBED specified
3357 * kwq/KWQKHTMLPart.h:
3358 * kwq/KWQKHTMLPart.mm:
3359 (KWQKHTMLPart::createPart): call renamed bridge method
3360 * kwq/KWQKJavaAppletWidget.mm:
3361 (KJavaAppletWidget::KJavaAppletWidget): ditto
3362 * kwq/KWQStringList.h:
3363 * kwq/KWQStringList.mm:
3364 (QStringList::getNSArray): return a const array
3365 * kwq/WebCoreBridge.h:
3366 * kwq/WebCoreBridge.mm:
3367 (-[WebCoreBridge URLWithAttributeString:]): renamed to match API
3369 2004-09-20 Darin Adler <darin@apple.com>
3373 - fixed <rdar://problem/3655360> REGRESSION (Mail): Ctrl-V emacs key binding, -pageDown: method, unimplemented (and pageUp, and selection-modifying versions)
3374 - fixed <rdar://problem/3735055> REGRESSION (Mail): WebCore double click rules treat style change as a boundary
3375 - fixed <rdar://problem/3789939> REGRESSION (Mail): double-clicking on border whitespace selects space plus word before/after
3376 - fixed <rdar://problem/3792138> REGRESSION (Mail): Spell checker doesn't check current selected word
3377 - fixed <rdar://problem/3806604> REGRESSION (164): Triple-click sometimes selects extra characters
3378 - fixed <rdar://problem/3806996> REGRESSION (125-162): Triple-click in <pre> tagged text behaves oddly (leuf.net)
3380 * khtml/xml/dom_caretposition.h: Added a lot of new functions. Removed implicit conversion operator
3381 that converts from CaretPosition to Position.
3382 * khtml/xml/dom_caretposition.cpp:
3383 (DOM::CaretPosition::CaretPosition): Change to call deepEquivalent so it works without the implicit
3384 Position conversion operator.
3385 (DOM::CaretPosition::operator=): Ditto.
3386 (DOM::CaretPosition::next): Ditto.
3387 (DOM::CaretPosition::previous): Ditto.
3388 (DOM::CaretPosition::setPosition): Added an assertion.
3389 (DOM::start): Added.
3391 (DOM::setStart): Added.
3392 (DOM::setEnd): Added.
3393 (DOM::previousWordBoundary): Added.
3394 (DOM::nextWordBoundary): Added.
3395 (DOM::startWordBoundary): Added.
3396 (DOM::startOfWord): Added.
3397 (DOM::endWordBoundary): Added.
3398 (DOM::endOfWord): Added.
3399 (DOM::previousWordPositionBoundary): Added.
3400 (DOM::previousWordPosition): Added.
3401 (DOM::nextWordPositionBoundary): Added.
3402 (DOM::nextWordPosition): Added.
3403 (DOM::previousLinePosition): Added.
3404 (DOM::nextLinePosition): Added.
3405 (DOM::startOfParagraph): Changed function name.
3406 (DOM::endOfParagraph): Changed function name. Fixed code in includeLineBreak to work around
3407 the CaretPosition constructor issue for <br>, pass the right parameter for the block flow case,
3408 and handle <pre> properly.
3409 (DOM::inSameParagraph): Added.
3410 (DOM::previousParagraphPosition): Added.
3411 (DOM::nextParagraphPosition): Added.
3413 * khtml/xml/dom_position.h: Removed a number of functions no longer used; also made some private.
3414 * khtml/xml/dom_position.cpp: Removed a number of functions no longer used.
3416 * khtml/xml/dom_selection.h: Replaced DOCUMENT with DOCUMENT_BOUNDARY. Added overloads of lots
3417 of functions that take CaretPosition directly. Added overload of modify that takes a parameter
3418 for vertical distance to help implement pageDown: and friends. Replaced getRepaintRect with
3419 two new functions named caretRect and caretRepaintRect. Removed nodeIsBeforeNode.
3420 * khtml/xml/dom_selection.cpp:
3421 (DOM::Selection::Selection): Added constructor that takes two CaretPosition objects.
3422 (DOM::Selection::setModifyBias): Added. Helper function.
3423 (DOM::Selection::modifyExtendingRightForward): Don't set modify bias, since that's now the caller's
3424 responsibility. Reimplement WORD and LINE in terms of new CaretPosition functions. Implement PARAGRAPH
3425 and change PARAGRAPH_BOUNDARY to use CaretPosition function by its new name.
3426 (DOM::Selection::modifyMovingRightForward): Ditto.
3427 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
3428 (DOM::Selection::modifyMovingLeftBackward): Ditto.
3429 (DOM::Selection::modify): Call setModifyBias, and use a switch statement instead of if.
3430 (DOM::caretY): Added. Helper for the new modify function that implements moving a pixel distance,
3431 used by pageDown: and friends.
3432 (DOM::Selection::modify): Added.
3433 (DOM::Selection::toRange): Use RangeImpl::compareBoundaryPoints instead of nodeIsBeforeNode.
3434 (DOM::Selection::caretRect): Added. Replaces getRepaintRect, but does not add slop.
3435 (DOM::Selection::caretRepaintRect): Added. Replaces getRepaintRect; still adds slop.
3436 (DOM::Selection::needsCaretRepaint): Call caretRepaintRect.
3437 (DOM::Selection::validate): Use RangeImpl::compareBoundaryPoints instead of nodeIsBeforeNode.
3438 Reimplement WORD to use new CaretPosition functions; this fixes the double-clicking problems.
3439 Change paragraph calls to use new names.
3441 * ForwardingHeaders/dom/dom_position.h: Removed. This was in the wrong location.
3442 * khtml/editing/htmlediting.cpp: Fixed include that said "dom/dom_position.h".
3443 * khtml/editing/htmlediting_impl.cpp: Fixed include that said "dom/dom_position.h".
3444 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Rewrote this to use the new CaretPosition
3445 functions instead of the old Position functions.
3447 * khtml/misc/helper.h: Added const to character pointer parameter. Also put invertedColor inside
3448 an !APPLE_CHANGES since it doesn't do us any good.
3449 * khtml/misc/helper.cpp:
3450 (khtml::findWordBoundary): Added const to character pointer parameter.
3451 (khtml::nextWordFromIndex): Ditto.
3453 * kwq/KWQTextUtilities.h: Change parameters to const.
3454 * kwq/KWQTextUtilities.cpp: (KWQFindWordBoundary): Change parameter to const.
3455 * kwq/KWQTextUtilities.mm: (KWQFindNextWordFromIndex): Change parameter to const.
3457 * khtml/css/cssstyleselector.cpp: Disable code that uses invertedColor when APPLE_CHANGES, since it
3460 * khtml/rendering/render_canvas.cpp: (RenderCanvas::setSelection): Added checks for selection end
3461 so we can set the selection end to nodes that are not leaf nodes and it will still work. Also took
3462 out bogus firstChild/lastChild loops for the same reason.
3464 * kwq/KWQKHTMLPart.h: Add "start before selection" flag to advanceToNextMisspelling.
3465 Needed to fix bug with spell checking.
3466 * kwq/KWQKHTMLPart.mm:
3467 (KWQKHTMLPart::findString): Changed to use CaretPosition.
3468 (KWQKHTMLPart::advanceToNextMisspelling): Added code to handle "start before selection" flag
3469 and changed to use CaretPosition and new helper functions.
3470 (KWQKHTMLPart::markMisspellingsInSelection): More changes to use CaretPosition.
3471 (KWQKHTMLPart::updateSpellChecking): Ditto.
3473 * kwq/WebCoreBridge.h: Replaced WebSelectByDocument with WebSelectToDocumentBoundary.
3474 Added advanceToNextMisspellingStartingJustBeforeSelection,
3475 rangeByAlteringCurrentSelection:verticalDistance:, and
3476 alterCurrentSelection:verticalDistance:.
3478 * kwq/WebCoreBridge.mm:
3479 (-[WebCoreBridge advanceToNextMisspellingStartingJustBeforeSelection]): Added.
3480 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Added case for selecting by
3481 paragraph to save X position.
3482 (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:]): Added.
3483 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Added.
3484 (-[WebCoreBridge ensureCaretVisible]): Call caretRect instead of getRepaintRect.
3486 2004-09-20 Darin Adler <darin@apple.com>
3490 - cleaned up DOM::RangeImpl a little so compareBoundaryPoints can be used outside the class
3492 * khtml/xml/dom2_rangeimpl.h: Added const to many of the member functions and made the
3493 compareBoundaryPoints that works on parameters be a const member function.
3494 * khtml/xml/dom2_rangeimpl.cpp:
3495 (DOM::RangeImpl::commonAncestorContainer): Added const.
3496 (DOM::RangeImpl::compareBoundaryPoints): Added const.
3497 (DOM::RangeImpl::boundaryPointsValid): Added const, and wrote cleaner version.
3498 (DOM::RangeImpl::insertNode): Simplified by calling containedByReadOnly.
3499 (DOM::RangeImpl::toString): Added const.
3500 (DOM::RangeImpl::toHTML): Added const.
3501 (DOM::RangeImpl::createContextualFragment): Added const.
3502 (DOM::RangeImpl::cloneRange): Added const.
3503 (DOM::RangeImpl::surroundContents): Simplified by calling containedByReadOnly.
3505 2004-09-20 Darin Adler <darin@apple.com>
3509 - fixed <rdar://problem/3806990> REGRESSION (125-162): Crash on Select All at http://leuf.net/cgi/wikidn?PerlConvertEolScript
3511 * khtml/rendering/render_replaced.cpp: (RenderWidget::setSelectionState): Added nil check for the
3514 2004-09-20 Darin Adler <darin@apple.com>
3518 - fixed <rdar://problem/3773740> calling addEventListener on a frame that hasn't loaded yet crashes
3520 * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Add nil checks for the document.
3521 The nil check prevents the crash but there's still a bug here; I filed 3807059 about that.
3523 2004-09-20 Darin Adler <darin@apple.com>
3527 - fixed problem where up and down arrow keys are not preserving X position
3529 * khtml/khtml_part.cpp:
3530 (KHTMLPart::selectionLayoutChanged): Moved code to clear m_xPosForVerticalArrowNavigation out of here.
3531 (KHTMLPart::notifySelectionChanged): Moved it into here.
3533 2004-09-18 Darin Adler <darin@apple.com>
3537 - fixed <rdar://problem/3805627> -[DOMRange _text] sometimes includes all text to the end of the document for certain ranges
3539 * khtml/misc/khtml_text_operations.cpp: (khtml::TextIterator::advance):
3540 Correctly handle the case when we are already on m_endNode. The concept here is that
3541 m_endNode is a node you must never "leave" when iterating.
3545 2004-09-17 Ken Kocienda <kocienda@apple.com>
3547 * layout-tests/editing/selection/unrendered-004-expected.txt: Updated expected results.
3549 2004-09-17 Ken Kocienda <kocienda@apple.com>
3555 <rdar://problem/3780245> REGRESSION (Mail): some lines are skipped when doing arrow navigation
3557 * khtml/xml/dom_position.cpp:
3558 (DOM::Position::previousLinePosition): One-line fix. Make sure that BRs at the end of blocks
3561 2004-09-17 Ken Kocienda <kocienda@apple.com>
3567 <rdar://problem/3805594> REGRESSION (Mail): Second return key stroke does not work when first was in blockquote
3569 * khtml/xml/dom_selection.cpp:
3570 (DOM::Selection::toRange): Code to convert caret positions moved the position upstream
3571 before making a range-compliant position, but erroneously would allow the position
3572 to cross blocks. Now it will no longer do so.
3574 2004-09-16 Richard Williamson <rjw@apple.com>
3576 Part 1 of the feature requested in
3577 <rdar://problem/3752791> Dashboard: Need a better solution for control regions
3579 This patch implements the CSS parsing necessary for dashboard regions.
3580 Here's an example of the syntax we support:
3584 -apple-dashboard-region:
3585 dashboard-region-circle(control 0 0 80 0)
3586 dashboard-region-rectangle(control,20,0,20,0)
3587 dashboard-region-circle(control 80 0 0 0);
3592 Part 2 will determine the appropriate regions.
3596 * khtml/css/css_valueimpl.cpp:
3597 (CSSPrimitiveValueImpl::CSSPrimitiveValueImpl):
3598 * khtml/css/css_valueimpl.h:
3599 (DOM::CSSPrimitiveValueImpl::):
3600 (DOM::DashboardRegionImpl::DashboardRegionImpl):
3601 (DOM::DashboardRegionImpl::~DashboardRegionImpl):
3602 (DOM::DashboardRegionImpl::setNext):
3603 (DOM::DashboardRegionImpl::setLabel):
3604 * khtml/css/cssparser.cpp:
3605 (CSSParser::parseValue):
3606 (CSSParser::parseContent):
3607 (skipCommaInDashboardRegion):
3608 (CSSParser::parseDashboardRegions):
3609 * khtml/css/cssparser.h:
3610 * khtml/css/cssproperties.c:
3613 * khtml/css/cssproperties.h:
3614 * khtml/css/cssproperties.in:
3615 * khtml/dom/css_value.h:
3616 (DOM::CSSPrimitiveValue::):
3618 2004-09-16 Darin Adler <darin@apple.com>
3620 - fixed caret-drawing regression from my last patch
3622 * khtml/xml/dom_selection.cpp:
3623 (DOM::Selection::xPosForVerticalArrowNavigation): Pass false, meaning "vertical line caret"
3624 rather than true meaning "big box for overtyping".
3625 (DOM::Selection::layoutCaret): Ditto.
3627 2004-09-16 Darin Adler <darin@apple.com>
3631 - fixed <rdar://problem/3803280> crash in selectAll on page with no contents
3633 * khtml/khtml_part.cpp: (KHTMLPart::selectAll): Handle case of 0 for documentElement().
3634 * khtml/xml/dom_position.cpp:
3635 (DOM::Position::previousWordPosition): Ditto.
3636 (DOM::Position::nextWordPosition): Ditto.
3638 - cleaned up caret code
3639 - changed DOM::Selection to use CaretPosition more
3641 * khtml/rendering/render_box.cpp: (RenderBox::caretRect): Change to use empty rectangles
3642 instead of an X value of -1 to mean no rectangle.
3643 * khtml/rendering/render_image.cpp: (RenderImage::selectionRect): Take advantage of the
3644 fixed QRect constructor.
3645 * khtml/rendering/render_object.cpp: (RenderObject::caretRect): Change to use empty
3646 rectangle instead of an X value of -1 to mean no rectangle.
3647 * khtml/rendering/render_text.cpp: (RenderText::caretRect): Cleaned up, and changed to use
3648 an empty rectangle instead of an X value of -1 to mean no rectangle.
3650 * khtml/xml/dom_caretposition.h: Made conversion from Position to CaretPosition something you
3651 can do implicitly, since it's an unambiguous conversion. Conversion in the other direction
3652 needs to be done explicitly. Moved EIncludeLineBreak here, and added startParagraphBoundary
3653 and endParagraphBoundary functions.
3654 * khtml/xml/dom_caretposition.cpp:
3655 (DOM::startParagraphBoundary): Added. Replaces, and made from, member function of DOM::Position.
3656 (DOM::endParagraphBoundary): Ditto.
3658 * khtml/xml/dom_position.h: Removed EIncludeLineBreak and startParagraphBoundary and
3659 endParagraphBoundary.
3660 * khtml/xml/dom_position.cpp: Removed startParagraphBoundary and endParagraphBoundary.
3662 * khtml/xml/dom_selection.h: Use CaretPosition instead of Position in a few places.
3663 Use a QRect for the caret rect. Change nodeIsBeforeNode to be a static member function.
3664 * khtml/xml/dom_selection.cpp:
3665 (DOM::Selection::Selection): Change caret to store QRect instead of 3 separate fields.
3666 (DOM::Selection::init): Ditto.
3667 (DOM::Selection::operator=): Ditto.
3668 (DOM::Selection::modifyExtendingRightForward): Change to use CaretPosition instead of Position.
3670 (DOM::Selection::modifyMovingRightForward): Ditto. Check for 0.
3671 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
3672 (DOM::Selection::modifyMovingLeftBackward): Ditto.
3673 (DOM::Selection::modify): Ditto.
3674 (DOM::Selection::layoutCaret): Change to use a QRect for the caret rect, and use an empty
3675 one to mean no rectangle.
3676 (DOM::Selection::getRepaintRect): Ditto.
3677 (DOM::Selection::paintCaret): Ditto.
3678 (DOM::Selection::validate): Change to use CaretPosition instead of Position. Also fixed
3679 PARAGRAPH_BOUNDARY, which was broken and doing the same thing as PARAGRAPH before, but
3680 it's not really used so that didn't matter. Check for 0.
3681 (DOM::Selection::nodeIsBeforeNode): Tightened up a bit and added some FIXMEs. This function
3682 has a number of problems and should probably be discarded in favor of the DOMStringImpl
3683 method that does the same thing.
3685 2004-09-16 Ken Kocienda <kocienda@apple.com>
3691 <rdar://problem/3787168> REGRESSION (Mail): Deleting text from the beginning of a quoted range removes the quoting from the rest
3693 * khtml/editing/htmlediting_impl.cpp:
3694 (khtml::DeleteSelectionCommandImpl::moveNodesAfterNode): Only move the text nodes (and their siblings) when
3695 doing this move between blocks. This serves to mimic NSText behavior very well.
3697 2004-09-15 Darin Adler <darin@apple.com>
3699 - fixed Panther build
3701 * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityActionDescription:]): Fixed backwards
3702 check in #if that was compiling the code on Panther only rather than Tiger only.
3704 2004-09-15 Darin Adler <darin@apple.com>
3708 - fixed lockFocus exception I observed; perhaps not a real issue in the field due to exception blocking
3710 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::imageFromRect): Put most of the function inside a
3711 big if statement to avoid the exception we get from lockFocus otherwise.
3713 2004-09-15 Darin Adler <darin@apple.com>
3717 - fixed <rdar://problem/3786467> REGRESSION (Mail): Reproducible crash replying to an HTML message when your preference is for plain text composing.
3719 * khtml/rendering/render_block.h: Remove removeChildrenFromLineBoxes.
3720 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::removeChild): Remove calls
3721 to removeChildrenFromLineBoxes which was the old way of working around this.
3722 * khtml/rendering/render_flow.cpp: (RenderFlow::detach): Add comments and code to handle
3723 removing children from line boxes we are about to delete.
3725 2004-09-15 Richard Williamson <rjw@apple.com>
3727 Fixed <rdar://problem/3781561> REGRESSION (Mail): typing in Mail became suddenly really sluggish (substitute font code)
3729 A DocumentMarker may begin before the InLineBox that includes
3730 it. Ensure that we correctly handle that case. The paintMarker()
3731 method and code that calls it could do with some cleanup to
3732 make it clearer how all the cases are handled, i.e. marker
3733 within box, or intersecting beginning or end of box.
3737 * khtml/rendering/render_text.cpp:
3738 (InlineTextBox::paintMarker): Minimal change to ensure that we
3739 handle the case of marker starting before box.
3741 2004-09-15 Darin Adler <darin@apple.com>
3745 - get rid of some of the localizable strings in here; we still have to figure out
3746 how we're going to localize the last few role descriptions
3748 * kwq/KWQAccObject.mm:
3749 (-[KWQAccObject roleDescription]): Use NSAccessibilityRoleDescription for most
3750 descriptions instead of a hard-coded string (inside the UI_STRING placeholder).
3751 (-[KWQAccObject accessibilityActionDescription:]): Same thing, with NSAccessibilityActionDescription.
3753 2004-09-15 Darin Adler <darin@apple.com>
3757 - did some QRect-related changes to facilitate later bug fixing
3759 * kwq/KWQPainter.h: Added fillRect overload that takes QRect to match the real Qt one.
3760 * kwq/KWQPainter.mm: (QPainter::fillRect): Added overload that takes QRect.
3762 * kwq/KWQRect.mm: (QRect::QRect): Change default constructed QRect to have a width and
3763 height of 0 rather than 1. Contrary to what we believed earlier, this is what Qt does.
3765 2004-09-15 Darin Adler <darin@apple.com>
3769 - fixed <rdar://problem/3799512> REGRESSION (Mail): caret flashes 1 pixel too far to the left
3771 * khtml/rendering/render_text.cpp: (RenderText::caretRect): Added one to the horizontal position
3774 2004-09-15 Ken Kocienda <kocienda@apple.com>
3778 * khtml/editing/htmlediting_impl.cpp:
3779 (khtml::DeleteSelectionCommandImpl::doApply): The whitespace fixup code
3780 that makes sure proper whitespace renders after deletion was getting confused
3781 in cases where the deletion merged blocks. Basically, I needed to move some
3782 whitespace fixup code so it runs before deleting in the case where blocks
3783 need to be merged. It used to run after, and was getting confused by
3784 whitespace left over at the ends of the block after the deletion.
3785 * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Added.
3786 * layout-tests/editing/deleting/delete-block-merge-contents-012.html: Added.
3787 * layout-tests/editing/deleting/delete-block-merge-contents-013-expected.txt: Added.
3788 * layout-tests/editing/deleting/delete-block-merge-contents-013.html: Added.
3789 * layout-tests/editing/deleting/delete-block-merge-contents-014-expected.txt: Added.
3790 * layout-tests/editing/deleting/delete-block-merge-contents-014.html: Added.
3791 * layout-tests/editing/deleting/delete-block-merge-contents-015-expected.txt: Added.
3792 * layout-tests/editing/deleting/delete-block-merge-contents-015.html: Added.
3793 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt: Added.
3794 * layout-tests/editing/deleting/delete-block-merge-contents-016.html: Added.
3795 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Added.
3796 * layout-tests/editing/deleting/delete-block-merge-contents-017.html: Added.
3798 2004-09-15 Ken Kocienda <kocienda@apple.com>
3802 * khtml/editing/htmlediting_impl.cpp:
3803 (khtml::DeleteSelectionCommandImpl::moveNodesAfterNode): Renamed from moveNodesToBlock.
3804 Just some simplification and cleanup in this function.
3805 (khtml::DeleteSelectionCommandImpl::doApply): Remove a hunk of start-of-block code I thought
3806 I was going to get around to improving and refining. However, I no longer need this case.
3807 * khtml/editing/htmlediting_impl.h: Function name change.
3809 2004-09-14 Darin Adler <darin@apple.com>
3813 - added method for fix to <rdar://problem/3788894> REGRESSION (Mail): ctrl-t emacs key binding does not work (transpose)
3815 * kwq/WebCoreBridge.h: Added rangeOfCharactersAroundCaret.
3816 * kwq/WebCoreBridge.mm: (-[WebCoreBridge rangeOfCharactersAroundCaret]): Added.
3818 * khtml/xml/dom_caretposition.h: Added range function to make a Range from two CaretPosition objects.
3819 * khtml/xml/dom_caretposition.cpp:
3820 (DOM::CaretPosition::rangeCompliantEquivalent): Fixed a bug in this that caused it to screw up
3821 ranges in text nodes. Also changed it to use offset 0 as Ken and I discussed.
3822 (DOM::range): Added.
3824 * kwq/DOM.mm: (-[DOMRange description]): Added.
3826 2004-09-14 Darin Adler <darin@apple.com>
3830 - fixed <rdar://problem/3786986> REGRESSION: TEXTAREAs have extra wide right margins where the scrollbars used to be
3832 * kwq/KWQTextArea.mm:
3833 (-[KWQTextArea _updateTextViewWidth]): Renamed from _frameSizeChanged. Now uses the width of
3834 the size from the contentSize method rather than trying to compute a size.
3835 (-[KWQTextArea initWithFrame:]): Call method by new name.
3836 (-[KWQTextArea tile]): Override this instead of setFrame: to adjust the size as the size of
3837 the text area changes.
3839 2004-09-14 Chris Blumenberg <cblu@apple.com>
3841 Backed out my changes to these files. They were not meant to be checked. (I'm having a bad CVS day)
3843 * kwq/WebCoreBridge.h:
3844 * kwq/WebCoreBridge.mm:
3845 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]):
3846 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:]):
3847 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:]):
3848 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:]):
3850 2004-09-14 David Hyatt <hyatt@apple.com>
3852 Fix the crash in the layout tests caused by my recent selection changes. Simply eliminate the buggy
3853 selection border setting code and let isSelectionBorder be implemented in terms of the SelectionState.
3855 Reviewed by kocienda
3857 * khtml/rendering/render_canvas.cpp:
3858 (RenderCanvas::setSelection):
3859 * khtml/rendering/render_object.cpp:
3860 (RenderObject::RenderObject):
3861 (RenderObject::container):
3862 (RenderObject::isSelectionBorder):
3863 * khtml/rendering/render_object.h:
3864 (khtml::RenderObject::minMaxKnown):
3865 (khtml::RenderObject::setReplaced):
3867 2004-09-14 Chris Blumenberg <cblu@apple.com>
3869 Fixed: <rdar://problem/3778680> REGRESSION: plug-in content sometimes doesn't show up
3873 * khtml/html/html_objectimpl.cpp:
3874 (HTMLObjectElementImpl::parseHTMLAttribute): set needWidgetUpdate to true only if there is a renderer
3875 (HTMLObjectElementImpl::attach): if needWidgetUpdate is true, call updateWidget