3 2004-10-05 David Hyatt <hyatt@apple.com>
5 Fix a bug in the iteration of locateCousinList and clean up the style sharing stats code.
7 Reviewed by NOBODY (OOPS!).
9 * khtml/css/cssstyleselector.cpp:
10 (khtml::CSSStyleSelector::locateCousinList):
11 (khtml::CSSStyleSelector::elementsCanShareStyle):
12 (khtml::CSSStyleSelector::locateSharedStyle):
13 (khtml::CSSStyleSelector::styleForElement):
15 2004-10-05 Ken Kocienda <kocienda@apple.com>
19 * khtml/rendering/bidi.cpp:
20 (khtml::RenderBlock::computeHorizontalPositionsForLine): Fix coding mistake that
21 broke layout tests involving compacts.
23 2004-10-05 Ken Kocienda <kocienda@apple.com>
27 Finish selection affinity implementation. This includes code to set the
28 affinity correctly when clicking with the mouse, and clearing the
29 affinity when altering the selection using any of the Selection object
32 Each instance of the positionForCoordinates function in the render tree
33 has been changed to include an EAffinity argument. It is now the job of this
34 function to set the selection affinity.
36 * khtml/editing/selection.cpp:
37 (khtml::Selection::moveTo): Set affinity to DOWNSTREAM.
38 (khtml::Selection::modify): Ditto.
39 (khtml::Selection::clear): Ditto.
40 (khtml::Selection::setBase): Ditto.
41 (khtml::Selection::setExtent): Ditto.
42 (khtml::Selection::setBaseAndExtent): Ditto.
43 * khtml/editing/selection.h:
44 (khtml::operator==): Consider affinity in equality check.
45 * khtml/khtml_events.cpp:
46 (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
47 as this function is being removed.
48 * khtml/khtml_part.cpp:
49 (KHTMLPart::isPointInsideSelection): Ditto.
50 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
51 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
52 (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
53 call to positionForCoordinates, and set resulting affinity on the selection.
54 (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on
55 NodeImpl::positionForCoordinates, as this function is being removed.
56 (KHTMLPart::khtmlMouseReleaseEvent):
57 * khtml/rendering/render_block.cpp:
58 (khtml::RenderBlock::positionForCoordinates): Changed, as described above.
59 * khtml/rendering/render_block.h:
60 * khtml/rendering/render_br.cpp:
61 (RenderBR::positionForCoordinates): Ditto.
62 * khtml/rendering/render_br.h:
63 * khtml/rendering/render_container.cpp:
64 (RenderContainer::positionForCoordinates): Ditto.
65 * khtml/rendering/render_container.h:
66 * khtml/rendering/render_inline.cpp:
67 (RenderInline::positionForCoordinates): Ditto.
68 * khtml/rendering/render_inline.h:
69 * khtml/rendering/render_object.cpp:
70 (RenderObject::positionForCoordinates): Ditto.
71 * khtml/rendering/render_object.h:
72 * khtml/rendering/render_replaced.cpp:
73 (RenderReplaced::positionForCoordinates): Ditto.
74 * khtml/rendering/render_replaced.h:
75 * khtml/rendering/render_text.cpp:
76 (RenderText::positionForCoordinates): Ditto.
77 * khtml/rendering/render_text.h:
78 * khtml/xml/dom_nodeimpl.cpp: Removed positionForCoordinates convenience.
79 * khtml/xml/dom_nodeimpl.h: Ditto.
80 * kwq/WebCoreBridge.mm:
81 (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on
82 NodeImpl::positionForCoordinates, as this function is being removed.
84 2004-10-05 David Hyatt <hyatt@apple.com>
86 Fix style sharing optimization to be fast again. Go back to using pointer comparisons when looking for
91 * khtml/css/cssstyleselector.cpp:
92 (khtml::CSSStyleSelector::locateCousinList):
93 * khtml/rendering/render_object.cpp:
94 (RenderObject::setStyleInternal):
95 * khtml/rendering/render_object.h:
96 * khtml/xml/dom_elementimpl.cpp:
97 (ElementImpl::recalcStyle):
99 2004-10-05 David Hyatt <hyatt@apple.com>
101 Fix lists so that they properly participate in line layout as though they are text (when text bullets are
102 used) and as images (when image bullets are used).
106 * khtml/rendering/render_list.cpp:
107 (RenderListMarker::createInlineBox):
108 * khtml/rendering/render_list.h:
109 (khtml::ListMarkerBox:::InlineBox):
110 (khtml::ListMarkerBox::isText):
112 2004-10-05 Ken Kocienda <kocienda@apple.com>
116 Recent checkin adding upstreamDeepEquivalent had it backwards. The helper
117 we want is downstreamDeepEquivalent, as the deepEquivalent function returns
118 an upstream position.
120 * khtml/editing/selection.cpp:
121 (khtml::Selection::layout): DOWNSTREAM case now uses downstreamDeepEquivalent.
122 UPSTREAM uses deepEquivalent.
123 * khtml/editing/visible_position.cpp:
124 (khtml::VisiblePosition::downstreamDeepEquivalent): New helper, replacing
125 upstreamDeepEquivalent.
126 * khtml/editing/visible_position.h
128 2004-10-05 David Hyatt <hyatt@apple.com>
130 New selection gap-filling architecture. Makes the gap-filling much more like NSTextView and puts the responsibility
131 for gap-filling in the block. Fixes numerous bugs with selection drawing including bidi issues, incorrect old
132 horizontal gap filling, and selection performance issues.
136 * khtml/html/html_imageimpl.cpp:
137 (HTMLImageLoader::notifyFinished):
138 * khtml/misc/khtmllayout.h:
139 (khtml::GapRects::left):
140 (khtml::GapRects::center):
141 (khtml::GapRects::right):
142 (khtml::GapRects::uniteLeft):
143 (khtml::GapRects::uniteCenter):
144 (khtml::GapRects::uniteRight):
145 (khtml::GapRects::unite):
146 (khtml::GapRects::operator QRect):
147 (khtml::GapRects::operator==):
148 (khtml::GapRects::operator!=):
149 * khtml/rendering/font.cpp:
150 (Font::drawHighlightForText):
151 * khtml/rendering/font.h:
152 * khtml/rendering/render_block.cpp:
153 (khtml:::RenderFlow):
154 (khtml::RenderBlock::removeChild):
155 (khtml::RenderBlock::paintObject):
156 (khtml::RenderBlock::paintEllipsisBoxes):
157 (khtml::RenderBlock::setSelectionState):
158 (khtml::RenderBlock::shouldPaintSelectionGaps):
159 (khtml::RenderBlock::isSelectionRoot):
160 (khtml::RenderBlock::selectionGapRects):
161 (khtml::RenderBlock::paintSelection):
162 (khtml::RenderBlock::fillSelectionGaps):
163 (khtml::RenderBlock::fillInlineSelectionGaps):
164 (khtml::RenderBlock::fillBlockSelectionGaps):
165 (khtml::RenderBlock::fillHorizontalSelectionGap):
166 (khtml::RenderBlock::fillVerticalSelectionGap):
167 (khtml::RenderBlock::fillLeftSelectionGap):
168 (khtml::RenderBlock::fillRightSelectionGap):
169 (khtml::RenderBlock::getHorizontalSelectionGapInfo):
170 (khtml::RenderBlock::leftSelectionOffset):
171 (khtml::RenderBlock::rightSelectionOffset):
172 * khtml/rendering/render_block.h:
173 (khtml::RenderBlock::hasSelectedChildren):
174 (khtml::RenderBlock::selectionState):
175 (khtml::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
176 (khtml::RenderBlock::BlockSelectionInfo::rects):
177 (khtml::RenderBlock::BlockSelectionInfo::state):
178 (khtml::RenderBlock::BlockSelectionInfo::block):
179 (khtml::RenderBlock::selectionRect):
180 * khtml/rendering/render_box.cpp:
181 (RenderBox::position):
182 * khtml/rendering/render_br.cpp:
183 (RenderBR::inlineBox):
184 * khtml/rendering/render_br.h:
185 (khtml::RenderBR::selectionRect):
186 (khtml::RenderBR::paint):
187 * khtml/rendering/render_canvas.cpp:
188 (RenderCanvas::selectionRect):
189 (RenderCanvas::setSelection):
190 * khtml/rendering/render_canvasimage.cpp:
191 (RenderCanvasImage::paint):
192 * khtml/rendering/render_image.cpp:
193 (RenderImage::paint):
194 * khtml/rendering/render_image.h:
195 * khtml/rendering/render_line.cpp:
196 (khtml::InlineBox::nextLeafChild):
197 (khtml::InlineBox::prevLeafChild):
198 (khtml::InlineBox::selectionState):
199 (khtml::InlineFlowBox::addToLine):
200 (khtml::InlineFlowBox::firstLeafChild):
201 (khtml::InlineFlowBox::lastLeafChild):
202 (khtml::InlineFlowBox::firstLeafChildAfterBox):
203 (khtml::InlineFlowBox::lastLeafChildBeforeBox):
204 (khtml::InlineFlowBox::selectionState):
205 (khtml::RootInlineBox::fillLineSelectionGap):
206 (khtml::RootInlineBox::setHasSelectedChildren):
207 (khtml::RootInlineBox::selectionState):
208 (khtml::RootInlineBox::firstSelectedBox):
209 (khtml::RootInlineBox::lastSelectedBox):
210 (khtml::RootInlineBox::selectionTop):
211 (khtml::RootInlineBox::block):
212 * khtml/rendering/render_line.h:
213 (khtml::RootInlineBox::RootInlineBox):
214 (khtml::RootInlineBox::hasSelectedChildren):
215 (khtml::RootInlineBox::selectionHeight):
216 * khtml/rendering/render_object.cpp:
217 (RenderObject::selectionColor):
218 * khtml/rendering/render_object.h:
219 (khtml::RenderObject::):
220 (khtml::RenderObject::selectionState):
221 (khtml::RenderObject::setSelectionState):
222 (khtml::RenderObject::selectionRect):
223 (khtml::RenderObject::canBeSelectionLeaf):
224 (khtml::RenderObject::hasSelectedChildren):
225 (khtml::RenderObject::hasDirtySelectionState):
226 (khtml::RenderObject::setHasDirtySelectionState):
227 (khtml::RenderObject::shouldPaintSelectionGaps):
228 (khtml::RenderObject::SelectionInfo::SelectionInfo):
229 * khtml/rendering/render_replaced.cpp:
230 (RenderReplaced::RenderReplaced):
231 (RenderReplaced::shouldPaint):
232 (RenderReplaced::selectionRect):
233 (RenderReplaced::setSelectionState):
234 (RenderReplaced::selectionColor):
235 (RenderWidget::paint):
236 (RenderWidget::setSelectionState):
237 * khtml/rendering/render_replaced.h:
238 (khtml::RenderReplaced::canBeSelectionLeaf):
239 (khtml::RenderReplaced::selectionState):
240 * khtml/rendering/render_text.cpp:
241 (InlineTextBox::checkVerticalPoint):
242 (InlineTextBox::isSelected):
243 (InlineTextBox::selectionState):
244 (InlineTextBox::selectionRect):
245 (InlineTextBox::paintSelection):
246 (InlineTextBox::paintMarkedTextBackground):
248 (RenderText::setSelectionState):
249 (RenderText::selectionRect):
250 * khtml/rendering/render_text.h:
251 (khtml::RenderText::canBeSelectionLeaf):
254 (QPainter::drawHighlightForText):
256 (QPtrDictIterator::toFirst):
259 * kwq/WebCoreTextRenderer.h:
260 * kwq/WebCoreTextRendererFactory.mm:
261 (WebCoreInitializeEmptyTextGeometry):
263 2004-10-05 Ken Kocienda <kocienda@apple.com>
267 Use the new CSS properties I added with my previous check-in. Also makes
268 some changes to caret positioning and drawing to make the proper editing
269 end-of-line behavior work correctly.
271 * khtml/editing/selection.cpp:
272 (khtml::Selection::layout): Caret drawing now takes affinity into account
273 when deciding where to paint the caret (finally!).
274 * khtml/editing/visible_position.cpp:
275 (khtml::VisiblePosition::previousVisiblePosition): Move off Position::rendersInDifferentPosition
276 to determine the result. Use a simpler test involving comparisons between
277 downstream positions while iterating. This is cheaper to do and easier to understand.
278 (khtml::VisiblePosition::nextVisiblePosition): Ditto.
279 * khtml/rendering/bidi.cpp:
280 (khtml::BidiIterator::current): Do not return non-breaking spaces for empty
281 text renderers and for non-text renderers. Return a null Qchar instead. Returning
282 non-breaking spaces was causing errors when the new -khtml-nbsp-mode was set to "space".
283 (khtml::RenderBlock::computeHorizontalPositionsForLine): Shrink line boxes that
284 contain with more spaces than can fit on the end of a line.
285 (khtml::RenderBlock::skipWhitespace): Factor this out from findNextLineBreak.
286 (khtml::RenderBlock::findNextLineBreak): Use new skipWhitespace function. Add
287 in code to check and use new CSS properties.
288 * khtml/rendering/break_lines.cpp:
289 (khtml::isBreakable): Consider a non-breaking space a breakable character based
290 on setting of new -khtml-nbsp-mode property.
291 * khtml/rendering/break_lines.h: Ditto.
292 * khtml/rendering/render_block.h: Declare skipWhitespace function.
293 * khtml/rendering/render_text.cpp:
294 (RenderText::caretRect): Do not draw the caret beyond the right edge of the
295 window when in white-space normal mode.
297 2004-10-05 Ken Kocienda <kocienda@apple.com>
303 In this patch, I add two new CSS properties and their associated behavior.
304 This is to support end-of-line and word-wrapping features that match the
305 conventions of text editors.
307 There are also some other small changes here which begin to lay the groundwork
308 for using these new properties to bring about the desired editing behavior.
310 * khtml/css/cssparser.cpp:
311 (CSSParser::parseValue): Add support for new CSS properties.
312 * khtml/css/cssproperties.c: Generated file.
313 * khtml/css/cssproperties.h: Ditto.
314 * khtml/css/cssproperties.in: Add new properties.
315 * khtml/css/cssstyleselector.cpp:
316 (khtml::CSSStyleSelector::applyProperty): Add support for new CSS properties.
317 * khtml/css/cssvalues.c: Generated file.
318 * khtml/css/cssvalues.h: Ditto.
319 * khtml/css/cssvalues.in: Add support for new CSS properties.
320 * khtml/editing/visible_position.cpp:
321 (khtml::VisiblePosition::upstreamDeepEquivalent): Added new helper.
322 * khtml/editing/visible_position.h:
323 * khtml/rendering/render_box.cpp:
324 (RenderBox::deleteLineBoxWrapper): Zero out inlineBoxWrapper.
325 * khtml/rendering/render_replaced.cpp:
326 (RenderWidget::detach): Zero out inlineBoxWrapper.
327 * khtml/rendering/render_style.cpp:
328 (StyleCSS3InheritedData):
329 (StyleCSS3InheritedData::operator==): Add support for new CSS properties.
330 (RenderStyle::diff): Ditto.
331 * khtml/rendering/render_style.h:
332 (khtml::RenderStyle::nbspMode): Ditto.
333 (khtml::RenderStyle::khtmlLineBreak): Ditto.
334 (khtml::RenderStyle::setNBSPMode): Ditto.
335 (khtml::RenderStyle::setKHTMLLineBreak): Ditto.
336 (khtml::RenderStyle::initialNBSPMode): Ditto.
337 (khtml::RenderStyle::initialKHTMLLineBreak): Ditto.
339 2004-10-05 Darin Adler <darin@apple.com>
343 - fixed <rdar://problem/3673150> Pasting string from clipboard that is longer than input box will accept fails rather than truncating
345 * kwq/KWQTextField.mm:
346 (-[KWQTextFieldFormatter isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:]):
347 Wrote a new version of this method that truncates incoming strings rather than rejecting them
350 2004-10-04 Darin Adler <darin@apple.com>
354 - fixed <rdar://problem/3826343> crash in KHTMLParser::setCurrent parsing document fragment (happens in Calendar widget)
356 * khtml/html/htmlparser.cpp:
357 (KHTMLParser::KHTMLParser): Initialized currentIsReferenced to false (fixes bug).
358 (KHTMLParser::reset): Use doc() to make code easier to read.
359 (KHTMLParser::setCurrent): Ditto.
360 (KHTMLParser::parseToken): Ditto.
361 (KHTMLParser::insertNode): Ditto.
362 (KHTMLParser::getElement): Ditto.
363 (KHTMLParser::popOneBlock): Ditto.
365 - fixed <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window
367 * kwq/KWQKHTMLPart.h: Added fontAttributesForSelectionStart.
368 * kwq/KWQKHTMLPart.mm:
369 (KWQKHTMLPart::styleForSelectionStart): Factored out most of fontForSelection.
370 (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
371 (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
372 (KWQKHTMLPart::registerCommandForUndo): Updated for name change (see below).
373 (KWQKHTMLPart::registerCommandForRedo): Ditto.
375 * kwq/WebCoreBridge.h: Added fontAttributesForSelectionStart.
376 * kwq/WebCoreBridge.mm:
377 (-[WebCoreBridge undoEditing:]): Updated for name change (see below).
378 (-[WebCoreBridge redoEditing:]): Ditto.
379 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Got rid of named temporary
380 EditCommandPtr variable to make things slightly more terse.
381 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): Ditto.
382 (-[WebCoreBridge deleteSelectionWithSmartDelete:]): Ditto.
383 (-[WebCoreBridge fontAttributesForSelectionStart]): Added.
385 - fix compile on Panther and other cleanup
387 * khtml/khtml_part.cpp: Removed unneeded include.
388 * kwq/KWQEditCommand.h: Got rid of use of "impl" when referring to EditCommand pointers.
389 * kwq/KWQEditCommand.mm: Added include so we compile on Panther.
390 (-[KWQEditCommand initWithEditCommand:]): Changed name.
391 (-[KWQEditCommand dealloc]): Updated for m_impl change to m_command.
392 (-[KWQEditCommand finalize]): Ditto.
393 (+[KWQEditCommand commandWithEditCommand:]): Changed name.
394 (-[KWQEditCommand command]): Changed name.
396 2004-10-04 Darin Adler <darin@apple.com>
400 - did a more-robust version of the fix I just landed
402 * khtml/html/htmlparser.h: Added currentIsReferenced boolean.
403 * khtml/html/htmlparser.cpp:
404 (KHTMLParser::KHTMLParser): Initializes currentIsReferenced.
405 (KHTMLParser::setCurrent): Changed to respect and set currentIsReferenced.
407 2004-10-04 Darin Adler <darin@apple.com>
411 - fixed <rdar://problem/3824393> REGRESSION (165-TOT): Crash in KHTMLParser::popOneBlock closing window (bose.com)
413 * khtml/html/htmlparser.cpp:
414 (KHTMLParser::~KHTMLParser): Move call to setCurrent(0) after the call to freeBlock, since freeBlock doesn't
415 work well when current is 0, and there's no reason we need to reset the current block first.
416 (KHTMLParser::setCurrent): Don't ever hold a reference to the document. This prevents a situation where there
417 would be a reference cycle. In the test case from the bug above, this cycle actually happened and resulted
418 in a double-delete of the document, tokenizer, and parser.
420 2004-10-04 Darin Adler <darin@apple.com>
424 - fixed <rdar://problem/3825429> onclick handler called when mouse down on another element (affects Dashboard Movies widget, test case enclosed)
426 * khtml/khtmlview.cpp:
427 (KHTMLViewPrivate::KHTMLViewPrivate): Initialize the click node to 0.
428 (KHTMLViewPrivate::~KHTMLViewPrivate): Deref the click node.
429 (KHTMLViewPrivate::reset): Clear the click node.
430 (KHTMLView::viewportMousePressEvent): Call invalidateClick when we pass the event to a subframe to
431 reduce the chance that we'll hold on to an old click node for a long time. Set the click node to
432 the node we we are clicking on.
433 (KHTMLView::viewportMouseDoubleClickEvent): Only send a click even if the node is the same one from
434 the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
435 old click node for a long time.
436 (KHTMLView::invalidateClick): Clear the click node.
437 (KHTMLView::viewportMouseReleaseEvent): Only send a click even if the node is the same one from
438 the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
439 old click node for a long time.
440 (KHTMLView::keyPressEvent): Remove code that sets the originalNode field, which is never used.
442 2004-10-04 Ken Kocienda <kocienda@apple.com>
448 <rdar://problem/3825289> REGRESSION (Mail): Crash in fontForSelection in empty window
450 * khtml/editing/visible_position.cpp:
451 (khtml::VisiblePosition::previousPosition): Switch to node iteration instead "leaf"
452 iteration. I have been wanting to make this change for a long time, but couldn't
453 since other code relied on the leaf behavior. That is no longer true. Plus, the
454 bug fix requires the new behavior.
455 (khtml::VisiblePosition::nextPosition): Ditto.
456 (khtml::VisiblePosition::isCandidate): Empty blocks needed a height to be a candidate,
457 but we make a special case for the body element. This fixes the bug.
459 2004-10-04 Darin Adler <darin@apple.com>
463 - fixed <rdar://problem/3800667> REGRESSION (Mail): double-clicking multiple spaces only selects two spaces
465 * kwq/KWQTextUtilities.mm: (KWQFindWordBoundary): Moved here from the .cpp file. Changed to use the
466 doubleClickAtIndex: method from NSAttributedString rather than using Unicode Utilities.
467 * kwq/KWQTextUtilities.cpp: Removed.
468 * WebCore.pbproj/project.pbxproj: Removed KWQTextUtilities.cpp.
470 - fixed a problem that would show up using HTML editing under garbage collection
472 * kwq/KWQEditCommand.mm: (-[KWQEditCommand finalize]): Fixed a [super dealloc] that should have been a
475 - another small change
477 * khtml/editing/visible_units.cpp: (khtml::nextWordBoundary): Tweaked a comment.
479 2004-10-01 Darin Adler <darin@apple.com>
481 Reviewed by Ken (or arguably done by Ken, reviewed by Darin).
483 - fixed <rdar://problem/3823828> REGRESSION (Mail): Clicking past end of any line puts insertion point at beginning of next line
485 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::VisiblePosition):
486 Check for an offset of 0 and a <br> and use UPSTREAM affinity in that case.
487 This is a short term fix for something that needs a better longer-term fix.
489 - fixed <rdar://problem/3823816> REGRESSION (Mail): double-clicking first word on line also selects previous empty line
491 * khtml/editing/visible_units.cpp: (khtml::previousWordBoundary): Added a special
492 case for <br>. While I'm not sure why this regressed, I'm sure this fix is good.
494 2004-10-01 Darin Adler <darin@apple.com>
498 - fixed <rdar://problem/3782117> CrashTracer: ..722 crashes at com.apple.WebCore: DOM::HTMLBodyElementImpl::insertedIntoDocument + 0x2c (AOL website)
500 * khtml/html/html_baseimpl.cpp:
501 (HTMLBodyElementImpl::insertedIntoDocument): Check for nil document case.
502 (HTMLFrameElementImpl::isURLAllowed): Ditto.
503 (HTMLFrameElementImpl::openURL): Ditto.
505 2004-10-01 Darin Adler <darin@apple.com>
509 - fixed <rdar://problem/3822218> REGRESSION (164-165): images don't update on rollover on directv.com page
511 I introduced a major regression where various JavaScript window properties would not be found when I
514 * khtml/ecma/kjs_window.h: Added hasProperty.
515 * khtml/ecma/kjs_window.cpp: (Window::hasProperty): Return true in all the cases where get returns something.
517 2004-09-30 Darin Adler <darin@apple.com>
521 - fixed <rdar://problem/3461499> JavaScript function document.open() is buggy with 2nd argument "replace"
523 Experiments with Firefox indicate that document.open() should not be treated as window.open() unless there
524 are more than two parameters. Also, Firefox does not implement the "replace" behavior, so we don't have
525 to worry about it either.
527 * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): Only forward to window if there are more than
528 two parameters, rather than if there are more than one.
530 - fixed <rdar://problem/3672933> oninput is firing at page load time for <input type=range>
532 * kwq/KWQSlider.mm: (QSlider::setValue): Don't emit a signal here. This follows the usual pattern, where
533 a signal is only emitted for changes that are not explicitly requested by the caller.
535 - fixed <rdar://problem/3821167> leaks of something allocated by recalcStyle after loading altavista page from cvs-base
537 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Ref and deref the style we allocate so it's
538 not left floating if setStyle decides not to ref it.
540 - fixed <rdar://problem/3821172> leak of HTML attribute string after loading the ESPN page from cvs-base
542 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Use the DOMString version of
543 the lower() operation so we don't end up leaving a DOMStringImpl * floating if AtomicString decides not
546 2004-09-30 Richard Williamson <rjw@apple.com>
548 Fixed <rdar://problem/3822330> REGRESSION: crash on launch when homepage is set to about:blank
552 * kwq/KWQKHTMLPart.mm:
553 (KWQKHTMLPart::setDisplaysWithFocusAttributes):
555 2004-09-30 Chris Blumenberg <cblu@apple.com>
557 Fixed: <rdar://problem/3792822> Safari is calling the Cocoa QuickTime plugin twice for the OBJECT and EMBED tags
561 * khtml/html/html_objectimpl.cpp:
562 (HTMLObjectElementImpl::attach): call dispatchHTMLEvent after updateWidget instead of every time this method is called
563 (HTMLObjectElementImpl::recalcStyle): ditto
565 2004-09-30 Darin Adler <darin@apple.com>
567 - rolled out bad image change that caused performance regression
569 * khtml/rendering/render_image.cpp: (RenderImage::setPixmap):
570 Don't reference the new image before doing the assignment.
571 This forced an unwanted.
573 2004-09-30 Ken Kocienda <kocienda@apple.com>
575 Reviewed by me, coded by Darin
577 - fixed <rdar://problem/3818305> REGRESSION (Mail): Shift + page up has no effect; should modify selection
579 * khtml/editing/selection.cpp: (khtml::Selection::modify): Fix problem where vertical distance
580 was used as a distance threshold, but was a negative number. Now make it positive at the start
581 of the function (and make a couple related changes).
583 2004-09-29 Richard Williamson <rjw@apple.com>
585 Fixed <rdar://problem/3779998> bringing window to front or sending to back does not send focus/blur events to JavaScript window object
587 The fix has two parts, 1) make onblur and onfocus work for windows,
588 and 2), allow the dashboard to override WebKit's special key/non-key
593 * kwq/KWQKHTMLPart.mm:
594 (KWQKHTMLPart::setDisplaysWithFocusAttributes):
596 2004-09-29 Ken Kocienda <kocienda@apple.com>
602 <rdar://problem/3705894> REGRESSION (Mail): if a single word is wider than the window,
603 it doesn't break and just runs off the right side
605 * khtml/css/css_computedstyle.cpp:
606 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support for CSS_PROP_WORD_WRAP.
607 * khtml/css/cssparser.cpp:
608 (CSSParser::parseValue): Ditto.
609 * khtml/css/cssproperties.c: Generated file.
610 * khtml/css/cssproperties.h: Ditto.
611 * khtml/css/cssproperties.in: Add word-wrap property.
612 * khtml/css/cssstyleselector.cpp:
613 (khtml::CSSStyleSelector::applyProperty): Add support for CSS_PROP_WORD_WRAP.
614 * khtml/css/cssvalues.c: Generated file.
615 * khtml/css/cssvalues.h: Ditto.
616 * khtml/css/cssvalues.in: Add break-word value.
617 * khtml/rendering/bidi.cpp:
618 (khtml::RenderBlock::findNextLineBreak): Add code to implement new word wrapping feature.
619 * khtml/rendering/render_style.cpp:
620 (StyleCSS3InheritedData): Add support for new wordWrap property.
621 (StyleCSS3InheritedData::operator==): Ditto.
622 (RenderStyle::diff): Ditto.
623 * khtml/rendering/render_style.h:
624 (khtml::RenderStyle::wordWrap): Ditto.
625 (khtml::RenderStyle::setWordWrap): Ditto.
626 (khtml::RenderStyle::initialWordWrap): Ditto.
628 2004-09-29 Maciej Stachowiak <mjs@apple.com>
632 - consolidated OS version checks into prefix header
635 * khtml/rendering/render_canvasimage.cpp:
636 * kwq/KWQAccObject.mm:
637 (-[KWQAccObject roleDescription]):
638 (-[KWQAccObject accessibilityActionDescription:]):
639 * kwq/KWQComboBox.mm:
640 (QComboBox::QComboBox):
641 * kwq/KWQFoundationExtras.h:
643 2004-09-29 David Hyatt <hyatt@apple.com>
645 Make sure <br>s always get line boxes. Also prevent the creation of RenderTexts for whitespace normal/nowrap nodes
650 * khtml/editing/visible_position.cpp:
651 (khtml::VisiblePosition::isCandidate):
652 * khtml/rendering/render_br.cpp:
653 (RenderBR::RenderBR):
654 (RenderBR::createInlineBox):
655 (RenderBR::baselinePosition):
656 (RenderBR::lineHeight):
657 * khtml/rendering/render_br.h:
658 * khtml/rendering/render_line.cpp:
659 (khtml::InlineFlowBox::placeBoxesVertically):
660 * khtml/rendering/render_line.h:
661 (khtml::InlineBox::isText):
662 (khtml::InlineFlowBox::addToLine):
663 * khtml/rendering/render_text.cpp:
664 (RenderText::detach):
665 * khtml/rendering/render_text.h:
666 (khtml::InlineTextBox:::InlineRunBox):
667 (khtml::InlineTextBox::isInlineTextBox):
668 (khtml::InlineTextBox::isText):
669 (khtml::InlineTextBox::setIsText):
670 * khtml/xml/dom_textimpl.cpp:
671 (TextImpl::rendererIsNeeded):
672 * kwq/KWQRenderTreeDebug.cpp:
675 2004-09-29 Ken Kocienda <kocienda@apple.com>
681 <rdar://problem/3815895> exception inside fontForSelection causes Mail to abort when selection hits bottom
683 * khtml/editing/selection.cpp:
684 (khtml::Selection::toRange): Use RangeImpl calls to detect exceptions when creating a Range
685 from a Selection. Return an empty Range when there is an exception.
689 <rdar://problem/3817268> REGRESSION (Mail): Window does not scroll when selecting out of
690 visible area of view with arrow keys
692 * khtml/editing/selection.cpp: Did some name changing. m_needsCaretLayout -> m_needsLayout.
693 Added m_expectedVisibleRect which supplies the right rectangle to update when scrolling.
694 (khtml::Selection::Selection): m_needsCaretLayout -> m_needsLayout name change.
695 (khtml::Selection::init): Handle m_expectedVisibleRect in initialization.
696 (khtml::Selection::operator=): Handle m_expectedVisibleRect in assignment.
697 (khtml::Selection::setNeedsLayout): m_needsCaretLayout -> m_needsLayout name change.
698 (khtml::Selection::layout): Changed name from layoutCaret, since m_expectedVisibleRect
699 is also calculated here.
700 (khtml::Selection::caretRect): m_needsCaretLayout -> m_needsLayout name change.
701 (khtml::Selection::expectedVisibleRect): New. Returns m_expectedVisibleRect, doing a
703 (khtml::Selection::needsCaretRepaint): m_needsCaretLayout -> m_needsLayout name change.
704 (khtml::Selection::paintCaret): Ditto.
705 (khtml::Selection::validate): Ditto.
706 * khtml/editing/selection.h: Add m_expectedVisibleRect member variable and
707 expectedVisibleRect accessor.
708 * kwq/WebCoreBridge.h: Change name of ensureCaretVisible to ensureSelectionVisible, since
709 this is not only about making the caret visible anymore. Now it can reveal the varying
710 end of the selection when scrolling with arrow keys.
711 * kwq/WebCoreBridge.mm:
712 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): ensureCaretVisible to
713 ensureSelectionVisible name change.
714 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto
715 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Ditto
716 (-[WebCoreBridge insertNewline]): Ditto
717 (-[WebCoreBridge insertText:selectInsertedText:]): Ditto
718 (-[WebCoreBridge deleteKeyPressed]): Ditto
719 (-[WebCoreBridge ensureSelectionVisible]): Ditto
721 2004-09-29 Ken Kocienda <kocienda@apple.com>
727 <rdar://problem/3818296> REGRESSION (Mail): centerSelectionInVisibleArea does not work correctly
729 * kwq/KWQKHTMLPart.h:
730 * kwq/KWQKHTMLPart.mm:
731 (KWQKHTMLPart::centerSelectionInVisibleArea): New function. Handles both caret
732 and range selections correctly.
733 * kwq/KWQNSViewExtras.h: Add forceCentering boolean to some methods in this file.
734 * kwq/KWQNSViewExtras.m: Ditto. This addition has been done since the AppKit
735 method we use to do the centering, -[NSView scrollRectToVisible:], does not alter
736 the view if the rectangle passed to it is already in view. When forceCentering is
737 true, extra math is done to make scrollRectToVisible center the rectangle we want.
738 (-[NSView _KWQ_scrollFrameToVisible]): Pass NO for forceCentering in call through to
739 _KWQ_scrollRectToVisible:forceCentering:
740 (-[NSView _KWQ_scrollRectToVisible:forceCentering:]): Add forceCentering argument.
741 (-[NSView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto.
742 (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto. Do extra
743 math to implement the forceCentering effect.
744 * kwq/KWQScrollView.h: Add forceCentering default argument to ensureRectVisibleCentered.
745 * kwq/KWQScrollView.mm:
746 (QScrollView::ensureRectVisibleCentered): Ditto.
747 * kwq/WebCoreBridge.h:
748 * kwq/WebCoreBridge.mm:
749 (-[WebCoreBridge centerSelectionInVisibleArea]): New function. Call through to KWQKHTMLPart.
751 2004-09-28 Chris Blumenberg <cblu@apple.com>
753 Fixed: WebArchives begin with "<#document/>"
757 * khtml/xml/dom_nodeimpl.cpp:
758 (NodeImpl::startMarkup): don't return markup if this is a document node, forgot this when factoring this method out from toHTML
760 2004-09-28 Chris Blumenberg <cblu@apple.com>
762 Removed range parameter from recursive_toHTML and friends since that code path is no longer used.
766 * khtml/xml/dom2_rangeimpl.cpp:
767 (DOM::RangeImpl::toHTML):
768 * khtml/xml/dom_nodeimpl.cpp:
769 (NodeImpl::recursive_toString):
770 (NodeImpl::recursive_toHTML):
771 * khtml/xml/dom_nodeimpl.h:
772 * kwq/WebCoreBridge.mm:
773 (-[WebCoreBridge markupStringFromNode:nodes:]):
775 2004-09-28 Darin Adler <darin@apple.com>
779 - improve spell checking so it doesn't unmark and remark as you move the cursor with the arrow
781 * khtml/editing/htmlediting.h: Remove obsolete markMisspellingsInSelection private function.
782 * khtml/editing/htmlediting.cpp:
783 (khtml::EditCommand::EditCommand): Blow away the selection when starting an edit command.
784 (khtml::EditCommand::apply): Remove code to mark misspellings because that's now done as part
785 of blowing away the selection.
786 (khtml::EditCommand::unapply): Blow away the selection instead of marking mispellings.
787 (khtml::EditCommand::reapply): Ditto.
788 (khtml::ReplaceSelectionCommand::doApply): Removed incorrect code that does spell checking
789 on inserted text; this doesn't match NSText behavior.
790 (khtml::TypingCommand::markMisspellingsAfterTyping): Use markMisspellingsInAdjacentWords
791 function for greater clarity on what this actually does.
793 * khtml/khtml_part.h: Replaced setSelection's "unmarkOldSelection" boolean parameter with a
794 "keepTypingStyle" boolean parameter. Removed notifySelectionChanged.
795 * khtml/khtml_part.cpp:
796 (KHTMLPart::setSelection): Replaced the "unmarkOldSelection" boolean with a new "keepTypingStyle"
797 boolean. This is a step on the way to simplifying how this works. Moved the code from the
798 notifySelectionChanged function here, since there was no clear line between the two functions.
799 (KHTMLPart::clearSelection): Call setSelection rather that having special case code here for
800 the case of an empty selection.
801 (KHTMLPart::appliedEditing): Remove the explicit "false" for "unmarkOldSelection".
802 (KHTMLPart::unappliedEditing): Ditto.
803 (KHTMLPart::reappliedEditing): Ditto.
805 * kwq/KWQKHTMLPart.h: Replaced markMisspellingsInSelection and updateSpellChecking with
806 markMisspellings and markMisspellingsInAdjacentWords. Added parameters to respondToChangedSelection.
807 * kwq/KWQKHTMLPart.mm:
808 (KWQKHTMLPart::markMisspellingsInAdjacentWords): Added.
809 (KWQKHTMLPart::markMisspellings): New name for markMisspellingsInSelection. Simplified logic a
810 bit and made it the caller's responsibility to expand the selection passed in to word boundaries.
811 (KWQKHTMLPart::respondToChangedSelection): Added parameter that identifies the old selection,
812 and changed logic so it won't mark mispellings in a word if the selection still starts in that word.
814 - implemented empty-cells property in computed style
816 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
817 Added code for CSS_PROP_EMPTY_CELLS. I think the HTML converter in AppKit uses this.
819 2004-09-28 Chris Blumenberg <cblu@apple.com>
821 Fixed n-squared issues with appending to KWQValueListImpl. This fixes the hang in 3794799.
823 Fixed by Darin, reviewed by me.
825 * khtml/xml/dom2_rangeimpl.cpp:
826 (DOM::RangeImpl::toHTML): tweaks
827 * kwq/KWQValueListImpl.mm:
828 (KWQValueListImpl::KWQValueListPrivate::KWQValueListPrivate):
829 (KWQValueListImpl::KWQValueListPrivate::copyList):
830 (KWQValueListImpl::clear):
831 (KWQValueListImpl::appendNode):
832 (KWQValueListImpl::prependNode):
833 (KWQValueListImpl::removeEqualNodes):
834 (KWQValueListImpl::containsEqualNodes):
835 (KWQValueListImpl::removeIterator):
836 (KWQValueListImpl::lastNode):
837 * kwq/WebCoreBridge.mm:
838 (-[WebCoreBridge nodesFromList:]): use iterator, not at()
840 2004-09-28 Richard Williamson <rjw@apple.com>
842 More dashboard region changes for John.
844 <rdar://problem/3817421> add getter for dashboard regions (debugging)
846 <rdar://problem/3817417> NSScrollView need autoregions for dashboard
848 <rdar://problem/3817388> should have short form form control regions
850 <rdar://problem/3817477> visibility does not work with dashboard control regions
854 * WebCore-combined.exp:
856 * khtml/css/cssparser.cpp:
857 (skipCommaInDashboardRegion):
858 (CSSParser::parseDashboardRegions):
859 * khtml/khtmlview.cpp:
860 (KHTMLView::updateDashboardRegions):
861 * khtml/rendering/render_object.cpp:
862 (RenderObject::setStyle):
863 (RenderObject::addDashboardRegions):
864 * khtml/xml/dom_docimpl.cpp:
865 (DocumentImpl::DocumentImpl):
866 (DocumentImpl::setDashboardRegions):
867 * khtml/xml/dom_docimpl.h:
868 (DOM::DocumentImpl::setDashboardRegionsDirty):
869 (DOM::DocumentImpl::dashboardRegionsDirty):
870 * kwq/KWQKHTMLPart.h:
871 * kwq/KWQKHTMLPart.mm:
872 (KWQKHTMLPart::paint):
873 (KWQKHTMLPart::dashboardRegionsDictionary):
874 (KWQKHTMLPart::dashboardRegionsChanged):
875 * kwq/WebCoreBridge.h:
876 * kwq/WebCoreBridge.mm:
877 (-[WebCoreBridge dashboardRegions]):
878 * kwq/WebDashboardRegion.h:
879 * kwq/WebDashboardRegion.m:
880 (-[WebDashboardRegion description]):
882 2004-09-28 John Sullivan <sullivan@apple.com>
886 - fixed <rdar://problem/3818558> REGRESSION: "Installed Plug-ins" is blank
887 because of <script type="application/x-javascript">
889 * khtml/html/htmltokenizer.cpp:
890 (khtml::HTMLTokenizer::parseTag):
891 add "application/x-javascript" to the list of legal scripting types. Mozilla
892 accepts this, but WinIE doesn't.
894 * layout-tests/fast/tokenizer/004.html:
895 updated layout test to test some application/xxxx types
897 2004-09-27 David Hyatt <hyatt@apple.com>
899 Reworked lists to work well with RTL text. Specifically the following bugs have been fixed:
901 (1) All bullets use the same offset constant now (a padding of 7 pixels). Before, images used 5 and others used 7.
902 (2) Line height now works properly, so that list items with no content aren't squished (and missing the line descent).
903 (3) Punctuation now works correctly with inside and outside style ordered lists in RTL.
904 (4) RTL lists now properly apply padding and margin to the right side rather than the left. This was done by adding
905 -khtml-margin-start and -khtml-padding-start properties that are just mapped to left/right based off the direction.
909 * khtml/css/cssparser.cpp:
910 (CSSParser::parseValue):
911 * khtml/css/cssproperties.c:
914 * khtml/css/cssproperties.h:
915 * khtml/css/cssproperties.in:
916 * khtml/css/cssstyleselector.cpp:
917 (khtml::CSSStyleSelector::applyDeclarations):
918 (khtml::CSSStyleSelector::applyProperty):
919 * khtml/css/html4.css:
920 * khtml/rendering/bidi.cpp:
921 (khtml::BidiIterator::direction):
922 * khtml/rendering/render_list.cpp:
923 (RenderListItem::getAbsoluteRepaintRect):
924 (RenderListMarker::paint):
925 (RenderListMarker::calcMinMaxWidth):
926 (RenderListMarker::lineHeight):
927 (RenderListMarker::baselinePosition):
929 2004-09-28 Ken Kocienda <kocienda@apple.com>
933 Mark the VisiblePosition taking (Position &, EAffinity=DOWNSTREAM) explicit. Recently, when I added
934 the EAffinity argument, I left this constructor implicit. Darin pointed out to me that this is
935 undesirable since implicit use of the the constructor involved making the affinity choice, something
936 which should be done explicitly.
938 * khtml/editing/selection.cpp:
939 (khtml::Selection::modifyExtendingRightForward): Make explicit use of constructor mentioned above.
940 (khtml::Selection::modifyMovingRightForward): Ditto.
941 (khtml::Selection::modifyExtendingLeftBackward): Ditto.
942 (khtml::Selection::modifyMovingLeftBackward): Ditto.
943 (khtml::Selection::modify): Ditto.
944 (khtml::Selection::validate): Ditto.
945 * khtml/editing/visible_position.h: Make constructor taking (Position &, EAffinity) explicit.
946 * khtml/editing/visible_units.cpp: Ditto.
947 (khtml::previousWordBoundary): Make explicit use of constructor mentioned above.
948 (khtml::nextWordBoundary): Ditto.
949 (khtml::previousLinePosition): Ditto.
950 (khtml::nextLinePosition): Ditto.
951 * kwq/KWQKHTMLPart.mm: Ditto.
952 (KWQKHTMLPart::findString): Ditto.
953 (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
954 (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
955 (KWQKHTMLPart::updateSpellChecking): Ditto.
957 2004-09-28 Darin Adler <darin@apple.com>
961 - fixed a storage leak discovered by code inspection
963 * khtml/html/htmlparser.cpp: (KHTMLParser::~KHTMLParser): Call setCurrent(0) to deref
964 the parser's current node in the rare case where it still has one.
966 2004-09-27 David Hyatt <hyatt@apple.com>
968 Don't allow nested headers when only inlines are in between them. Fixes a hang related to pathological nesting
969 on magicmethodsonline.com.
973 * khtml/html/htmlparser.cpp:
974 (KHTMLParser::parseToken):
975 (KHTMLParser::processCloseTag):
976 (KHTMLParser::isHeaderTag):
977 (KHTMLParser::popNestedHeaderTag):
978 * khtml/html/htmlparser.h:
980 2004-09-27 Kevin Decker <kdecker@apple.com>
984 * khtml/css/css_base.cpp:
985 (CSSSelector::selectorText): changed another ATTR_CLASS case to properly return class selector names.
987 2004-09-27 David Hyatt <hyatt@apple.com>
989 Fix style sharing so that it doesn't share when it shouldn't. Partially fixes 3671516, table cells don't update
990 their color on macosx.apple.com.
992 Fix 3521639, iframe mispositioned on bidi page. Make sure that when the width of a line exceeds the available line
993 width that the spillage out of the block is determined by the direction of the block and not by the text-align value.
995 Partial fix for 3762962, make sure the image cells with specified widths but percentage heights don't just get a minwidth
998 Fix for 3533878, framesets that use percentages that add up to a value > 100% should normalize those percentages.
1002 * khtml/css/cssstyleselector.cpp:
1003 (khtml::CSSStyleSelector::locateCousinList):
1004 (khtml::CSSStyleSelector::elementsCanShareStyle):
1005 (khtml::CSSStyleSelector::locateSharedStyle):
1006 * khtml/css/cssstyleselector.h:
1007 * khtml/html/html_elementimpl.h:
1008 (DOM::HTMLNamedAttrMapImpl::hasMappedAttributes):
1009 (DOM::HTMLElementImpl::inlineStyleDecl):
1010 * khtml/rendering/bidi.cpp:
1011 (khtml::RenderBlock::computeHorizontalPositionsForLine):
1012 * khtml/rendering/render_frames.cpp:
1013 (RenderFrameSet::layout):
1014 * khtml/rendering/render_replaced.cpp:
1015 (RenderReplaced::calcMinMaxWidth):
1016 * khtml/xml/dom_elementimpl.h:
1017 (DOM::ElementImpl::inlineStyleDecl):
1018 (DOM::ElementImpl::hasMappedAttributes):
1020 2004-09-27 Ken Kocienda <kocienda@apple.com>
1024 Removed closestRenderedPosition function from Position class and gave this work
1025 to VisiblePosition instead. However, in order to make the transfer possible,
1026 VisiblePosition needed upstream and downstream affinities added to its
1027 constructors. Also moved the EAffinity enum into its own file. Also moved it
1028 to the khtml namespace.
1030 Updated several functions which used closestRenderedPosition to use VisiblePosition
1033 Also deleted Position::equivalentShallowPosition. This was unused.
1035 * ForwardingHeaders/editing/text_affinity.h: Added.
1036 * ForwardingHeaders/editing/visible_position.h: Added.
1037 * WebCore.pbproj/project.pbxproj: Added new files.
1038 * khtml/editing/selection.cpp:
1039 (khtml::Selection::validate): Use VisiblePosition instead of closestRenderedPosition.
1040 * khtml/editing/selection.h:
1041 * khtml/editing/text_affinity.h: Added.
1042 * khtml/editing/visible_position.cpp:
1043 (khtml::VisiblePosition::VisiblePosition):
1044 (khtml::VisiblePosition::initUpstream): New helper for finding upstream visible position.
1045 (khtml::VisiblePosition::initDownstream): Was old init function that unconditionally did
1046 downstream checks for visible position. Renamed to describe this more clearly.
1047 * khtml/editing/visible_position.h:
1048 * khtml/editing/visible_units.cpp:
1049 (khtml::previousWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
1050 (khtml::nextWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
1051 * khtml/xml/dom_docimpl.cpp:
1052 (DocumentImpl::updateSelection): Use VisiblePosition instead of closestRenderedPosition.
1053 * khtml/xml/dom_position.cpp:
1054 (DOM::Position::closestRenderedPosition): Removed.
1055 * khtml/xml/dom_position.h: Removed two functions mentioned above.
1056 * kwq/KWQKHTMLPart.mm:
1057 (KWQKHTMLPart::fontForSelection) Use VisiblePosition instead of closestRenderedPosition.:
1058 * kwq/WebCoreBridge.mm:
1059 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Use VisiblePosition instead of closestRenderedPosition.
1060 * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Updated expected results.
1061 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Ditto.
1062 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
1063 * layout-tests/editing/selection/move-by-character-004-expected.txt: Ditto.
1065 2004-09-27 Ken Kocienda <kocienda@apple.com>
1067 Reviewed by Darin and Maciej
1069 Removed EditCommand smart pointer wrappers from htmlediting.cpp/.h, save for the one
1070 at the root of the hierarchy, and this one has been renamed EditCommandPtr. Renamed
1071 each of the XXXCommandImpl classes, removing the Impl suffix from each, and rolled
1072 these into the htmlediting.cpp/.h files. The htmlediting_impl.cpp/.h files have
1073 been emptied and are being removed.
1075 For the remainder of files, perform the mechanical changes necessary to make everything
1076 compile and run as before.
1078 * WebCore.pbproj/project.pbxproj
1079 * khtml/editing/htmlediting.cpp
1080 * khtml/editing/htmlediting.h
1081 * khtml/editing/htmlediting_impl.cpp: Removed.
1082 * khtml/editing/htmlediting_impl.h: Removed.
1083 * khtml/editing/jsediting.cpp
1084 * khtml/khtml_part.cpp
1085 (KHTMLPart::openURL)
1086 (KHTMLPart::lastEditCommand)
1087 (KHTMLPart::appliedEditing)
1088 (KHTMLPart::unappliedEditing)
1089 (KHTMLPart::reappliedEditing)
1090 (KHTMLPart::applyStyle):
1091 * khtml/khtml_part.h
1092 * khtml/khtmlpart_p.h
1093 * kwq/KWQEditCommand.h
1094 * kwq/KWQEditCommand.mm
1095 (-[KWQEditCommand initWithEditCommandImpl:])
1096 (+[KWQEditCommand commandWithEditCommandImpl:])
1097 (-[KWQEditCommand impl])
1098 * kwq/KWQKHTMLPart.h
1099 * kwq/KWQKHTMLPart.mm
1100 (KWQKHTMLPart::registerCommandForUndo)
1101 (KWQKHTMLPart::registerCommandForRedo)
1102 * kwq/WebCoreBridge.mm
1103 (-[WebCoreBridge undoEditing:])
1104 (-[WebCoreBridge redoEditing:])
1105 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
1106 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:])
1107 (-[WebCoreBridge deleteSelectionWithSmartDelete:])
1109 2004-09-26 Darin Adler <darin@apple.com>
1113 - fixed <rdar://problem/3816170> image.width/height not available from Image objects (works in Firefox)
1115 * khtml/ecma/kjs_html.h: Added width and height.
1116 * khtml/ecma/kjs_html.cpp: (Image::getValueProperty): Added width and height.
1117 * khtml/ecma/kjs_html.lut.h: Regenerated.
1119 - unrelated change; changed ordering of use count manipulation just in case we decide some day to do
1120 something when the use count hits 0
1122 * khtml/rendering/render_image.cpp: (RenderImage::setPixmap): Increment use count on new object before
1123 decrementing use count on old object.
1125 2004-09-26 Darin Adler <darin@apple.com>
1129 - fixed <rdar://problem/3812771> document.implementation.hasFeature returns false for a lot of features we implement
1131 * khtml/xml/dom_docimpl.cpp: (DOMImplementationImpl::hasFeature): Added all the DOM features that we implemented
1132 as part of the HTML editing work.
1134 * khtml/dom/dom_node.cpp: (Node::isSupported): Changed this to call DOMImplementationImpl::hasFeature to share
1135 code. Later this might need to be different per-node, but at the moment that does not seem to be so.
1137 * khtml/ecma/kjs_dom.cpp:
1138 (DOMNodeProtoFunc::tryCall): Pass a null string if the parameter is omitted, undefined, or null. This is better than
1139 having a special case for the string "null" in the DOM implementation.
1140 (DOMDOMImplementationProtoFunc::tryCall): Ditto.
1142 - fixed <rdar://problem/3814605> REGRESSION: fast/table/039 layout test is failing due to extra trailing whitespace in innerText
1144 * khtml/editing/visible_text.cpp: (khtml::TextIterator::advance): Check for the case where we are at the end of
1145 iteration, and don't call exitNode in that case. This prevents us from getting some unwanted trailing \n characters.
1147 - fixed <rdar://problem/3813253> method cloneNode() does not clone dynamically-set style attributes correctly
1149 * khtml/html/html_elementimpl.h: Added cloneNode override.
1150 * khtml/html/html_elementimpl.cpp:
1151 (HTMLElementImpl::cloneNode): Added. Copies m_inlineStyleDecl.
1152 (HTMLElementImpl::parseHTMLAttribute): Changed to use getInlineStyleDecl().
1153 (HTMLElementImpl::innerText): Changed to do the same thing with fewer lines of code.
1154 (HTMLElementImpl::outerText): Tweaked comment.
1158 * khtml/xml/dom_elementimpl.cpp:
1159 (ElementImpl::cloneNode): Removed an uneeded type cast.
1160 (XMLElementImpl::cloneNode): Ditto.
1162 2004-09-24 Kevin Decker <kdecker@apple.com>
1166 <rdar://problem/3799334> DIG: Safari does not properly return style names [DigCSS.htm]
1168 * khtml/css/css_base.cpp:
1169 (CSSSelector::selectorText): Properly returns Class Selector names.
1170 Before we would get *[CLASS"foo"] instead of .foo
1172 2004-09-24 Ken Kocienda <kocienda@apple.com>
1178 <rdar://problem/3814660> REGRESSION (8A200-8A259): Select All has no effect on livepage.apple.com
1180 * khtml/xml/dom_docimpl.cpp:
1181 (DocumentImpl::updateSelection): Move the selection start and end to rendered positions
1182 before passing off to the RenderCanvas for drawing.
1183 * layout-tests/editing/selection/select-all-004-expected.txt: Added.
1184 * layout-tests/editing/selection/select-all-004.html: Added.
1186 2004-09-24 John Sullivan <sullivan@apple.com>
1190 - fixed <rdar://problem/3528339> Turn on full keyboard access shows
1191 invisible <input> elements
1193 * khtml/html/html_formimpl.cpp:
1194 (DOM::HTMLGenericFormElementImpl::isFocusable):
1195 reject elements that have zero width or height, even if they aren't hidden
1197 2004-09-24 Maciej Stachowiak <mjs@apple.com>
1199 - fixed deployment build
1203 * khtml/dom/dom_string.cpp: put implementation of ascii() in #ifdef !NDEBUG
1206 2004-09-24 David Hyatt <hyatt@apple.com>
1208 Fix for 3800316, test 37 for tables is failing on the layout tests. Make sure we don't incorrectly match
1209 non-HTML elements with HTML tag selectors in CSS.
1213 * khtml/css/cssstyleselector.cpp:
1214 (khtml::CSSStyleSelector::checkOneSelector):
1216 2004-09-23 David Hyatt <hyatt@apple.com>
1218 Fix for 3601920, CSS "tabs" not switching properly on zen garden design. Improve the repainting to account
1219 for layer changes of z-index that necessitate an invalidation.
1221 Reviewed by kocienda
1223 * khtml/rendering/render_object.cpp:
1224 (RenderObject::setStyle):
1225 * khtml/rendering/render_style.cpp:
1226 (RenderStyle::diff):
1227 * khtml/rendering/render_style.h:
1228 (khtml::RenderStyle::):
1230 2004-09-24 Chris Blumenberg <cblu@apple.com>
1232 Made markup copying 5 times faster. Unfortunately, this still doesn't fix:
1233 <rdar://problem/3794799> Tiger8A252: copying a bunch o' text is so slow it seems like a hang
1237 * khtml/dom/dom_string.h:
1238 * khtml/xml/dom2_rangeimpl.cpp:
1239 (DOM::RangeImpl::toHTML): serialize the range by iterating through the range
1240 * khtml/xml/dom_nodeimpl.cpp:
1241 (NodeImpl::startMarkup): new, factored out from recursive_toString
1242 (NodeImpl::endMarkup): ditto
1243 (NodeImpl::recursive_toString): call factored out methods
1244 * khtml/xml/dom_nodeimpl.h:
1248 2004-09-24 Ken Kocienda <kocienda@apple.com>
1252 Hyatt made an improvement in the render tree which caused the results
1253 to get a little thinner.
1255 * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt.
1256 * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt.
1258 2004-09-24 Ken Kocienda <kocienda@apple.com>
1264 <rdar://problem/3812939> REGRESSION: move-between-blocks-no-001 editing layout test fails in DeleteSelectionCommandImpl
1266 * khtml/rendering/render_block.cpp:
1267 (khtml::RenderBlock::removeChild): Hyatt said this regression was caused by a bad merge.
1268 Found by code inspection.
1270 2004-09-23 John Sullivan <sullivan@apple.com>
1274 - fixed <rdar://problem/3551850> hang caused by interpreting bad javascript
1275 guarded by a deliberately bogus "language" attribute (www.riibe.com)
1277 * khtml/html/htmltokenizer.cpp:
1278 (khtml::HTMLTokenizer::parseTag):
1279 Check for language attribute of <script> tag in a way that matches WinIE.
1280 Previously we were far too permissive.
1282 2004-09-23 David Hyatt <hyatt@apple.com>
1284 Fix for 3685234 and 3548444, the x-offset for frame borders was off by 1 pixel, causing mojibake to occur when
1285 repainting happened.
1287 * khtml/rendering/render_canvas.cpp:
1288 (RenderCanvas::repaintViewRectangle):
1290 2004-09-23 Richard Williamson <rjw@apple.com>
1292 Fixed <rdar://problem/3813271> dashboard-region-circle and dashboard-region-rectangle should be collapsed into dashboard-region
1293 Fixed <rdar://problem/3813289> dashboard regions need to correctly account for overflow/scrolling
1297 * khtml/css/css_valueimpl.cpp:
1298 (CSSPrimitiveValueImpl::cssText):
1299 * khtml/css/css_valueimpl.h:
1300 * khtml/css/cssparser.cpp:
1301 (CSSParser::parseValue):
1302 (skipCommaInDashboardRegion):
1303 (CSSParser::parseDashboardRegions):
1304 * khtml/khtmlview.cpp:
1305 (KHTMLView::layout):
1306 (KHTMLView::updateDashboardRegions):
1307 * khtml/khtmlview.h:
1308 * khtml/rendering/render_layer.cpp:
1309 (RenderLayer::scrollToOffset):
1310 * khtml/rendering/render_object.cpp:
1311 (RenderObject::addDashboardRegions):
1312 * kwq/KWQKHTMLPart.mm:
1313 (KWQKHTMLPart::dashboardRegionsChanged):
1314 * kwq/WebDashboardRegion.h:
1315 * kwq/WebDashboardRegion.m:
1316 (-[WebDashboardRegion initWithRect:clip:type:]):
1317 (-[WebDashboardRegion dashboardRegionClip]):
1318 (-[WebDashboardRegion description]):
1320 2004-09-23 Ken Kocienda <kocienda@apple.com>
1324 * khtml/xml/dom_position.cpp:
1325 (DOM::Position::inRenderedContent): Make the "empty block" check the same as the one
1326 use in visible position. This fixes a recent regression which broke up and down
1327 arrowing between blocks with an empty block in between.
1329 2004-09-23 Maciej Stachowiak <mjs@apple.com>
1333 <rdar://problem/3685235> REGRESSION (Mail): links are not properly editable
1335 * khtml/html/html_inlineimpl.cpp:
1336 (HTMLAnchorElementImpl::isFocusable): If this element is editable, then follow
1337 the normal focus rules so the link does not swallow focus when you arrow key
1338 or drag-select into it.
1340 2004-09-23 Darin Adler <darin@apple.com>
1342 - added test for the DOM::Range bug fixed recently
1344 * layout-tests/fast/dom/clone-contents-0-end-offset-expected.txt: Added.
1345 * layout-tests/fast/dom/clone-contents-0-end-offset.html: Added.
1347 2004-09-23 David Hyatt <hyatt@apple.com>
1349 Fix for hitlist bug, crash when deleting.
1351 Also fix repaint bug when inlines are inside overflow:auto/scroll regions.
1353 Reviewed by kocienda
1355 * khtml/editing/htmlediting_impl.cpp:
1356 (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
1357 (khtml::DeleteSelectionCommandImpl::doApply):
1358 * khtml/rendering/render_block.cpp:
1359 (khtml::RenderBlock::removeChild):
1360 * khtml/rendering/render_flow.cpp:
1361 (RenderFlow::getAbsoluteRepaintRect):
1363 2004-09-23 John Sullivan <sullivan@apple.com>
1367 - fixed <rdar://problem/3527840> reproducible crash at johnbrown.v32.qikker.com
1368 (nil-deref in NodeImpl::dispatchEvent)
1370 * khtml/xml/dom_nodeimpl.cpp:
1371 (NodeImpl::dispatchEvent):
1372 guard against document or document->document() being nil
1374 2004-09-23 Darin Adler <darin@apple.com>
1378 - added new VisibleRange class; not used yet
1380 * WebCore.pbproj/project.pbxproj: Added visible_range.h and visible_range.cpp.
1381 * khtml/editing/visible_range.cpp: Added.
1382 * khtml/editing/visible_range.h: Added.
1386 * kwq/WebCoreBridge.mm: (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
1387 Use switch statement instead of if statement so we get a warning if we ever add a new
1390 * khtml/editing/selection.h: khtml, not DOM, namespace
1391 * khtml/editing/visible_position.h: Ditto.
1393 2004-09-23 Darin Adler <darin@apple.com>
1397 - fixed <rdar://problem/3812758> 8S266: attaching mutation events to an editable div crashes Safari
1399 * khtml/xml/dom_nodeimpl.cpp:
1400 (NodeImpl::dispatchEvent): Added ref/deref so this works if passed a "floating" event object.
1401 (NodeImpl::dispatchGenericEvent): Ditto.
1402 (NodeImpl::dispatchHTMLEvent): Removed unneeded ref/deref now that dispatchEvent takes care of it.
1403 (NodeImpl::dispatchMouseEvent): Ditto.
1404 (NodeImpl::dispatchUIEvent): Ditto.
1406 2004-09-23 Darin Adler <darin@apple.com>
1410 - fixed some minor mistakes discovered by code inspection
1412 * khtml/khtml_part.cpp:
1413 (KHTMLPart::setSelection): Changed to not grab focus if clearing the selection.
1414 Grabbing focus when we get the selection is also probably something that should be
1415 conditional, since you can use a WebView in a mode where it can have selection even
1416 when not first responder, ala NSTextView.
1417 (KHTMLPart::setCaretVisible): Changed to not grab focus if making the caret invisible.
1418 Not sure if it's ever important to grab focus when making the caret visible, but by
1419 code inspection it seemed that was unlikely to do harm.
1421 2004-09-23 Darin Adler <darin@apple.com>
1425 - fixed <rdar://problem/3790595> "ERROR: unimplemented propertyID: 97" logged to console when copying selection (table-layout)
1427 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1428 Added CSS_PROP_TABLE_LAYOUT case.
1430 2004-09-23 Darin Adler <darin@apple.com>
1434 - fixed <rdar://problem/3809600> REGRESSION: text in search field doesn't disappear when clicked at developer.apple.com
1436 Reversing the order of scope caused us to get and set too many properties in the window
1437 object; in the case of this bug setting value ended up setting a window.value property
1438 instead of the value of the <input> element.
1440 * khtml/ecma/kjs_window.h: Removed bogus hasProperty function that always returns true.
1441 Testing shows that MacIE and Gecko match our behavior when we remove this, despite the
1442 "need this to match IE behavior" comment in the file, which I believe is incorrect.
1443 * khtml/ecma/kjs_window.cpp: Ditto.
1445 2004-09-23 Darin Adler <darin@apple.com>
1449 - fixed <rdar://problem/3812471> -[DOMRange cloneContents] clones too much in some cases where endOffset is 0
1451 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Added some nil
1452 checks to prevent this function from crashing if offsets are greater than the
1453 number of child nodes. Added a special case for offset 0 in one case that has a loop
1454 that won't work correctly for that case.
1456 2004-09-23 Darin Adler <darin@apple.com>
1460 - fixed <rdar://problem/3811890> when selecting and moving the caret, some words aren't spell-checked (test case included)
1462 This was mostly fixed by changes I made recently, but using the test case in the bug
1463 I discovered one regression I introduced and another problem that wasn't fixed yet.
1464 This change fixes both.
1466 * kwq/KWQKHTMLPart.mm:
1467 (KWQKHTMLPart::markMisspellingsInSelection): Removed unneeded inRenderedContent() check. It was returning false
1468 in cases involving a <br> at the end of line, and the check isn't all that helpful now that we use VisiblePosition,
1469 which takes care of that sort of thing for you. Changed code to determine the range to check to use the two
1470 different flavors of word boundary to expand to words we touch in both directions.
1471 (KWQKHTMLPart::updateSpellChecking): Changed to use the same logic about word boundaries. By being consistent,
1472 the anomalies reported in the bug report go away.
1474 2004-09-23 Darin Adler <darin@apple.com>
1478 - fixed <rdar://problem/3811584> REGRESSION (85-125): iframe.document undefined in function called from button onclick; works from img onclick
1480 Since we are doing a bit less "defers callbacks" work, when testing I ran into this code path.
1482 * khtml/xml/dom2_eventsimpl.cpp: (MouseEventImpl::computeLayerPos): Check for document without renderer.
1484 2004-09-23 Darin Adler <darin@apple.com>
1486 - checked in a new file I forgot
1488 * khtml/editing/text_granularity.h: Added.
1490 2004-09-22 Darin Adler <darin@apple.com>
1494 DOM::CaretPosition -> khtml::VisibleRange
1495 DOM::Selection -> khtml::Selection
1497 - moved all the functions in visible_units.h from DOM to khtml namespace
1498 - moved the one thing from Selection that KHTMLPart uses into its own header
1500 * WebCore.pbproj/project.pbxproj: Added text_granularity.h.
1502 * ForwardingHeaders/editing/selection.h: Added.
1503 * WebCore-combined.exp: Regenerated.
1504 * WebCore-tests.exp: Updated symbol for DOM::Selection debugging.
1506 * khtml/ecma/kjs_window.cpp: Update names and namespaces.
1507 * khtml/editing/htmlediting.cpp: Ditto.
1508 * khtml/editing/htmlediting.h: Ditto.
1509 * khtml/editing/htmlediting_impl.cpp: Ditto.
1510 * khtml/editing/htmlediting_impl.h: Ditto.
1511 * khtml/editing/jsediting.cpp: Ditto.
1512 * khtml/editing/selection.cpp: Ditto.
1513 * khtml/editing/selection.h: Ditto.
1514 * khtml/editing/visible_position.cpp: Ditto.
1515 * khtml/editing/visible_position.h: Ditto.
1516 * khtml/editing/visible_text.h: Ditto.
1517 * khtml/editing/visible_units.cpp: Ditto.
1518 * khtml/editing/visible_units.h: Ditto.
1519 * khtml/khtml_part.cpp: Ditto.
1520 * khtml/khtml_part.h: Ditto.
1521 * khtml/khtmlpart_p.h: Ditto.
1522 * khtml/rendering/render_block.cpp: Ditto.
1523 * khtml/xml/dom_docimpl.h: Ditto.
1524 * khtml/xml/dom_nodeimpl.cpp: Ditto.
1525 * kwq/KWQKHTMLPart.h: Ditto.
1526 * kwq/KWQKHTMLPart.mm: Ditto.
1527 * kwq/KWQRenderTreeDebug.cpp: Ditto.
1528 * kwq/WebCoreBridge.mm: Ditto.
1530 2004-09-22 Darin Adler <darin@apple.com>
1532 * ForwardingHeaders/*: Use import instead of include.
1534 2004-09-22 Darin Adler <darin@apple.com>
1536 - renamed these files:
1538 misc/khtml_text_operations.h -> editing/visible_text.h
1539 misc/khtml_text_operations.cpp -> editing/visible_text.cpp
1540 xml/dom_caretposition.cpp -> editing/visible_position.cpp
1541 xml/dom_caretposition.h -> editing/visible_position.h
1542 xml/dom_selection.cpp -> editing/selection.cpp
1543 xml/dom_selection.h -> editing/selection.h
1545 - broke out the word/line/paragraph part of visible_position.h into visible_units.h
1546 - removed some unnecessary includes from some header files to reduce the number of
1547 files that trigger "building the world"
1549 * WebCore.pbproj/project.pbxproj: Added the files under new names, removed the old ones.
1551 * ForwardingHeaders/editing/jsediting.h: Added.
1552 * ForwardingHeaders/editing/visible_text.h: Added.
1553 * ForwardingHeaders/misc/khtml_text_operations.h: Removed.
1554 * ForwardingHeaders/xml/dom_caretposition.h: Removed.
1555 * ForwardingHeaders/xml/dom_selection.h: Removed.
1557 * khtml/ecma/kjs_window.cpp: Updated or removed #include lines.
1558 * khtml/editing/htmlediting.cpp: Ditto.
1559 * khtml/editing/htmlediting.h: Ditto.
1560 * khtml/editing/htmlediting_impl.cpp: Ditto.
1561 * khtml/editing/htmlediting_impl.h: Ditto.
1562 * khtml/editing/jsediting.cpp: Ditto.
1563 * khtml/editing/selection.cpp: Ditto.
1564 * khtml/editing/selection.h: Ditto.
1565 * khtml/editing/visible_position.cpp: Ditto.
1566 * khtml/editing/visible_position.h: Ditto.
1567 * khtml/editing/visible_text.cpp: Ditto.
1568 * khtml/editing/visible_text.h: Ditto.
1569 * khtml/editing/visible_units.cpp: Added.
1570 * khtml/editing/visible_units.h: Added.
1571 * khtml/html/html_elementimpl.cpp: Updated or removed #include lines.
1572 * khtml/khtml_part.cpp: Ditto.
1573 * khtml/khtml_part.h: Ditto.
1574 * khtml/khtmlpart_p.h: Ditto.
1575 * khtml/khtmlview.cpp: Ditto.
1576 * khtml/misc/khtml_text_operations.cpp: Removed.
1577 * khtml/misc/khtml_text_operations.h: Removed.
1578 * khtml/rendering/render_block.cpp: Updated or removed #include lines.
1579 * khtml/xml/dom2_rangeimpl.cpp: Ditto.
1580 * khtml/xml/dom_caretposition.cpp: Removed.
1581 * khtml/xml/dom_caretposition.h: Removed.
1582 * khtml/xml/dom_docimpl.cpp: Updated or removed #include lines.
1583 * khtml/xml/dom_docimpl.h: Ditto.
1584 * khtml/xml/dom_elementimpl.cpp: Ditto.
1585 * khtml/xml/dom_nodeimpl.cpp: Ditto.
1586 * khtml/xml/dom_position.cpp: Ditto.
1587 * khtml/xml/dom_selection.cpp: Removed.
1588 * khtml/xml/dom_selection.h: Removed.
1589 * kwq/KWQKHTMLPart.mm: Updated or removed #include lines.
1590 * kwq/KWQKHTMLPart.h: Ditto.
1591 * kwq/KWQRenderTreeDebug.cpp: Ditto.
1592 * kwq/WebCoreBridge.mm: Ditto.
1594 2004-09-22 Richard Williamson <rjw@apple.com>
1596 Pass dashboard regions up to WebKit.
1598 Don't collect regions from RenderTexts.
1600 Made more args and return types references to avoid
1601 copying value lists.
1605 * WebCore.pbproj/project.pbxproj:
1606 * khtml/khtmlview.cpp:
1607 (KHTMLView::layout):
1608 * khtml/rendering/render_object.cpp:
1609 (RenderObject::collectDashboardRegions):
1610 * khtml/xml/dom_docimpl.cpp:
1611 (DocumentImpl::dashboardRegions):
1612 (DocumentImpl::setDashboardRegions):
1613 * khtml/xml/dom_docimpl.h:
1614 * kwq/KWQKHTMLPart.h:
1615 * kwq/KWQKHTMLPart.mm:
1616 (KWQKHTMLPart::didFirstLayout):
1617 (KWQKHTMLPart::dashboardRegionsChanged):
1618 * kwq/WebCoreBridge.h:
1619 * kwq/WebDashboardRegion.h: Added.
1620 * kwq/WebDashboardRegion.m: Added.
1621 (-[WebDashboardRegion initWithRect:type:]):
1622 (-[WebDashboardRegion copyWithZone:]):
1623 (-[WebDashboardRegion dashboardRegionRect]):
1624 (-[WebDashboardRegion dashboardRegionType]):
1625 (-[WebDashboardRegion description]):
1627 2004-09-22 Ken Kocienda <kocienda@apple.com>
1631 Fix for this hitlist bug:
1633 <rdar://problem/3805486> REGRESSION (Mail): Empty block elements can cause the caret to get "stuck" in one spot
1635 * khtml/xml/dom_caretposition.cpp:
1636 (DOM::CaretPosition::isCandidate): You can no longer caret into empty blocks with no height.
1637 Also did a little clean up in this function.
1638 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Regenerated expected results.
1639 This test was actually failing and had bogus results checked in!
1640 * layout-tests/editing/selection/select-all-003-expected.txt: Regenerated expected results.
1642 2004-09-22 Chris Blumenberg <cblu@apple.com>
1644 Fixed: <rdar://problem/3812091> REGRESSION (Mail): double-clicked word is not smart inserted on drag
1648 * khtml/editing/htmlediting.cpp:
1649 (khtml::MoveSelectionCommand::MoveSelectionCommand): take smartMove arg
1650 * khtml/editing/htmlediting.h:
1651 * khtml/editing/htmlediting_impl.cpp:
1652 (khtml::CompositeEditCommandImpl::deleteSelection): take smartDelete arg
1653 (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): take smartMove arg
1654 (khtml::MoveSelectionCommandImpl::doApply): pass smartMove for smartDelete and smartReplace
1655 * khtml/editing/htmlediting_impl.h:
1656 * kwq/WebCoreBridge.h:
1657 * kwq/WebCoreBridge.mm:
1658 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): take smartMove arg
1660 2004-09-22 Ken Kocienda <kocienda@apple.com>
1664 * khtml/css/css_computedstyle.cpp:
1665 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): New overloaded
1666 version of this function, one that takes a flag to determine whether to
1667 perform a document updateLayout() call before querying the style system.
1668 * khtml/css/css_computedstyle.h:
1669 (DOM::EUpdateLayout): Give a symbolic constant to true/false for the
1670 purpose of the new call to getPropertyCSSValue.
1671 * khtml/editing/htmlediting_impl.cpp:
1672 (khtml::StyleChange::currentlyHasStyle): Pass DoNotUpdateLayout to call to
1673 getPropertyCSSValue.
1674 (khtml::CompositeEditCommandImpl::applyTypingStyle): Add in top-level calls
1675 to updateLayout before doing style changes that now do not update styles
1677 (khtml::ApplyStyleCommandImpl::doApply): Ditto.
1678 (khtml::ApplyStyleCommandImpl::removeCSSStyle): Pass DoNotUpdateLayout to call to
1679 getPropertyCSSValue.
1680 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Remove this dead code.
1681 * khtml/editing/htmlediting_impl.h: Ditto.
1683 2004-09-22 Ken Kocienda <kocienda@apple.com>
1687 * WebCore.pbproj/project.pbxproj: New files added.
1688 * khtml/khtml_part.cpp:
1689 (KHTMLPart::clearSelection): No longer calls setFocusIfNeeded.
1690 (KHTMLPart::slotClearSelection): Merged old implementation from this function to
1691 clearSelection. Now just calls clearSelection. Also put in !APPLE_CHANGES since
1693 * khtml/xml/dom_docimpl.cpp:
1694 (DocumentImpl::setFocusNode): Add some code to determine when setting the focus should
1695 clear the selection.
1697 (QWidget::hasFocus): Call _webcore_effectiveFirstResponder to get view to check for focus.
1698 (QWidget::setFocus): Ditto.
1699 * kwq/WebCoreBridge.mm:
1700 (-[WebCoreBridge deselectText]): Called slotClearSelection and should have been. Now calls
1702 * kwq/WebCoreView.h: Added.
1703 * kwq/WebCoreView.m: Added.
1704 (-[NSView _webcore_effectiveFirstResponder]): New method to yield the correct responder
1705 to check for firstResponder-ness before calling makeFirstResonder. This helps to prevent
1706 unwanted firstResponder switching.
1707 (-[NSClipView _webcore_effectiveFirstResponder]): Ditto.
1708 (-[NSScrollView _webcore_effectiveFirstResponder]): Ditto.
1710 2004-09-21 Maciej Stachowiak <mjs@apple.com>
1714 <rdar://problem/3805137> REGRESSION: Cannot search on pricetool.com
1716 The problem here is that residual style handling can cause an
1717 element associated with a misnested form to lose the association,
1718 because it can become detached and then reattached in this
1719 case. So we need to maintain the association.
1721 * khtml/html/html_formimpl.h: Added list of dormant elements to form,
1722 and dormant bit to generic form element.
1723 * khtml/html/html_formimpl.cpp:
1724 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl): Clear m_form field for
1725 dormant elements too.
1726 (DOM::HTMLFormElementImpl::registerFormElement): Remove from dormant list
1727 in addition to adding to main list.
1728 (DOM::HTMLFormElementImpl::removeFormElement): Remove from both lists.
1729 (DOM::HTMLFormElementImpl::makeFormElementDormant): New method, remove from
1730 main list, add to dormant list.
1731 (DOM::HTMLGenericFormElementImpl::HTMLGenericFormElementImpl): Initialize
1732 dormant bit to false.
1733 (DOM::HTMLGenericFormElementImpl::insertedIntoDocument): If the element is
1734 dormant and has a form, re-register it and clear the dormant bit.
1735 (DOM::HTMLGenericFormElementImpl::removedFromDocument): If the document has
1736 a form, tell the form it is dormant and set the dormant bit.
1738 2004-09-22 Chris Blumenberg <cblu@apple.com>
1740 Fixed: <rdar://problem/3811187> REGRESSION (Mail): Control-click past end of document does not spell check last word
1742 Reviewed by kocienda.
1744 * khtml/xml/dom_selection.cpp:
1745 (DOM::Selection::validate): if at the end of the document, expand to the left.
1747 2004-09-22 Maciej Stachowiak <mjs@apple.com>
1749 Reviewed by Ken and John.
1751 <rdar://problem/3759228> REGRESSION (Mail): stray characters when entering text via input method right after newline
1753 * khtml/editing/htmlediting_impl.cpp:
1754 (khtml::CompositeEditCommandImpl::inputText): Add an optional
1755 selectInsertedText parameter.
1756 (khtml::ReplaceSelectionCommandImpl::doApply): Let the inputText operation
1757 select the text when inserting plain text, because it already knows all the right
1758 information to do so, and this function doesn't (sometimes text is inserted
1759 before the start of the old selection, not after!)
1760 * khtml/editing/htmlediting_impl.h:
1762 2004-09-22 Richard Williamson <rjw@apple.com>
1764 More tweaks to dashboard regions.
1766 Move dashboard regions list into css3NonInheritedData so it will be shared
1767 by all styles that don't modify the empty region list.
1769 Make the initial value for dashboard region list a static to minimize allocations
1772 Make marquee and flex style accessor functions const.
1776 * khtml/rendering/render_style.cpp:
1777 (RenderStyle::diff):
1778 * khtml/rendering/render_style.h:
1779 (khtml::RenderStyle::opacity):
1780 (khtml::RenderStyle::boxAlign):
1781 (khtml::RenderStyle::boxDirection):
1782 (khtml::RenderStyle::boxFlexGroup):
1783 (khtml::RenderStyle::boxOrdinalGroup):
1784 (khtml::RenderStyle::boxOrient):
1785 (khtml::RenderStyle::boxPack):
1786 (khtml::RenderStyle::marqueeIncrement):
1787 (khtml::RenderStyle::marqueeSpeed):
1788 (khtml::RenderStyle::marqueeLoopCount):
1789 (khtml::RenderStyle::marqueeBehavior):
1790 (khtml::RenderStyle::marqueeDirection):
1791 (khtml::RenderStyle::dashboardRegions):
1792 (khtml::RenderStyle::setDashboardRegions):
1793 (khtml::RenderStyle::setDashboardRegion):
1794 (khtml::RenderStyle::initialDashboardRegions):
1796 2004-09-22 David Hyatt <hyatt@apple.com>
1798 Fix for 3802766, entire view redrawn in Blot while typing. Don't needlessly create text nodes just to find
1799 out the font for the caret position.
1803 * kwq/KWQKHTMLPart.mm:
1804 (KWQKHTMLPart::fontForSelection):
1806 2004-09-21 Chris Blumenberg <cblu@apple.com>
1809 <rdar://problem/3735071> REGRESSION (Mail): WebCore Editing must do smart paste
1810 <rdar://problem/3799163> REGRESSION (Mail): Deleting a word doesn't delete whitespace
1814 * khtml/editing/htmlediting.cpp:
1815 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): take smartDelete parameter
1816 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take smartReplace parameter
1817 * khtml/editing/htmlediting.h:
1818 * khtml/editing/htmlediting_impl.cpp:
1819 (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl): take smartDelete parameter
1820 (khtml::DeleteSelectionCommandImpl::doApply): delete whitespace before and after selection if necessary
1821 (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl): take smartReplace parameter
1822 (khtml::ReplaceSelectionCommandImpl::doApply): add whitespace before and after the replacement if necessary
1823 * khtml/editing/htmlediting_impl.h:
1824 * kwq/WebCoreBridge.h:
1825 * kwq/WebCoreBridge.mm:
1826 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): take smartReplace parameter
1827 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): ditto
1828 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): ditto
1829 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): ditto
1830 (-[WebCoreBridge deleteSelectionWithSmartDelete:]): take smartDelete parameter
1832 2004-09-21 Richard Williamson <rjw@apple.com>
1834 More dashboard region work.
1836 Added support for computed style and cssText for new region property.
1837 Added restriction on length types allowed in region functions.
1838 Added initial and inheritance support for -apple-dashboard-region.
1842 * khtml/css/css_computedstyle.cpp:
1843 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1844 * khtml/css/css_valueimpl.cpp:
1845 (CSSPrimitiveValueImpl::cssText):
1846 * khtml/css/cssparser.cpp:
1847 (CSSParser::parseDashboardRegions):
1848 * khtml/css/cssstyleselector.cpp:
1849 (khtml::CSSStyleSelector::applyProperty):
1850 * khtml/rendering/render_object.cpp:
1851 (RenderObject::addDashboardRegions):
1852 * khtml/rendering/render_style.cpp:
1853 (RenderStyle::diff):
1854 * khtml/rendering/render_style.h:
1855 (khtml::StyleDashboardRegion::operator==):
1856 (khtml::RenderStyle::dashboardRegions):
1857 (khtml::RenderStyle::setDashboardRegions):
1858 (khtml::RenderStyle::initialDashboardRegions):
1860 2004-09-21 Darin Adler <darin@apple.com>
1864 - fixed problem where our updateLayout call ignores pending stylesheets all the time
1866 * khtml/xml/dom_docimpl.h: Added updateLayoutIgnorePendingStylesheets.
1867 * khtml/xml/dom_docimpl.cpp:
1868 (DocumentImpl::updateLayout): Took out the "ignore pending stylesheets" business here.
1869 (DocumentImpl::updateLayoutIgnorePendingStylesheets): Put it in here.
1871 * khtml/ecma/kjs_dom.cpp: (DOMNode::getValueProperty): Call the new
1872 updateLayoutIgnorePendingStylesheets function.
1873 * khtml/ecma/kjs_html.cpp:
1874 (KJS::HTMLElement::getValueProperty): Ditto.
1875 (KJS::HTMLElement::putValue): Ditto.
1876 * khtml/ecma/kjs_views.cpp: (DOMAbstractViewFunc::tryCall): Ditto.
1877 * khtml/ecma/kjs_window.cpp:
1878 (Window::updateLayout): Ditto.
1879 (Selection::get): Ditto.
1880 (SelectionFunc::tryCall): Ditto.
1882 * khtml/html/html_imageimpl.h: Add ignorePendingStylesheets boolean parameter.
1883 * khtml/html/html_imageimpl.cpp:
1884 (HTMLImageElementImpl::width): Respect new parameter.
1885 (HTMLImageElementImpl::height): Ditto.
1889 * kwq/WebCoreBridge.mm:
1890 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Removed unneeded
1891 explicit "true" parameter to setSelection.
1892 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto.
1894 2004-09-21 Darin Adler <darin@apple.com>
1898 - fix crash when pasting text at the end of the document and then doing an undo
1900 * khtml/editing/htmlediting_impl.cpp:
1901 (khtml::EditCommandImpl::apply): Call markMisspellingsInSelection before doing
1902 the editing operation, and we'll tell setSelection not to unmark the old selection.
1903 Also call updateLayout before calling appliedEditing so DOM operations in the
1904 code responding to the selection change will work.
1905 (khtml::EditCommandImpl::unapply): Ditto.
1906 (khtml::EditCommandImpl::reapply): Ditto.
1908 * khtml/khtml_part.h: Added a third parameter to setSelection to tell it whether
1909 to unmark the old selection. We must pass false when editing, because the old
1910 selection might have now-invalid offsets inside it.
1911 * khtml/khtml_part.cpp:
1912 (KHTMLPart::setSelection): Add unmarkOldSelection parameter, and respect it.
1913 (KHTMLPart::appliedEditing): Pass false for unmarkOldSelection.
1914 (KHTMLPart::unappliedEditing): Ditto.
1915 (KHTMLPart::reappliedEditing): Ditto.
1917 2004-09-21 Richard Williamson <rjw@apple.com>
1919 Part 2 of the feature requested in
1920 <rdar://problem/3752791> Dashboard: Need a better solution for control regions
1922 This patch actually collections the regions and converts to absolute coordinates.
1923 Only remaining piece is to pass over the bridge and up the alley to WebKit
1928 * khtml/css/css_valueimpl.h:
1929 (DOM::CSSPrimitiveValueImpl::getDashboardRegionValue):
1930 * khtml/css/cssparser.cpp:
1931 (CSSParser::parseValue):
1932 (CSSParser::parseDashboardRegions):
1933 * khtml/css/cssproperties.c:
1934 * khtml/css/cssproperties.h:
1935 * khtml/css/cssproperties.in:
1936 * khtml/css/cssstyleselector.cpp:
1937 (khtml::CSSStyleSelector::applyProperty):
1938 * khtml/khtmlview.cpp:
1939 (KHTMLView::layout):
1940 * khtml/rendering/render_object.cpp:
1941 (RenderObject::computeDashboardRegions):
1942 (RenderObject::addDashboardRegions):
1943 (RenderObject::collectDashboardRegions):
1944 * khtml/rendering/render_object.h:
1945 (khtml::DashboardRegionValue::operator==):
1946 * khtml/rendering/render_style.cpp:
1947 * khtml/rendering/render_style.h:
1948 (khtml::StyleDashboardRegion::):
1949 (khtml::RenderStyle::dashboardRegions):
1950 (khtml::RenderStyle::setDashboardRegion):
1951 * khtml/xml/dom_docimpl.cpp:
1952 (DocumentImpl::DocumentImpl):
1953 (DocumentImpl::updateLayout):
1954 (DocumentImpl::acceptsEditingFocus):
1955 (DocumentImpl::dashboardRegions):
1956 (DocumentImpl::setDashboardRegions):
1957 * khtml/xml/dom_docimpl.h:
1958 (DOM::DocumentImpl::hasDashboardRegions):
1959 (DOM::DocumentImpl::setHasDashboardRegions):
1961 2004-09-21 John Sullivan <sullivan@apple.com>
1965 - WebCore part of fix for <rdar://problem/3618274> REGRESSION (125-135):
1966 Option-tab doesn't always work as expected
1968 * kwq/KWQKHTMLPart.mm:
1969 (KWQKHTMLPart::tabsToAllControls):
1970 reworked logic to match what we promise in the UI; this worked correctly
1971 before for regular tabbing, but not for option-tabbing.
1974 (QButton::focusPolicy):
1975 check tabsToAllControls() rather than just WebCoreKeyboardAccessFull
1977 * kwq/KWQComboBox.mm:
1978 (QComboBox::focusPolicy):
1981 * kwq/KWQFileButton.mm:
1982 (KWQFileButton::focusPolicy):
1985 * kwq/KWQListBox.mm:
1986 (QListBox::focusPolicy):
1989 2004-09-21 John Sullivan <sullivan@apple.com>
1991 * khtml/xml/dom_selection.cpp:
1992 (DOM::Selection::modify):
1993 initialize xPos to make compiler happy in deployment builds
1995 2004-09-21 Darin Adler <darin@apple.com>
1999 - some small mechanical improvements to the position and selection classes
2001 * khtml/xml/dom_position.h: Added clear(), startPosition(), and endPosition().
2002 * khtml/xml/dom_position.cpp:
2003 (DOM::Position::clear): Added.
2004 (DOM::startPosition): Added.
2005 (DOM::endPosition): Added.
2007 * khtml/xml/dom_caretposition.h: Changed m_position to m_deepPosition. Added clear(),
2008 removed node() and offset().
2009 * khtml/xml/dom_caretposition.cpp:
2010 (DOM::CaretPosition::init): Updated for name change of m_position to m_deepPosition.
2011 (DOM::CaretPosition::isLastInBlock): Ditto.
2012 (DOM::CaretPosition::next): Ditto.
2013 (DOM::CaretPosition::previous): Ditto.
2014 (DOM::CaretPosition::debugPosition): Ditto.
2015 (DOM::CaretPosition::formatForDebugger): Ditto.
2017 * khtml/xml/dom_selection.h: Remove setStart, setEnd, setStartAndEnd, rangeStart, rangeEnd,
2018 and all the assignXXX functions.
2019 * khtml/xml/dom_selection.cpp:
2020 (DOM::Selection::Selection): Wean from assign functions, get and set data members directly.
2021 (DOM::Selection::init): Don't clear base, extent, start, and end, since they have constructors.
2022 (DOM::Selection::operator=): Wean from assign functions, get and set data members directly.
2023 (DOM::Selection::moveTo): Ditto.
2024 (DOM::Selection::setModifyBias): Ditto.
2025 (DOM::Selection::modifyExtendingRightForward): Ditto.
2026 (DOM::Selection::modifyMovingRightForward): Ditto.
2027 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
2028 (DOM::Selection::modifyMovingLeftBackward): Ditto.
2029 (DOM::Selection::modify): Ditto.
2030 (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
2031 (DOM::Selection::clear): Ditto.
2032 (DOM::Selection::setBase): Ditto.
2033 (DOM::Selection::setExtent): Ditto.
2034 (DOM::Selection::setBaseAndExtent): Ditto.
2035 (DOM::Selection::toRange): Ditto.
2036 (DOM::Selection::layoutCaret): Ditto.
2037 (DOM::Selection::needsCaretRepaint): Ditto.
2038 (DOM::Selection::validate): Ditto.
2039 (DOM::Selection::debugRenderer): Ditto.
2040 (DOM::Selection::debugPosition): Ditto.
2041 (DOM::Selection::end):
2043 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::advanceToNextMisspelling): Tweaked whitespace.
2045 2004-09-21 Chris Blumenberg <cblu@apple.com>
2047 Fixed: <rdar://problem/3647229> Safari does not play inline Windows Media Content on some sites (miggy.net and ministryofsound.com)
2051 * khtml/rendering/render_frames.cpp:
2052 (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
2054 2004-09-20 Darin Adler <darin@apple.com>
2058 - fixed regression from my recent check-in where misspelled words do not get unmarked when moving the caret
2059 - changed CaretPosition to hold a Position instead of a node and offset
2060 - renamed isEmpty to isNull, etc.
2062 * kwq/KWQKHTMLPart.mm:
2063 (KWQKHTMLPart::jumpToSelection): Updated for name changes.
2064 (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
2065 (KWQKHTMLPart::fontForSelection): Ditto.
2066 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Ditto.
2067 (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
2068 (KWQKHTMLPart::updateSpellChecking): Fixed bug by using LeftWordIfOnBoundary.
2070 * khtml/xml/dom_position.h: Updated for name changes.
2071 * khtml/xml/dom_position.cpp:
2072 (DOM::Position::element): Change to not use a separate null check.
2073 (DOM::Position::computedStyle): Updated for name changes.
2074 (DOM::Position::previousCharacterPosition): Ditto.
2075 (DOM::Position::nextCharacterPosition): Ditto.
2076 (DOM::Position::equivalentRangeCompliantPosition): Ditto.
2077 (DOM::Position::equivalentShallowPosition): Ditto.
2078 (DOM::Position::equivalentDeepPosition): Ditto.
2079 (DOM::Position::closestRenderedPosition): Ditto.
2080 (DOM::Position::inRenderedContent): Ditto.
2081 (DOM::Position::inRenderedText): Ditto.
2082 (DOM::Position::isRenderedCharacter): Ditto.
2083 (DOM::Position::rendersInDifferentPosition): Ditto.
2084 (DOM::Position::isFirstRenderedPositionOnLine): Ditto.
2085 (DOM::Position::isLastRenderedPositionOnLine): Ditto.
2086 (DOM::Position::inFirstEditableInRootEditableElement): Ditto.
2087 (DOM::Position::leadingWhitespacePosition): Ditto.
2088 (DOM::Position::trailingWhitespacePosition): Ditto.
2089 (DOM::Position::debugPosition): Ditto.
2090 (DOM::Position::formatForDebugger): Ditto.
2092 * khtml/xml/dom_caretposition.h: Change to use m_position, and change names.
2093 * khtml/xml/dom_caretposition.cpp:
2094 (DOM::CaretPosition::CaretPosition): Remove code to set up m_node.
2095 (DOM::CaretPosition::init): Set m_position directly.
2096 (DOM::CaretPosition::isLastInBlock): Updated for name changes.
2097 (DOM::CaretPosition::next): Set m_position directly.
2098 (DOM::CaretPosition::previous): Set m_position directly.
2099 (DOM::CaretPosition::previousCaretPosition): Updated for name changes.
2100 (DOM::CaretPosition::nextCaretPosition): Ditto.
2101 (DOM::CaretPosition::previousPosition): Ditto.
2102 (DOM::CaretPosition::nextPosition): Ditto.
2103 (DOM::CaretPosition::atStart): Ditto.
2104 (DOM::CaretPosition::atEnd): Ditto.
2105 (DOM::CaretPosition::isCandidate): Ditto.
2106 (DOM::CaretPosition::debugPosition): Ditto.
2107 (DOM::CaretPosition::formatForDebugger): Ditto.
2108 (DOM::startOfWord): Ditto.
2109 (DOM::endOfWord): Ditto.
2110 (DOM::previousParagraphPosition): Ditto.
2111 (DOM::nextParagraphPosition): Ditto.
2113 * khtml/xml/dom_selection.h: Updated names. Added isCaret and isRange.
2114 * khtml/xml/dom_selection.cpp:
2115 (DOM::Selection::modifyMovingRightForward): Updated for name changes.
2116 (DOM::Selection::modifyMovingLeftBackward): Ditto.
2117 (DOM::Selection::modify): Ditto.
2118 (DOM::Selection::expandUsingGranularity): Ditto.
2119 (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
2120 (DOM::Selection::toRange): Ditto.
2121 (DOM::Selection::layoutCaret): Ditto.
2122 (DOM::Selection::needsCaretRepaint): Ditto.
2123 (DOM::Selection::validate): Ditto.
2124 (DOM::startOfFirstRunAt): Ditto.
2125 (DOM::endOfLastRunAt): Ditto.
2126 (DOM::selectionForLine): Ditto.
2127 (DOM::Selection::formatForDebugger): Ditto.
2129 * khtml/ecma/kjs_window.cpp:
2130 (Selection::get): Updated for name changes.
2131 (Selection::toString): Ditto.
2132 * khtml/editing/htmlediting_impl.cpp:
2133 (khtml::debugPosition): Ditto.
2134 (khtml::StyleChange::init): Ditto.
2135 (khtml::StyleChange::currentlyHasStyle): Ditto.
2136 (khtml::CompositeEditCommandImpl::deleteSelection): Ditto.
2137 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): Ditto.
2138 (khtml::ApplyStyleCommandImpl::doApply): Ditto.
2139 (khtml::DeleteSelectionCommandImpl::doApply): Ditto.
2140 (khtml::InputNewlineCommandImpl::doApply): Ditto.
2141 (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
2142 (khtml::InputTextCommandImpl::input): Ditto.
2143 (khtml::ReplaceSelectionCommandImpl::doApply): Ditto.
2144 (khtml::MoveSelectionCommandImpl::doApply): Ditto.
2145 (khtml::TypingCommandImpl::doApply): Ditto.
2146 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Ditto.
2147 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Ditto.
2148 * khtml/editing/jsediting.cpp:
2149 (enabledAnySelection): Ditto.
2150 (enabledRangeSelection): Ditto.
2151 * khtml/khtml_part.cpp:
2152 (KHTMLPart::hasSelection): Ditto.
2153 (KHTMLPart::setFocusNodeIfNeeded): Ditto.
2154 (KHTMLPart::selectionLayoutChanged): Ditto.
2155 (KHTMLPart::timerEvent): Ditto.
2156 (KHTMLPart::isPointInsideSelection): Ditto.
2157 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
2158 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2159 (KHTMLPart::handleMousePressEventSingleClick): Ditto.
2160 (KHTMLPart::handleMouseMoveEventSelection): Ditto.
2161 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
2162 (KHTMLPart::selectionHasStyle): Ditto.
2163 (KHTMLPart::selectionComputedStyle): Ditto.
2164 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::updateSelection): Ditto.
2165 * khtml/xml/dom_positioniterator.cpp:
2166 (DOM::PositionIterator::peekPrevious): Ditto.
2167 (DOM::PositionIterator::peekNext): Ditto.
2168 (DOM::PositionIterator::atStart): Ditto.
2169 (DOM::PositionIterator::atEnd): Ditto.
2170 * khtml/xml/dom_positioniterator.h:
2171 (DOM::PositionIterator::isEmpty): Ditto.
2172 * kwq/KWQRenderTreeDebug.cpp:
2173 (writeSelection): Ditto.
2174 * kwq/WebCoreBridge.mm:
2175 (-[WebCoreBridge editableDOMRangeForPoint:]): Ditto.
2176 (-[WebCoreBridge deleteSelection]): Ditto.
2177 (-[WebCoreBridge ensureCaretVisible]): Ditto.
2178 (-[WebCoreBridge rangeOfCharactersAroundCaret]): Ditto.
2180 2004-09-20 Darin Adler <darin@apple.com>
2184 - fixed <rdar://problem/3808073> find is broken
2186 * khtml/misc/khtml_text_operations.h: Add m_pastEndNode and change name of m_endNode to
2187 m_endContainer to more accurately reflect its purpose.
2188 * khtml/misc/khtml_text_operations.cpp:
2189 (khtml::TextIterator::TextIterator): Use pastEnd() for end of iteration, and change to
2190 handle bad ranges better: just return an empty iterator instead of raising an exception.
2191 (khtml::TextIterator::advance): Change to use m_pastEndNode to detect the end of iteration.
2192 (khtml::TextIterator::handleTextNode): Update for name change.
2193 (khtml::TextIterator::handleTextBox): Ditto.
2194 (khtml::TextIterator::range): Handle case where m_endContainer is nil.
2196 * khtml/xml/dom2_rangeimpl.cpp:
2197 (DOM::RangeImpl::surroundContents): Use offsetInCharacters.
2198 (DOM::RangeImpl::startNode): Added check for nil start container and use offsetInCharacters.
2199 (DOM::RangeImpl::pastEndNode): Ditto.
2201 2004-09-20 Chris Blumenberg <cblu@apple.com>
2203 Fixed: <rdar://problem/3781290> REGRESSION (Mail): Crash in ReplaceSelectionCommandImpl attaching file to new message
2205 Reviewed by kocienda.
2207 * khtml/khtml_part.cpp:
2208 (KHTMLPart::setSelection): setFocusNodeIfNeeded now works on the current selection so call setFocusNodeIfNeeded after setting the selection
2209 (KHTMLPart::clearSelection): don't call setFocusNodeIfNeeded with the current selection
2210 (KHTMLPart::setCaretVisible): ditto
2211 (KHTMLPart::setFocusNodeIfNeeded): do nothing if the part isn't focused, work with the current selection
2212 * khtml/khtml_part.h:
2213 * khtml/khtmlpart_p.h:
2214 (KHTMLPartPrivate::KHTMLPartPrivate): added m_isFocused
2215 * kwq/KWQKHTMLPart.h:
2216 * kwq/KWQKHTMLPart.mm:
2217 (KWQKHTMLPart::KWQKHTMLPart): removed _displaysWithFocusAttributes this is replaced by m_isFocused
2218 (KWQKHTMLPart::setSelectionFromNone): new, code factored out from setDisplaysWithFocusAttributes
2219 (KWQKHTMLPart::setDisplaysWithFocusAttributes): call setSelectionFromNone
2220 (KWQKHTMLPart::displaysWithFocusAttributes): now returns m_isFocused
2221 * kwq/WebCoreBridge.h:
2222 * kwq/WebCoreBridge.mm:
2223 (-[WebCoreBridge setSelectionFromNone]): new
2225 2004-09-20 Darin Adler <darin@apple.com>
2229 - fixed nil-deref happening often in Mail when I delete
2231 * khtml/rendering/render_br.cpp: (RenderBR::selectionRect): Check for nil lastLeafChild.
2232 Dave may want to figure out why it's nil and do a different fix later.
2234 2004-09-20 Maciej Stachowiak <mjs@apple.com>
2236 Reviewed by Richard.
2238 <rdar://problem/3672101> HANG: typing into login field at dws-direkt.deutsche-bank.de (infinite recursion)
2240 * khtml/xml/dom_docimpl.cpp:
2241 (DocumentImpl::defaultEventHandler): Copy the list of handlers
2242 before firing any of them, in case a handler affects the list of
2245 2004-09-20 Chris Blumenberg <cblu@apple.com>
2248 <rdar://problem/3429921> obey PARAM tags inside of OBJECT tags when necessary
2249 <rdar://problem/3515685> Object tag in Java 1.4.1 / Safari doesn't recognize params
2253 * khtml/khtml_part.cpp:
2254 (KHTMLPart::requestFrame): take 2 parameter arrays rather than 1 which will have to be parsed
2255 (KHTMLPart::requestObject): ditto
2256 * khtml/khtml_part.h:
2257 * khtml/khtmlpart_p.h:
2258 * khtml/rendering/render_frames.cpp:
2259 (RenderPartObject::updateWidget): use PARAM tags when there is no EMBED specified
2260 * kwq/KWQKHTMLPart.h:
2261 * kwq/KWQKHTMLPart.mm:
2262 (KWQKHTMLPart::createPart): call renamed bridge method
2263 * kwq/KWQKJavaAppletWidget.mm:
2264 (KJavaAppletWidget::KJavaAppletWidget): ditto
2265 * kwq/KWQStringList.h:
2266 * kwq/KWQStringList.mm:
2267 (QStringList::getNSArray): return a const array
2268 * kwq/WebCoreBridge.h:
2269 * kwq/WebCoreBridge.mm:
2270 (-[WebCoreBridge URLWithAttributeString:]): renamed to match API
2272 2004-09-20 Darin Adler <darin@apple.com>
2276 - fixed <rdar://problem/3655360> REGRESSION (Mail): Ctrl-V emacs key binding, -pageDown: method, unimplemented (and pageUp, and selection-modifying versions)
2277 - fixed <rdar://problem/3735055> REGRESSION (Mail): WebCore double click rules treat style change as a boundary
2278 - fixed <rdar://problem/3789939> REGRESSION (Mail): double-clicking on border whitespace selects space plus word before/after
2279 - fixed <rdar://problem/3792138> REGRESSION (Mail): Spell checker doesn't check current selected word
2280 - fixed <rdar://problem/3806604> REGRESSION (164): Triple-click sometimes selects extra characters
2281 - fixed <rdar://problem/3806996> REGRESSION (125-162): Triple-click in <pre> tagged text behaves oddly (leuf.net)
2283 * khtml/xml/dom_caretposition.h: Added a lot of new functions. Removed implicit conversion operator
2284 that converts from CaretPosition to Position.
2285 * khtml/xml/dom_caretposition.cpp:
2286 (DOM::CaretPosition::CaretPosition): Change to call deepEquivalent so it works without the implicit
2287 Position conversion operator.
2288 (DOM::CaretPosition::operator=): Ditto.
2289 (DOM::CaretPosition::next): Ditto.
2290 (DOM::CaretPosition::previous): Ditto.
2291 (DOM::CaretPosition::setPosition): Added an assertion.
2292 (DOM::start): Added.
2294 (DOM::setStart): Added.
2295 (DOM::setEnd): Added.
2296 (DOM::previousWordBoundary): Added.
2297 (DOM::nextWordBoundary): Added.
2298 (DOM::startWordBoundary): Added.
2299 (DOM::startOfWord): Added.
2300 (DOM::endWordBoundary): Added.
2301 (DOM::endOfWord): Added.
2302 (DOM::previousWordPositionBoundary): Added.
2303 (DOM::previousWordPosition): Added.
2304 (DOM::nextWordPositionBoundary): Added.
2305 (DOM::nextWordPosition): Added.
2306 (DOM::previousLinePosition): Added.
2307 (DOM::nextLinePosition): Added.
2308 (DOM::startOfParagraph): Changed function name.
2309 (DOM::endOfParagraph): Changed function name. Fixed code in includeLineBreak to work around
2310 the CaretPosition constructor issue for <br>, pass the right parameter for the block flow case,
2311 and handle <pre> properly.
2312 (DOM::inSameParagraph): Added.
2313 (DOM::previousParagraphPosition): Added.
2314 (DOM::nextParagraphPosition): Added.
2316 * khtml/xml/dom_position.h: Removed a number of functions no longer used; also made some private.
2317 * khtml/xml/dom_position.cpp: Removed a number of functions no longer used.
2319 * khtml/xml/dom_selection.h: Replaced DOCUMENT with DOCUMENT_BOUNDARY. Added overloads of lots
2320 of functions that take CaretPosition directly. Added overload of modify that takes a parameter
2321 for vertical distance to help implement pageDown: and friends. Replaced getRepaintRect with
2322 two new functions named caretRect and caretRepaintRect. Removed nodeIsBeforeNode.
2323 * khtml/xml/dom_selection.cpp:
2324 (DOM::Selection::Selection): Added constructor that takes two CaretPosition objects.
2325 (DOM::Selection::setModifyBias): Added. Helper function.
2326 (DOM::Selection::modifyExtendingRightForward): Don't set modify bias, since that's now the caller's
2327 responsibility. Reimplement WORD and LINE in terms of new CaretPosition functions. Implement PARAGRAPH
2328 and change PARAGRAPH_BOUNDARY to use CaretPosition function by its new name.
2329 (DOM::Selection::modifyMovingRightForward): Ditto.
2330 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
2331 (DOM::Selection::modifyMovingLeftBackward): Ditto.
2332 (DOM::Selection::modify): Call setModifyBias, and use a switch statement instead of if.
2333 (DOM::caretY): Added. Helper for the new modify function that implements moving a pixel distance,
2334 used by pageDown: and friends.
2335 (DOM::Selection::modify): Added.
2336 (DOM::Selection::toRange): Use RangeImpl::compareBoundaryPoints instead of nodeIsBeforeNode.
2337 (DOM::Selection::caretRect): Added. Replaces getRepaintRect, but does not add slop.
2338 (DOM::Selection::caretRepaintRect): Added. Replaces getRepaintRect; still adds slop.
2339 (DOM::Selection::needsCaretRepaint): Call caretRepaintRect.
2340 (DOM::Selection::validate): Use RangeImpl::compareBoundaryPoints instead of nodeIsBeforeNode.
2341 Reimplement WORD to use new CaretPosition functions; this fixes the double-clicking problems.
2342 Change paragraph calls to use new names.
2344 * ForwardingHeaders/dom/dom_position.h: Removed. This was in the wrong location.
2345 * khtml/editing/htmlediting.cpp: Fixed include that said "dom/dom_position.h".
2346 * khtml/editing/htmlediting_impl.cpp: Fixed include that said "dom/dom_position.h".
2347 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Rewrote this to use the new CaretPosition
2348 functions instead of the old Position functions.
2350 * khtml/misc/helper.h: Added const to character pointer parameter. Also put invertedColor inside
2351 an !APPLE_CHANGES since it doesn't do us any good.
2352 * khtml/misc/helper.cpp:
2353 (khtml::findWordBoundary): Added const to character pointer parameter.
2354 (khtml::nextWordFromIndex): Ditto.
2356 * kwq/KWQTextUtilities.h: Change parameters to const.
2357 * kwq/KWQTextUtilities.cpp: (KWQFindWordBoundary): Change parameter to const.
2358 * kwq/KWQTextUtilities.mm: (KWQFindNextWordFromIndex): Change parameter to const.
2360 * khtml/css/cssstyleselector.cpp: Disable code that uses invertedColor when APPLE_CHANGES, since it
2363 * khtml/rendering/render_canvas.cpp: (RenderCanvas::setSelection): Added checks for selection end
2364 so we can set the selection end to nodes that are not leaf nodes and it will still work. Also took
2365 out bogus firstChild/lastChild loops for the same reason.
2367 * kwq/KWQKHTMLPart.h: Add "start before selection" flag to advanceToNextMisspelling.
2368 Needed to fix bug with spell checking.
2369 * kwq/KWQKHTMLPart.mm:
2370 (KWQKHTMLPart::findString): Changed to use CaretPosition.
2371 (KWQKHTMLPart::advanceToNextMisspelling): Added code to handle "start before selection" flag
2372 and changed to use CaretPosition and new helper functions.
2373 (KWQKHTMLPart::markMisspellingsInSelection): More changes to use CaretPosition.
2374 (KWQKHTMLPart::updateSpellChecking): Ditto.
2376 * kwq/WebCoreBridge.h: Replaced WebSelectByDocument with WebSelectToDocumentBoundary.
2377 Added advanceToNextMisspellingStartingJustBeforeSelection,
2378 rangeByAlteringCurrentSelection:verticalDistance:, and
2379 alterCurrentSelection:verticalDistance:.
2381 * kwq/WebCoreBridge.mm:
2382 (-[WebCoreBridge advanceToNextMisspellingStartingJustBeforeSelection]): Added.
2383 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Added case for selecting by
2384 paragraph to save X position.
2385 (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:]): Added.
2386 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Added.
2387 (-[WebCoreBridge ensureCaretVisible]): Call caretRect instead of getRepaintRect.
2389 2004-09-20 Darin Adler <darin@apple.com>
2393 - cleaned up DOM::RangeImpl a little so compareBoundaryPoints can be used outside the class
2395 * khtml/xml/dom2_rangeimpl.h: Added const to many of the member functions and made the
2396 compareBoundaryPoints that works on parameters be a const member function.
2397 * khtml/xml/dom2_rangeimpl.cpp:
2398 (DOM::RangeImpl::commonAncestorContainer): Added const.
2399 (DOM::RangeImpl::compareBoundaryPoints): Added const.
2400 (DOM::RangeImpl::boundaryPointsValid): Added const, and wrote cleaner version.
2401 (DOM::RangeImpl::insertNode): Simplified by calling containedByReadOnly.
2402 (DOM::RangeImpl::toString): Added const.
2403 (DOM::RangeImpl::toHTML): Added const.
2404 (DOM::RangeImpl::createContextualFragment): Added const.
2405 (DOM::RangeImpl::cloneRange): Added const.
2406 (DOM::RangeImpl::surroundContents): Simplified by calling containedByReadOnly.
2408 2004-09-20 Darin Adler <darin@apple.com>
2412 - fixed <rdar://problem/3806990> REGRESSION (125-162): Crash on Select All at http://leuf.net/cgi/wikidn?PerlConvertEolScript
2414 * khtml/rendering/render_replaced.cpp: (RenderWidget::setSelectionState): Added nil check for the
2417 2004-09-20 Darin Adler <darin@apple.com>
2421 - fixed <rdar://problem/3773740> calling addEventListener on a frame that hasn't loaded yet crashes
2423 * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Add nil checks for the document.
2424 The nil check prevents the crash but there's still a bug here; I filed 3807059 about that.
2426 2004-09-20 Darin Adler <darin@apple.com>
2430 - fixed problem where up and down arrow keys are not preserving X position
2432 * khtml/khtml_part.cpp:
2433 (KHTMLPart::selectionLayoutChanged): Moved code to clear m_xPosForVerticalArrowNavigation out of here.
2434 (KHTMLPart::notifySelectionChanged): Moved it into here.
2436 2004-09-18 Darin Adler <darin@apple.com>
2440 - fixed <rdar://problem/3805627> -[DOMRange _text] sometimes includes all text to the end of the document for certain ranges
2442 * khtml/misc/khtml_text_operations.cpp: (khtml::TextIterator::advance):
2443 Correctly handle the case when we are already on m_endNode. The concept here is that
2444 m_endNode is a node you must never "leave" when iterating.
2448 2004-09-17 Ken Kocienda <kocienda@apple.com>
2450 * layout-tests/editing/selection/unrendered-004-expected.txt: Updated expected results.
2452 2004-09-17 Ken Kocienda <kocienda@apple.com>
2458 <rdar://problem/3780245> REGRESSION (Mail): some lines are skipped when doing arrow navigation
2460 * khtml/xml/dom_position.cpp:
2461 (DOM::Position::previousLinePosition): One-line fix. Make sure that BRs at the end of blocks
2464 2004-09-17 Ken Kocienda <kocienda@apple.com>
2470 <rdar://problem/3805594> REGRESSION (Mail): Second return key stroke does not work when first was in blockquote
2472 * khtml/xml/dom_selection.cpp:
2473 (DOM::Selection::toRange): Code to convert caret positions moved the position upstream
2474 before making a range-compliant position, but erroneously would allow the position
2475 to cross blocks. Now it will no longer do so.
2477 2004-09-16 Richard Williamson <rjw@apple.com>
2479 Part 1 of the feature requested in
2480 <rdar://problem/3752791> Dashboard: Need a better solution for control regions
2482 This patch implements the CSS parsing necessary for dashboard regions.
2483 Here's an example of the syntax we support:
2487 -apple-dashboard-region:
2488 dashboard-region-circle(control 0 0 80 0)
2489 dashboard-region-rectangle(control,20,0,20,0)
2490 dashboard-region-circle(control 80 0 0 0);
2495 Part 2 will determine the appropriate regions.
2499 * khtml/css/css_valueimpl.cpp:
2500 (CSSPrimitiveValueImpl::CSSPrimitiveValueImpl):
2501 * khtml/css/css_valueimpl.h:
2502 (DOM::CSSPrimitiveValueImpl::):
2503 (DOM::DashboardRegionImpl::DashboardRegionImpl):
2504 (DOM::DashboardRegionImpl::~DashboardRegionImpl):
2505 (DOM::DashboardRegionImpl::setNext):
2506 (DOM::DashboardRegionImpl::setLabel):
2507 * khtml/css/cssparser.cpp:
2508 (CSSParser::parseValue):
2509 (CSSParser::parseContent):
2510 (skipCommaInDashboardRegion):
2511 (CSSParser::parseDashboardRegions):
2512 * khtml/css/cssparser.h:
2513 * khtml/css/cssproperties.c:
2516 * khtml/css/cssproperties.h:
2517 * khtml/css/cssproperties.in:
2518 * khtml/dom/css_value.h:
2519 (DOM::CSSPrimitiveValue::):
2521 2004-09-16 Darin Adler <darin@apple.com>
2523 - fixed caret-drawing regression from my last patch
2525 * khtml/xml/dom_selection.cpp:
2526 (DOM::Selection::xPosForVerticalArrowNavigation): Pass false, meaning "vertical line caret"
2527 rather than true meaning "big box for overtyping".
2528 (DOM::Selection::layoutCaret): Ditto.
2530 2004-09-16 Darin Adler <darin@apple.com>
2534 - fixed <rdar://problem/3803280> crash in selectAll on page with no contents
2536 * khtml/khtml_part.cpp: (KHTMLPart::selectAll): Handle case of 0 for documentElement().
2537 * khtml/xml/dom_position.cpp:
2538 (DOM::Position::previousWordPosition): Ditto.
2539 (DOM::Position::nextWordPosition): Ditto.
2541 - cleaned up caret code
2542 - changed DOM::Selection to use CaretPosition more
2544 * khtml/rendering/render_box.cpp: (RenderBox::caretRect): Change to use empty rectangles
2545 instead of an X value of -1 to mean no rectangle.
2546 * khtml/rendering/render_image.cpp: (RenderImage::selectionRect): Take advantage of the
2547 fixed QRect constructor.
2548 * khtml/rendering/render_object.cpp: (RenderObject::caretRect): Change to use empty
2549 rectangle instead of an X value of -1 to mean no rectangle.
2550 * khtml/rendering/render_text.cpp: (RenderText::caretRect): Cleaned up, and changed to use
2551 an empty rectangle instead of an X value of -1 to mean no rectangle.
2553 * khtml/xml/dom_caretposition.h: Made conversion from Position to CaretPosition something you
2554 can do implicitly, since it's an unambiguous conversion. Conversion in the other direction
2555 needs to be done explicitly. Moved EIncludeLineBreak here, and added startParagraphBoundary
2556 and endParagraphBoundary functions.
2557 * khtml/xml/dom_caretposition.cpp:
2558 (DOM::startParagraphBoundary): Added. Replaces, and made from, member function of DOM::Position.
2559 (DOM::endParagraphBoundary): Ditto.
2561 * khtml/xml/dom_position.h: Removed EIncludeLineBreak and startParagraphBoundary and
2562 endParagraphBoundary.
2563 * khtml/xml/dom_position.cpp: Removed startParagraphBoundary and endParagraphBoundary.
2565 * khtml/xml/dom_selection.h: Use CaretPosition instead of Position in a few places.
2566 Use a QRect for the caret rect. Change nodeIsBeforeNode to be a static member function.
2567 * khtml/xml/dom_selection.cpp:
2568 (DOM::Selection::Selection): Change caret to store QRect instead of 3 separate fields.
2569 (DOM::Selection::init): Ditto.
2570 (DOM::Selection::operator=): Ditto.
2571 (DOM::Selection::modifyExtendingRightForward): Change to use CaretPosition instead of Position.
2573 (DOM::Selection::modifyMovingRightForward): Ditto. Check for 0.
2574 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
2575 (DOM::Selection::modifyMovingLeftBackward): Ditto.
2576 (DOM::Selection::modify): Ditto.
2577 (DOM::Selection::layoutCaret): Change to use a QRect for the caret rect, and use an empty
2578 one to mean no rectangle.
2579 (DOM::Selection::getRepaintRect): Ditto.
2580 (DOM::Selection::paintCaret): Ditto.
2581 (DOM::Selection::validate): Change to use CaretPosition instead of Position. Also fixed
2582 PARAGRAPH_BOUNDARY, which was broken and doing the same thing as PARAGRAPH before, but
2583 it's not really used so that didn't matter. Check for 0.
2584 (DOM::Selection::nodeIsBeforeNode): Tightened up a bit and added some FIXMEs. This function
2585 has a number of problems and should probably be discarded in favor of the DOMStringImpl
2586 method that does the same thing.
2588 2004-09-16 Ken Kocienda <kocienda@apple.com>
2594 <rdar://problem/3787168> REGRESSION (Mail): Deleting text from the beginning of a quoted range removes the quoting from the rest
2596 * khtml/editing/htmlediting_impl.cpp:
2597 (khtml::DeleteSelectionCommandImpl::moveNodesAfterNode): Only move the text nodes (and their siblings) when
2598 doing this move between blocks. This serves to mimic NSText behavior very well.
2600 2004-09-15 Darin Adler <darin@apple.com>
2602 - fixed Panther build
2604 * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityActionDescription:]): Fixed backwards
2605 check in #if that was compiling the code on Panther only rather than Tiger only.
2607 2004-09-15 Darin Adler <darin@apple.com>
2611 - fixed lockFocus exception I observed; perhaps not a real issue in the field due to exception blocking
2613 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::imageFromRect): Put most of the function inside a
2614 big if statement to avoid the exception we get from lockFocus otherwise.
2616 2004-09-15 Darin Adler <darin@apple.com>
2620 - fixed <rdar://problem/3786467> REGRESSION (Mail): Reproducible crash replying to an HTML message when your preference is for plain text composing.
2622 * khtml/rendering/render_block.h: Remove removeChildrenFromLineBoxes.
2623 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::removeChild): Remove calls
2624 to removeChildrenFromLineBoxes which was the old way of working around this.
2625 * khtml/rendering/render_flow.cpp: (RenderFlow::detach): Add comments and code to handle
2626 removing children from line boxes we are about to delete.
2628 2004-09-15 Richard Williamson <rjw@apple.com>
2630 Fixed <rdar://problem/3781561> REGRESSION (Mail): typing in Mail became suddenly really sluggish (substitute font code)
2632 A DocumentMarker may begin before the InLineBox that includes
2633 it. Ensure that we correctly handle that case. The paintMarker()
2634 method and code that calls it could do with some cleanup to
2635 make it clearer how all the cases are handled, i.e. marker
2636 within box, or intersecting beginning or end of box.
2640 * khtml/rendering/render_text.cpp:
2641 (InlineTextBox::paintMarker): Minimal change to ensure that we
2642 handle the case of marker starting before box.
2644 2004-09-15 Darin Adler <darin@apple.com>
2648 - get rid of some of the localizable strings in here; we still have to figure out
2649 how we're going to localize the last few role descriptions
2651 * kwq/KWQAccObject.mm:
2652 (-[KWQAccObject roleDescription]): Use NSAccessibilityRoleDescription for most
2653 descriptions instead of a hard-coded string (inside the UI_STRING placeholder).
2654 (-[KWQAccObject accessibilityActionDescription:]): Same thing, with NSAccessibilityActionDescription.
2656 2004-09-15 Darin Adler <darin@apple.com>
2660 - did some QRect-related changes to facilitate later bug fixing
2662 * kwq/KWQPainter.h: Added fillRect overload that takes QRect to match the real Qt one.
2663 * kwq/KWQPainter.mm: (QPainter::fillRect): Added overload that takes QRect.
2665 * kwq/KWQRect.mm: (QRect::QRect): Change default constructed QRect to have a width and
2666 height of 0 rather than 1. Contrary to what we believed earlier, this is what Qt does.
2668 2004-09-15 Darin Adler <darin@apple.com>
2672 - fixed <rdar://problem/3799512> REGRESSION (Mail): caret flashes 1 pixel too far to the left
2674 * khtml/rendering/render_text.cpp: (RenderText::caretRect): Added one to the horizontal position
2677 2004-09-15 Ken Kocienda <kocienda@apple.com>
2681 * khtml/editing/htmlediting_impl.cpp:
2682 (khtml::DeleteSelectionCommandImpl::doApply): The whitespace fixup code
2683 that makes sure proper whitespace renders after deletion was getting confused
2684 in cases where the deletion merged blocks. Basically, I needed to move some
2685 whitespace fixup code so it runs before deleting in the case where blocks
2686 need to be merged. It used to run after, and was getting confused by
2687 whitespace left over at the ends of the block after the deletion.
2688 * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Added.
2689 * layout-tests/editing/deleting/delete-block-merge-contents-012.html: Added.
2690 * layout-tests/editing/deleting/delete-block-merge-contents-013-expected.txt: Added.
2691 * layout-tests/editing/deleting/delete-block-merge-contents-013.html: Added.
2692 * layout-tests/editing/deleting/delete-block-merge-contents-014-expected.txt: Added.
2693 * layout-tests/editing/deleting/delete-block-merge-contents-014.html: Added.
2694 * layout-tests/editing/deleting/delete-block-merge-contents-015-expected.txt: Added.
2695 * layout-tests/editing/deleting/delete-block-merge-contents-015.html: Added.
2696 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt: Added.
2697 * layout-tests/editing/deleting/delete-block-merge-contents-016.html: Added.
2698 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Added.
2699 * layout-tests/editing/deleting/delete-block-merge-contents-017.html: Added.
2701 2004-09-15 Ken Kocienda <kocienda@apple.com>
2705 * khtml/editing/htmlediting_impl.cpp:
2706 (khtml::DeleteSelectionCommandImpl::moveNodesAfterNode): Renamed from moveNodesToBlock.
2707 Just some simplification and cleanup in this function.
2708 (khtml::DeleteSelectionCommandImpl::doApply): Remove a hunk of start-of-block code I thought
2709 I was going to get around to improving and refining. However, I no longer need this case.
2710 * khtml/editing/htmlediting_impl.h: Function name change.
2712 2004-09-14 Darin Adler <darin@apple.com>
2716 - added method for fix to <rdar://problem/3788894> REGRESSION (Mail): ctrl-t emacs key binding does not work (transpose)
2718 * kwq/WebCoreBridge.h: Added rangeOfCharactersAroundCaret.
2719 * kwq/WebCoreBridge.mm: (-[WebCoreBridge rangeOfCharactersAroundCaret]): Added.
2721 * khtml/xml/dom_caretposition.h: Added range function to make a Range from two CaretPosition objects.
2722 * khtml/xml/dom_caretposition.cpp:
2723 (DOM::CaretPosition::rangeCompliantEquivalent): Fixed a bug in this that caused it to screw up
2724 ranges in text nodes. Also changed it to use offset 0 as Ken and I discussed.
2725 (DOM::range): Added.
2727 * kwq/DOM.mm: (-[DOMRange description]): Added.
2729 2004-09-14 Darin Adler <darin@apple.com>
2733 - fixed <rdar://problem/3786986> REGRESSION: TEXTAREAs have extra wide right margins where the scrollbars used to be
2735 * kwq/KWQTextArea.mm:
2736 (-[KWQTextArea _updateTextViewWidth]): Renamed from _frameSizeChanged. Now uses the width of
2737 the size from the contentSize method rather than trying to compute a size.
2738 (-[KWQTextArea initWithFrame:]): Call method by new name.
2739 (-[KWQTextArea tile]): Override this instead of setFrame: to adjust the size as the size of
2740 the text area changes.
2742 2004-09-14 Chris Blumenberg <cblu@apple.com>
2744 Backed out my changes to these files. They were not meant to be checked. (I'm having a bad CVS day)
2746 * kwq/WebCoreBridge.h:
2747 * kwq/WebCoreBridge.mm:
2748 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]):
2749 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:]):
2750 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:]):
2751 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:]):
2753 2004-09-14 David Hyatt <hyatt@apple.com>
2755 Fix the crash in the layout tests caused by my recent selection changes. Simply eliminate the buggy
2756 selection border setting code and let isSelectionBorder be implemented in terms of the SelectionState.
2758 Reviewed by kocienda
2760 * khtml/rendering/render_canvas.cpp:
2761 (RenderCanvas::setSelection):
2762 * khtml/rendering/render_object.cpp:
2763 (RenderObject::RenderObject):
2764 (RenderObject::container):
2765 (RenderObject::isSelectionBorder):
2766 * khtml/rendering/render_object.h:
2767 (khtml::RenderObject::minMaxKnown):
2768 (khtml::RenderObject::setReplaced):
2770 2004-09-14 Chris Blumenberg <cblu@apple.com>
2772 Fixed: <rdar://problem/3778680> REGRESSION: plug-in content sometimes doesn't show up
2776 * khtml/html/html_objectimpl.cpp:
2777 (HTMLObjectElementImpl::parseHTMLAttribute): set needWidgetUpdate to true only if there is a renderer
2778 (HTMLObjectElementImpl::attach): if needWidgetUpdate is true, call updateWidget
2780 2004-09-14 Maciej Stachowiak <mjs@apple.com>
2784 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
2785 - updated escape/encodeURI layout test to match our new, more
2786 compatible behavior.
2788 * layout-tests/fast/js/global/encode-URI-test.html:
2790 2004-09-14 Ken Kocienda <kocienda@apple.com>
2796 <rdar://problem/3800834> REGRESSION (Mail): Can't delete backwards past quoted text using HTML editing
2798 * khtml/editing/htmlediting_impl.cpp:
2799 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Use CaretPosition class to get superior
2800 smarts about the selection to delete in the "start of block" case. This fixes the bug.
2801 While I was in the neighborhood, I cleaned up this function a bit.
2802 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Added.
2803 * layout-tests/editing/deleting/delete-3800834-fix.html: Added.
2805 2004-09-14 Ken Kocienda <kocienda@apple.com>
2807 * khtml/css/parser.cpp: Did not regenerate this file from parser.y before last checkin.
2809 2004-09-14 Chris Blumenberg <cblu@apple.com>
2811 Fixed typos in last check-in.
2813 * khtml/khtml_part.cpp:
2814 (KHTMLPart::selectClosestWordFromMouseEvent):
2815 (KHTMLPart::handleMousePressEventDoubleClick):
2816 * khtml/khtml_part.h:
2817 * kwq/KWQKHTMLPart.mm:
2818 (KWQKHTMLPart::sendContextMenuEvent):
2820 2004-09-09 David Hyatt <hyatt@apple.com>
2822 Fix for 3667862, regression where dragging of selection became really slow. This patch completely rewrites
2823 selection painting and drawing so that the enclosing rect is much more snug. The containing block rect is no
2826 Reviewed by kocienda
2828 * khtml/rendering/render_canvas.cpp:
2829 (RenderCanvas::selectionRect):
2831 (RenderCanvas::setSelection):
2832 (RenderCanvas::clearSelection):
2833 * khtml/rendering/render_canvas.h:
2834 * khtml/rendering/render_container.cpp:
2835 (RenderContainer::removeChildNode):
2836 * khtml/rendering/render_image.cpp:
2837 (RenderImage::selectionRect):
2838 (RenderImage::selectionTintColor):
2839 (RenderImage::paint):
2840 * khtml/rendering/render_image.h:
2841 * khtml/rendering/render_object.cpp:
2842 (RenderObject::selectionStartEnd):
2843 * khtml/rendering/render_object.h:
2844 (khtml::RenderObject::selectionRect):
2845 (khtml::RenderObject::SelectionInfo::object):
2846 (khtml::RenderObject::SelectionInfo::rect):
2847 (khtml::RenderObject::SelectionInfo::state):
2848 (khtml::RenderObject::SelectionInfo::SelectionInfo):
2849 (khtml::RenderObject::SelectionInfo::m_state):
2850 * khtml/rendering/render_text.cpp:
2851 (InlineTextBox::textObject):
2852 (InlineTextBox::selectionRect):
2853 (InlineTextBox::paintSelection):
2854 (RenderText::getAbsoluteRepaintRect):
2855 (RenderText::selectionRect):
2856 * khtml/rendering/render_text.h:
2857 * kwq/KWQPainter.mm:
2858 (getBlendedColorComponent):
2859 (QPainter::selectedTextBackgroundColor):
2861 2004-09-14 Ken Kocienda <kocienda@apple.com>
2867 <rdar://problem/3794376> vertical formatting lines that show quote level are missing
2869 Rolling out change Dave made to fix 3787686. It turns out that we do not want this
2870 change, as it does not appear to have any effect on the bug. In addition, it caused
2871 the regression in quote bar behavior.
2873 * khtml/css/parser.cp
2874 * khtml/css/parser.y
2876 2004-09-14 Chris Blumenberg <cblu@apple.com>
2878 Fixed: Control-click shouldn't cause deselect when clicking selection.
2882 * kwq/KWQKHTMLPart.mm:
2883 (KWQKHTMLPart::sendContextMenuEvent): don't attempt to select the closest word when the selection is clicked
2885 2004-09-14 Chris Blumenberg <cblu@apple.com>
2887 Fixed badness that my last patch caused. Because there was a conflict, my last patch added stuff that darin had just removed.
2891 * kwq/KWQKHTMLPart.mm:
2892 (KWQKHTMLPart::sendContextMenuEvent): don't call deref on the view
2894 2004-09-14 Chris Blumenberg <cblu@apple.com>
2896 Fixed: <rdar://problem/3783595> REGRESSION (Mail): control-click does not select closest word
2898 Reviewed by kocienda.
2900 * khtml/khtml_part.cpp:
2901 (KHTMLPart::selectionGranularity): new getter, need this for an upcoming patch
2902 (KHTMLPart::selectClosetWordFromMouseEvent): new, factored from handleMousePressEventDoubleClick
2903 (KHTMLPart::handleMousePressEventDoubleClick): call selectClosetWordFromMouseEvent
2904 * khtml/khtml_part.h:
2905 * kwq/KWQKHTMLPart.mm:
2906 (KWQKHTMLPart::sendContextMenuEvent): call selectClosetWordFromMouseEvent if nothing swallows the event
2908 2004-09-14 Ken Kocienda <kocienda@apple.com>
2914 <rdar://problem/3800346> Inserting newline in BR after block not working
2916 * khtml/editing/htmlediting_impl.cpp:
2917 (khtml::InputNewlineCommandImpl::doApply): The code to insert the "extra" BR at the end
2918 of blocks (hack done to make BRs show up when they appear at the ends of blocks) did not
2919 cover this one quirky case where the insertion point can be placed in a BR at the end of
2920 a block that does actually render. Now the input newline code can handle this addtional
2922 * layout-tests/editing/selection/insert-3800346-fix-expected.txt: Added.
2923 * layout-tests/editing/selection/insert-3800346-fix.html: Added.
2925 2004-09-14 Darin Adler <darin@apple.com>
2929 - fixed <rdar://problem/3479392> REGRESSION (Mail): select all does not select all at some pages
2931 * khtml/xml/dom_caretposition.cpp: (DOM::CaretPosition::deepEquivalent):
2932 Use caretMaxOffset instead of maxOffset when descending to the last node.
2933 Also change around the function a bit.
2935 2004-09-13 Darin Adler <darin@apple.com>
2939 - fixed <rdar://problem/3710123> Loading iframe that replaces content in the parent document crashes Safari (Oracle Portal)
2941 This is a more complete fix, but it requires the previous attempt at a fix for this same
2942 bug below, because this is only the "don't destroy the KHTMLPart" portion; other fixes are
2943 still needed to survive shutdown of the part.
2945 * khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::interpreter): Call the new keepAlive method.
2946 This is called whenever we're about to use an interpreter to run some JavaScript, and
2947 it's JavaScript that might destroy the part, hence the interpreter.
2949 * khtml/khtml_part.h: Added keepAlive() and slotEndLifeSupport() member functions.
2950 * khtml/khtmlpart_p.h: Added m_lifeSupportTimer.
2951 * khtml/khtml_part.cpp:
2952 (KHTMLPart::init): Connects m_lifeSupportTimer to slotEndLifeSupport.
2953 (KHTMLPart::write): Removed old attempt to work around this issue.
2954 (KHTMLPart::end): Ditto.
2955 (KHTMLPart::keepAlive): Added. References the part, then sets up a one-shot timer.
2956 (KHTMLPart::slotEndLifeSupport): Added. Stops the timer and then removes the reference
2957 from the part, possibly destroying it.
2960 (KWQSlot::KWQSlot): Added the new slot to the list of slots.
2961 (KWQSlot::call): Ditto.
2963 * kwq/KWQKHTMLPart.mm:
2964 (KWQKHTMLPart::sendResizeEvent): Removed an old attempt to work around this same issue.
2965 (KWQKHTMLPart::mouseDown): Ditto.
2966 (KWQKHTMLPart::mouseDragged): Ditto.
2967 (KWQKHTMLPart::mouseUp): Ditto.
2968 (KWQKHTMLPart::mouseMoved): Ditto.
2969 (KWQKHTMLPart::sendContextMenuEvent): Ditto.
2971 2004-09-13 Darin Adler <darin@apple.com>
2975 - fixed regression caused by change earlier today
2977 * khtml/xml/dom_selection.cpp: (DOM::Selection::modifyExtendingRightForward):
2978 Use CaretPosition for CHARACTER, not WORD.
2980 2004-09-13 Darin Adler <darin@apple.com>
2984 - fixed <rdar://problem/3798453> DIG failure: getting variable with same name as DOM element attribute gets attribute value instead
2986 * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): When adding current target and
2987 other event handler scope, put it below the existing scope chain. This ensures that things
2988 found in the function's scope will come before the event handler, as in other browsers.
2990 2004-09-13 Ken Kocienda <kocienda@apple.com>
2996 <rdar://problem/3798346> REGRESSION (125-162): crash pushing down arrow key on KLM.com site
2998 * khtml/xml/dom_position.cpp:
2999 (DOM::Position::nextLinePosition): This function was being called in a case where it was not expected
3000 until we traced the code. It has to do with some deeper issues associated with handling arrow keys,
3001 resulting in the editing arrow-down code running in a case where we are not editing. I discussed this
3002 with Darin, and we decided to handle the broader issues at a later date. The fix I am checking in
3003 here to fix the bug is merely avoiding a null-deref.
3005 2004-09-13 Ken Kocienda <kocienda@apple.com>
3011 <rdar://problem/3784840> REGRESSION (Mail): Text is inserted in the wrong place after changing typing style
3013 * khtml/editing/htmlediting_impl.cpp:
3014 (khtml::InputTextCommandImpl::prepareForTextInsertion): Code to handle typing style did not
3015 check to see if the reference node used for the DOM node insertion operation was a block.
3016 If it is, then the new node containing the new editing style now is inserted at the start of the block,
3017 instead of after it.
3019 2004-09-13 Ken Kocienda <kocienda@apple.com>
3021 Added a couple new layout tests to cover recent changes.
3023 * layout-tests/editing/editing.js: Added some new functions to do by-word selection movement.
3024 * layout-tests/editing/selection/move-backwords-by-word-001-expected.txt: Added.
3025 * layout-tests/editing/selection/move-backwords-by-word-001.html: Added.
3026 * layout-tests/editing/selection/selection-3748164-fix-expected.txt: Added.
3027 * layout-tests/editing/selection/selection-3748164-fix.html: Added.
3029 2004-09-13 Ken Kocienda <kocienda@apple.com>
3035 <rdar://problem/3765519> REGRESSION (Mail): word movement goes too far upstream at start of line
3037 * khtml/xml/dom_position.cpp:
3038 (DOM::Position::previousWordPosition): Use downstream position here when making final placement of caret.
3040 2004-09-13 Ken Kocienda <kocienda@apple.com>
3044 Various editing improvements, many focused on the improvements made possible by the
3045 new CaretPosition class.
3047 Includes fixes for these bugs:
3049 <rdar://problem/3748164> REGRESSION (Mail): Arrow navigation in typical mail message can result in stuck caret
3050 <rdar://problem/3782062> REGRESSION (Mail): option-delete can delete almost all of a message when it has trouble finding a word
3051 <rdar://problem/3790456> triple click does not select entire paragraph (folklore.org)
3053 * WebCore.pbproj/project.pbxproj: Added CaretPosition class files.
3054 * khtml/dom/dom2_range.h:
3055 (DOM::offsetInCharacters): Moved this helper here from khtml_text_operations.cpp. This
3056 function helps to determine how to interpret the offsets used in DOM Ranges.
3057 * khtml/editing/htmlediting_impl.cpp:
3058 (khtml::InputNewlineCommandImpl::doApply): Use CaretPosition class to make "end-of-block" determination.
3059 Also, fix a caret placement glitch in "case 1" in the code: Place the caret in the node after the inserted
3060 BR. This makes it show up in the right place.
3061 * khtml/khtml_part.cpp:
3062 (KHTMLPart::handleMousePressEventDoubleClick): Don't limit double-click and triple-click handling only to text nodes.
3063 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
3064 (KHTMLPart::selectAll): Use CaretPosition class to implement improved selectAll.
3065 * khtml/misc/khtml_text_operations.cpp:
3066 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): Make a fix to the initial state setting of
3067 m_handledChildren. This is true if the offset into the end node is 0, meaning that we do not want to descend
3068 into its children at all.
3069 * khtml/xml/dom_caretposition.cpp: Added.
3070 * khtml/xml/dom_caretposition.h: Added.
3071 * khtml/xml/dom_nodeimpl.cpp:
3072 (NodeImpl::traverseNextNode): Fix bugs with the stayWithin implementation. We could miss nodes we want to test
3073 due to an erroneous check of stayWithin when no such check is needed.
3074 (NodeImpl::traverseNextSibling): Ditto.
3075 (NodeImpl::traversePreviousNodePostOrder): Ditto.
3076 * khtml/xml/dom_position.cpp:
3077 (DOM::Position::Position): Remove spurious semi-colon.
3078 (DOM::Position::upstream): Move incoming Position to its equivalentDeepPosition. This is part of the transition
3079 that will make this code work better with increased use of CaretPosition.
3080 (DOM::Position::downstream): Ditto.
3081 (DOM::Position::atStartOfContainingEditableBlock): Removed. Dead code; was not being called.
3082 (DOM::Position::atStartOfRootEditableElement): Removed. Dead code; was not being called.
3083 (DOM::Position::isLastRenderedPositionInEditableBlock): Removed. Replaced with calls to CaretPosition class.
3084 (DOM::Position::inLastEditableInRootEditableElement): Removed. Dead code; was not being called.
3085 (DOM::Position::inFirstEditableInRootEditableElement): Removed. Was only being called by other code that has been removed.
3086 * khtml/xml/dom_position.h:
3087 * khtml/xml/dom_selection.cpp:
3088 (DOM::Selection::modifyExtendingRightForward): Moved implementation of CHARACTER case to use CaretPosition class instead
3089 of Position class helpers.
3090 (DOM::Selection::modifyMovingRightForward): Ditto.
3091 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
3092 (DOM::Selection::modifyMovingLeftBackward): Ditto.
3093 (DOM::Selection::validate): Made simplifications in code that used to call a concoction of Position class helpers to
3094 do the right thing. Now calls CaretPosition equivalents.
3096 2004-09-13 Ken Kocienda <kocienda@apple.com>
3098 This test was broken. The result is that it was not testing what it was supposed to
3099 be testing. I fixed the test and updated the expected results.
3101 * layout-tests/editing/selection/move-between-blocks-no-001-expected.txt
3102 * layout-tests/editing/selection/move-between-blocks-no-001.html
3104 2004-09-13 Ken Kocienda <kocienda@apple.com>
3110 <rdar://problem/3784835> REGRESSION (Mail): crash in DOM::ElementImpl::tagName inside delete text command code while editing a Mail message
3111 <rdar://problem/3788015> REGRESSION (Mail): Crash deleting before a blockquote
3112 <rdar://problem/3796366> REGRESSION (Mail): Crash Mail by deleting the right line from pasted HTML
3114 * khtml/editing/htmlediting_impl.cpp:
3115 (khtml::DeleteSelectionCommandImpl::doApply): All of these bugs are due to the same problem. When I
3116 made the delete command run even when the text is a caret (to make block merges work right when the
3117 caret is at the start of a block), I failed to handle one case when there might be no text to
3118 delete. This resulted in a call to the DeleteTextCommand with a zero-length deletion request.
3119 This is not supported. Now, I have added an additional test in this one place in the code that
3120 was causing all these failures.
3122 2004-09-12 Darin Adler <darin@apple.com>
3126 - fixed <rdar://problem/3797758> REGRESSION (155-156): Cannot tab between input fields at switchboard.com
3128 * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Use setFocus() instead of calling makeFirstResponder
3129 directly since it handles the case where the field editor has focus.
3131 2004-09-12 Darin Adler <darin@apple.com>
3135 - fixed <rdar://problem/3792082> zero character codes in UTF-16 input cause crash
3137 * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertUTF16): Fixed code that was using the wrong variable
3138 to decrement the input length, causing buffer overrun.
3140 2004-09-12 Darin Adler <darin@apple.com>
3144 - fixed <rdar://problem/3798240> computed style error log messages seen with numbers in the range 74-77
3146 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3147 Added implementations for CSS_PROP__KHTML_MARQUEE_INCREMENT, CSS_PROP_MAX_HEIGHT, CSS_PROP_MAX_WIDTH,
3148 CSS_PROP_MIN_HEIGHT, CSS_PROP_MIN_WIDTH, and CSS_PROP_VISIBILITY.
3150 2004-09-12 Darin Adler <darin@apple.com>
3152 * layout-tests/css1/text_properties/text-transform-expected.txt: Removed unused test result.
3154 2004-09-11 Maciej Stachowiak <mjs@apple.com>
3158 <rdar://problem/3787208> can't log in to SAP SDN site (JS parse error)
3161 (KURL::decode_string): Check for find result >= 0 instead of >0,
3162 to handle case of first character in a string being encoded.
3164 2004-09-09 Chris Blumenberg <cblu@apple.com>
3166 Support for: <rdar://problem/3795485> debug menu item to enable RSS animation on first layout
3170 * khtml/khtml_part.h:
3171 (KHTMLPart::didFirstLayout): new
3172 * khtml/khtmlview.cpp:
3173 (KHTMLView::layout): call didFirstLayout
3174 * kwq/KWQKHTMLPart.h:
3175 * kwq/KWQKHTMLPart.mm:
3176 (KWQKHTMLPart::didFirstLayout): new
3177 * kwq/WebCoreBridge.h:
3181 2004-09-09 Maciej Stachowiak <mjs@apple.com>
3183 - roll out the last change, it appears to cause a performance regression
3185 * khtml/rendering/render_box.cpp:
3186 (RenderBox::caretRect):
3187 * khtml/rendering/render_box.h:
3188 * khtml/rendering/render_br.cpp:
3189 (RenderBR::caretRect):
3190 * khtml/rendering/render_br.h:
3191 * khtml/rendering/render_flow.cpp:
3192 (RenderFlow::caretRect):
3193 * khtml/rendering/render_flow.h:
3194 * khtml/rendering/render_object.cpp:
3195 (RenderObject::caretRect):
3196 * khtml/rendering/render_object.h:
3197 * khtml/rendering/render_text.cpp:
3198 (RenderText::caretRect):
3199 * khtml/rendering/render_text.h:
3200 * kwq/WebCoreBridge.h:
3201 * kwq/WebCoreBridge.mm:
3203 2004-09-08 Maciej Stachowiak <mjs@apple.com>
3207 WebCore part of fix for:
3209 <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
3211 * kwq/WebCoreBridge.h:
3212 * kwq/WebCoreBridge.mm:
3213 (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
3214 DOMRange, or if the range is split into multiple lines, the rect for the part on
3215 the first line only.
3217 * khtml/rendering/render_object.cpp:
3218 (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
3219 for the overrides below.
3220 * khtml/rendering/render_object.h:
3221 * khtml/rendering/render_box.cpp:
3222 (RenderBox::caretRect):
3223 * khtml/rendering/render_box.h:
3224 * khtml/rendering/render_br.cpp:
3225 (RenderBR::caretRect):
3226 * khtml/rendering/render_br.h:
3227 * khtml/rendering/render_flow.cpp:
3228 (RenderFlow::caretRect):
3229 * khtml/rendering/render_flow.h:
3230 * khtml/rendering/render_text.cpp:
3231 (RenderText::caretRect):
3233 2004-09-06 Darin Adler <darin@apple.com>
3237 - fixed <rdar://problem/3790526> mark-related methods not implemented (needed for people with them in their key bindings files)
3239 * khtml/khtml_part.h: Added mark and setMark.
3240 * khtml/khtmlpart_p.h: Added m_mark.
3241 * khtml/khtml_part.cpp:
3242 (KHTMLPart::mark): Added.
3243 (KHTMLPart::setMark): Added.
3245 * kwq/KWQKHTMLPart.h: Change name of markedRange to markedTextRange to decrease
3246 the change it will be confused with the mark.
3247 * kwq/KWQKHTMLPart.mm:
3248 (KWQKHTMLPart::clear): Update for name change.
3249 (KWQKHTMLPart::markedTextRange): Ditto.
3250 (KWQKHTMLPart::setMarkedTextRange): Ditto.
3252 * khtml/rendering/render_text.cpp: (RenderText::paint): Update for name change.
3254 * kwq/WebCoreBridge.h: Remove setSelectionFrom, selectionStart, selectionStartOffset,
3255 selectionEnd, selectionEndOffset, and clearMarkedDOMRange. Renamed setMarkedDOMRange
3256 to setMarkedTextDOMRange and markedDOMRange to markedTextDOMRange. Added setMarkDOMRange
3257 and markDOMRange for the Emacs "mark".
3258 * kwq/WebCoreBridge.mm:
3259 (-[WebCoreBridge setMarkDOMRange:]): Added.
3260 (-[WebCoreBridge markDOMRange]): Added.
3261 (-[WebCoreBridge setMarkedTextDOMRange:]): Renamed.
3262 (-[WebCoreBridge markedTextDOMRange]): Renamed.
3264 * khtml/xml/dom_selection.cpp: (DOM::Selection::validate): Make paragraph positions
3265 canonical by using deep rendered positions. Maybe someday this won't be an ad hoc
3268 * khtml/xml/dom_nodeimpl.cpp: (NodeBaseImpl::removeChildren): Use ref and deref
3269 rather than the unconventional check for 0 refCount. This makes us a bit more
3270 robust against a node going away partway through the removal process.
3272 * WebCore.pbproj/project.pbxproj: Update MACOSX_DEPLOYMENT_TARGET to 10.3.
3274 2004-09-08 Maciej Stachowiak <mjs@apple.com>
3276 - fixed deployment build problems noticed by Grant
3278 * khtml/rendering/render_flow.cpp:
3279 (RenderFlow::caretRect):
3280 * khtml/rendering/render_text.cpp:
3281 (RenderText::caretRect):
3283 2004-09-08 David Hyatt <hyatt@apple.com>
3285 Fix XML so that elements with no namespace never make HTML elements (when their names coincidentally match).
3289 * khtml/xml/dom_docimpl.cpp:
3290 (DocumentImpl::createElementNS):
3292 2004-09-07 Maciej Stachowiak <mjs@apple.com>
3296 - renamed caretPos to caretRect and made it return a QRect instead
3297 of taking four out parameters by reference.
3299 * khtml/rendering/render_box.cpp:
3300 (RenderBox::caretRect):
3301 * khtml/rendering/render_box.h:
3302 * khtml/rendering/render_br.cpp:
3303 (RenderBR::caretRect):
3304 * khtml/rendering/render_br.h:
3305 * khtml/rendering/render_flow.cpp:
3306 (RenderFlow::caretRect):
3307 * khtml/rendering/render_flow.h:
3308 * khtml/rendering/render_object.cpp:
3309 (RenderObject::caretRect):
3310 * khtml/rendering/render_object.h:
3311 * khtml/rendering/render_text.cpp:
3312 (RenderText::caretRect):
3313 * khtml/rendering/render_text.h:
3314 * khtml/xml/dom_selection.cpp:
3315 (DOM::Selection::xPosForVerticalArrowNavigation):
3316 (DOM::Selection::layoutCaret):
3317 * kwq/WebCoreBridge.mm:
3318 (-[WebCoreBridge caretRectAtNode:offset:]):
3320 2004-09-07 Maciej Stachowiak <mjs@apple.com>
3324 <rdar://problem/3759209> REGRESSION (Mail): assertion failure when all of marked text deleted at start of document
3326 * kwq/KWQKHTMLPart.mm:
3327 (KWQKHTMLPart::setMarkedRange): Allow any empty range, even if
3328 it's not in a text node, since in this case it won't matter and
3329 weird things can happen when all marked text is removed, there
3330 might not be any text nodes.
3332 2004-09-07 David Hyatt <hyatt@apple.com>
3334 Initial text-decoration CSS3 work for editing. Just gets the properties and values parsed.
3338 * khtml/css/css_computedstyle.cpp:
3339 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3340 * khtml/css/cssparser.cpp:
3341 (CSSParser::parseValue):
3342 * khtml/css/cssproperties.c:
3345 * khtml/css/cssproperties.h:
3346 * khtml/css/cssproperties.in:
3347 * khtml/css/cssstyleselector.cpp:
3348 (khtml::CSSStyleSelector::adjustRenderStyle):
3349 * khtml/css/cssvalues.c: