1 2004-07-09 Ken Kocienda <kocienda@apple.com>
5 Updated some layout test results.
7 * layout-tests/editing/deleting/delete-image-004-expected.txt:
8 * layout-tests/editing/selection/extend-by-character-006-expected.txt:
10 2004-07-09 Chris Blumenberg <cblu@apple.com>
12 Allowed my change for 3715785 to compile on Jaguar.
16 * kwq/WebCoreBridge.h:
17 * kwq/WebCoreBridge.mm:
18 (-[WebCoreBridge domain]): new, allows access to the domain without using the DOM API which doesn't exist on Jaguar
20 2004-07-09 Ken Kocienda <kocienda@apple.com>
24 Some improvements to fix:
26 <rdar://problem/3723111> Caret not drawn when selection set to unrendered content
28 * khtml/editing/htmlediting_impl.cpp:
29 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Adjust selection to delete if
30 selected position is not rendered.
31 * khtml/rendering/render_block.cpp:
32 (khtml::RenderBlock::paintObject): Use new caretPosition() function on Selection to
33 figure out whether to paint.
34 * khtml/xml/dom_position.cpp:
35 (DOM::Position::previousCharacterPosition): Now correctly deals with a start
36 position that is not rendered.
37 (DOM::Position::nextCharacterPosition): Ditto.
38 (DOM::Position::closestRenderedPosition): New helper.
39 * khtml/xml/dom_position.h:
40 (DOM::): Moved in EAffinity from Selection header. Now used in closestRenderedPosition function.
41 * khtml/xml/dom_selection.cpp:
42 (DOM::Selection::Selection): Added new m_caretPosition member. This is the position of the caret
43 after a caret layout. This may be different from start or end if start and end are not rendered.
44 (DOM::Selection::init):
45 (DOM::Selection::modifyExtendingRightForward): New helper to clean up modify() and make it more readble.
46 (DOM::Selection::modifyMovingRightForward): Ditto.
47 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
48 (DOM::Selection::modifyMovingLeftBackward): Ditto.
49 (DOM::Selection::modify): Use new helpers to make this more readble.
50 (DOM::Selection::layoutCaret): Uses new closestRenderedPosition helper to place the caret if in unrendered
52 (DOM::Selection::paintCaret): Remove moveToRenderedContent. obsolete.
53 * khtml/xml/dom_selection.h:
54 (DOM::Selection::caretPosition): New accessor.
55 * kwq/WebCoreBridge.mm:
56 (-[WebCoreBridge setSelectedDOMRange:affinity:]): EAffinity no longer a member enum of Selection class.
58 2004-07-08 David Hyatt <hyatt@apple.com>
60 Fix for the table layout test that failed because of a change in how innerText worked. We need to do
61 updateLayout now when using innerText, since the method has been changed to use line boxes in the render tree
62 that might otherwise be out of date.
66 * khtml/html/html_elementimpl.cpp:
67 (HTMLElementImpl::innerText):
69 2004-07-08 John Sullivan <sullivan@apple.com>
73 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
74 now also extends selection (even if there wasn't one before)
76 * khtml/khtml_part.cpp:
77 (KHTMLPart::handleMousePressEventSingleClick):
78 if there's a URL associated with the event, don't extend the selection
80 2004-07-08 Ken Kocienda <kocienda@apple.com>
84 Added some helper functions which provide strings to display in the
85 Xcode debugger's variable inspector window. These functions are called
86 from the LabyrinthDataFormatter debugger plugin I just checked in to
87 the Labyrinth/Tools directory.
89 Note that these functions are compiled in on Development builds only.
91 * WebCore-combined.exp:
92 * WebCore-tests.exp: Export all the formatForDebugger symbols so the
93 debugger program can link with them.
94 * khtml/xml/dom2_rangeimpl.cpp:
95 (DOM::RangeImpl::formatForDebugger):
96 * khtml/xml/dom2_rangeimpl.h:
97 * khtml/xml/dom_elementimpl.cpp:
98 (ElementImpl::formatForDebugger):
99 * khtml/xml/dom_elementimpl.h:
100 * khtml/xml/dom_nodeimpl.cpp:
101 * khtml/xml/dom_nodeimpl.h:
102 * khtml/xml/dom_position.cpp:
103 (DOM::Position::formatForDebugger):
104 * khtml/xml/dom_position.h:
105 * khtml/xml/dom_selection.cpp:
106 (DOM::Selection::formatForDebugger):
107 * khtml/xml/dom_selection.h:
108 * khtml/xml/dom_textimpl.cpp:
109 (TextImpl::formatForDebugger):
110 * khtml/xml/dom_textimpl.h:
112 2004-07-08 John Sullivan <sullivan@apple.com>
116 - fixed <rdar://problem/3721544> crash increasing font size;
117 entrezeroetun.com (works in IE and Firefox)
119 * khtml/rendering/render_block.cpp:
120 (khtml::RenderBlock::updateFirstLetter):
121 Check for nil originalString() before dereffing
123 2004-07-08 David Hyatt <hyatt@apple.com>
125 Fix for 3721453, CSS3 initial property caused crashes because the macros were not written correctly.
129 * khtml/css/cssstyleselector.cpp:
133 2004-07-07 David Hyatt <hyatt@apple.com>
135 Fix for 3712133, crash from first-line pseudo-style use.
139 * khtml/css/cssstyleselector.cpp:
140 (khtml::CSSStyleSelector::styleForElement):
141 * khtml/css/cssstyleselector.h:
142 * khtml/rendering/render_object.cpp:
143 (RenderObject::getPseudoStyle):
145 2004-07-07 Ken Kocienda <kocienda@apple.com>
151 <rdar://problem/3716479> calling setInnerHTML during a webViewDidChange delegate call causes a crash
153 The fix involves some rearrangement of code in TypingCommand and TypingCommandImpl.
154 Formerly, new TypingCommands would apply themselves (which was a no-op) and then
155 do their action in some code a way different than other commands. This type of command
156 application is different than for all other commands since TypingCommands can be coalesced.
157 The crash occurred as a result of the "no-op" TypingCommand having the unconsidered
158 consequence of causing editing delegate notifications to be sent before the command
159 has actually run. This change takes a small step towards making TypingCommandImpl function like
160 other commands, where the command work is done in doApply. This makes the notification
161 happen in the right order.
163 * khtml/editing/htmlediting.cpp:
164 (khtml::TypingCommand::TypingCommand):
165 (khtml::TypingCommand::insertText):
166 (khtml::TypingCommand::insertNewline):
167 (khtml::TypingCommand::deleteKeyPressed):
168 * khtml/editing/htmlediting.h:
169 (khtml::TypingCommand::):
170 * khtml/editing/htmlediting_impl.cpp:
171 (khtml::TypingCommandImpl::TypingCommandImpl):
172 (khtml::TypingCommandImpl::doApply):
173 * khtml/editing/htmlediting_impl.h:
175 2004-07-06 Ken Kocienda <kocienda@apple.com>
179 * khtml/html/html_tableimpl.cpp:
180 (HTMLTableElementImpl::addChild): Added a better comment in the
181 code I just checked in a few minutes ago.
183 2004-07-06 Ken Kocienda <kocienda@apple.com>
189 <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply
190 due to non-0 exception code trying to insert a DIV markup string
192 The solution was to revert to the code that was rolled out, and removing
193 the child checks from NodeImpl::checkAddChild. However, this time, I added
194 code very similar to this check into the code that runs while HTML is
195 being parsed to build up tables. This code relies on child-add failure
196 to ensure the proper construction of well-formed tables (as gross as that
197 sounds), so the check needs to be retained there. No other code seems to
198 be so affected. Layout tests are unchanged by this patch.
200 * khtml/html/html_tableimpl.cpp:
201 (HTMLTableElementImpl::addChild):
202 * khtml/xml/dom_nodeimpl.cpp:
203 (NodeImpl::checkAddChild):
205 2004-07-06 Ken Kocienda <kocienda@apple.com>
209 Simple change. I switched the arguments of the appendNode helper function
210 and the AppendNodeCommand and AppendNodeCommandImpl classes. The node to
211 insert now comes before the parent node in the argument list. I did this
212 to make this function match the convention of others in the HTML editing code.
213 This was the only one that was "different" in the way that it ordered arguments.
214 As a result, I was always looking to see that I was passing things in the right
217 * khtml/editing/htmlediting.cpp:
218 (khtml::AppendNodeCommand::AppendNodeCommand):
219 (khtml::AppendNodeCommand::appendChild):
220 (khtml::AppendNodeCommand::parentNode):
221 * khtml/editing/htmlediting.h:
222 * khtml/editing/htmlediting_impl.cpp:
223 (khtml::CompositeEditCommandImpl::insertNodeAfter):
224 (khtml::CompositeEditCommandImpl::insertNodeAt):
225 (khtml::CompositeEditCommandImpl::appendNode):
226 (khtml::AppendNodeCommandImpl::AppendNodeCommandImpl):
227 (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl):
228 (khtml::AppendNodeCommandImpl::doApply):
229 (khtml::AppendNodeCommandImpl::doUnapply):
230 (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
231 (khtml::DeleteSelectionCommandImpl::doApply):
232 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition):
233 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition):
234 (khtml::InputTextCommandImpl::prepareForTextInsertion):
235 * khtml/editing/htmlediting_impl.h:
236 (khtml::AppendNodeCommandImpl::parentNode):
238 2004-07-06 Ken Kocienda <kocienda@apple.com>
242 Fixed several problems with traversal classes. For one, NodeIterators treat
243 FILTER_REJECT and FILTER_SKIP the same, since it treats the DOM tree as a
244 flat collection of nodes free of hierarchy. The code before this change did
245 not do this correctly. It sure pays to go back and read the specs. :)
247 Also, the code to traverse from node to node when filters were applied was
248 not working correctly. My first attemmpt to implement this was just plain
249 buggy, as I discovered when I tried to write tests for my WWDC talk. I have
250 settled on an implementation which is much simpler and worked for all the
253 * khtml/xml/dom2_traversalimpl.cpp:
254 (DOM::NodeIteratorImpl::findNextNode):
255 (DOM::NodeIteratorImpl::nextNode):
256 (DOM::NodeIteratorImpl::findPreviousNode):
257 (DOM::NodeIteratorImpl::previousNode):
258 (DOM::TreeWalkerImpl::parentNode):
259 (DOM::TreeWalkerImpl::firstChild):
260 (DOM::TreeWalkerImpl::lastChild):
261 (DOM::TreeWalkerImpl::previousSibling):
262 (DOM::TreeWalkerImpl::nextSibling):
263 (DOM::TreeWalkerImpl::previousNode):
264 (DOM::TreeWalkerImpl::nextNode):
265 (DOM::TreeWalkerImpl::ancestorRejected):
266 * khtml/xml/dom2_traversalimpl.h:
268 2004-07-06 Vicki Murley <vicki@apple.com>
270 Reviewed by kocienda.
272 - added backColorCommand, foreColorCommand, fontNameCommand,
275 * layout-tests/editing/editing.js:
277 2004-07-06 Trey Matteson <trey@apple.com>
279 3716053 - www.theage.com.au has extra back/forward items due to ads
281 This turned out to be easily fixed by generalizing the fix to 3438441. We prevent
282 addition to the b/f list not just during an onload event, but during any non-user
283 gesture, which includes top level script executing.
287 * kwq/KWQKHTMLPart.mm:
288 (KWQKHTMLPart::openURL): Only real change - prevent adding to b/f list if not
290 (KWQKHTMLPart::openURLRequest): Rename "onLoadEvent" to "userGesture", swap sense
291 (KWQKHTMLPart::submitForm): Ditto
292 (KWQKHTMLPart::urlSelected): Ditto
293 * kwq/KWQKHTMLPartBrowserExtension.mm:
294 (KHTMLPartBrowserExtension::createNewWindow): Ditto
295 * kwq/WebCoreBridge.h:
297 2004-07-02 Darin Adler <darin@apple.com>
301 - fixed half of <rdar://problem/3709244> utf-8 meta tag not parsed when page title contains angle brackets or if </meta> tag used
303 * khtml/misc/decoder.cpp: (Decoder::decode): Allow </meta> tags without deciding we
304 are done with the header.
306 2004-06-30 Trey Matteson <trey@apple.com>
308 Dragging within a web view should be allowed to start when the window isn't key.
310 A few months ago, Chris made this work, but it relied on the fact that all dragging
311 was done in WebKit. When WebCore got involved in dragging, it was broken. Now we
312 have a new scheme that gets it working again that properly involves WebCore.
314 The general idea is that when AK asks us whether to accept the first mouse and do
315 "delayed window ordering", we must consult WC to see if we might start a drag. In
316 addition, instead of these drags in non-active windows being started as a special
317 case in WK, they go through the normal WK-WC drag machinery.
321 * khtml/khtml_part.cpp:
322 (KHTMLPart::shouldDragAutoNode): New x,y args.
323 * khtml/khtml_part.h:
324 * khtml/rendering/render_object.cpp:
325 (RenderObject::draggableNode): Pass through new x,y args.
326 * khtml/rendering/render_object.h:
327 * kwq/KWQKHTMLPart.h:
328 (KWQKHTMLPart::setActivationEventNumber): New setter.
329 * kwq/KWQKHTMLPart.mm:
330 (KWQKHTMLPart::KWQKHTMLPart): Init new ivar.
331 (KWQKHTMLPart::eventMayStartDrag): New routine that checks if we might start
332 a drag in response to a mouseDown.
333 (KWQKHTMLPart::khtmlMouseMoveEvent): Pass x,y to the routine that finds a draggable
334 node. This eventually gets back up to WK's _mayStartDragAtEventLocation:.
335 Delay requirement when dragging the selection now implemented here.
336 (KWQKHTMLPart::khtmlMouseReleaseEvent): Must avoid changing the selection if we
337 wind up here as part of the first click in a window (because we started handling
338 the click to possible start a drag, but that never came through).
339 (KWQKHTMLPart::mouseDown): Save away event timestamp.
340 (KWQKHTMLPart::shouldDragAutoNode): Pass location up to WK instead of the
341 most recent event we stashed.
342 * kwq/WebCoreBridge.h:
343 * kwq/WebCoreBridge.mm:
344 (-[WebCoreBridge setActivationEventNumber:]): Trivial glue.
345 (-[WebCoreBridge eventMayStartDrag:]): Ditto.
347 2004-06-29 Trey Matteson <trey@apple.com>
349 Need to tighten up JS error checking for requesting drag props
354 * khtml/ecma/kjs_events.cpp:
355 (Clipboard::getValueProperty): Assert if someone somehow set
356 dropEffect or effectAllowed and it's a copy/paste clipboard
357 instead of a dragging clipboard.
358 (Clipboard::putValue): Don't let anyone set dropEffect or
359 effectAllowed on a copy/paste clipboard.
360 (ClipboardProtoFunc::tryCall): Disallow setting dragImage on
361 a copy/paste clipboard.
363 2004-06-29 Trey Matteson <trey@apple.com>
365 DHTML dragging - source should have access to the operation chosen
370 * kwq/KWQKHTMLPart.h:
371 * kwq/KWQKHTMLPart.mm:
372 (KWQKHTMLPart::dragSourceEndedAt): Set the destination's operation
374 * kwq/WebCoreBridge.mm:
375 (-[WebCoreBridge dragExitedWithDraggingInfo:]): For completeness
376 we set the source op for the ondragexit event.
377 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto for the
379 (-[WebCoreBridge dragSourceEndedAt:operation:]): Pass through of operation.
381 2004-06-24 Trey Matteson <trey@apple.com>
383 3710422 - REGRESSION: Safari crashes trying to send onbeforecut event at about://blank
385 Simple fix - don't try to send the event to the body element if we have no body element.
389 * kwq/KWQKHTMLPart.mm:
390 (KWQKHTMLPart::dispatchCPPEvent):
392 2004-06-24 Trey Matteson <trey@apple.com>
394 3704950 drag image in DB ConfigBar has horizontal graphics turd WebCore JavaScript
396 When we generate a drag image (or a selection image too, for that matter) we
397 translate the CTM using a CG call. Later, WebImageRenderer adjusts the pattern
398 phase based on the CTM of the focused view, which doesn't include our translate.
399 So we must inform WebKit about the additional phase adjustment.
403 * kwq/KWQKHTMLPart.mm: Tell WebKit about the phase adjustment.
404 (KWQKHTMLPart::imageFromRect):
405 * kwq/WebCoreGraphicsBridge.h:
406 * kwq/WebCoreGraphicsBridge.m:
407 (-[WebCoreGraphicsBridge setAdditionalPatternPhase:]): New routine to receive
408 the phase adjustment.
410 2004-06-24 Trey Matteson <trey@apple.com>
412 3679986 - screenX and screenY are flipped and relative to the bottom left of the WebView, rather than the screen
413 3699510 - synthesized click events have bogus screen coords
417 * khtml/khtmlview.cpp:
418 (KHTMLView::dispatchDragEvent): Generate screen coords for drag events using new func.
419 (KHTMLView::dispatchMouseEvent): Ditto.
421 * khtml/xml/dom_nodeimpl.cpp:
422 (NodeImpl::dispatchMouseEvent): Comment tricky semantics.
423 Calc screen coords in apple-specific way.
424 * kwq/KWQKHTMLView.mm:
425 (KHTMLView::viewportToGlobal): Passthrough to window widget.
426 * kwq/KWQScrollView.mm:
427 * kwq/KWQWindowWidget.h:
428 * kwq/KWQWindowWidget.mm:
429 (KWQWindowWidget::mapToGlobal): Call former code factored to new method below.
430 (KWQWindowWidget::viewportToGlobal): New method to convert "viewport" (which for us
431 really means NSWindow coords) to screen coords.
433 2004-06-24 Trey Matteson <trey@apple.com>
435 3693420 - onbeforecut and onbeforepaste need real implementaion
439 * kwq/KWQKHTMLPart.h:
440 * kwq/KWQKHTMLPart.mm:
441 (KWQKHTMLPart::mayCut): Dispatch event to DHTML.
442 (KWQKHTMLPart::mayCopy): Ditto
443 (KWQKHTMLPart::mayPaste): Ditto
444 (KWQKHTMLPart::tryCut): No more need to send fake onbefore event
445 (KWQKHTMLPart::tryCopy): Ditto
446 (KWQKHTMLPart::tryPaste): Ditto
447 * kwq/WebCoreBridge.h:
448 * kwq/WebCoreBridge.mm:
449 (-[WebCoreBridge mayDHTMLCut]): Standard glue
450 (-[WebCoreBridge mayDHTMLCopy]): Ditto
451 (-[WebCoreBridge mayDHTMLPaste]): Ditto
453 2004-06-24 Darin Adler <darin@apple.com>
457 - fixed <rdar://problem/3709385> Find on page doesn't find a string at the very end of the file
459 * khtml/misc/khtml_text_operations.cpp: (khtml::findPlainText): Rearrange loop to avoid an early
460 exit once we have all the characters we need, but are at the end of the range we are searching.
462 - fixed <rdar://problem/3102271>: (text areas have scroll bars even when they don't need them)
463 - fixed <rdar://problem/3665430>: (horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode)
465 * kwq/KWQTextArea.mm:
466 (-[KWQTextArea _configureTextViewForWordWrapMode]): Added. Helper method that sets up the
467 view for a new word wrap mode.
468 (-[KWQTextArea _createTextView]): Moved much of the code inside _configureTextViewForWordWrapMode.
469 (-[KWQTextArea _frameSizeChanged]): Added. Method shared by setFrame: and initWithFrame: to
470 avoid duplicate code that was there before. The old code also had redundant code to update
471 the text container size, but NSText handles that automatically.
472 (-[KWQTextArea initWithFrame:]): Set wrap to YES by default, which is the key to fixing bug 3665430.
473 Call setAutohidesScrollers:YES, which fixes bug 3102271. Also call the new _frameSizeChanged method.
474 (-[KWQTextArea setWordWrap:]): Call _configureTextViewForWordWrapMode instead of trying
475 to do the work here. The old version did both too little and too much.
476 (-[KWQTextArea setFrame:]): Call _frameSizeChanged instead of trying to do the work here.
477 The old version did both too little and too much.
479 2004-06-24 John Sullivan <sullivan@apple.com>
481 Darin made this change on my machine; I reviewed it.
483 - fixed <rdar://problem/3698333> Find on page doesn't find a particular string
484 with a newline in the source
486 * khtml/misc/khtml_text_operations.cpp:
487 (khtml::TextIterator::handleTextBox):
488 Clear m_lastTextNodeEndedWithCollapsedSpace after taking it into account.
490 2004-06-23 Richard Williamson <rjw@apple.com>
492 Implemented changes for latest npruntime.h.
496 * kwq/KWQKHTMLPart.h:
497 * kwq/KWQKHTMLPart.mm:
498 (KWQKHTMLPart::KWQKHTMLPart):
499 (KWQKHTMLPart::windowScriptNPObject):
500 (KWQKHTMLPart::getEmbedInstanceForView):
501 * kwq/WebCoreBridge.h:
502 * kwq/WebCoreBridge.mm:
503 (-[WebCoreBridge windowScriptObject]):
504 (-[WebCoreBridge windowScriptNPObject]):
506 2004-06-22 Richard Williamson <rjw@apple.com>
508 Fixed <rdar://problem/3707162>: accessing embeds[] plug-in interface may crash
510 embedInstance was uninitialized.
514 * khtml/html/html_objectimpl.cpp:
515 (HTMLEmbedElementImpl::HTMLEmbedElementImpl):
517 2004-06-18 John Sullivan <sullivan@apple.com>
521 - fixed <rdar://problem/3534851> Pop up windows not showing up within SAP's
522 BW Module (changing location.href on new window created by window.open)
524 * khtml/khtml_part.cpp:
525 (KHTMLPart::scheduleRedirection):
526 allow new redirect to win if delay <= current delay, not just <
528 === WebCore-146.1 ===
530 2004-06-18 Trey Matteson <trey@apple.com>
532 3702053 - DHTML dragging destination can't control the cursor (by setting the drop operation)
534 Fallout from security work, but an easy fix.
538 * kwq/KWQClipboard.mm:
539 (KWQClipboard::setDropEffect): Allow dest side to set dropEffect.
541 2004-06-18 Darin Adler <darin@apple.com>
545 - re-fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)
547 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
548 Check !isInlineFlow rather than checking hasMarkupTruncation. Otherwise, we break
549 plain old non-markup truncation.
551 2004-06-18 Darin Adler <darin@apple.com>
555 - fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)
557 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
558 Only walk the ellipsis list if hasMarkupTruncation is true.
562 2004-06-17 Richard Williamson <rjw@apple.com>
564 Fixed <rdar://problem/3698867> setting the canvas or parent to display:none and updating the causes a nil-deref
566 Ensured that we have a renderer before rendering.
570 * khtml/ecma/kjs_html.cpp:
571 (KJS::Context2DFunction::tryCall):
573 2004-06-17 David Hyatt <hyatt@apple.com>
575 Fix for 3674601, "Read More..." links should trail articles in Emerson.
579 * khtml/rendering/bidi.cpp:
580 (khtml::RenderBlock::layoutInlineChildren):
581 (khtml::RenderBlock::deleteEllipsisLineBoxes):
582 (khtml::RenderBlock::checkLinesForTextOverflow):
583 * khtml/rendering/render_block.cpp:
584 (khtml:::RenderFlow):
585 (khtml::RenderBlock::paintEllipsisBoxes):
586 (khtml::RenderBlock::nodeAtPoint):
587 (khtml::shouldCheckLines):
588 (khtml::getLineAtIndex):
589 (khtml::getHeightForLineCount):
590 (khtml::RenderBlock::lineAtIndex):
591 (khtml::RenderBlock::lineCount):
592 (khtml::RenderBlock::heightForLineCount):
593 (khtml::RenderBlock::clearTruncation):
594 * khtml/rendering/render_block.h:
595 (khtml::RenderBlock::setHasMarkupTruncation):
596 (khtml::RenderBlock::hasMarkupTruncation):
597 * khtml/rendering/render_flexbox.cpp:
598 (khtml::RenderFlexibleBox::layoutVerticalBox):
599 * khtml/rendering/render_line.cpp:
600 (khtml::EllipsisBox::m_str):
601 (khtml::InlineBox::adjustPosition):
602 (khtml::InlineFlowBox::adjustPosition):
603 (khtml::InlineFlowBox::clearTruncation):
604 (khtml::EllipsisBox::paint):
605 (khtml::EllipsisBox::nodeAtPoint):
606 (khtml::RootInlineBox::clearTruncation):
607 (khtml::RootInlineBox::placeEllipsis):
608 (khtml::RootInlineBox::paintEllipsisBox):
609 (khtml::RootInlineBox::hitTestEllipsisBox):
610 (khtml::RootInlineBox::adjustPosition):
611 (khtml::RootInlineBox::childRemoved):
612 * khtml/rendering/render_line.h:
613 (khtml::InlineBox::clearTruncation):
614 * khtml/rendering/render_text.cpp:
615 * khtml/rendering/render_text.h:
616 (khtml::InlineTextBox::clearTruncation):
618 2004-06-17 Trey Matteson <trey@apple.com>
620 3698514 - coordinates in ondragstart and ondrag events are wrong
622 This part fixes the ondragstart coords. We salt away the window-based mouseDown
623 location, since we need that when we dispatch the ondragstart event. Previously
624 we were errantly using a mouseDown point that had already been converted to view
625 coords, and then the dispatch converted it again.
629 * kwq/KWQKHTMLPart.h:
630 * kwq/KWQKHTMLPart.mm:
631 (KWQKHTMLPart::khtmlMouseMoveEvent): Use window based mouse event coords to dispatch event.
632 (KWQKHTMLPart::mouseDown): Save window based mouse event coords .
634 2004-06-16 David Hyatt <hyatt@apple.com>
636 Fix for 3596620, implement a subset of CSS3 text truncation for Emerson.
640 * khtml/rendering/bidi.cpp:
641 (khtml::RenderBlock::checkLinesForTextOverflow):
642 * khtml/rendering/font.cpp:
643 (Font::checkSelectionPoint):
644 * khtml/rendering/font.h:
645 * khtml/rendering/render_block.cpp:
646 (khtml::RenderBlock::paintObject):
647 (khtml::RenderBlock::paintFloats):
648 (khtml::RenderBlock::paintEllipsisBoxes):
649 * khtml/rendering/render_block.h:
650 * khtml/rendering/render_line.cpp:
651 (InlineBox::canAccommodateEllipsis):
652 (InlineBox::placeEllipsisBox):
653 (InlineFlowBox::paintDecorations):
654 (InlineFlowBox::placeEllipsisBox):
655 (EllipsisBox::paint):
656 (RootInlineBox::placeEllipsis):
657 (RootInlineBox::placeEllipsisBox):
658 * khtml/rendering/render_line.h:
659 (khtml::EllipsisBox::m_str):
660 (khtml::RootInlineBox::ellipsisBox):
661 * khtml/rendering/render_text.cpp:
662 (InlineTextBox::placeEllipsisBox):
663 (InlineTextBox::paintDecoration):
664 (InlineTextBox::offsetForPosition):
665 (RenderText::positionForCoordinates):
667 * khtml/rendering/render_text.h:
668 * kwq/KWQFontMetrics.h:
669 * kwq/KWQFontMetrics.mm:
670 (QFontMetrics::checkSelectionPoint):
671 * kwq/WebCoreTextRenderer.h:
673 === WebCore-145.1 ===
675 2004-06-16 Maciej Stachowiak <mjs@apple.com>
679 <rdar://problem/3697602> REGRESSION (144.2-TOT) Selection highlight does not draw
681 * khtml/rendering/render_canvas.cpp:
682 (RenderCanvas::setSelection):
686 2004-06-16 Richard Williamson <rjw@apple.com>
688 Fixed 3695730: Added support for embeds[], much like
689 applets[], to allow access to a plugin's exported interface.
693 * khtml/dom/html_document.cpp:
694 (HTMLDocument::embeds):
695 * khtml/dom/html_document.h:
696 * khtml/ecma/kjs_dom.cpp:
697 (KJS::getRuntimeObject):
698 * khtml/ecma/kjs_html.cpp:
699 (KJS::HTMLDocument::tryGet):
700 (KJS::HTMLElement::tryGet):
701 (KJS::HTMLCollection::tryGet):
702 (KJS::HTMLCollection::getNamedItems):
703 * khtml/ecma/kjs_html.h:
704 (KJS::HTMLDocument::):
705 * khtml/ecma/kjs_html.lut.h:
707 * khtml/html/html_miscimpl.cpp:
708 (HTMLCollectionImpl::calcLength):
709 (HTMLCollectionImpl::getItem):
710 (HTMLCollectionImpl::getNamedItem):
711 * khtml/html/html_miscimpl.h:
712 (DOM::HTMLCollectionImpl::):
713 * khtml/html/html_objectimpl.cpp:
714 (HTMLEmbedElementImpl::getEmbedInstance):
715 * khtml/html/html_objectimpl.h:
716 * kwq/KWQKHTMLPart.h:
717 * kwq/KWQKHTMLPart.mm:
718 (KWQKHTMLPart::getEmbedInstanceForView):
720 2004-06-15 Maciej Stachowiak <mjs@apple.com>
724 <rdar://problem/3695907>: (can't enable selection inside parent where it is disabled via CSS)
726 * khtml/css/cssparser.cpp:
727 (CSSParser::parseValue):
728 * khtml/css/cssstyleselector.cpp:
729 (khtml::CSSStyleSelector::applyProperty):
730 * khtml/rendering/render_object.cpp:
731 (RenderObject::shouldSelect):
732 * khtml/rendering/render_style.h:
734 (khtml::RenderStyle::userSelect):
735 (khtml::RenderStyle::setUserSelect):
736 (khtml::RenderStyle::initialUserSelect):
738 2004-06-15 David Hyatt <hyatt@apple.com>
740 Initial impl of the EllipsisBox. This code just gets the box created and gets it placed vertically. The next
741 stage will be to position the box horizontally as well.
745 * khtml/rendering/bidi.cpp:
746 (khtml::RenderBlock::checkLinesForTextOverflow):
747 * khtml/rendering/render_line.cpp:
748 (RootInlineBox::placeEllipsis):
749 * khtml/rendering/render_line.h:
750 (khtml::EllipsisBox::m_str):
752 2004-06-15 David Hyatt <hyatt@apple.com>
754 Implement canAccommodateEllipsis. The basic idea is that everything on a line will allow an ellipsis to be
755 drawn on top of it unless it's a replaced element. Then, if the replaced element overlaps, the ellipsis won't
760 * khtml/rendering/bidi.cpp:
761 (khtml::RenderBlock::checkLinesForTextOverflow):
762 * khtml/rendering/render_line.cpp:
763 (InlineBox::closestLeafChildForXPos):
764 (InlineBox::canAccommodateEllipsis):
765 (InlineFlowBox::canAccommodateEllipsis):
766 (RootInlineBox::canAccommodateEllipsis):
767 * khtml/rendering/render_line.h:
769 2004-06-15 Vicki Murley <vicki@apple.com>
771 - added a few layout tests, rdar://3694510
773 * layout-tests/editing/deleting/delete-image-004-expected.txt: Added.
774 * layout-tests/editing/deleting/delete-image-004.html: Added.
775 * layout-tests/editing/selection/extend-by-character-006-expected.txt: Added.
776 * layout-tests/editing/selection/extend-by-character-006.html: Added.
778 2004-06-15 Trey Matteson <trey@apple.com>
780 Dragging tweak: We pass the mouse down coords instead of the
781 latest mouse drag coords to the ondragstart event. This makes it
782 easy for the client to figure the correct drag image offset,
783 whereas the mouse drag location is next to useless for that.
787 * kwq/KWQKHTMLPart.mm:
788 (KWQKHTMLPart::khtmlMouseMoveEvent):
790 2004-06-15 Maciej Stachowiak <mjs@apple.com>
794 <rdar://problem/3685236>: (Safari does not support onselectstart event handler)
796 * khtml/ecma/kjs_dom.cpp:
797 (DOMNode::getValueProperty):
799 * khtml/ecma/kjs_dom.h:
801 * khtml/ecma/kjs_dom.lut.h:
803 * khtml/html/html_elementimpl.cpp:
804 (HTMLElementImpl::parseHTMLAttribute):
805 * khtml/misc/htmlattrs.c:
808 * khtml/misc/htmlattrs.h:
809 * khtml/misc/htmlattrs.in:
810 * khtml/rendering/render_object.cpp:
811 (RenderObject::shouldSelect):
812 * khtml/xml/dom2_eventsimpl.cpp:
813 (EventImpl::typeToId):
814 (EventImpl::idToType):
815 * khtml/xml/dom2_eventsimpl.h:
818 2004-06-15 Maciej Stachowiak <mjs@apple.com>
822 Fix crash with last checkin.
824 * khtml/ecma/kjs_binding.cpp:
825 (ScriptInterpreter::domObjectsPerDocument): check the same
826 property we want to initialize.
828 2004-06-15 Maciej Stachowiak <mjs@apple.com>
832 <rdar://problem/3685309>: (properties not shared for JS wrappers of same DOM object, accessed from different frames)
834 * khtml/ecma/kjs_binding.cpp:
835 (ScriptInterpreter::domObjects):
836 (ScriptInterpreter::domObjectsPerDocument):
837 (ScriptInterpreter::ScriptInterpreter):
838 (ScriptInterpreter::forgetDOMObject):
839 (ScriptInterpreter::getDOMObjectForDocument):
840 (ScriptInterpreter::putDOMObjectForDocument):
841 (ScriptInterpreter::deleteDOMObjectsForDocument):
842 (ScriptInterpreter::mark):
843 (ScriptInterpreter::forgetDOMObjectsForDocument):
844 (ScriptInterpreter::updateDOMObjectDocument):
845 * khtml/ecma/kjs_binding.h:
846 (KJS::ScriptInterpreter::getDOMObject):
847 (KJS::ScriptInterpreter::putDOMObject):
848 (KJS::ScriptInterpreter::deleteDOMObject):
850 2004-06-15 Darin Adler <darin@apple.com>
852 - rolled out Ken's fix for <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply due to non-0 exception code trying to insert a DIV markup string
853 (it was making most layout tests fail)
855 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::checkAddChild): Rolled check back in.
857 2004-06-15 David Hyatt <hyatt@apple.com>
859 Add a truncation variable to text run boxes that will eventually be used to know how to cut out some of the glyphs when
864 * khtml/rendering/render_text.cpp:
865 (RenderText::clearTextOverflowTruncation):
866 * khtml/rendering/render_text.h:
867 (khtml::InlineTextBox:::InlineRunBox):
868 (khtml::InlineTextBox::clearTruncation):
870 2004-06-14 Darin Adler <darin@apple.com>
874 - fixed some things for GC that Patrick missed, or that happened after the branch
877 (-[DOMStyleSheet finalize]): Added.
878 (-[DOMStyleSheetList finalize]): Added.
879 (-[DOMCSSStyleSheet finalize]): Added.
880 (-[DOMMediaList finalize]): Added.
881 (-[DOMCSSRuleList finalize]): Added.
882 (-[DOMCSSRule finalize]): Added.
883 (-[DOMCSSStyleDeclaration finalize]): Added.
884 (-[DOMCSSValue finalize]): Added.
885 (-[DOMRGBColor finalize]): Added.
886 (-[DOMRect finalize]): Added.
887 (-[DOMCounter finalize]): Added.
889 (-[DOMObject finalize]): Added.
890 (-[DOMNode finalize]): Added.
891 (-[DOMNamedNodeMap finalize]): Added.
892 (-[DOMNodeList finalize]): Added.
893 (-[DOMImplementation finalize]): Added.
894 (-[DOMRange finalize]): Added.
895 (-[DOMNodeFilter finalize]): Added.
896 (-[DOMNodeIterator finalize]): Added.
897 (-[DOMTreeWalker dealloc]): Removed unneeded nil check.
898 (-[DOMTreeWalker finalize]): Added.
900 (-[DOMHTMLCollection finalize]): Added.
901 (-[DOMHTMLOptionsCollection finalize]): Added.
902 * kwq/KWQClipboard.mm:
903 (KWQClipboard::KWQClipboard): Use KWQRetain instead of retain.
904 (KWQClipboard::~KWQClipboard): Use KWQRelease instead of release.
905 * kwq/KWQEditCommand.mm:
906 (-[KWQEditCommand finalize]): Added.
908 (QFont::~QFont): Use KWQRelease instead of release.
909 * kwq/KWQKHTMLPart.mm:
910 (KWQKHTMLPart::keyEvent): Use KWQRetain instead of retain, and KWQRelease instead of release.
911 (KWQKHTMLPart::mouseDown): Use KWQRetain instead of retain, and KWQRelease instead of release.
912 (KWQKHTMLPart::mouseDragged): Use KWQRetain instead of retain, and KWQRelease instead of release.
913 (KWQKHTMLPart::mouseUp): Use KWQRetain instead of retain, and KWQRelease instead of release.
914 (KWQKHTMLPart::mouseMoved): Use KWQRetain instead of retain, and KWQRelease instead of release.
915 (KWQKHTMLPart::sendContextMenuEvent): Use KWQRetain instead of retain, and KWQRelease instead of release.
916 * kwq/KWQPageState.mm:
917 (-[KWQPageState finalize]): Added. Filed <rdar://problem/3694163> about the fact that this is not right.
919 (-[KWQSingleShotTimerTarget finalize]): Added.
920 * kwq/WebCoreBridge.mm:
921 (-[WebCoreBridge finalize]): Added. Filed <rdar://problem/3694165> about the fact that this is not right.
923 2004-06-15 David Hyatt <hyatt@apple.com>
925 Initial work on text truncation. Working top-down, I think I've made all the changes I will need to bidi.cpp
926 and to the block code itself. The rest of the code can be concentrated in the render_line and render_text files.
930 * khtml/rendering/bidi.cpp:
931 (khtml::RenderBlock::layoutInlineChildren):
932 (khtml::RenderBlock::findNextLineBreak):
933 (khtml::RenderBlock::deleteEllipsisLineBoxes):
934 (khtml::RenderBlock::checkLinesForTextOverflow):
935 * khtml/rendering/render_block.h:
936 * khtml/rendering/render_line.cpp:
937 (RootInlineBox::detach):
938 (RootInlineBox::detachEllipsisBox):
939 (RootInlineBox::canAccommodateEllipsis):
940 (RootInlineBox::placeEllipsis):
941 * khtml/rendering/render_line.h:
942 (khtml::RootInlineBox::RootInlineBox):
943 * khtml/rendering/render_text.cpp:
944 (RenderText::clearTextOverflowTruncation):
945 * khtml/rendering/render_text.h:
947 2004-06-14 Trey Matteson <trey@apple.com>
949 3692690 - REGRESSION: canceling drag from WebView cause link to load
950 Just need to take extra care to cancel any click handling in
951 all cases once we're committed to doing the drag.
955 * kwq/KWQKHTMLPart.mm:
956 (KWQKHTMLPart::khtmlMouseMoveEvent): Call invalidateClick once
957 we're past the hysteresis point, and definitely going to try
958 to start a drag and drop.
960 2004-06-14 Darin Adler <darin@apple.com>
962 - fixed crash on boot
964 * kwq/KWQFoundationExtras.h: (KWQRetainNSRelease):
965 Fixed return value of this method; was uninitialized.
967 2004-06-14 Trey Matteson <trey@apple.com>
969 Dashboard wants access to pastboard data during the drag gesture.
971 We address this need be allowing docs that are local files to access the
972 pasteboard data during a drag, while other pages can only get at the types
973 list until the drop happens. This is deemed safe because local files already
974 have such broad super powers.
980 (KURL::isLocalFile): Implement this QT method to look for the file scheme.
981 * kwq/WebCoreBridge.mm:
982 (-[WebCoreBridge dragOperationForDraggingInfo:]): Use more relaxed clipboard
983 security for local file pages.
984 (-[WebCoreBridge dragExitedWithDraggingInfo:]): Ditto.
986 2004-06-14 Darin Adler <darin@apple.com>
988 Reviewed by me, code changes by Patrick Beard.
990 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
992 * WebCore.pbproj/project.pbxproj: Added KWQFoundationExtras.h.
993 * kwq/KWQFoundationExtras.h: Added.
994 (KWQRetain): Cover for CFRetain that is tolerant of nil.
995 (KWQRelease): Cover for CFRelease that is tolerant of nil.
996 (KWQRetainNSRelease): Combination of a CFRetain and an -[NSObject release] that is tolerant of nil.
997 Also includes a declaration of finalize so we can call [super finalize] without warnings on Panther.
1000 (ObjCNodeFilterCondition::ObjCNodeFilterCondition): Use CFRetain instead of retain.
1001 (ObjCNodeFilterCondition::~ObjCNodeFilterCondition): Use CFRelease instead of release.
1002 * kwq/KWQComboBox.mm:
1003 (QComboBox::~QComboBox): Use KWQRelease instead of release.
1004 (QComboBox::setFont): Use KWQRelease instead of release.
1005 (QComboBox::labelFont): Use KWQRetain instead of retain.
1007 (QCursor::QCursor): Use KWQRetain instead of retain.
1008 (QCursor::~QCursor): Use KWQRelease instead of release.
1009 (QCursor::operator=): More of the same.
1010 * kwq/KWQFileButton.mm:
1011 (KWQFileButton::KWQFileButton): Use KWQRetainNSRelease to retain a newly-allocated object.
1012 (KWQFileButton::~KWQFileButton): Use CFRelease instead of release.
1014 (QFont::QFont): Use KWQRetain instead of retain.
1015 (QFont::operator=): More of the same.
1016 (QFont::setFamily): Use KWQRelease instead of release.
1017 (QFont::setFirstFamily): Use KWQRelease instead of release.
1018 (QFont::setPixelSize): Use KWQRelease instead of release.
1019 (QFont::setWeight): Use KWQRelease instead of release.
1020 (QFont::setItalic): Use KWQRelease instead of release.
1021 (QFont::getNSFont): Use KWQRetain instead of retain.
1022 * kwq/KWQFontMetrics.mm:
1023 (QFontMetricsPrivate::~QFontMetricsPrivate): Use KWQRelease instead of release.
1024 (QFontMetricsPrivate::getRenderer): Use KWQRetain instead of retain.
1025 (QFontMetricsPrivate::setFont): Use KWQRelease instead of release.
1026 * kwq/KWQKHTMLPart.mm:
1027 (KWQKHTMLPart::~KWQKHTMLPart): Use KWQRelease instead of release.
1028 (KWQKHTMLPart::clearRecordedFormValues): Use KWQRelease instead of release.
1029 (KWQKHTMLPart::recordFormValue): Use KWQRetainNSRelease and use KWQRetain instead of retain.
1030 (KWQKHTMLPart::windowScriptObject): Use KWQRetainNSRelease.
1031 * kwq/KWQKJobClasses.mm:
1032 (KIO::TransferJobPrivate::TransferJobPrivate): Use KWQRetainNSRelease.
1033 (KIO::TransferJobPrivate::~TransferJobPrivate): Use KWQRelease instead of release.
1034 (KIO::TransferJob::setLoader): More of the same.
1036 (KWQRetainResponse): Use KWQRetain instead of retain.
1037 (KWQReleaseResponse): Use KWQRelease instead of release.
1038 * kwq/KWQPainter.mm:
1039 (QPainterPrivate::~QPainterPrivate): Use KWQRelease instead of release.
1040 (QPainter::_updateRenderer): More of the same.
1041 (QPainter::initFocusRing): Use KWQRetainNSRelease.
1042 (QPainter::clearFocusRing): Use KWQRelease instead of release.
1044 (QPixmap::QPixmap): Use KWQRetain instead of retain.
1045 (QPixmap::~QPixmap): Use KWQRelease instead of release.
1046 (QPixmap::receivedData): Use KWQRetain instead of retain.
1047 (QPixmap::resize): Use KWQRetainNSRelease and use KWQRelease instead of release.
1048 (QPixmap::operator=): More of the same.
1050 (QRegion::QRegion): Use KWQRetain instead of retain.
1051 (QRegion::~QRegion): Use KWQRelease instead of release.
1052 (QRegion::operator=): More of the same.
1054 (QTimer::start): Use KWQRetain instead of retain.
1055 (QTimer::stop): Use KWQRelease instead of release.
1056 (QTimer::fire): Use KWQRelease instead of release.
1058 (QWidget::QWidget): Use KWQRetain instead of retain.
1059 (QWidget::~QWidget): Use KWQRelease instead of release.
1060 (QWidget::setView): More of the same.
1061 * kwq/WebCoreSettings.mm: (-[WebCoreSettings finalize]):
1062 Delete the storage here, as well as in dealloc.
1064 2004-06-14 Maciej Stachowiak <mjs@apple.com>
1068 <rdar://problem/3693818>: (Safari should use CG calls for circle drawing for better performance)
1070 * kwq/KWQPainter.mm:
1071 (QPainter::drawEllipse): Use CG calls instead of NS calls for faster circle drawing.
1072 (QPainter::drawArc): Ditto.
1074 2004-06-14 Ken Kocienda <kocienda@apple.com>
1080 <rdar://problem/3690115> Crash deleting text out of iChat's profile (an editable Webview)
1082 * khtml/html/html_elementimpl.cpp:
1083 (HTMLElementImpl::isFocusable): Added null-check of parent node before deref'ing it.
1085 2004-06-14 Trey Matteson <trey@apple.com>
1087 Two tweaks to recently added "drag" pseudo-class, as suggested by
1088 Dave. The class is renamed to "-khtml-drag", and we update layout
1089 when using it, instead of only updating styles.
1093 * khtml/css/css_base.cpp:
1094 (CSSSelector::extractPseudoType):
1095 * kwq/KWQKHTMLPart.mm:
1096 (KWQKHTMLPart::snapshotDragImage):
1098 2004-06-13 Trey Matteson <trey@apple.com>
1100 Support for DHTML cut/copy/paste. We now support oncut, oncopy, onpaste. The events
1101 are sent to the first node in the selection, or else the body. Current holes are
1102 that we do not send events for operations in text fields or text areas (because it
1103 is hard to get the right hooks into the AppKit).
1105 We also send onbeforecut, onbeforecopy, onbeforepaste before the other events, which
1106 isn't really WinIE compatible, but is close. WinIE uses these to enable cut/paste
1107 menu items in its UI. DB doesn't need this for now.
1111 * khtml/ecma/kjs_dom.cpp:
1112 (DOMNode::getValueProperty): Boilerplate for new events
1113 (DOMNode::putValue): Boilerplate for new events
1114 * khtml/ecma/kjs_dom.h:
1115 (KJS::DOMNode::): Boilerplate for new events
1116 * khtml/ecma/kjs_dom.lut.h:
1117 * khtml/ecma/kjs_events.cpp:
1118 (DOMEvent::DOMEvent): "dataTransfer" and "clipboardData" properties are conditionally
1119 defined on DOMEvent, depending on if the event is a dragging or clipboard event.
1120 (DOMMouseEvent::mark): Pass mark along to any clipboard object we have.
1121 (DOMEvent::getValueProperty): Return "dataTransfer" or "clipboardData".
1122 (DOMMouseEvent::getValueProperty): Returning "dataTransfer" now handled by
1124 * khtml/ecma/kjs_events.h:
1126 (KJS::DOMMouseEvent::DOMMouseEvent):
1127 (KJS::DOMMouseEvent::):
1128 (KJS::DOMMouseEvent::toMouseEvent):
1129 * khtml/ecma/kjs_events.lut.h:
1130 * khtml/html/html_elementimpl.cpp:
1131 (HTMLElementImpl::parseHTMLAttribute): Boilerplate for new events
1132 * khtml/misc/htmlattrs.c:
1133 * khtml/misc/htmlattrs.h:
1134 * khtml/misc/htmlattrs.in: Boilerplate for new events
1135 * khtml/xml/dom2_eventsimpl.cpp:
1136 (EventImpl::typeToId): Boilerplate for new events
1137 (EventImpl::idToType): Boilerplate for new events
1138 (EventImpl::isDragEvent): New utility
1139 (EventImpl::isClipboardEvent): New utility
1140 (MouseEventImpl::isDragEvent): New utility
1141 (ClipboardEventImpl::ClipboardEventImpl): ref optional clipboard
1142 (ClipboardEventImpl::~ClipboardEventImpl): deref optional clipboard
1143 (ClipboardEventImpl::isClipboardEvent): New utility
1144 * khtml/xml/dom2_eventsimpl.h:
1145 (DOM::EventImpl::): Boilerplate for new events
1146 (DOM::ClipboardEventImpl::clipboard):
1147 * kwq/KWQClipboard.h: Monkey business so this file is includable in C++.
1148 * kwq/KWQClipboard.mm:
1149 * kwq/KWQKHTMLPart.h:
1150 * kwq/KWQKHTMLPart.mm:
1151 (KWQKHTMLPart::dispatchCPPEvent): Send one of the new events.
1152 (KWQKHTMLPart::tryCut): Declare pasteboard types, send cut events.
1153 (KWQKHTMLPart::tryCopy): Declare pasteboard types, send copy events.
1154 (KWQKHTMLPart::tryPaste): Send paste events.
1155 * kwq/WebCoreBridge.h:
1156 * kwq/WebCoreBridge.mm:
1157 (-[WebCoreBridge tryDHTMLCut]): Pass through to part
1158 (-[WebCoreBridge tryDHTMLCopy]): Ditto
1159 (-[WebCoreBridge tryDHTMLPaste]): Ditto
1161 2004-06-14 Trey Matteson <trey@apple.com>
1163 A new CSS pseudo-class ".drag" is added. Analogous to the "hover" class,
1164 this class determines styles used while an element is generating a drag
1169 * khtml/css/css_base.cpp:
1170 (CSSSelector::extractPseudoType): Boilerplate for adding new class.
1171 * khtml/css/css_base.h: Boilerplate for adding new class.
1172 * khtml/css/cssstyleselector.cpp:
1173 (khtml::CSSStyleSelector::checkOneSelector): Match new class against
1174 elements being dragged.
1175 * khtml/css/cssstyleselector.h:
1176 (khtml::StyleSelector::): Boilerplate for adding new class.
1177 * khtml/rendering/render_object.cpp:
1178 (RenderObject::RenderObject): Init new member.
1179 (RenderObject::isDragging): Return whether this object is being dragged.
1180 (RenderObject::updateDragState): Paint us an all children with a new dragged state.
1181 * khtml/rendering/render_object.h:
1182 * khtml/rendering/render_style.h: Boilerplate for adding new class.
1183 (khtml::RenderStyle::NonInheritedFlags::operator==):
1184 (khtml::RenderStyle::setBitDefaults):
1185 (khtml::RenderStyle::affectedByDragRules):
1186 (khtml::RenderStyle::setAffectedByDragRules):
1187 * kwq/KWQClipboard.mm:
1188 (KWQClipboard::dragNSImage): Method rename.
1189 * kwq/KWQKHTMLPart.h:
1190 * kwq/KWQKHTMLPart.mm:
1191 (KWQKHTMLPart::snapshotDragImage): Mark the element as being dragged before
1192 we snapshot it, so new style class will apply.
1194 2004-06-14 Ken Kocienda <kocienda@apple.com>
1198 Added a few more editing-related layout tests.
1200 * layout-tests/editing/inserting/insert-3654864-fix-expected.txt: Added.
1201 * layout-tests/editing/inserting/insert-3654864-fix.html: Added.
1202 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt: Added.
1203 * layout-tests/editing/inserting/insert-3659587-fix.html: Added.
1204 * layout-tests/editing/inserting/insert-after-delete-001-expected.txt: Added.
1205 * layout-tests/editing/inserting/insert-after-delete-001.html: Added.
1206 * layout-tests/editing/inserting/insert-br-case1-expected.txt: Added.
1207 * layout-tests/editing/inserting/insert-br-case1.html: Added.
1208 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Added.
1209 * layout-tests/editing/inserting/insert-br-case2.html: Added.
1210 * layout-tests/editing/inserting/insert-br-case3-expected.txt: Added.
1211 * layout-tests/editing/inserting/insert-br-case3.html: Added.
1213 2004-06-14 Ken Kocienda <kocienda@apple.com>
1217 Regarding the bug below, removing some tests since we have removed the execCommand("paste")
1218 feature, at least for now.
1220 <rdar://problem/3684792>: (JavaScript execCommand("paste") presents security issues)
1222 * layout-tests/editing/pasteboard/copy-paste-text-001-expected.txt: Removed.
1223 * layout-tests/editing/pasteboard/copy-paste-text-001.html: Removed.
1224 * layout-tests/editing/pasteboard/cut-paste-text-002-expected.txt: Removed.
1225 * layout-tests/editing/pasteboard/cut-paste-text-002.html: Removed.
1227 2004-06-14 Ken Kocienda <kocienda@apple.com>
1233 <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply due to non-0 exception code trying to insert a DIV markup string
1235 * khtml/xml/dom_nodeimpl.cpp:
1236 (NodeImpl::checkAddChild): This function was being too strict in disallowing certain nodes
1237 to be added as other child nodes, applying rules we typically use for parsing. However,
1238 those parsing rules are primarily for dealing with "bad" HTML, and should not be
1239 applied to programmatic DOM operations. The fix involves removing calls to childAllowed().
1241 2004-06-12 Trey Matteson <trey@apple.com>
1243 The drag image may be updated during a DHTML drag. This includes updating
1244 from a Timer instead of a drag event handler. In addition, an arbitrary
1245 element can be set as the one to snapshot for the drag image.
1249 * khtml/ecma/kjs_events.cpp:
1250 (ClipboardProtoFunc::tryCall): setDragImage accepts a node. Previously,
1251 it had to be an Image object.
1252 * khtml/rendering/render_object.cpp:
1253 (RenderObject::paintingRootRect): Also returns top element's rect.
1254 * khtml/rendering/render_object.h:
1255 * khtml/xml/dom2_eventsimpl.h:
1256 * kwq/KWQClipboard.h: New security mode where image is still writable, but
1259 (KWQClipboard::setDragHasStarted):
1260 * kwq/KWQClipboard.mm:
1261 (KWQClipboard::KWQClipboard): Part may be passed. Needed in the source
1262 case to generate an image from an element.
1263 (KWQClipboard::setAccessPolicy): New, replaces former becomeNumb method
1264 which wasn't flexible enough.
1265 (KWQClipboard::accessPolicy): New getter.
1266 (KWQClipboard::dragImage): No change, diff confusion.
1267 (KWQClipboard::setDragImage): Call new helper, below.
1268 (KWQClipboard::dragImageElement): New, return any element set.
1269 (KWQClipboard::setDragImageElement): New, call new helper.
1270 (KWQClipboard::setDragImage): New helper, set the image via either a
1271 pixmap or an element to snapshot, pushes the result to WebKit if we've
1272 already started the drag.
1273 (KWQClipboard::dragNSImage): Generate an NSImage and mouse offset, no
1274 matter how the drag image was set (Image or element).
1275 * kwq/KWQKHTMLPart.h: A single clipboard is kept over the life of a
1276 source drag instead of making one for each event.
1277 * kwq/KWQKHTMLPart.mm:
1278 (KWQKHTMLPart::KWQKHTMLPart): Init clipboard.
1279 (KWQKHTMLPart::~KWQKHTMLPart): Free clipboard.
1280 (KWQKHTMLPart::freeClipboard): New helper.
1281 (KWQKHTMLPart::dispatchDragSrcEvent): Most code moved to caller.
1282 (KWQKHTMLPart::khtmlMouseMoveEvent): Make clipboard for this drag session.
1283 Init clipboard to make an image from the dragSource element. Mark the
1284 drag as having started.
1285 (KWQKHTMLPart::dragSourceMovedTo): Clipboard will update WK with any new
1286 drag image, so we don't need to.
1287 (KWQKHTMLPart::dragSourceEndedAt): Ditto.
1288 (KWQKHTMLPart::elementImage): Also return element rect.
1289 * kwq/WebCoreBridge.h: Glue moved to WebCoreGraphicsBridge.
1290 * kwq/WebCoreBridge.mm:
1291 (-[WebCoreBridge dragOperationForDraggingInfo:]): Use new method.
1292 (-[WebCoreBridge dragExitedWithDraggingInfo:]): Ditto
1293 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto
1294 * kwq/WebCoreGraphicsBridge.h:
1295 * kwq/WebCoreGraphicsBridge.m:
1296 (-[WebCoreGraphicsBridge setDraggingImage:at:]): Glue moved from WebBridge
1298 2004-06-11 Chris Blumenberg <cblu@apple.com>
1300 Support for WebKit drag & drop API.
1304 * kwq/WebCoreBridge.h:
1305 * kwq/WebCoreBridge.mm:
1306 (-[WebCoreBridge _positionForPoint:]): new
1307 (-[WebCoreBridge moveDragCaretToPoint:]): call _positionForPoint
1308 (-[WebCoreBridge editableDOMRangeForPoint:]): new
1310 2004-06-11 Darin Adler <darin@apple.com>
1314 - fixed <rdar://problem/3645846>: (REGRESSION: Stuck "Loading" when logging into Google's Gmail on newer versions of Safari)
1316 * khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::parseHTMLAttribute):
1317 Call through to base class for ATTR_ID so the "has ID" bit gets set.
1318 * khtml/html/html_imageimpl.cpp:
1319 (HTMLImageElementImpl::parseHTMLAttribute): Move ATTR_COMPOSITE code up and out of the way so
1320 it doesn't screw up ATTR_ID parsing.
1321 (HTMLMapElementImpl::parseHTMLAttribute): Call through to base class for ATTR_ID
1322 so the "has ID" bit gets set.
1323 * khtml/html/html_objectimpl.cpp:
1324 (HTMLAppletElementImpl::parseHTMLAttribute): Remove ATTR_ID case; not needed.
1325 (HTMLParamElementImpl::parseHTMLAttribute): Call through to base class for ATTR_ID
1326 so the "has ID" bit gets set.
1328 2004-06-11 Ken Kocienda <kocienda@apple.com>
1334 <rdar://problem/3659587>: "when typing in Blot, bold style does not carry over to next line after pressing 'return'"
1336 Did some work to improve the insert newline command. The refinement is to insert the newline
1337 at the upstream position of the caret, ensuring that the newline takes on the
1338 appropriate style, and does not let the caret "escape" from an element that is
1341 * khtml/editing/htmlediting_impl.cpp:
1342 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition): New helper. Adds smarts about adding
1343 newlines when the selection is a caret in a block.
1344 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition): Ditto.
1345 (khtml::InputNewlineCommandImpl::doApply): Simplified cases. One case in the code could not
1347 * khtml/editing/htmlediting_impl.h:
1351 <rdar://problem/3654864>: "Pasting content at start of line places it at end of previous line"
1353 (khtml::InputTextCommandImpl::prepareForTextInsertion): Simple code mistake. Content was indeed
1354 being added to the line before. Fixed to add new content after the line break.
1356 2004-07-10 Trey Matteson <trey@apple.com>
1358 Prep work for latest delegate API for dragging. In addition, I also straightened out all
1359 the cases of DHTML setting a drag image or setting pasteboard data, and how that would
1360 override WebKit's default behavior (which follows how WinIE does things).
1364 * khtml/rendering/render_object.cpp:
1365 (RenderObject::draggableNode): Obey new params for whether a DHTML or UserAgent (i.e.,
1366 WebKit) drag source is allowed.
1367 * khtml/rendering/render_object.h:
1368 * kwq/KWQKHTMLPart.h:
1369 * kwq/KWQKHTMLPart.mm:
1370 (KWQKHTMLPart::dispatchDragSrcEvent): Setting pasteboard data was moved out of here, now
1371 caller's responsibility.
1372 (KWQKHTMLPart::khtmlMouseMoveEvent): Ask bridge for allowable drag actions (DHTML vs UA).
1373 Only send drag events if DHTML is allowed. Only generate a drag image if the source is
1374 a DHTML element. Note whether event handler set any pasteboard data, and pass that fact
1376 (KWQKHTMLPart::dragSourceMovedTo): Only send drag events if DHTML is allowed.
1377 (KWQKHTMLPart::dragSourceEndedAt): Only send drag events if DHTML is allowed.
1378 * kwq/WebCoreBridge.h:
1380 2004-06-11 Ken Kocienda <kocienda@apple.com>
1384 Lay some groundwork for better testing of inserting newlines. Layout
1385 tests that use this new code will be coming soon.
1387 * khtml/editing/jsediting.cpp: Add commands for bold and inserting newlines.
1388 * layout-tests/editing/editing.js: Added new insertNewline command.
1389 which calls through to TypingCommand::insertNewline. There was no way to get
1390 to this command from JS before this addition.
1392 2004-06-11 Ken Kocienda <kocienda@apple.com>
1396 Javascript execCommand system wants to use case-insensitive QDict.
1397 The interface for QDict offers this feature, but it was never implemented.
1400 * kwq/KWQDictImpl.h: Declare bool to store case-sensitive bit.
1401 * kwq/KWQDictImpl.mm:
1402 (KWQDictImpl::KWQDictImpl): No longer drops caseSensitive on the floor; stores
1403 it in instance variable.
1404 (KWQDictImpl::insert): Make lowercase version of key for operation, if necessary.
1405 (KWQDictImpl::remove): Ditto.
1406 (KWQDictImpl::find): Ditto.
1407 (KWQDictIteratorImpl::currentStringKey): Whitespace cleanup.
1411 2004-06-10 Ken Kocienda <kocienda@apple.com>
1417 <rdar://problem/3654850>: "Style changes do not work across blocks"
1419 Now, applying styles works across blocks. I did quite a bit
1420 of internal redsign on the member functions of this class to
1421 make this work. As a bonus, from an architectural standpoint,
1422 all style changes are now done "in place". There is no more
1423 copying of content in order to perform style changes.
1425 * khtml/editing/htmlediting_impl.cpp:
1426 (khtml::ApplyStyleCommandImpl::doApply):
1427 (khtml::ApplyStyleCommandImpl::removeHTMLStyleNode):
1428 (khtml::ApplyStyleCommandImpl::removeCSSStyle):
1429 (khtml::ApplyStyleCommandImpl::removeStyle):
1430 (khtml::ApplyStyleCommandImpl::nodeFullySelected):
1431 (khtml::ApplyStyleCommandImpl::splitTextAtStartIfNeeded):
1432 (khtml::ApplyStyleCommandImpl::splitTextAtEndIfNeeded):
1433 (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
1434 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded):
1435 (khtml::ApplyStyleCommandImpl::positionInsertionPoint):
1436 * khtml/editing/htmlediting_impl.h:
1438 2004-06-10 Darin Adler <darin@apple.com>
1442 - filled out execCommand a lot more
1443 - fixed <rdar://problem/3685231>: (execCommand italic is not implemented)
1444 - fixed <rdar://problem/3685232>: (execCommand bold is not implemented)
1445 - fixed <rdar://problem/3675899>: (Make queryCommandIndeterm work as specified in the Javascript execCommand Compatibility Plan)
1446 - fixed <rdar://problem/3675901>: (Make queryCommandState work as specified in the Javascript execCommand Compatibility Plan)
1447 - fixed <rdar://problem/3675904>: (Make queryCommandValue work as specified in the Javascript execCommand Compatibility Plan)
1449 * khtml/editing/jsediting.cpp:
1450 (DOM::JSEditor::queryCommandIndeterm): Changed to use KHTMLPart::TriState instead of CommandState.
1451 (DOM::JSEditor::queryCommandState): Ditto.
1452 (execStyleChange): Changed to use KHTMLPart::applyStyle.
1453 (stateStyle): Used KHTMLPart::selectionHasStyle for this.
1454 (selectionStartHasStyle): Use KHTMLPart::selectionStartHasStyle for this.
1455 (valueStyle): Used KHTMLPart::selectionStartStylePropertyValue for this.
1456 (execBold): Implemented toggling, using selectionStartHasStyle.
1457 (execItalic): Implemented toggling, using selectionStartHasStyle.
1458 (execPrint): Implemented.
1459 (enabledRedo): Implemented, using canRedo.
1460 (enabledUndo): Implemented, using canUndo.
1461 (stateNone): Renamed from stateNo.
1462 (valueBackColor): Implemented, using valueStyle.
1463 (valueFontName): Implemented, using valueStyle.
1464 (valueFontSize): Implemented, using valueStyle.
1465 (valueForeColor): Implemented, using valueStyle.
1466 (valueFontSize): Implemented, using valueStyle.
1468 * khtml/khtml_part.h: Added editing operations.
1469 * khtml/khtml_part.cpp:
1470 (KHTMLPart::copyToPasteboard): Added.
1471 (KHTMLPart::cutToPasteboard): Added.
1472 (KHTMLPart::redo): Added.
1473 (KHTMLPart::undo): Added.
1474 (KHTMLPart::applyStyle): Added.
1475 (updateState): Added.
1476 (KHTMLPart::selectionHasStyle): Added.
1477 (KHTMLPart::selectionStartHasStyle): Added.
1478 (KHTMLPart::selectionStartStylePropertyValue): Added.
1479 (KHTMLPart::selectionComputedStyle): Added.
1480 (KHTMLPart::print): Added.
1482 * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Call print() on plain old part, not KWQ(part).
1484 * kwq/KWQKHTMLPart.h: Removed print(), added _haveUndoRedoOperations.
1485 * kwq/KWQKHTMLPart.mm:
1486 (KHTMLPart::print): Moved from KWQKHTMLPart to KHTMLPart.
1487 (KWQKHTMLPart::registerCommandForUndo): Moved code here from bridge.
1488 (KWQKHTMLPart::registerCommandForRedo): Moved code here from bridge.
1489 (KWQKHTMLPart::clearUndoRedoOperations): Moved code here from bridge.
1490 (KWQKHTMLPart::issueUndoCommand): Moved code here from bridge.
1491 (KWQKHTMLPart::issueRedoCommand): Moved code here from bridge.
1492 (KWQKHTMLPart::issuePasteCommand): Moved code here from bridge.
1493 (KHTMLPart::canUndo): Added.
1494 (KHTMLPart::canRedo): Added.
1496 * kwq/WebCoreBridge.h: Added undoManager, removed undo-related methods.
1497 * kwq/WebCoreBridge.mm: (-[WebCoreBridge applyStyle:]): Changed to call
1498 KHTMLPart::applyStyle.
1500 * WebCore.pbproj/.cvsignore: Updated for new Xcode files.
1502 2004-06-09 Maciej Stachowiak <mjs@apple.com>
1506 <rdar://problem/3671555>: Blot scrolls to the top every time you type
1508 * khtml/xml/dom_selection.cpp:
1509 (DOM::Selection::getRepaintRect): If the caret position is invalid, recompute it.
1511 2004-06-09 David Hyatt <hyatt@apple.com>
1513 Fix for 3607091, implement a style that prevents zoom and min font size from taking effect.
1514 The name of the new style is "-apple-text-size-adjust" with values of "none" and "auto." The default
1519 * khtml/css/cssparser.cpp:
1520 (CSSParser::parseValue):
1521 * khtml/css/cssproperties.c:
1524 * khtml/css/cssproperties.h:
1525 * khtml/css/cssproperties.in:
1526 * khtml/css/cssstyleselector.cpp:
1527 (khtml::CSSStyleSelector::styleForElement):
1528 (khtml::CSSStyleSelector::pseudoStyleForElement):
1529 (khtml::CSSStyleSelector::applyDeclarations):
1530 (khtml::CSSStyleSelector::applyProperty):
1531 (khtml::CSSStyleSelector::checkForTextSizeAdjust):
1532 * khtml/css/cssstyleselector.h:
1533 * khtml/rendering/render_style.cpp:
1535 (StyleCSS3InheritedData):
1536 (StyleCSS3InheritedData::operator==):
1537 (RenderStyle::diff):
1538 * khtml/rendering/render_style.h:
1539 (khtml::RenderStyle::lineClamp):
1540 (khtml::RenderStyle::textSizeAdjust):
1541 (khtml::RenderStyle::setTextSizeAdjust):
1542 (khtml::RenderStyle::initialTextSizeAdjust):
1544 2004-06-09 David Hyatt <hyatt@apple.com>
1546 Implement parsing and setting of the text-overflow CSS3 property.
1548 Reviewed by kocienda
1550 * khtml/css/cssparser.cpp:
1551 (CSSParser::parseValue):
1552 * khtml/css/cssproperties.c:
1555 * khtml/css/cssproperties.h:
1556 * khtml/css/cssproperties.in:
1557 * khtml/css/cssstyleselector.cpp:
1558 (khtml::CSSStyleSelector::applyProperty):
1559 * khtml/css/cssvalues.c:
1562 * khtml/css/cssvalues.h:
1563 * khtml/css/cssvalues.in:
1564 * khtml/rendering/render_style.cpp:
1566 (StyleCSS3NonInheritedData::operator==):
1567 (RenderStyle::diff):
1568 * khtml/rendering/render_style.h:
1569 (khtml::RenderStyle::textOverflow):
1570 (khtml::RenderStyle::setTextOverflow):
1571 (khtml::RenderStyle::initialTextOverflow):
1573 2004-06-09 David Hyatt <hyatt@apple.com>
1575 Fix for 3678031, implement better flexing for Emerson headers. This involved adding support for max-width: intrinsic,
1576 fixing the box layout algorithm to properly deal with max-widths, and implementing support for baseline alignment
1577 so that boxes can be aligned vertically along their interior baselines.
1579 Reviewed by kocienda
1581 * khtml/css/cssparser.cpp:
1582 (CSSParser::parseValue):
1583 (CSSParser::parseShadow):
1584 * khtml/css/cssparser.h:
1585 * khtml/css/cssproperties.c:
1588 * khtml/css/cssproperties.h:
1589 * khtml/css/cssproperties.in:
1590 * khtml/css/cssstyleselector.cpp:
1591 (khtml::CSSStyleSelector::applyProperty):
1592 * khtml/css/cssvalues.c:
1595 * khtml/css/cssvalues.h:
1596 * khtml/css/cssvalues.in:
1597 * khtml/misc/khtmllayout.h:
1599 * khtml/rendering/render_block.cpp:
1600 (khtml::RenderBlock::baselinePosition):
1601 (khtml::RenderBlock::getBaselineOfFirstLineBox):
1602 * khtml/rendering/render_block.h:
1603 * khtml/rendering/render_box.cpp:
1604 (RenderBox::RenderBox):
1605 (RenderBox::overrideWidth):
1606 (RenderBox::overrideHeight):
1607 (RenderBox::calcWidth):
1608 (RenderBox::calcHeight):
1609 * khtml/rendering/render_box.h:
1610 (khtml::RenderBox::overrideSize):
1611 (khtml::RenderBox::setOverrideSize):
1612 * khtml/rendering/render_flexbox.cpp:
1613 (khtml::RenderFlexibleBox::calcMinMaxWidth):
1614 (khtml::RenderFlexibleBox::layoutBlock):
1615 (khtml::RenderFlexibleBox::layoutHorizontalBox):
1616 (khtml::RenderFlexibleBox::layoutVerticalBox):
1617 (khtml::RenderFlexibleBox::placeChild):
1618 (khtml::RenderFlexibleBox::allowedChildFlex):
1619 * khtml/rendering/render_flexbox.h:
1620 * khtml/rendering/render_image.cpp:
1621 (RenderImage::isWidthSpecified):
1622 (RenderImage::isHeightSpecified):
1623 * khtml/rendering/render_object.h:
1624 (khtml::RenderObject::getBaselineOfFirstLineBox):
1625 (khtml::RenderObject::overrideSize):
1626 (khtml::RenderObject::overrideWidth):
1627 (khtml::RenderObject::overrideHeight):
1628 (khtml::RenderObject::setOverrideSize):
1629 * khtml/rendering/render_style.cpp:
1630 (StyleFlexibleBoxData::StyleFlexibleBoxData):
1631 (StyleFlexibleBoxData::operator==):
1632 (ShadowData::operator==):
1633 * khtml/rendering/render_style.h:
1634 (khtml::RenderStyle::boxPack):
1635 (khtml::RenderStyle::setBoxPack):
1636 * khtml/rendering/table_layout.cpp:
1637 (AutoTableLayout::layout):
1639 2004-06-09 Richard Williamson <rjw@apple.com>
1641 Added support for drawing un-rasterized transformed PDFs.
1645 * khtml/ecma/kjs_html.cpp:
1646 (KJS::Context2DFunction::tryCall):
1648 2004-06-09 Darin Adler <darin@apple.com>
1652 - implemented still more execCommand commands
1654 * khtml/editing/jsediting.cpp: Added a lot more commands, and reformatted a bit.
1656 2004-06-08 Darin Adler <darin@apple.com>
1660 - implemented a bunch more execCommand commands
1661 - fixed <rdar://problem/3684792>: (JavaScript execCommand("paste") presents security issues)
1662 - fixed <rdar://problem/3675898>: (Make queryCommandEnabled work as specified in the Javascript execCommand Compatibility Plan)
1663 - fixed <rdar://problem/3675903>: (Make queryCommandSupported work as specified in the Javascript execCommand Compatibility Plan)
1664 - about half of <rdar://problem/3685231>: (execCommand italic is not implemented)
1665 - about half of <rdar://problem/3685232>: (execCommand bold is not implemented)
1667 * khtml/editing/jsediting.h: Made constructor inline. Deleted a few unneeded member functions
1668 that are now just private functions inside jsediting.cpp.
1670 * khtml/editing/jsediting.cpp:
1671 (commandImp): Changed this around, so the dictionary is a static local to this function,
1672 and initialized with C++ "first time initialization" rule.
1673 (DOM::JSEditor::execCommand): Got rid of special case for 0 for function pointer and added const.
1674 (DOM::JSEditor::queryCommandEnabled): Ditto.
1675 (DOM::JSEditor::queryCommandIndeterm): Got rid of special case for 0 for function pointer, added const,
1676 and use a common three-state state function rather than a separate "indeterm" function.
1677 (DOM::JSEditor::queryCommandState): Ditto.
1678 (DOM::JSEditor::queryCommandValue): More of the same.
1679 (execNotImplemented): Added. Used for unimplemented commands; there are only a few left.
1680 (execCopy): Renamed.
1682 (execDelete): Renamed.
1683 (execInsertText): Renamed.
1684 (execPaste): Renamed, and disabled.
1685 (execRedo): Renamed.
1686 (execSelectAll): Renamed.
1687 (execUndo): Renamed.
1688 (execStyleChange): Added. Helper function for commands that are style changes.
1690 (execItalic): Added.
1691 (execJustifyCenter): Added.
1692 (execJustifyFull): Added.
1693 (execJustifyLeft): Added.
1694 (execJustifyRight): Added.
1695 (execSubscript): Added.
1696 (execSuperscript): Added.
1697 (execUnselect): Added.
1698 (stateNotImplemented): Added. Used for unimplemented state queries; there are a few left.
1700 (valueNotImplemented): Added. Used for unimplemented value queries; there are a few left.
1701 (nullStringValue): Added.
1702 (createCommandDictionary): Changed the initDict function into this function. Added implementations
1703 for many commands and condensed format so it's easier to work with.
1705 2004-06-08 Darin Adler <darin@apple.com>
1709 - our part of fix to <rdar://problem/3629334>: (REGRESSION (Tiger): titles on pop-ups menus are truncated and show ellipses)
1711 * kwq/KWQComboBox.mm: (QComboBox::QComboBox): Call setLineBreakMode:NSLineBreakByClipping.
1712 In the current version of Tiger I am using, this is not implemented yet.
1714 - a couple of other unrelated changes
1716 * khtml/rendering/render_form.cpp: (RenderTextArea::calcMinMaxWidth): Put a little more code
1717 inside the APPLE_CHANGES ifdef.
1718 * kwq/KWQTextEdit.h: Remove unused setTabStopWidth function, and make empty setTextFormat
1719 function an inline for slightly smaller code size.
1720 * kwq/KWQTextEdit.mm: Ditto.
1721 * kwq/KWQTextField.mm: Update copyright date.
1723 2004-06-08 Trey Matteson <trey@apple.com>
1725 A DHTML drag source can now change the dragging image during the drag. Currently
1726 it may only be set to a static image.
1730 * kwq/KWQKHTMLPart.mm:
1731 (KWQKHTMLPart::dragSourceMovedTo): If the ondrag event handler set an image,
1733 * kwq/WebCoreBridge.h:
1735 2004-06-08 Ken Kocienda <kocienda@apple.com>
1739 Changes to the selection state for these tests as a result of my previous
1740 checkin. The changes are minor to a couple of offsets. I looked at the
1741 changes and approve them.
1743 * layout-tests/editing/deleting/delete-block-contents-001-expected.txt
1744 * layout-tests/editing/deleting/delete-block-contents-002-expected.txt
1745 * layout-tests/editing/deleting/delete-block-contents-003-expected.txt
1747 2004-06-08 Ken Kocienda <kocienda@apple.com>
1753 <rdar://problem/3654841>: "Hitting delete key with start of block selected
1754 does not merge content with preceding block"
1756 Selections that span blocks now work correctly for deleting the selection and inserting
1757 over the selection. The largest part of the change is adding a new field to the
1758 RemoveNodeAndPruneCommand and its impl version. This was done since the starting block
1759 for a multi-block selection should always be preserved when deleting, and this was
1760 a convenient way to express this using the code structure already in place.
1762 * khtml/editing/htmlediting.cpp:
1763 (khtml::RemoveNodeAndPruneCommand::RemoveNodeAndPruneCommand): Modify this command to
1764 take two nodes: the node to remove and a node to stop at when pruning back up the tree.
1765 (khtml::RemoveNodeAndPruneCommand::pruneNode): New accessor, replaces old node() accessor.
1766 (khtml::RemoveNodeAndPruneCommand::stopNode): New accessor for additional feature described
1768 * khtml/editing/htmlediting.h:
1769 * khtml/editing/htmlediting_impl.cpp:
1770 (khtml::shouldPruneNode): blow flow renderers can now be deleted, but not if they are a
1771 rootEditableElement.
1772 (khtml::CompositeEditCommandImpl::removeNodeAndPrune): Pass new stopNode param and change the
1773 name of the existing node argument to pruneNode to distinguish it.
1774 (khtml::DeleteSelectionCommandImpl::doApply): Pass the block containing the start of the
1775 selection to removeNodeAndPrune in each case. Also, add one little loop to move all
1776 the content from the block containing the end of the selection if that block is different
1777 than the start block.
1778 (khtml::RemoveNodeAndPruneCommandImpl::RemoveNodeAndPruneCommandImpl): Implement the
1779 pruneNode/stopNode design already described.
1780 (khtml::RemoveNodeAndPruneCommandImpl::~RemoveNodeAndPruneCommandImpl): Manage the
1781 lifecycle of stopNode.
1782 (khtml::RemoveNodeAndPruneCommandImpl::doApply): Add a check to stop at the stop
1784 * khtml/editing/htmlediting_impl.h:
1785 (khtml::RemoveNodeAndPruneCommandImpl::pruneNode): New accessor.
1786 (khtml::RemoveNodeAndPruneCommandImpl::stopNode): Ditto.
1788 2004-06-07 Trey Matteson <trey@apple.com>
1790 Clipboard access during DHTML dragging is made secure.
1794 * kwq/KWQClipboard.h:
1796 * kwq/KWQClipboard.mm:
1797 (KWQClipboard::KWQClipboard): Init new policy and changeCount members.
1798 (KWQClipboard::becomeNumb): Set policy to numb.
1799 (KWQClipboard::clearData): Check policy.
1800 (KWQClipboard::clearAllData): Check policy.
1801 (KWQClipboard::getData): Check policy and changeCount.
1802 (KWQClipboard::setData): Check policy.
1803 (KWQClipboard::types): Check policy and ChangeCount.
1804 (KWQClipboard::setDragLocation): Check policy.
1805 (KWQClipboard::setDragImage): Check policy.
1806 (KWQClipboard::setDropEffect): Check policy.
1807 (KWQClipboard::setEffectAllowed): Check policy.
1808 * kwq/KWQKHTMLPart.mm:
1809 (KWQKHTMLPart::dispatchDragSrcEvent): Set policy when creating clipboard,
1810 and numb-ify it when we're done.
1811 * kwq/WebCoreBridge.mm:
1812 (-[WebCoreBridge dragOperationForDraggingInfo:]): Set policy when creating clipboard,
1813 and numb-ify it when we're done.
1814 (-[WebCoreBridge dragExitedWithDraggingInfo:]): Ditto
1815 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto
1817 2004-06-08 Ken Kocienda <kocienda@apple.com>
1821 * khtml/editing/jsediting.cpp:
1822 (DOM::EditorCommand::): Stray capital letter in "selectAll" command static
1823 initializer prevented the command from ever working since the command
1824 strings are lower-cased when trying to find a match, but not when they
1825 are inserted into the dictionary. This is a one character change to make
1826 the string "selectall" in the initializer.
1828 2004-06-07 Trey Matteson <trey@apple.com>
1830 WebCore will now generate a default drag image when an element serves as a drag
1831 source. The basic idea is the image contains the element and all its children.
1833 As for the implementation, instead of adding a new paintAction I added a new
1834 field to the paintInfo struct, "paintingRoot". If this field is set, painting will
1835 only paint that root's descendants.
1837 Some code also moved from the bridge to the part, to be available within WebCore.
1841 * khtml/rendering/render_block.cpp:
1842 (khtml::RenderBlock::paintObject): Pass along paintingRoot to kids.
1843 (khtml::RenderBlock::paintFloats): Pass along paintingRoot to kids.
1844 * khtml/rendering/render_box.cpp:
1845 (RenderBox::paintBoxDecorations): Test paintingRoot before painting.
1846 * khtml/rendering/render_canvasimage.cpp:
1847 (RenderCanvasImage::paint): Test paintingRoot before painting.
1848 * khtml/rendering/render_flow.cpp:
1849 (RenderFlow::paintLineBoxBackgroundBorder): Test paintingRoot before painting.
1850 (RenderFlow::paintLineBoxDecorations): Test paintingRoot before painting.
1851 * khtml/rendering/render_image.cpp:
1852 (RenderImage::paint): Test paintingRoot before painting.
1853 * khtml/rendering/render_inline.cpp:
1854 (RenderInline::paint): Pass along paintingRoot to kids.
1855 * khtml/rendering/render_layer.cpp:
1856 (RenderLayer::paint): Pass along paintingRoot to kids.
1857 (RenderLayer:: paintLayer): Pass along paintingRoot to kids. Test if we are within the
1858 paintingRoot to decide whether to pass the root to our renderer.
1859 * khtml/rendering/render_layer.h:
1860 * khtml/rendering/render_object.cpp:
1861 (RenderObject::hasAncestor): New utility.
1862 (RenderObject::absoluteBoundingBoxRect): Helper for paintingRootRect
1863 (RenderObject::addAbsoluteRectForLayer): Helper for paintingRootRect
1864 (RenderObject::paintingRootRect): Return rect that will be painted if we are
1866 (RenderObject::draggableNode): Add test to avoid rare NULL ptr crash.
1867 * khtml/rendering/render_object.h:
1868 (khtml::RenderObject::PaintInfo::PaintInfo): Add paintingRoot field.
1869 (khtml::RenderObject::paintingRootForChildren): New utility. Return the current
1870 paintingRoot, or nil if we are the root (so kids draw normally).
1871 (khtml::RenderObject::shouldPaintWithinRoot): New utility. We can paint if we
1872 are the paintingRoot, or no root is set.
1873 * khtml/rendering/render_replaced.cpp:
1874 (RenderReplaced::shouldPaint): Pass along paintingRoot to kids.
1875 * khtml/rendering/render_table.cpp:
1876 (RenderTable::paint): Pass along paintingRoot to kids.
1877 * khtml/rendering/render_text.cpp:
1878 (RenderText::paint): Test paintingRoot before painting.
1879 * kwq/KWQKHTMLPart.h:
1880 * kwq/KWQKHTMLPart.mm:
1881 (KWQKHTMLPart::KWQKHTMLPart): Init new _elementToDraw member.
1882 (KWQKHTMLPart::paint): Generalized to handle cases of painting selection or a
1884 (KWQKHTMLPart::khtmlMouseMoveEvent): Make a default image if dragSrc didn't
1886 (KWQKHTMLPart::selectionRect): Moved from bridge.
1887 (KWQKHTMLPart::visibleSelectionRect): Ditto.
1888 (KWQKHTMLPart::imageFromRect): Newly factored code, from bridge.
1889 (KWQKHTMLPart::selectionImage): Moved from bridge, wrapper around imageFromRect.
1890 (KWQKHTMLPart::elementImage): New method, wrapper around imageFromRect.
1891 * kwq/WebCoreBridge.h:
1892 * kwq/WebCoreBridge.mm:
1893 (-[WebCoreBridge drawRect:withPainter:]): Just call part to draw.
1894 (-[WebCoreBridge visibleSelectionRect]): Guts moved to part.
1895 (-[WebCoreBridge selectionImage]): Ditto.
1897 2004-06-07 Darin Adler <darin@apple.com>
1901 - fixed <rdar://problem/3682821>: (setTimeout fails when additional parameters are used and timeout function is a string)
1903 * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Ignore excess arguments instead
1904 of rejecting the argument list for window.scrollBy, scroll, scrollTo, moveBy, moveTo,
1905 resizeBy, resizeTo, and setTimeout (when the timeout is a string rather than an object).
1907 - did a refinement of JSEditor to be slightly more efficient, and not have to edit
1908 both the .cpp file and the .h when adding more implementation
1910 * khtml/khtml_part.h: Hack so we can get to the docImpl and xmlDocImpl without being a friend.
1911 * khtml/editing/jsediting.h: Simplified a bit.
1912 * khtml/editing/jsediting.cpp: Redid to use a table, and simplified a bit.
1914 2004-06-07 Ken Kocienda <kocienda@apple.com>
1920 <rdar://problem/3682354>: "Typing style does not work yet"
1922 Did the final hook-up of support that has landed in the tree in the
1923 recent past as part of ongoing style-application work.
1925 For the most part, this patch modifies the InputNewlineCommandImpl and
1926 InputTextCommandImpl commands to insert a styling span when there is
1927 a typing style active.
1929 * khtml/editing/htmlediting_impl.cpp:
1930 (khtml::CompositeEditCommandImpl::createTypingStyleElement): Helper
1931 shared by the two commands modified.
1932 (khtml::InputNewlineCommandImpl::doApply): Create a styling span if the
1933 part has a typing style. Maintain a nodeToInsert local variable, which is
1934 either the break to insert or a styling span containing the break. Also,
1935 remove some utterly bogus derefs. They are just plain wrong.
1936 (khtml::InputTextCommandImpl::InputTextCommandImpl): Don't need to keep
1937 m_insertedTextNode. The composite commands this command uses will keep
1938 track of that object's lifetime. We do not need to do that here.
1939 (khtml::InputTextCommandImpl::~InputTextCommandImpl): No longer need
1940 to deref obsolete m_insertedTextNode.
1941 (khtml::InputTextCommandImpl::prepareForTextInsertion): Handle the case
1942 where a styling span needs to be added.
1943 (khtml::TypingCommandImpl::insertText): Create a new InputTextCommand when
1944 there is an active typping style.
1945 * khtml/editing/htmlediting_impl.h: Declare createTypingStyleElement helper.
1946 Remove m_insertedTextNode from InputTextCommandImpl.
1947 * kwq/WebCoreBridge.mm:
1948 (-[WebCoreBridge applyStyle:]): Swicth on the state of the selection, calling
1949 setTypingStyle when a caret and ApplyStyleCommand when a range.
1951 2004-06-07 Darin Adler <darin@apple.com>
1955 * khtml/editing/jsediting.h: Elide some unnecessary namespace prefixes.
1956 * khtml/editing/jsediting.cpp: Make typed constants instead of macros.
1957 (DOM::JSEditor::commandDict): Elide unnecessary namespace prefix.
1958 (DOM::JSEditor::execCommand): Remove xxxNotImplemented functions; just return false instead.
1959 (DOM::JSEditor::queryCommandEnabled): Ditto.
1960 (DOM::JSEditor::queryCommandIndeterm): Ditto.
1961 (DOM::JSEditor::queryCommandState): Ditto.
1962 (DOM::JSEditor::queryCommandSupported): Ditto.
1963 (DOM::JSEditor::queryCommandValue): Ditto.
1965 2004-06-05 Trey Matteson <trey@apple.com>
1967 As agreed with Hyatt and Louch, do not post incoming dragging events
1972 * khtml/khtmlview.cpp:
1973 (KHTMLView::updateDragAndDrop): For any drag target that is a text node,
1974 use its parent instead.
1976 2004-06-03 Trey Matteson <trey@apple.com>
1978 DHTML dragging uses the Cocoa NSDragOperation on both the source and dest ends.
1980 In addition, I caught a prime gaffe where I had used "dropAllowed" instead of "effectAllowed"
1981 for that particular WinIE property. That is renamed throughout.
1985 * khtml/ecma/kjs_events.cpp:
1986 (stringOrUndefined): New little helper.
1987 (Clipboard::getValueProperty): Return Undefined if dropEffect or effectAllowed are not set.
1988 (Clipboard::putValue): Rename.
1989 * khtml/ecma/kjs_events.h:
1990 (KJS::Clipboard::): Rename.
1991 * khtml/ecma/kjs_events.lut.h:
1992 * khtml/xml/dom2_eventsimpl.h: Rename.
1993 * kwq/KWQClipboard.h: Rename, add access to Cocoa drag op.
1994 * kwq/KWQClipboard.mm:
1995 (KWQClipboard::dropEffect): These 4 just moved in the file.
1996 (KWQClipboard::setDropEffect):
1997 (KWQClipboard::effectAllowed):
1998 (KWQClipboard::setEffectAllowed):
1999 (cocoaOpFromIEOp): Convert from an IE operation string to a Cocoa DragOp
2000 (IEOpFromCocoaOp): and vice-versa
2001 (KWQClipboard::sourceOperation): Return effectAllowed, converted to a NSDragOp
2002 (KWQClipboard::destinationOperation): Return dropEffect, converted to a NSDragOp
2003 (KWQClipboard::setSourceOperation): Set effectAllowed, using a Cocoa value
2004 (KWQClipboard::setDestinationOperation): Set dropEffect, using a Cocoa value
2005 * kwq/KWQKHTMLPart.h:
2006 * kwq/KWQKHTMLPart.mm:
2007 (KWQKHTMLPart::dispatchDragSrcEvent): Return the drag op specified by the source element.
2008 (KWQKHTMLPart::khtmlMouseMoveEvent): Pass our drag op up to WebKit.
2009 (KWQKHTMLPart::dragSourceMovedTo): Pass NULL for new arg.
2010 (KWQKHTMLPart::dragSourceEndedAt): Ditto
2011 * kwq/WebCoreBridge.h:
2012 * kwq/WebCoreBridge.mm:
2013 (-[WebCoreBridge dragOperationForDraggingInfo:]): Set the incoming dragOp onto the clipboard
2014 so DHTML can access it. In addition, validate whatever op DHTML returns so we play well
2017 2004-06-04 David Hyatt <hyatt@apple.com>
2019 Add support for auto values in flex transitions. Add support for mapping the back end values to
2020 front end values. Next it's time to actually try to use this stuff in render_flexbox.
2024 * khtml/css/css_valueimpl.cpp:
2026 * khtml/css/css_valueimpl.h:
2027 (DOM::FlexGroupTransitionValueImpl::isAuto):
2028 * khtml/css/cssparser.cpp:
2029 (FlexGroupTransitionParseContext::length):
2030 (FlexGroupTransitionParseContext::commitAutoValue):
2031 (FlexGroupTransitionParseContext::commitValue):
2032 (CSSParser::parseFlexGroupTransition):
2033 * khtml/css/cssstyleselector.cpp:
2034 (khtml::CSSStyleSelector::applyProperty):
2035 * khtml/rendering/render_style.cpp:
2036 (FlexGroupTransitionData::operator==):
2037 * khtml/rendering/render_style.h:
2038 (khtml::FlexGroupTransitionData::next):
2039 (khtml::FlexGroupTransitionData::isAuto):
2043 2004-06-04 Kevin Decker <kdecker@apple.com>
2047 - kwq/KWQKHTMLPart.mm: addMessagetoConsole places sourceURL in the dictionary
2048 - khtml/xml/dom_docimpl.cpp: right now, we don't have a way to get a url,
2049 so we leave this blank
2050 - khtml/ecma/kjs_window.cpp: still need to get the real line number and sourceURL
2051 - khtml/ecma/kjs_proxy.cpp: now passing the sourceURL to addMessageToConsole
2052 - khtml/ecma/kjs_events.cpp: still need to grab an accurate line number and sourceURL
2054 * khtml/ecma/kjs_events.cpp:
2055 (JSEventListener::handleEvent):
2056 (JSLazyEventListener::handleEvent):
2057 * khtml/ecma/kjs_proxy.cpp:
2058 (KJSProxyImpl::evaluate):
2059 * khtml/ecma/kjs_window.cpp:
2060 (Window::isSafeScript):
2061 (ScheduledAction::execute):
2062 * khtml/xml/dom_docimpl.cpp:
2063 (DocumentImpl::open):
2064 * kwq/KWQKHTMLPart.h:
2065 * kwq/KWQKHTMLPart.mm:
2066 (KWQKHTMLPart::addMessageToConsole):
2068 2004-06-04 Ken Kocienda <kocienda@apple.com>
2072 Fix a comical little bug where the style-applying code did not take into
2073 account deleting content from the start of a block. After the deletion,
2074 the caret is placed in the node before the deleted content and so
2075 inserting a styled fragment after the deletion position works great.
2076 The problem is that if the selectionis at the start of a block, there
2077 is no "position before the deletion" and the caret is placed in the new
2078 first child of the block. Inserting the styled content after this
2079 node is just plain wrong. Now, this case is handled correctly, and the
2080 styled content is inserted in the proper position.
2082 * khtml/editing/htmlediting_impl.cpp:
2083 (khtml::ApplyStyleCommandImpl::insertFragment):
2085 2004-06-04 Ken Kocienda <kocienda@apple.com>
2089 * khtml/rendering/bidi.cpp:
2090 (khtml::RenderBlock::layoutInlineChildren): Only add additional line height
2091 in for root editable elements. This helps to keep layout from deviating too
2092 much from the intended page layout, but still gives an empty document a line
2093 in which it can blink the caret.
2095 2004-06-04 Ken Kocienda <kocienda@apple.com>
2099 Made some progress on this set of related bugs:
2101 <rdar://problem/3675867>: "Make execCommand work as specified in the Javascript execCommand Compatibility Plan"
2102 <rdar://problem/3675898>: "Make queryCommandEnabled work as specified in the Javascript execCommand Compatibility Plan"
2103 <rdar://problem/3675899>: "Make queryCommandIndeterm work as specified in the Javascript execCommand Compatibility Plan"
2104 <rdar://problem/3675901>: "Make queryCommandState work as specified in the Javascript execCommand Compatibility Plan"
2105 <rdar://problem/3675903>: "Make queryCommandSupported work as specified in the Javascript execCommand Compatibility Plan"
2106 <rdar://problem/3675904>: "Make queryCommandValue work as specified in the Javascript execCommand Compatibility Plan"
2108 I did several things to move the ahead with the plan:
2110 1. The latter five methods did not appear in the tree at all. Now they do, although
2112 2. I removed the implementation for these editing methods from dom_docimpl.cpp, and moved
2113 them out to new js_editing.cpp/js_editing.h files. The remaining code in dom_docimpl.cpp
2114 is glue to call over to the new JSEditor object defined in the new files.
2116 3. For a couple of the command implementations in js_editing.cpp, I made a stab at returning sensible values.
2117 For others, I just return place-holder values. I have added some comments to describe what has been done and
2118 what still needs to be done.
2120 * WebCore.pbproj/project.pbxproj:
2121 * khtml/dom/dom_doc.cpp: Add call-overs for these methods.
2122 (DOM::Document::queryCommandEnabled):
2123 (DOM::Document::queryCommandIndeterm):
2124 (DOM::Document::queryCommandState):
2125 (DOM::Document::queryCommandSupported):
2126 (DOM::Document::queryCommandValue):
2127 * khtml/dom/dom_doc.h:
2128 * khtml/ecma/kjs_dom.cpp: Add queryCommandXXX terminology.
2129 (DOMDocumentProtoFunc::tryCall):
2130 * khtml/ecma/kjs_dom.h:
2131 (KJS::DOMDocument::):
2132 * khtml/ecma/kjs_dom.lut.h:
2134 * khtml/editing/jsediting.cpp: Added. This file implements the guts of editing-related JS methods.
2135 (DOM::execCommandNotImplemented):
2136 (DOM::queryBoolNotImplemented):
2137 (DOM::queryValueNotImplemented):
2138 (DOM::JSEditor::commandDict):
2139 (DOM::JSEditor::JSEditor):
2140 (DOM::JSEditor::~JSEditor):
2141 (DOM::JSEditor::commandIdentifier):
2142 (DOM::JSEditor::addCommand):
2143 (DOM::JSEditor::initDict):
2144 (DOM::JSEditor::execCommand):
2145 (DOM::JSEditor::queryCommandEnabled):
2146 (DOM::JSEditor::queryCommandIndeterm):
2147 (DOM::JSEditor::queryCommandState):
2148 (DOM::JSEditor::queryCommandSupported):
2149 (DOM::JSEditor::queryCommandValue):
2150 (DOM::JSEditor::execCommandCopy):
2151 (DOM::JSEditor::execCommandCut):
2152 (DOM::JSEditor::execCommandDelete):
2153 (DOM::JSEditor::execCommandInsertText):
2154 (DOM::JSEditor::execCommandPaste):
2155 (DOM::JSEditor::execCommandRedo):
2156 (DOM::JSEditor::execCommandSelectAll):
2157 (DOM::JSEditor::execCommandUndo):
2158 (DOM::JSEditor::enabledIfPartNotNull):
2159 (DOM::JSEditor::enabledIfSelectionNotEmpty):
2160 (DOM::JSEditor::enabledIfSelectionIsRange):
2161 (DOM::JSEditor::commandSupported):
2162 * khtml/editing/jsediting.h: Added.
2163 (DOM::JSEditor::CommandIdentifier::CommandIdentifier):
2164 (DOM::JSEditor::document):
2165 (DOM::JSEditor::part):
2166 * khtml/xml/dom_docimpl.cpp: Rework JS editing support into glue that calls over into new JSEditor object.
2167 (DocumentImpl::DocumentImpl):
2168 (DocumentImpl::~DocumentImpl):
2169 (DocumentImpl::jsEditor):
2170 (DocumentImpl::execCommand):
2171 (DocumentImpl::queryCommandEnabled):
2172 (DocumentImpl::queryCommandIndeterm):
2173 (DocumentImpl::queryCommandState):
2174 (DocumentImpl::queryCommandSupported):
2175 (DocumentImpl::queryCommandValue):
2176 * khtml/xml/dom_docimpl.h:
2178 2004-06-03 Richard Williamson <rjw@apple.com>
2180 Added setCompositeOperation method to Context2D.
2181 Actually pass composite operation to drawPixmap (instead of 1).
2185 * khtml/ecma/kjs_html.cpp:
2186 (KJS::Context2DFunction::tryCall):
2187 * khtml/ecma/kjs_html.h:
2189 * khtml/ecma/kjs_html.lut.h:
2192 * kwq/KWQPainter.mm:
2193 (QPainter::compositeOperatorFromString):
2194 (QPainter::drawPixmap):
2196 2004-06-03 David Hyatt <hyatt@apple.com>
2198 Add support for box-flex-group-transition (whew!), a new property that is going to enable some incredibly
2199 complicated flexing layouts in HTML.
2201 This is Stage 1 - wire up the CSS property and make it get parsed into front-end data. Nobody actually looks
2206 * khtml/css/css_valueimpl.cpp:
2207 (CSSInheritedValueImpl::cssText):
2208 (ShadowValueImpl::cssText):
2210 (FlexGroupTransitionValueImpl::~FlexGroupTransitionValueImpl):
2211 (FlexGroupTransitionValueImpl::cssText):
2212 * khtml/css/css_valueimpl.h:
2213 (DOM::FlexGroupTransitionValueImpl::cssValueType):
2214 * khtml/css/cssparser.cpp:
2215 (CSSParser::parseValue):
2216 (CSSParser::parseShadow):
2217 (FlexGroupTransitionParseContext::length):
2218 (FlexGroupTransitionParseContext::~FlexGroupTransitionParseContext):
2219 (FlexGroupTransitionParseContext::failed):
2220 (FlexGroupTransitionParseContext::allowGroup):
2221 (FlexGroupTransitionParseContext::commitGroup):
2222 (FlexGroupTransitionParseContext::commitSlash):
2223 (FlexGroupTransitionParseContext::commitLength):
2224 (FlexGroupTransitionParseContext::commitValue):
2225 (CSSParser::parseFlexGroupTransition):
2226 * khtml/css/cssparser.h:
2227 * khtml/css/cssproperties.c:
2230 * khtml/css/cssproperties.h:
2231 * khtml/css/cssproperties.in:
2232 * khtml/rendering/render_style.cpp:
2233 (StyleFlexibleBoxData::StyleFlexibleBoxData):
2234 (StyleFlexibleBoxData::operator==):
2235 (StyleFlexibleBoxData::transitionDataEquivalent):
2236 (StyleCSS3InheritedData::operator==):
2237 (StyleCSS3InheritedData::shadowDataEquivalent):
2238 (ShadowData::operator==):
2239 (RenderStyle::setBoxFlexGroupTransition):
2241 (FlexGroupTransitionData::operator==):
2242 * khtml/rendering/render_style.h:
2243 (khtml::FlexGroupTransitionData::next):
2244 (khtml::FlexGroupTransitionData::~FlexGroupTransitionData):
2245 (khtml::FlexGroupTransitionData::operator!=):
2246 (khtml::StyleFlexibleBoxData::~StyleFlexibleBoxData):
2247 (khtml::RenderStyle::boxFlexGroupTransition):
2249 2004-06-03 Richard Williamson <rjw@apple.com>
2251 Add extra sanity check to Image parameter of drawImage...
2255 * khtml/ecma/kjs_html.cpp:
2256 (KJS::Context2DFunction::tryCall):
2258 2004-06-02 David Hyatt <hyatt@apple.com>
2260 Fix for 3673931, negative margins on objects that dodge floats not handled correctly.
2264 * khtml/rendering/render_block.cpp:
2265 (khtml::RenderBlock::layoutBlockChildren):
2267 2004-06-03 Ken Kocienda <kocienda@apple.com>
2271 Fix for layout regression I caused when fixing:
2273 <rdar://problem/3668619>: "REGRESSION: text placed on pasteboard by WebKit is offset by one character"
2275 Extra height is added to empty blocks that are editable, so we can click to place
2276 the caret in them. This extra height was erroneously being added to non-editable
2277 blocks as a result of my earlier change. After looking at this and doing some
2278 code review, there are the following changes:
2280 Change away from "containingBlock" terminology in the NodeImpl class. The
2281 operation we are doing in NodeImpl is not the same as what is done in CSS
2282 when it uses the term "containingBlock" so:
2283 containingBlock changes to enclosingBlockFlowElement, and
2284 rootEditableBlock changes to rootEditableElement
2286 The vast majority of changes here are to make these name changes. The other
2287 significant piece of work, and the fix for the regression, is to change
2288 bidi.cpp to only include this extra line height if a block is empty
2289 and is content-editable.
2291 * khtml/editing/htmlediting_impl.cpp:
2292 (khtml::leadingWhitespacePosition):
2293 (khtml::trailingWhitespacePosition):
2294 (khtml::DeleteSelectionCommandImpl::doApply):
2295 (khtml::InputNewlineCommandImpl::doApply):
2296 (khtml::RemoveNodeAndPruneCommandImpl::doApply):
2297 (khtml::TypingCommandImpl::issueCommandForDeleteKey):
2298 * khtml/rendering/bidi.cpp:
2299 (khtml::RenderBlock::layoutInlineChildren):
2300 * khtml/xml/dom_docimpl.cpp:
2301 (DocumentImpl::relinquishesEditingFocus):
2302 (DocumentImpl::acceptsEditingFocus):
2303 * khtml/xml/dom_nodeimpl.cpp:
2304 * khtml/xml/dom_nodeimpl.h:
2305 * khtml/xml/dom_position.cpp:
2306 (DOM::Position::equivalentLeafPosition):
2307 (DOM::Position::previousCharacterPosition):
2308 (DOM::Position::nextCharacterPosition):
2309 (DOM::Position::previousLinePosition):
2310 (DOM::Position::nextLinePosition):
2311 (DOM::Position::equivalentUpstreamPosition):
2312 (DOM::Position::equivalentDownstreamPosition):
2313 (DOM::Position::atStartOfRootEditableElement):
2314 (DOM::Position::inRenderedContent):
2315 (DOM::Position::rendersOnSameLine):
2316 (DOM::Position::rendersInDifferentPosition):
2317 (DOM::Position::isLastRenderedPositionInEditableBlock):
2318 (DOM::Position::inFirstEditableInRootEditableElement):
2319 (DOM::Position::inLastEditableInRootEditableElement):
2320 (DOM::Position::inFirstEditableInContainingEditableBlock):
2321 (DOM::Position::inLastEditableInContainingEditableBlock):
2322 * khtml/xml/dom_position.h:
2323 * khtml/xml/dom_selection.cpp:
2324 (DOM::Selection::moveToRenderedContent):
2326 2004-06-02 Trey Matteson <trey@apple.com>
2328 Added types property to JS clipboard object.
2330 Reviewed by Richard.
2332 * khtml/ecma/kjs_events.cpp:
2333 (Clipboard::getValueProperty): Create JS array for strings coming from the clipboard impl.
2334 * khtml/ecma/kjs_events.h:
2336 * khtml/ecma/kjs_events.lut.h:
2337 * kwq/KWQClipboard.mm:
2338 (MIMETypeFromCocoaType): New helper routine to map types.
2339 (KWQClipboard::types): Implement based on NSPasteboard's types.
2341 2004-06-02 Richard Williamson <rjw@apple.com>
2343 Corrected typo ID_IMG should have been ID_CANVAS when
2344 checking for the canvas composite operator.
2348 * khtml/rendering/render_canvasimage.cpp:
2349 (RenderCanvasImage::paint):
2351 2004-06-02 Richard Williamson <rjw@apple.com>
2353 Correctly size the <CANVAS> if margins, borders, or
2358 * khtml/rendering/render_canvasimage.cpp:
2359 (RenderCanvasImage::createDrawingContext):
2361 2004-06-01 Trey Matteson <trey@apple.com>
2363 First cut at the source side of DHTML dragging. Following IE, new events are added:
2364 ondragstart, ondrag, ondragend. The recently added CSS property -khtml-user-drag can
2365 be used to make an element draggable. event.dataTransfer.setDragImage(ImageObject,x,y)
2366 can be used from ondragstart to set a static image for the dragImage. x,y is the location
2367 of the mouse within the image from the upper right corner. clipboard methods setdata
2368 and cleardata are implemented.
2372 * khtml/ecma/kjs_dom.cpp:
2373 (DOMNode::getValueProperty): Boilerplate for new events
2374 (DOMNode::putValue): Boilerplate for new events
2375 * khtml/ecma/kjs_dom.h:
2376 (KJS::DOMNode::): Boilerplate for new events
2377 * khtml/ecma/kjs_dom.lut.h:
2378 * khtml/ecma/kjs_events.cpp:
2379 (DOMMouseEvent::getValueProperty): Return undefined for clipboard when its not a drag event.
2380 (ClipboardProtoFunc::tryCall): setDragImage glue to clipboard routine.
2381 * khtml/ecma/kjs_events.h:
2383 * khtml/ecma/kjs_events.lut.h:
2384 * khtml/html/html_elementimpl.cpp:
2385 (HTMLElementImpl::parseHTMLAttribute): Boilerplate for new events
2386 * khtml/khtml_part.cpp:
2387 (KHTMLPart::shouldDragAutoNode): Empty impl of new method, where UA determines
2388 draggability for events with -khtml-user-drag=auto
2389 * khtml/khtml_part.h:
2390 * khtml/misc/htmlattrs.c:
2391 * khtml/misc/htmlattrs.h:
2392 * khtml/misc/htmlattrs.in: Boilerplate for new events
2393 * khtml/rendering/render_object.cpp:
2394 (RenderObject::draggableNode): Find the node or parent node which might be dragged.
2395 * khtml/rendering/render_object.h:
2396 * khtml/xml/dom2_eventsimpl.cpp:
2397 (EventImpl::typeToId): Boilerplate for new events
2398 (EventImpl::idToType): Boilerplate for new events
2399 * khtml/xml/dom2_eventsimpl.h:
2400 (DOM::EventImpl::): Boilerplate for new events
2401 * kwq/KWQClipboard.h:
2402 * kwq/KWQClipboard.mm:
2403 (KWQClipboard::clearData): Implemented to call NSPasteboard
2404 (KWQClipboard::clearAllData): ditto
2405 (KWQClipboard::getData): fix corner case that came up testing
2406 (KWQClipboard::setData): Implemented to call NSPasteboard
2407 (KWQClipboard::dragLocation): Simple setter/getters
2408 (KWQClipboard::setDragLocation):
2409 (KWQClipboard::dragImage):
2410 (KWQClipboard::setDragImage):
2411 (KWQClipboard::dragNSImage):
2412 * kwq/KWQKHTMLPart.h:
2413 * kwq/KWQKHTMLPart.mm:
2414 (KWQKHTMLPart::KWQKHTMLPart): init new member var
2415 (KWQKHTMLPart::dragHysteresisExceeded): Hysteresis moved here from WebKit
2416 (KWQKHTMLPart::dispatchDragSrcEvent): Send a dragging event to the current dragSource
2417 (KWQKHTMLPart::khtmlMouseMoveEvent): Initiate dragging, now including consulting DHTML,
2418 hysteresis and sending ondragstart.
2419 (KWQKHTMLPart::dragSourceMovedTo): simple passthrough
2420 (KWQKHTMLPart::dragSourceEndedAt): simple passthrough
2421 (KWQKHTMLPart::mouseDown): salt away _mouseDownX, _mouseDownY
2422 (KWQKHTMLPart::shouldDragAutoNode): Called for -khtml-user-drag=auto. We just call
2424 * kwq/WebCoreBridge.h:
2425 * kwq/WebCoreBridge.mm:
2426 (-[WebCoreBridge dragSourceMovedTo:]): New glue to drive new dragging events.
2427 (-[WebCoreBridge dragSourceEndedAt:operation:]):
2429 2004-06-02 Ken Kocienda <kocienda@apple.com>
2433 Finish off name change from previous check-in by changing dom_edititerator
2434 file names to dom_positioniterator. Files copied and renamed in repository.
2435 Includes updated as needed.
2437 * ForwardingHeaders/xml/dom_edititerator.h: Removed.
2438 * ForwardingHeaders/xml/dom_positioniterator.h: Added.
2439 * WebCore.pbproj/project.pbxproj:
2440 * khtml/editing/htmlediting_impl.cpp:
2441 * khtml/xml/dom_edititerator.cpp: Removed.
2442 * khtml/xml/dom_edititerator.h: Removed.
2443 * khtml/xml/dom_position.cpp:
2444 * khtml/xml/dom_positioniterator.cpp: Added.
2445 (DOM::PositionIterator::peekPrevious):
2446 (DOM::PositionIterator::peekNext):
2447 (DOM::PositionIterator::atStart):
2448 (DOM::PositionIterator::atEnd):
2449 * khtml/xml/dom_positioniterator.h: Added.
2450 (DOM::PositionIterator::PositionIterator):
2451 (DOM::PositionIterator::current):
2452 (DOM::PositionIterator::previous):
2453 (DOM::PositionIterator::next):
2454 (DOM::PositionIterator::setPosition):
2455 (DOM::PositionIterator::isEmpty):
2456 * khtml/xml/dom_selection.cpp:
2458 2004-06-02 Ken Kocienda <kocienda@apple.com>
2462 Probable fix for this bug:
2464 <rdar://problem/3668619>: "REGRESSION: text placed on pasteboard by WebKit is offset by one character"
2466 I could not reproduce the bug myself, which is why I call the fix
2469 Darin and I did some code inspection and found some problems
2470 with the equivalentUpstreamPosition and
2471 equivalentDownstreamPosition functions on DOM::Position and how
2472 these functions dealt with changing from editable to
2473 non-editable content. As a result of these discoveries, I went
2474 over this code and the helpers and functions which support them,
2475 and made some corrections and simplifications. The big changes
2478 1. Rename EditIterator class to PositionIterator. This class needs
2479 to run code for selections in non-editable content, so the name
2480 change is appropriate.
2482 2. Change containingEditableBlock to containingBlock. It turns out
2483 that none of the editing code relies on the distinction between
2484 editable blocks and non-editable blocks. The important distinction
2485 is the block boundary. The notion of rootEditableBlock remains.
2487 * khtml/editing/htmlediting_impl.cpp:
2488 (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): PositionIterator name change.
2489 (khtml::DeleteSelectionCommandImpl::joinTextNodesWithSameStyle): Ditto.
2490 (khtml::DeleteSelectionCommandImpl::containsOnlyWhitespace): Ditto.
2491 (khtml::DeleteSelectionCommandImpl::doApply): Ditto.
2492 (khtml::InputNewlineCommandImpl::doApply): Ditto.
2493 (khtml::RemoveNodeAndPruneCommandImpl::doApply): Ditto.
2494 * khtml/rendering/bidi.cpp:
2495 (khtml::RenderBlock::layoutInlineChildren): Ditto.
2496 * khtml/xml/dom_edititerator.cpp:
2497 (DOM::PositionIterator::peekPrevious): Call for previousLeafNode instead of previousEditable.
2498 Editable check is not appropriate as this class is used for non-editable content.
2499 (DOM::PositionIterator::peekNext): Call nextLeafNode instead of nextEditable, as above.
2500 (DOM::PositionIterator::atStart): Call for previousLeafNode instead of previousEditable, as above.
2501 (DOM::PositionIterator::atEnd): Call nextLeafNode instead of nextEditable, as above.
2502 * khtml/xml/dom_edititerator.h:
2503 (DOM::PositionIterator::PositionIterator): PositionIterator name change. Remove unused and unneeded constructors.
2504 * khtml/xml/dom_nodeimpl.cpp:
2505 (NodeImpl::previousEditable): Simplify. Rely on previousLeafNode as a helper.
2506 (NodeImpl::nextEditable): Ditto, but rely on nextLeafNode.
2507 (NodeImpl::previousLeafNode): Remove tree-walking code. Rely on traversePreviousNode as a helper.
2508 (NodeImpl::nextLeafNode): Ditto, but rely on traverseNextNode.
2509 (NodeImpl::containingBlock): Renamed replacement for containingEditableBlock.
2510 (NodeImpl::inSameContainingEditableBlock): Call renamed containingBlock.
2511 * khtml/xml/dom_nodeimpl.h:
2512 * khtml/xml/dom_position.cpp:
2513 (DOM::Position::previousCharacterPosition): Various name changes, as described above.
2514 (DOM::Position::nextCharacterPosition): Ditto.
2515 (DOM::Position::previousWordPosition): Ditto.
2516 (DOM::Position::nextWordPosition): Ditto.
2517 (DOM::Position::previousLinePosition): Ditto.
2518 (DOM::Position::nextLinePosition): Ditto.
2519 (DOM::Position::equivalentUpstreamPosition): Remove bogus check for editable node in loop. Perform
2520 improved block-crossing check at start of loop which works for editable and non-editable content.
2521 This is the crux of the fix for the bug.
2522 (DOM::Position::equivalentDownstreamPosition): Ditto.
2523 (DOM::Position::inRenderedContent): Various name changes, as described above.
2524 (DOM::Position::rendersOnSameLine): Ditto.
2525 (DOM::Position::rendersInDifferentPosition): Ditto.
2526 (DOM::Position::isFirstRenderedPositionOnLine): Ditto.
2527 (DOM::Position::isLastRenderedPositionOnLine): Ditto.
2528 (DOM::Position::isLastRenderedPositionInEditableBlock): Ditto.
2529 (DOM::Position::inFirstEditableInRootEditableBlock): Ditto.
2530 (DOM::Position::inLastEditableInRootEditableBlock): Ditto.
2531 (DOM::Position::inFirstEditableInContainingEditableBlock): Ditto.
2532 (DOM::Position::inLastEditableInContainingEditableBlock): Ditto.
2534 2004-06-01 Richard Williamson <rjw@apple.com>
2536 Fixed deployment build warning.
2538 * khtml/rendering/render_canvasimage.cpp:
2539 (RenderCanvasImage::paint):
2541 2004-06-01 Richard Williamson <rjw@apple.com>
2543 Added support for composite attribute to <CANVAS>
2544 Added support for drawImage and drawImageFromRect to <CANVAS>, i.e.:
2550 var img = new Image(600,600);
2552 function drawImage()
2554 var aCanvas = document.getElementById ("canvas1");
2555 var context = aCanvas.getContext("context-2d");
2556 context.drawImage (img, 0, 0, 600, 600, "copy");
2559 img.onload = drawImage;
2560 img.src = "http://www.google.com/images/logo.gif";
2565 <canvas id="canvas1" width=600 height=600>
2571 * khtml/ecma/kjs_html.cpp:
2572 (KJS::Context2DFunction::tryCall):
2573 (Context2D::Context2D):
2574 * khtml/ecma/kjs_html.h:
2575 * khtml/rendering/render_canvasimage.cpp:
2576 (RenderCanvasImage::paint):
2578 * kwq/KWQPainter.mm:
2579 (QPainter::getCompositeOperation):
2580 (QPainter::setCompositeOperation):
2581 (QPainter::drawPixmap):
2582 (QPainter::drawTiledPixmap):
2585 (QPixmap::flushRasterCache):
2586 * kwq/WebCoreImageRenderer.h:
2587 * kwq/WebCoreImageRendererFactory.h:
2589 2004-06-01 Ken Kocienda <kocienda@apple.com>
2595 <rdar://problem/3655028>: "Text styles have hard-coded values making bold the only supported text style"
2596 <rdar://problem/3656969>: "HTML Editing: Font panel doesn't work"
2598 * khtml/css/css_valueimpl.cpp:
2599 (FontFamilyValueImpl::cssText): Added implementation for this subclass. Returns parsedFontName.
2600 * khtml/css/css_valueimpl.h: Declare cssText() on FontFamilyValueImpl.
2601 (DOM::CSSProperty::value):
2602 * khtml/editing/htmlediting.cpp:
2603 (khtml::ApplyStyleCommand::ApplyStyleCommand): Changed signature to take a CSSStyleDeclarationImpl.
2604 (khtml::ApplyStyleCommand::style): Added accessor.
2605 * khtml/editing/htmlediting.h: Changed constructor signature to take a CSSStyleDeclarationImpl.
2606 * khtml/editing/htmlediting_impl.cpp:
2607 (khtml::styleSpanClassString): Added helper to return attribute used to tag spans we add to apply styles.
2608 (khtml::ApplyStyleCommandImpl::ApplyStyleCommandImpl): Ref style passed in.
2609 (khtml::ApplyStyleCommandImpl::~ApplyStyleCommandImpl): Deref style passed in.
2610 (khtml::ApplyStyleCommandImpl::doApply): m_removingStyle is obsolete. Removed.
2611 (khtml::ApplyStyleCommandImpl::isHTMLStyleNode): Now checks all properties in the object's declaration.
2612 (khtml::ApplyStyleCommandImpl::removeCSSStyle): Again, now is multi-property-savvy. Will now remove an empty span
2614 (khtml::ApplyStyleCommandImpl::currentlyHasStyle): Replaced, bold-only code with code that can handle all styles.
2615 (khtml::ApplyStyleCommandImpl::computeStyleChange): Helper which helps to determine whether we want to apply
2616 HTML-style markup for bold and italic, and gathers up all style changes that need to be done.
2617 (khtml::ApplyStyleCommandImpl::positionInsertionPoint): Added comment explaining possible optimization that might be
2619 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Significant reworking; now handles applying multiple styles.
2620 (khtml::ApplyStyleCommandImpl::cloneSelection): Assert fragment has at least one child. Don't want to work
2622 (khtml::ApplyStyleCommandImpl::surroundContentsWithElement): New helper.
2623 (khtml::RemoveCSSPropertyCommandImpl::~RemoveCSSPropertyCommandImpl): Juggle asserts and lifecycle methods to be
2624 more like other commands.
2625 (khtml::RemoveCSSPropertyCommandImpl::doApply): Ditto.
2626 (khtml::RemoveNodeAttributeCommandImpl::~RemoveNodeAttributeCommandImpl): Ditto.
2627 (khtml::RemoveNodeAttributeCommandImpl::doApply):Ditto.
2628 * khtml/editing/htmlediting_impl.h:
2629 (khtml::ApplyStyleCommandImpl::style): Added.
2630 (khtml::ApplyStyleCommandImpl::StyleChange::StyleChange): Added.
2632 (-[DOMCSSStyleDeclaration setProperty:::]): Fix problem where passing an empty NSString to a function expecting a boolean
2633 made all properties important priority.
2634 * kwq/WebCoreBridge.mm:
2635 (-[WebCoreBridge applyStyle:]): Remove provisional code and comment. Now pass along style, following the intended design.
2637 2004-06-01 Chris Blumenberg <cblu@apple.com>
2639 Reviewed by kocienda.
2641 * kwq/WebCoreBridge.h:
2642 * kwq/WebCoreBridge.mm:
2643 (-[WebCoreBridge dragCaretDOMRange]): new, lets WebKit pass the drag caret DOM range to the editing delegate
2645 2004-05-28 John Louch <ouch@apple.com>
2649 - removed setShadowWithColor and change setShadow to work with optional attributes
2650 it follows the same rules as setFill/StrokeColor
2651 - Fixed bug in setFillColor and setStrokeColor for CMYK colors (missing break in case).
2653 * khtml/ecma/kjs_html.cpp:
2654 (KJS::Context2DFunction::tryCall):
2655 * khtml/ecma/kjs_html.h:
2657 * khtml/ecma/kjs_html.lut.h:
2660 2004-05-28 Darin Adler <darin@apple.com>
2664 - various editing-related improvements
2666 * khtml/xml/dom_selection.h: Removed UP and DOWN directions, and added PARAGRAPH granularity.
2667 * khtml/xml/dom_selection.cpp:
2668 (DOM::Selection::modify): Got rid of the UP and DOWN directions, and made movement
2669 between lines happen when granularity is LINE. Added a new unimplemented granularity:
2671 (DOM::Selection::validate): Remove some unneeded APPLE_CHANGES. The code need not be ifdef'd.
2672 (DOM::Selection::debugPosition): Ditto.
2674 * kwq/WebCoreBridge.h: Removed WebSelectUp and WebSelectDown, and added WebSelectByParagraph.
2675 Added stringForRange: and selectedDOMRangeWithGranularity:, and renamed replaceSelectionWithNewline
2676 to insertNewline because it has the insertText: semantic, not the replaceSelectionWithText: one.
2677 * kwq/WebCoreBridge.mm:
2678 (-[WebCoreBridge stringForRange:]): Added.
2679 (-[WebCoreBridge selectedDOMRangeWithGranularity:]): Added.
2680 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Updated code to understand
2681 that vertical movement is based on granularity now, not direction.
2682 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]): Moved an ensureCaretVisible
2683 from the WebKit down here. I think perhaps this should go down even further in WebCore.
2684 (-[WebCoreBridge insertNewline]): Renamed, and moved ensureCaretVisible here.
2685 (-[WebCoreBridge insertText:]): Moved ensureCaretVisible here.
2686 (-[WebCoreBridge deleteKeyPressed]): Moved ensureCaretVisible here.
2688 * khtml/xml/dom_position.cpp: Some ifdef tweaks.
2690 * khtml/misc/helper.cpp: Namespace and formatting tweaks.
2691 * khtml/misc/helper.h: Removed some unused stuff.
2693 * khtml/dom/dom2_range.h: Make range constructor public so that anyone with
2694 a RangeImpl can easily make a Range.
2696 2004-05-28 Richard Williamson <rjw@apple.com>
2698 setStrokeColor and setFillColor now support
2699 old school web color string, oswcs+alpha, gray, gray+alpha,
2704 * khtml/css/cssparser.cpp:
2705 (CSSParser::parseColor):
2706 (CSSParser::parseColorFromValue):
2707 * khtml/css/cssparser.h: Made parseColor static public class method
2708 * khtml/ecma/kjs_html.cpp:
2709 (KJS::Context2DFunction::tryCall):
2711 2004-05-28 David Hyatt <hyatt@apple.com>
2713 Implement -khtml-user-select and add support for the property -khtml-user-drag (although someone will still
2714 need to wire it up).
2718 * khtml/css/cssparser.cpp:
2719 (CSSParser::parseValue):
2720 * khtml/css/cssproperties.c:
2723 * khtml/css/cssproperties.h:
2724 * khtml/css/cssproperties.in:
2725 * khtml/css/cssstyleselector.cpp:
2726 (khtml::CSSStyleSelector::applyProperty):
2727 * khtml/css/cssvalues.c:
2730 * khtml/css/cssvalues.h:
2731 * khtml/css/cssvalues.in:
2732 * khtml/khtml_part.cpp:
2733 (KHTMLPart::handleMousePressEventDoubleClick):
2734 (KHTMLPart::handleMousePressEventTripleClick):
2735 (KHTMLPart::handleMousePressEventSingleClick):
2736 (KHTMLPart::handleMouseMoveEventSelection):
2737 * khtml/rendering/render_canvas.cpp:
2738 (RenderCanvas::setSelection):
2739 * khtml/rendering/render_object.cpp:
2740 (RenderObject::shouldSelect):
2741 * khtml/rendering/render_object.h:
2742 * khtml/rendering/render_style.cpp:
2744 (StyleCSS3NonInheritedData::operator==):
2745 (RenderStyle::diff):
2746 * khtml/rendering/render_style.h:
2748 (khtml::RenderStyle::userDrag):
2749 (khtml::RenderStyle::userSelect):
2750 (khtml::RenderStyle::setUserDrag):
2751 (khtml::RenderStyle::setUserSelect):
2752 (khtml::RenderStyle::initialUserDrag):
2753 (khtml::RenderStyle::initialUserSelect):
2755 2004-05-28 John Louch <set EMAIL_ADDRESS environment variable>
2756 added addArc and clip path routines.
2758 Reviewed by sullivan.
2760 * khtml/ecma/kjs_html.cpp:
2761 (KJS::Context2DFunction::tryCall):
2762 * khtml/ecma/kjs_html.h:
2764 * khtml/ecma/kjs_html.lut.h:
2767 2004-05-28 John Louch <ouch@apple.com>
2769 Added addArcToPoint and addRect path routines.
2771 Reviewed by sullivan.
2773 * khtml/ecma/kjs_html.cpp:
2774 (KJS::Context2DFunction::tryCall):
2775 * khtml/ecma/kjs_html.h:
2777 * khtml/ecma/kjs_html.lut.h:
2780 2004-05-27 Ken Kocienda <kocienda@apple.com>
2784 * khtml/xml/dom_selection.cpp:
2785 (DOM::Selection::toRange): Add call to update document layout before returning a Range.
2786 This is done to ensure recently-done editing changes are reflected in the calculation
2787 of the Range. This change solves a specific problem with updating the font panel, where
2788 the wrong Range was used, resulting in an incorrect font. Also, defer converting
2789 positions to be range-compliant positions. The nodeIsBeforeNode function is not
2790 range-compliant-position-savvy.
2792 2004-05-27 Kevin Decker <kdecker@apple.com>
2796 - added support for the new JavaScript error console
2797 - error messages are now wired directly to the bridge
2798 - revised generated error message content
2800 * khtml/ecma/kjs_events.cpp:
2801 (JSEventListener::handleEvent):
2802 * khtml/ecma/kjs_proxy.cpp:
2803 (KJSProxyImpl::evaluate):
2804 * khtml/ecma/kjs_window.cpp:
2805 (Window::isSafeScript):
2806 (ScheduledAction::execute):
2807 * kwq/KWQKHTMLPart.h:
2808 * kwq/KWQKHTMLPart.mm:
2809 (KWQKHTMLPart::addMessageToConsole):
2810 * kwq/WebCoreBridge.h:
2811 * kwq/WebCoreBridge.mm:
2813 2004-05-27 Trey Matteson <trey@apple.com>
2815 Two dragging tweaks: ondragleave events are sent before ondragenter events when
2816 going across element boundaries, to match WinIE.
2817 For compatibility with WinIE, we honor MIME types of "Text" and "URL".
2821 * khtml/khtmlview.cpp:
2822 (KHTMLView::updateDragAndDrop):
2823 * kwq/KWQClipboard.mm:
2824 (cocoaTypeFromMIMEType):
2828 2004-05-27 Vicki Murley <vicki@apple.com>
2832 - Fix Tiger build failure. Rename constant "S" to "WHITESPACE",
2833 and change all instances of S to WHITESPACE.
2835 * khtml/css/cssparser.cpp:
2836 (DOM::CSSParser::lex): S to WHITESPACE
2837 * khtml/css/parser.cpp: regenerated file
2838 * khtml/css/parser.h: regenerated file
2839 * khtml/css/parser.y: S to WHITESPACE
2840 * khtml/css/tokenizer.cpp: regenerated file
2841 * khtml/css/tokenizer.flex: S to WHITESPACE
2843 2004-05-27 John Louch <set EMAIL_ADDRESS environment variable>
2845 Reviewed by NOBODY (OOPS!).
2847 * khtml/ecma/kjs_html.cpp:
2848 (KJS::Context2DFunction::tryCall):
2849 * khtml/ecma/kjs_html.h:
2851 * khtml/ecma/kjs_html.lut.h:
2854 2004-05-27 Trey Matteson <trey@apple.com>
2856 First cut at DHTML dragging, destination side. Dragging text, files
2857 and URLs onto elements works. Type conversion from NSPasteboard to
2858 MIME types is hardwired. No JS access yet to modifier keys, or
2859 drag operations mask.
2861 Per IE's dragging API, we have the new DOM events ondragenter,
2862 ondragover, ondragleave and ondrop.
2863 We also have an event.dataTransfer object providing access to the
2864 NSPasteboard bearing the incoming data.
2868 * WebCore.pbproj/project.pbxproj: add 2 new files.
2869 * khtml/ecma/kjs_dom.cpp:
2870 (DOMNode::getValueProperty): JS access to ondragenter and pals
2871 (DOMNode::putValue): Ditto
2872 * khtml/ecma/kjs_dom.h:
2873 (KJS::DOMNode::): New attr enum values.
2874 * khtml/ecma/kjs_dom.lut.h:
2876 * khtml/ecma/kjs_events.cpp:
2877 (DOMMouseEvent::mark): Pass along mark to dataTransfer we hold.
2878 (DOMMouseEvent::getValueProperty): Create and return dataTransfer.
2879 (Clipboard::Clipboard): New class exposed in JS.
2880 (Clipboard::~Clipboard):
2881 (Clipboard::tryGet): Boilerplate.
2882 (Clipboard::getValueProperty): Return the clipboard's props.
2883 (Clipboard::tryPut): Boilerplate.
2884 (Clipboard::putValue): Set the clipboard's props.
2885 (ClipboardProtoFunc::tryCall): Implement clipboard's funcs.
2886 * khtml/ecma/kjs_events.h:
2887 (KJS::DOMMouseEvent::DOMMouseEvent): Init clipboard ptr.
2888 (KJS::DOMMouseEvent::):
2889 (KJS::Clipboard::toBoolean):
2890 (KJS::Clipboard::classInfo):
2892 * khtml/ecma/kjs_events.lut.h:
2894 * khtml/html/html_elementimpl.cpp:
2895 (HTMLElementImpl::parseHTMLAttribute): Enable setting ondragenter
2896 and friends as html attributes.
2897 * khtml/khtmlview.cpp:
2898 (KHTMLView::dispatchDragEvent): Send a drag related event to the DOM.
2899 (KHTMLView::updateDragAndDrop): Handle a dragenter or dragupdate.
2900 (KHTMLView::cancelDragAndDrop): Handle a dragexit.
2901 (KHTMLView::performDragAndDrop): Handle an actual drop.
2902 * khtml/khtmlview.h:
2903 * khtml/misc/htmlattrs.c: Generated code.
2904 * khtml/misc/htmlattrs.h: Generated code.
2905 * khtml/misc/htmlattrs.in: Add ondragenter, etc
2906 * khtml/xml/dom2_eventsimpl.cpp:
2907 (EventImpl::typeToId): Handle new event types for dragging.
2908 (EventImpl::idToType): Ditto.
2909 (MouseEventImpl::MouseEventImpl): Init new clipboard ptr.
2910 (MouseEventImpl::~MouseEventImpl): Deref clipboard.
2911 (ClipboardImpl::ClipboardImpl):
2912 (ClipboardImpl::~ClipboardImpl):
2913 * khtml/xml/dom2_eventsimpl.h:
2914 (DOM::EventImpl::): New event enums.
2915 (DOM::MouseEventImpl::clipboard):
2916 * kwq/KWQClipboard.h: Added.
2917 * kwq/KWQClipboard.mm: Added.
2918 (KWQClipboard::KWQClipboard):
2919 (KWQClipboard::~KWQClipboard):
2920 (KWQClipboard::isForDragging): Trivial getter/setters.
2921 (KWQClipboard::dropEffect):
2922 (KWQClipboard::setDropEffect):
2923 (KWQClipboard::dropAllowed):
2924 (KWQClipboard::setDropAllowed):
2925 (cocoaTypeFromMIMEType): Convert MIME pboard type to Cocoa type.
2926 (KWQClipboard::clearData): OSX specific clipboard impl. of IE func
2927 (KWQClipboard::clearAllData): Ditto
2928 (KWQClipboard::getData): Ditto
2929 (KWQClipboard::setData): Ditto
2930 * kwq/WebCoreBridge.h:
2931 * kwq/WebCoreBridge.mm:
2932 (-[WebCoreBridge dragOperationForDraggingInfo:]): Passthrough from WebKit to khtmlpart
2933 (-[WebCoreBridge dragExitedWithDraggingInfo:]): Ditto
2934 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto
2936 2004-05-27 Ken Kocienda <kocienda@apple.com>
2940 * kwq/KWQKHTMLPart.h: Declare new fontForCurrentPosition helper.
2941 * kwq/KWQKHTMLPart.mm:
2942 (KWQKHTMLPart::fontForCurrentPosition): Determines the "current font" in the way that Cocoa
2943 does. Either the font of the character before the caret, when the selection is a caret, or
2944 the font of the first character selected, when the selection is a range.
2945 * kwq/WebCoreBridge.h: Declare bridge method so this can be called from WebKit.
2946 * kwq/WebCoreBridge.mm:
2947 (-[WebCoreBridge fontForCurrentPosition]): Calls through to fontForCurrentPosition on KWQKHTMLPart.
2949 2004-05-27 Ken Kocienda <kocienda@apple.com>
2953 Adds a typing style member variable to khtml part.
2954 This patch adds basic life-cycle management and
2955 accessors. In addition, one essential piece of
2956 behavior has been added: Clearing the typing style
2957 whenever the selection changes.
2959 Follow-on work will make this typing style a fully
2960 functional part of applying styles to text while typing.
2962 * khtml/khtml_part.cpp:
2963 (KHTMLPart::notifySelectionChanged): Clear typing style.
2964 (KHTMLPart::typingStyle): Getter.
2965 (KHTMLPart::setTypingStyle): Setter.
2966 (KHTMLPart::clearTypingStyle): Convenience. Sets to 0.
2967 * khtml/khtml_part.h: Function declarations.
2968 * khtml/khtmlpart_p.h:
2969 (KHTMLPartPrivate::KHTMLPartPrivate): Initialize member variable.
2970 (KHTMLPartPrivate::~KHTMLPartPrivate): Deref if necessary.
2972 2004-05-27 Ken Kocienda <kocienda@apple.com>
2976 Add helper to get the DOM element for a Position.
2978 * khtml/xml/dom_position.cpp:
2979 (DOM::Position::element): Returns the Position's node if it is an element, or
2980 the first ancestor of the node that is an element. Returns 0 if node is not
2981 an element and has no parent that is an element.
2982 * khtml/xml/dom_position.h: Added declaration.
2984 2004-05-27 Darin Adler <darin@apple.com>
2988 - moved to new symlink technique for embedding frameworks
2990 * WebCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
2991 because we don't need it any more.
2993 2004-05-27 Darin Adler <darin@apple.com>
2995 - fixed bug where all pages with images would cause a crash
2996 - fixed Deployment build
2998 * kwq/KWQPainter.mm: (QPainter::drawPixmap): Put #if 0 around placeholder code
2999 for setting up the graphics context.
3001 2004-05-26 Richard Williamson <rjw@apple.com>
3003 Added shadow support (w/ Louch).
3004 Added infrastructure for drawing images.
3006 New context methods:
3012 Reviewed by me and Louch.
3014 * khtml/ecma/kjs_html.cpp:
3015 (KJS::Context2DFunction::tryCall):
3016 * khtml/ecma/kjs_html.h:
3017 (KJS::Image::image):
3019 * khtml/ecma/kjs_html.lut.h:
3022 * kwq/KWQPainter.mm:
3023 (QPainter::drawPixmap):
3025 2004-05-26 Richard Williamson <rjw@apple.com>
3029 * khtml/ecma/kjs_html.cpp:
3030 (KJS::Context2DFunction::tryCall):
3031 * khtml/ecma/kjs_html.h:
3033 * khtml/ecma/kjs_html.lut.h:
3036 2004-05-26 Richard Williamson <rjw@apple.com>
3038 Part 2 of the new <CANVAS> tag implementation. This adds the
3039 basic machinery and draw operations for the <CANVAS> tag. Pretty cool.
3041 function drawLine() {
3042 var canvas1 = document.getElementById ("canvas1");
3043 var context = canvas1.getContext("context-2d");
3045 context.setStrokeColor ("red");
3046 context.setLineWidth (10);
3047 context.beginPath();
3048 context.moveToPoint (0,0);
3049 context.addLineToPoint (400,400);
3050 context.strokePath();
3055 <canvas id="canvas1" width="400" height="400">
3057 Currently supported operations on the 2D context are:
3060 Scale, Rotate, Translate,
3061 BeginPath, ClosePath,
3062 SetStrokeColor, SetFillColor, SetLineWidth, SetLineCap, SetLineJoin, SetMiterLimit,
3063 FillPath, StrokePath,
3064 MoveToPoint, AddLineToPoint, AddQuadraticCurveToPoint, AddBezierCurveToPoint,
3071 * khtml/ecma/kjs_html.cpp:
3072 (KJS::HTMLElementFunction::tryCall):
3073 (KJS::Context2DFunction::tryCall):
3074 (Context2D::tryGet):
3075 (Context2D::getValueProperty):
3076 (Context2D::tryPut):
3077 (Context2D::putValue):
3078 (Context2D::Context2D):
3079 (Context2D::~Context2D):
3080 * khtml/ecma/kjs_html.h:
3081 (KJS::Context2D::toBoolean):
3082 (KJS::Context2D::classInfo):
3084 * khtml/ecma/kjs_html.lut.h:
3086 * khtml/html/html_canvasimpl.cpp:
3087 (HTMLCanvasElementImpl::HTMLCanvasElementImpl):
3088 * khtml/html/htmlparser.cpp:
3089 (KHTMLParser::getElement):
3090 * khtml/rendering/render_canvasimage.cpp:
3091 (RenderCanvasImage::RenderCanvasImage):
3092 (RenderCanvasImage::~RenderCanvasImage):
3093 (RenderCanvasImage::createDrawingContext):
3094 (RenderCanvasImage::drawingContext):
3095 (RenderCanvasImage::setNeedsImageUpdate):
3096 (RenderCanvasImage::updateDrawnImage):
3097 (RenderCanvasImage::drawnImage):
3098 (RenderCanvasImage::paint):
3099 (RenderCanvasImage::layout):
3100 * khtml/rendering/render_canvasimage.h:
3101 * khtml/rendering/render_image.cpp:
3102 (RenderImage::paint):
3103 * khtml/rendering/render_image.h:
3104 * khtml/rendering/render_replaced.cpp:
3105 (RenderReplaced::shouldPaint):
3106 (RenderWidget::paint):
3108 * kwq/KWQPainter.mm:
3109 (QPainter::currentContext):
3111 2004-05-26 Darin Adler <darin@apple.com>
3113 - fixed warning that prevents Deployment build from compiling
3115 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMousePressEvent):
3116 Moved use of single-click boolean outside the scope of the "block exceptions" macros.
3118 2004-05-25 Chris Blumenberg <cblu@apple.com>
3120 Fixed a regression where selections that were created via double or triple were not draggable.
3124 * kwq/KWQKHTMLPart.mm:
3125 (KWQKHTMLPart::khtmlMousePressEvent): if the click count is greater than 1, don't allow drags
3126 (KWQKHTMLPart::khtmlMouseMoveEvent): allow drags to occur even if the selection was originally created via double or triple click
3128 2004-05-25 Chris Blumenberg <cblu@apple.com>
3130 Fixed regression where undoing typing would undo character-by-character.
3132 Reviewed by kocienda.
3134 * kwq/WebCoreBridge.h:
3135 * kwq/WebCoreBridge.mm:
3136 (-[WebCoreBridge insertText:]): new, this method used to be replaceSelectionWithText, but replaceSelectionWithText now is one operation whereas calls to insertText: are coalesced
3138 2004-05-25 Ken Kocienda <kocienda@apple.com>
3142 Change postDidChangeSelectionNotification and postDidChangeNotification tp
3143 respondToChangedSelection and respondToChangedContents, respectively, to
3144 account for the fact that we do work in these calls other than post a
3147 * khtml/khtml_part.cpp:
3148 (KHTMLPart::notifySelectionChanged): Use new names.
3149 (KHTMLPart::appliedEditing): Ditto.
3150 (KHTMLPart::unappliedEditing): Ditto.
3151 (KHTMLPart::reappliedEditing): Ditto.
3152 * kwq/KWQKHTMLPart.h: Change name of functions as described.
3153 * kwq/KWQKHTMLPart.mm:
3154 (KWQKHTMLPart::respondToChangedSelection): Ditto.
3155 (KWQKHTMLPart::respondToChangedContents): Ditto.
3156 * kwq/WebCoreBridge.h: Ditto.
3158 2004-05-25 Maciej Stachowiak <mjs@apple.com>
3162 * ForwardingHeaders/misc/khtml_text_operations.h: Added.
3164 2004-05-25 Richard Williamson <rjw@apple.com>
3166 Part 1 of the new <CANVAS> tag implementation. This patch
3167 adds the boiler plate for the new element.
3171 * ForwardingHeaders/html/html_canvasimpl.h: Added.
3172 * ForwardingHeaders/rendering/render_canvasimage.h: Added.
3173 * WebCore.pbproj/project.pbxproj:
3174 * khtml/ecma/kjs_html.cpp:
3175 (KJS::HTMLElement::classInfo):
3176 (KJS::HTMLElementFunction::tryCall):
3177 * khtml/ecma/kjs_html.h:
3178 (KJS::HTMLElement::):
3179 * khtml/ecma/kjs_html.lut.h:
3181 * khtml/html/dtd.cpp:
3183 * khtml/html/html_canvasimpl.cpp: Added.
3184 (HTMLCanvasElementImpl::HTMLCanvasElementImpl):
3185 (HTMLCanvasElementImpl::~HTMLCanvasElementImpl):
3186 (HTMLCanvasElementImpl::id):
3187 (HTMLCanvasElementImpl::mapToEntry):
3188 (HTMLCanvasElementImpl::parseHTMLAttribute):
3189 (HTMLCanvasElementImpl::createRenderer):
3190 (HTMLCanvasElementImpl::attach):
3191 (HTMLCanvasElementImpl::detach):
3192 (HTMLCanvasElementImpl::isURLAttribute):
3193 * khtml/html/html_canvasimpl.h: Added.
3194 * khtml/html/htmlparser.cpp:
3195 (KHTMLParser::getElement):
3196 * khtml/misc/htmltags.c:
3199 * khtml/misc/htmltags.h:
3200 * khtml/misc/htmltags.in:
3201 * khtml/rendering/render_canvasimage.cpp: Added.
3202 (RenderCanvasImage::RenderCanvasImage):
3203 (RenderCanvasImage::~RenderCanvasImage):
3204 (RenderCanvasImage::paint):
3205 (RenderCanvasImage::layout):
3206 * khtml/rendering/render_canvasimage.h: Added.
3207 (khtml::RenderCanvasImage::renderName):
3208 (khtml::RenderCanvasImage::element):
3210 2004-05-25 Chris Blumenberg <cblu@apple.com>
3212 Fixed: <rdar://problem/3546418>: (when dragging text within an editable HTML doc, the selection should be moved not copied)
3214 Reviewed by kocienda.
3216 * khtml/editing/htmlediting_impl.cpp:
3217 (khtml::MoveSelectionCommandImpl::doApply): implemented
3218 * khtml/khtml_part.cpp:
3219 (KHTMLPart::setDragCaret): make the old drag cursor rect dirty
3220 * khtml/khtml_part.h:
3222 2004-05-25 Maciej Stachowiak <mjs@apple.com>
3226 - fixed <rdar://problem/3657363>: (Editing: export innerText, innerHTML, outerText, outerHTML and setters to Objective-C)
3227 - partial fix for <rdar://problem/3656706>: (Fix innerText and setInnerText DOM extensions)
3229 * khtml/html/html_elementimpl.cpp:
3230 (HTMLElementImpl::innerText): Use plainText() to make the text, to
3231 match other browsers.
3232 (HTMLElementImpl::outerText): Extended comment.
3233 * khtml/misc/khtml_text_operations.h:
3234 * kwq/DOMExtensions.h:
3236 (-[DOMHTMLElement outerText]): Added new ObjC wrapper for this.
3237 (-[DOMHTMLElement setOuterText:]): Ditto.
3239 2004-05-25 Ken Kocienda <kocienda@apple.com>
3243 Defer setting the selection to delete when none has been passed in to the
3244 time that the command is run. This fixes a problem where a command nested
3245 in a composite was not correctly picking up the right selection to begin
3246 its work. Now, the command will correctly use the ending selection of
3247 its parent when no selection has been passed in.
3249 * khtml/editing/htmlediting_impl.cpp:
3250 (khtml::DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl):
3251 (khtml::DeleteCollapsibleWhitespaceCommandImpl::doApply):
3252 (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
3253 (khtml::DeleteSelectionCommandImpl::doApply):
3254 * khtml/editing/htmlediting_impl.h:
3256 2004-05-24 Maciej Stachowiak <mjs@apple.com>
3260 Added a new simple layout test for outerText.
3262 * layout-tests/fast/dom/outerText-expected.txt: Added.
3263 * layout-tests/fast/dom/outerText.html: Added.
3265 2004-05-24 Darin Adler <darin@apple.com>
3269 - fixed <rdar://problem/3665813>: (iBench is crashing in TOT)
3271 * khtml/html/html_formimpl.cpp: (HTMLSelectElementImpl::HTMLSelectElementImpl):
3272 Initialize m_options to 0.
3274 2004-05-24 Ken Kocienda <kocienda@apple.com>
3278 * khtml/xml/dom_selection.cpp:
3279 (DOM::Selection::toRange): Improved the code to return ranges that are
3280 convenient to use by WebKit code which needs to perform text-editor-like
3281 operations with ranges. Comments in the code describe this behavior.
3282 (DOM::Selection::nodeIsBeforeNode): Make this method const.
3283 * khtml/xml/dom_selection.h: Ditto.
3285 2004-05-24 Chris Blumenberg <cblu@apple.com>
3287 Improved editing via drag.
3289 Reviewed by kocienda.
3291 * khtml/editing/htmlediting.cpp: Renamed PasteMarkupCommand to ReplaceSelectionCommand
3292 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
3293 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
3294 (khtml::ReplaceSelectionCommand::impl):
3295 (khtml::MoveSelectionCommand::MoveSelectionCommand):
3296 (khtml::MoveSelectionCommand::~MoveSelectionCommand):
3297 (khtml::MoveSelectionCommand::impl):
3298 * khtml/editing/htmlediting.h:
3300 * khtml/editing/htmlediting_impl.cpp:
3301 (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl):
3302 (khtml::ReplaceSelectionCommandImpl::~ReplaceSelectionCommandImpl):
3303 (khtml::ReplaceSelectionCommandImpl::commandID):
3304 (khtml::ReplaceSelectionCommandImpl::doApply):
3305 (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): new command
3306 (khtml::MoveSelectionCommandImpl::~MoveSelectionCommandImpl):
3307 (khtml::MoveSelectionCommandImpl::commandID):
3308 (khtml::MoveSelectionCommandImpl::doApply):
3309 * khtml/editing/htmlediting_impl.h:
3310 * khtml/khtml_part.cpp:
3311 (KHTMLPart::dragCaret): new
3312 (KHTMLPart::setDragCaret): new
3313 (KHTMLPart::notifyDragCaretChanged): new
3314 (KHTMLPart::paintDragCaret): new
3315 * khtml/khtml_part.h:
3316 * khtml/khtmlpart_p.h:
3317 * khtml/rendering/render_block.cpp:
3318 (khtml::RenderBlock::paintObject): paint the drag caret
3320 (+[DOMDocumentFragment _documentFragmentWithImpl:]): made internally available
3321 (-[DOMDocumentFragment _fragmentImpl]):
3322 * kwq/DOMInternal.h:
3323 * kwq/WebCoreBridge.h:
3324 * kwq/WebCoreBridge.mm:
3325 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): new
3326 (-[WebCoreBridge documentFragmentWithText:]): new
3327 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]): new
3328 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:]): renamed to take the selectReplacement BOOL
3329 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:]): ditto
3330 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:]): ditto
3331 (-[WebCoreBridge replaceSelectionWithNewline]): moved
3332 (-[WebCoreBridge setSelectionToDragCaret]): new
3333 (-[WebCoreBridge moveSelectionToDragCaret:]): new
3334 (-[WebCoreBridge moveDragCaretToPoint:]): set the drag caret, not the selection
3335 (-[WebCoreBridge removeDragCaret]): new
3337 2004-05-24 Ken Kocienda <kocienda@apple.com>
3341 Fixed some life-cycle issues with node iterators and detaching. Big deal is
3342 to detach in DOMNodeIterator dealloc. Otherwise, NodeIterators created from
3345 * khtml/xml/dom2_traversalimpl.cpp:
3346 (DOM::NodeIteratorImpl::detach): Only detach if not yet detached.
3347 * khtml/xml/dom2_traversalimpl.h:
3348 (DOM::NodeIteratorImpl::setDetached): New convenience.
3350 (-[DOMNodeIterator dealloc]): Detach here, if not yet detached; fixes leak.
3352 2004-05-24 Ken Kocienda <kocienda@apple.com>
3356 * khtml/css/css_computedstyle.cpp:
3357 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Fixed to return the property value,
3358 as it should, instead of the whole property, as it was doing before.
3360 2004-05-23 Darin Adler <darin@apple.com>
3364 - fixed <rdar://problem/3259919>: (Shift click should extend selection)
3366 * khtml/khtmlpart_p.h: Renamed m_textElement to m_selectionGranularity and
3367 m_mouseMovedSinceLastMousePress to m_beganSelectingText.
3368 * khtml/khtml_part.cpp:
3369 (KHTMLPart::handleMousePressEventDoubleClick): Set m_beganSelectingText if the double-click
3370 began selecting text.
3371 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
3372 (KHTMLPart::handleMousePressEventSingleClick): Added code to extend selection if shift is down.
3373 (KHTMLPart::khtmlMousePressEvent): Remove code that sets the selection granularity to
3374 "by character". We only want to do that if we start selecting with a single click.
3375 Otherwise we want to leave the selection granularity alone.
3376 (KHTMLPart::khtmlMouseReleaseEvent): Change the code that clears the selection on a plain old
3377 click to check the m_beganSelectingText boolean so it won't run when you shift-click, for example.
3378 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMouseMoveEvent): Updated for m_textElement
3381 2004-05-22 Darin Adler <darin@apple.com>
3385 - went through things marked "unimplemented" or "not implemented" and removed
3386 or implemented as many as possible
3388 * kwq/DOM.mm: (-[DOMNode dispatchEvent:]): Implemented.
3389 Also moved DOMAbstractView and DOMDocumentView into DOMViews.mm.
3390 * kwq/DOM-CSS.mm: (-[DOMDocument getComputedStyle::]): Implemented.
3392 * kwq/DOMEventsInternal.h: Added.
3394 (-[DOMEvent type]): Implemented.
3395 (-[DOMEvent target]): Implemented.
3396 (-[DOMEvent currentTarget]): Implemented.
3397 (-[DOMEvent eventPhase]): Implemented.
3398 (-[DOMEvent bubbles]): Implemented.
3399 (-[DOMEvent cancelable]): Implemented.
3400 (-[DOMEvent timeStamp]): Implemented.
3401 (-[DOMEvent stopPropagation]): Implemented.
3402 (-[DOMEvent preventDefault]): Implemented.
3403 (-[DOMEvent initEvent:::]): Implemented.
3404 (-[DOMEvent _eventImpl]): Added.
3405 (-[DOMEvent _initWithEventImpl:]): Added.
3406 (+[DOMEvent _eventWithImpl:]): Added.
3407 (-[DOMMouseEvent _mouseEventImpl]): Added.
3408 (-[DOMMouseEvent screenX]): Implemented.
3409 (-[DOMMouseEvent screenY]): Implemented.
3410 (-[DOMMouseEvent clientX]): Implemented.
3411 (-[DOMMouseEvent clientY]): Implemented.
3412 (-[DOMMouseEvent ctrlKey]): Implemented.
3413 (-[DOMMouseEvent shiftKey]): Implemented.
3414 (-[DOMMouseEvent altKey]): Implemented.
3415 (-[DOMMouseEvent metaKey]): Implemented.
3416 (-[DOMMouseEvent button]): Implemented.
3417 (-[DOMMouseEvent relatedTarget]): Implemented.
3418 (-[DOMMouseEvent initMouseEvent:::::::::::::::]): Implemented.
3419 (-[DOMMutationEvent _mutationEventImpl]): Added.
3420 (-[DOMMutationEvent relatedNode]): Implemented.
3421 (-[DOMMutationEvent prevValue]): Implemented.
3422 (-[DOMMutationEvent newValue]): Implemented.
3423 (-[DOMMutationEvent attrName]): Implemented.
3424 (-[DOMMutationEvent attrChange]): Implemented.
3425 (-[DOMMutationEvent initMutationEvent::::::::]):
3426 (-[DOMUIEvent _UIEventImpl]): Added.
3427 (-[DOMUIEvent view]): Implemented.
3428 (-[DOMUIEvent detail]): Implemented.
3429 (-[DOMUIEvent initUIEvent:::::]): Implemented.
3430 (-[DOMDocument createEvent:]): Implemented.
3432 * kwq/DOMHTMLInternal.h: Added.
3434 (+[DOMHTMLOptionsCollection _optionsCollectionWithImpl:]): Added.
3435 (-[DOMHTMLOptionsCollection length]): Implemented.
3436 (-[DOMHTMLOptionsCollection setLength:]): Implemented.
3437 (-[DOMHTMLOptionsCollection item:]): Implemented.
3438 (-[DOMHTMLOptionsCollection namedItem:]): Implemented.
3439 (-[DOMHTMLSelectElement options]): Implemented.
3441 * kwq/DOMViews.h: Changed DOMDocumentView to be a category on DOMDocument
3442 rather than a separate class.
3443 * kwq/DOMViewsInternal.h: Added.
3444 * kwq/DOMViews.mm: Added.
3445 (-[DOMAbstractView document]): Implemnted.
3446 (-[DOMAbstractView _abstractViewImpl]): Added.
3447 (-[DOMAbstractView _initWithAbstractViewImpl:]): Added.
3448 (+[DOMAbstractView _abstractViewWithImpl:]): Added.
3449 (-[DOMDocument defaultView]): Implemented.
3451 * khtml/dom/dom2_views.h: Made AbstractView constructor public to allow creation in
3452 the bindings. Would not be necessary if the impl classes were used consistently.
3454 * khtml/html/html_formimpl.h: Added options() function to HTMLSelectElementImpl.
3455 Added HTMLOptionsCollectionImpl class.
3456 * khtml/html/html_formimpl.cpp:
3457 (HTMLSelectElementImpl::~HTMLSelectElementImpl): Added code to detach and deref the
3459 (HTMLSelectElementImpl::options): Create an options collection if needed.
3460 (HTMLOptionsCollectionImpl::length): Added. Not yet implemented.
3461 (HTMLOptionsCollectionImpl::setLength): Ditto.
3462 (HTMLOptionsCollectionImpl::item): Ditto.
3463 (HTMLOptionsCollectionImpl::namedItem): Ditto.
3465 * khtml/khtmlview.h: Move unused focusNextPrevChild virtual function inside !APPLE_CHANGES.
3466 * khtml/khtmlview.cpp: Put the tp, paintBuffer, and formCompletions fields entirely
3467 inside !APPLE_CHANGES. Also made QT_NO_TOOLTIP entirely disable the tooltip field.
3468 Also put focusNextPrevChild and formCompletionItems functions inside !APPLE_CHANGES.
3470 * khtml/rendering/render_text.h: Removed unused isFixedWidthFont member function.
3471 * khtml/rendering/render_text.cpp: Ditto.
3473 * kwq/KWQCursor.h: Removed unused pos member function.
3474 * kwq/KWQCursor.mm: Ditto.
3476 * kwq/KWQFontMetrics.h: Removed unused rightBearing and leftBearing member functions.
3477 * kwq/KWQFontMetrics.mm: Ditto.
3479 * kwq/KWQKComboBox.h: Removed KCompletionBase as a base class.
3481 * kwq/KWQKConfigBase.h: Removed unused readBoolEntry, writeEntry, and readListEntry
3483 * kwq/KWQKConfigBase.mm: Ditto.
3484 (KConfig::readEntry): Improved "not implemented" message to indicate which key is uinimplemented.
3485 (KConfig::readNumEntry): Ditto.
3486 (KConfig::readUnsignedNumEntry): Ditto.
3488 * kwq/KWQKLineEdit.h: Removed everything, since all the KLineEdit stuff was unused.
3489 Changed KLineEdit to just be a typedef for QLineEdit.
3491 * kwq/KWQSlot.mm: Removed slotAutoScroll.
3492 (KWQSlot::KWQSlot): And from here.
3493 (KWQSlot::call): And from here.
3495 * kwq/KWQTextStream.h: Removed unused QTextOStream and QTextIStream.
3496 * kwq/KWQTextStream.mm: Removed unused QTextIStream function. Also made buffer sizes larger
3497 so we don't have any problems on 64-bit systems. 10 bytes might not be long enough to sprintf an
3498 integer or a long or a pointer, but 100 bytes surely will.
3500 * kwq/KWQWidget.h: Removed unused focusNextPrevChild.
3501 * kwq/KWQWidget.mm: Ditto.
3503 * WebCore.pbproj/project.pbxproj: Removed some files, added others.
3505 * ForwardingHeaders/kcompletionbox.h: Emptied out, no KWQKCompletionBox.h any more.
3506 * ForwardingHeaders/kiconloader.h: Emptied out, no KWQKIconLoader.h any more.
3507 * ForwardingHeaders/kmimetype.h: Emptied out, no KWQKMimeType.h any more.
3508 * ForwardingHeaders/ksimpleconfig.h: Emptied out, no KWQKSimpleConfig.h any more.
3509 * ForwardingHeaders/qfontinfo.h: Emptied out, no KWQFontInfo.h any more.
3510 * ForwardingHeaders/qtooltip.h: Replaced with define of QT_NO_TOOLTIP, no
3511 KWQToolTip.h any more.
3513 * kwq/KWQCompletion.h: Removed.
3514 * kwq/KWQCompletion.mm: Removed.
3515 * kwq/KWQFontInfo.h: Removed.
3516 * kwq/KWQFontInfo.mm: Removed.
3517 * kwq/KWQKCompletionBox.h: Removed.
3518 * kwq/KWQKIconLoader.h: Removed.
3519 * kwq/KWQKIconLoader.mm: Removed.
3520 * kwq/KWQKMimeType.h: Removed.
3521 * kwq/KWQKMimeType.mm: Removed.
3522 * kwq/KWQKSimpleConfig.h: Removed.
3523 * kwq/KWQKSimpleConfig.mm: Removed.
3524 * kwq/KWQToolTip.h: Removed.
3526 2004-05-21 Darin Adler <darin@apple.com>
3530 - fixed <rdar://problem/3663659>: (result of toString mistakenly includes all subsequent sibling content)
3532 * khtml/xml/dom2_rangeimpl.h: Added private startNode() and pastEndNode() functions.
3533 * khtml/xml/dom2_rangeimpl.cpp:
3534 (DOM::RangeImpl::toString): Rewrote to use startNode(), pastEndNode(), and traverseNextNode().
3535 The old code here was wrong, and it was easier to rewrite than fix.
3536 (DOM::RangeImpl::checkDeleteExtract): Extracted the logic to compute the start node and the past-end
3537 node into separate functions.
3538 (DOM::RangeImpl::startNode): Added. Started with code extracted from checkDeleteExtract, but then
3539 also fixed bugs by using the new traverseNextSibling. The old code handled cases where the offset was
3540 past the last child in a container incorrectly.
3541 (DOM::RangeImpl::pastEndNode): Added. Started with code extracted from checkDeleteExtract, but then
3542 also fixed bugs by using the new traverseNextSibling. The old code hanlded cases where the offset was
3543 past the last child in a container incorrectly, and also iterated one node too few in cases where the
3544 end contaier was a text node.
3546 * khtml/xml/dom2_traversalimpl.h: Removed a bunch of unused and unneeded member functions.
3548 * khtml/xml/dom_nodeimpl.h: Added traverseNextSibling.
3549 * khtml/xml/dom_nodeimpl.cpp:
3550 (NodeImpl::traverseNextNode): Reformatted the code a little bit.
3551 (NodeImpl::traverseNextSibling): Added. Like traverseNextNode except it starts after the node's children
3552 instead of starting at the beginning of the first child.
3554 2004-05-21 Maciej Stachowiak <mjs@apple.com>
3558 <rdar://problem/3656722>: Implement outerText and setOuterText DOM extensions
3560 * khtml/html/html_elementimpl.cpp:
3561 (HTMLElementImpl::outerText): Return same value as innerText().
3562 (HTMLElementImpl::setInnerText): Fix comment.
3563 (HTMLElementImpl::setOuterText): Replace node with text, merge neighboring text nodes.
3564 * khtml/html/html_elementimpl.h: Prototype new methods.
3565 * khtml/dom/html_element.cpp:
3566 (HTMLElement::outerText): Hook up to impl.
3567 (HTMLElement::setOuterText): Ditto.
3568 * khtml/dom/html_element.h: Prototype new methods.
3569 * khtml/ecma/kjs_html.cpp:
3570 (KJS::HTMLElement::getValueProperty): Glue up outerText.
3571 (KJS::HTMLElement::putValue): Ditto.
3572 * khtml/ecma/kjs_html.h: Added new enum value.
3573 * khtml/ecma/kjs_html.lut.h:
3574 (KJS::): Regenerated.
3576 2004-05-21 Richard Williamson <rjw@apple.com>
3578 Removed _bindObject:forFrame: SPI.
3582 * kwq/KWQKHTMLPart.h:
3583 * kwq/KWQKHTMLPart.mm:
3584 * kwq/WebCoreBridge.h:
3585 * kwq/WebCoreBridge.mm:
3587 2004-05-21 David Hyatt <hyatt@apple.com>
3589 Fix for 3663644, repaints don't occur when the .innerHTML of a positioned element is changed.
3593 * khtml/rendering/bidi.cpp:
3594 (khtml::RenderBlock::layoutInlineChildren):
3595 * khtml/rendering/render_layer.h:
3596 (khtml::RenderLayer::repaintRect):
3600 2004-05-21 Darin Adler <darin@apple.com>
3602 Reviewed by Ken and Chris.
3604 - fixed <rdar://problem/3656948>: (markup strings that contain <html> and <body> elements don't work, producing nothing)
3606 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::createContextualFragment):
3607 Changed things around so that nodes are removed from their parent node before
3609 2004-05-21 Darin Adler <darin@apple.com>
3611 Reviewed by Ken and Chris.
3613 - fixed part of <rdar://problem/3656948>: (HTML Editing: -[WebView replaceSelectionWithMarkupString:] doesn't seem to work)
3615 * khtml/editing/htmlediting_impl.cpp: (khtml::PasteMarkupCommandImpl::doApply):
3616 Changed code to handle case where contextual fragment parses to nothing without crashing.
3618 2004-05-21 Darin Adler <darin@apple.com>
3622 * kwq/DOM-CSS.mm: Change DOMCSSStyleDeclaration methods to use strings with dash-separators in them
3623 rather than interCaps.
3625 2004-05-21 Darin Adler <darin@apple.com>
3629 - fixed <rdar://problem/3090663>: (scroll to top of page when anchor is "#top" or "#")
3631 * khtml/khtml_part.cpp:
3632 (KHTMLPart::gotoAnchor): Detect anchor by checking for non-null, not non-empty, because an
3633 empty anchor is not the same as no anchor.
3634 (KHTMLPart::gotoAnchor): Add special case for anchors named "" and "top" (case insensitive),
3635 to scroll to the top left of the frame to match what WinIE and Mozilla do.
3636 (KHTMLPart::checkCompleted): Check for non-null here too for consistency.
3639 (KURL::ref): Change check so that we return empty, not null, if there's an empty ref,
3640 as opposed to no ref.
3641 (KURL::hasRef): Return true if there's an empty ref, as opposed to no ref.
3642 (KURL::parse): Preserve an empty fragment when parsing.
3644 2004-05-20 Darin Adler <darin@apple.com>
3648 - fixed <rdar://problem/3575385>: (multiple radio buttons checked when arriving at sites (poll at www.1170kfaq.com, many others))
3650 * khtml/html/html_formimpl.cpp:
3651 (HTMLInputElementImpl::parseHTMLAttribute): Use setChecked to set the default value if we are still in
3652 "use default checked" mode. That way, other radio buttons will be unchecked properly and the proper
3653 changed methods will be dispatched.
3654 (HTMLInputElementImpl::reset): Ditto.
3655 * khtml/html/html_formimpl.h: (DOM::HTMLInputElementImpl::checked): Changed to just return m_checked.
3656 The m_useDefaultChecked flag is now only really looked at when you parse a checked attribute; that's
3657 because m_checked and m_defaultChecked are kept equal as long as m_useDefaultChecked is true.
3659 * khtml/xml/dom_nodeimpl.h: Removed an unnecessary virtual, to make code a little smaller and faster.
3661 2004-05-20 Darin Adler <darin@apple.com>
3665 - fixed <rdar://problem/3662383>: (REGRESSION: drag slide-back sometimes causes link to load)
3666 - fixed <rdar://problem/3662556>: (REGRESSION: letting up mouse while dragging over link activates the link)
3668 * khtml/khtmlview.h: Added invalidateClick.
3669 * khtml/khtmlview.cpp: (KHTMLView::invalidateClick): Added. Sets clickCount to 0.
3671 * kwq/KWQKHTMLPart.mm:
3672 (KWQKHTMLPart::matchLabelsAgainstElement): Changed a string replace to a character replace for slightly
3673 faster code and smaller code size.
3674 (KWQKHTMLPart::khtmlMouseMoveEvent): Call invalidateClick at the appropriate times. To do this correctly,
3675 had to add a boolean result to handleMouseDragged: so I can tell if a drag started or not (due to hysteresis).
3676 (KWQKHTMLPart::attributedString): Changed a string append to a character append for slightly faster code
3677 and smaller code size.
3679 * kwq/WebCoreBridge.h: Added BOOL result to handleMouseDragged:.
3683 - handle rules with empty bodies properly
3685 * khtml/css/parser.y: Remove bogus check for empty body that prevents the rule
3687 * khtml/css/parser.cpp: Regenerated.
3689 2004-05-20 David Hyatt <hyatt@apple.com>
3691 Revise the patch for incorrect caret positions when brs get deleted. It can be even simpler.
3693 Reviewed by kocienda
3695 * khtml/rendering/render_flow.cpp:
3696 (RenderFlow::dirtyLinesFromChangedChild):
3697 * khtml/rendering/render_text.cpp:
3698 (RenderText::detach):
3700 2004-05-20 David Hyatt <hyatt@apple.com>
3702 Fix for 3629816, caret in wrong position when deleting <br>s on lines by themselves or when moving <br>s
3703 on lines by themselves.
3705 Reviewed by kocienda
3707 * khtml/rendering/render_box.cpp:
3708 (RenderBox::detach):
3709 * khtml/rendering/render_br.cpp:
3711 * khtml/rendering/render_br.h:
3712 * khtml/rendering/render_flow.cpp:
3713 (RenderFlow::dirtyLinesFromChangedChild):
3715 2004-05-20 Ken Kocienda <kocienda@apple.com>
3719 Provide the methods to glue the WebView's editing delegate so that these methods work:
3721 <rdar://problem/3655316>: "Editing: -webViewShouldBeginEditing:inDOMRange: method unimplemented (WebKit editing API)"
3722 <rdar://problem/3655317>: "Editing: -webViewShouldEndEditing:inDOMRange: method unimplemented (WebKit editing API)"
3724 While I was in the neighborhood and working on understanding focus shifts, I fixed this bug as well:
3726 <rdar://problem/3645154>: "contentEditable div receives focus and blur twice when focus changes to new element"
3728 * khtml/khtml_part.cpp:
3729 (KHTMLPart::invalidateSelection): Do not move focus in this function. That is just a mistake. This function
3730 is all about redraw.
3731 (KHTMLPart::selectionLayoutChanged): New function. Factor out the redraw parts of notifySelectionChanged so
3732 that invalidateSelection can call it.
3733 (KHTMLPart::notifySelectionChanged): Call selectionLayoutChanged now that the redraw parts have been
3735 (KHTMLPart::shouldBeginEditing): New function that calls through to the KWQKHTMLPart in an APPLE_CHANGES
3736 block. This is part of the code path that will eventually The WebView's delegate to ask the
3737 shouldBeginEditing question.
3738 (KHTMLPart::shouldEndEditing): Ditto, except the question is about shouldEndEditing.
3739 * khtml/khtml_part.h:
3740 * khtml/khtmlview.cpp:
3741 (KHTMLView::dispatchMouseEvent): Now looks at the boolean value returned from DocumentImpl::setFocusNode
3742 (described below). If the focus shift was blocked, swallow the mouse event.
3743 * khtml/xml/dom_docimpl.cpp:
3744 (DocumentImpl::relinquishesEditingFocus): Part of the WebView's delegation call chain described above.
3745 (DocumentImpl::acceptsEditingFocus): Ditto.
3746 (DocumentImpl::setFocusNode): Many improvements. Now handles WebView delegation and switching focus
3747 in the handlers called as a result of the DOM events that this function calls. Also now returns a
3748 boolean to say whether the attempt to set focus was blocked by a handler or by the WebView's delegate.
3749 * khtml/xml/dom_docimpl.h:
3750 * kwq/KWQKHTMLPart.h:
3751 * kwq/KWQKHTMLPart.mm:
3752 (KWQKHTMLPart::shouldBeginEditing): More WebView's delegation glue.
3753 (KWQKHTMLPart::shouldEndEditing): Ditto.
3754 * kwq/WebCoreBridge.h:
3756 2004-05-20 Richard Williamson <rjw@apple.com>
3758 Reviewed by NOBODY (OOPS!).
3761 (-[DOMObject _init]):
3762 * kwq/DOMInternal.mm:
3763 (-[WebScriptObject _init]):
3764 (-[WebScriptObject _initializeScriptDOMNodeImp]):
3765 * kwq/KWQKHTMLPart.h:
3766 * kwq/KWQKHTMLPart.mm:
3767 (KWQKHTMLPart::KWQKHTMLPart):
3768 (KWQKHTMLPart::bindingRootObject):
3769 (KWQKHTMLPart::windowScriptObject):
3771 2004-05-20 Darin Adler <darin@apple.com>
3775 - fixed <rdar://problem/3661918>: "repro nil-deref in RenderImage::paint (www.codepoetry.net)"
3777 * khtml/rendering/render_image.cpp: (RenderImage::paint): Check renderer pointer to see if it's
3778 nil before dereferencing it.
3780 - fixed <rdar://problem/3658455>: "readFromData:options:documentAttributes: crashes when passed page without a body (in WebKit mode)"
3782 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::bodyBackgroundColor): Check renderer pointer to see if it's
3783 nil before dereferencing it.
3785 - fixed <rdar://problem/2948112>: "implement addRule for JavaScript for style sheets"
3787 * khtml/dom/css_stylesheet.h: Added addRule.
3788 * khtml/dom/css_stylesheet.cpp: (CSSStyleSheet::addRule): Added.
3789 * khtml/css/css_stylesheetimpl.h: Added addRule.
3790 * khtml/css/css_stylesheetimpl.cpp: (CSSStyleSheetImpl::addRule): Added an implementation
3791 based on the Microsoft documentation. An index of -1 means "at the end of the list".
3793 * khtml/dom/dom_string.h: Changed the string-append operator to be a non-member function
3794 so it works even if the left side has to undergo type conversion.
3795 * khtml/dom/dom_string.cpp: (DOM::operator+): Changed implementation to match above.
3796 Also changed to not use anything private or protected so it doesn't have to be a friend.
3798 * khtml/ecma/kjs_css.h: Added addRule to the list of functions for CSS style sheets.
3799 * khtml/ecma/kjs_css.cpp: (DOMCSSStyleSheetProtoFunc::tryCall): Add support for addRule,
3800 based on the Microsoft documentation; always returns -1. Also removed unused string conversions.
3801 * khtml/ecma/kjs_css.lut.h: Regenerated.
3803 2004-05-19 David Hyatt <hyatt@apple.com>
3805 Implement support for notification posting to accessibility clients for layouts and loads.
3807 * khtml/khtmlview.cpp:
3808 (KHTMLView::layout):
3809 * khtml/xml/dom_docimpl.cpp:
3810 (DocumentImpl::close):
3811 * kwq/KWQAccObjectCache.h:
3812 (KWQAccObjectCache::enableAccessibility):
3813 (KWQAccObjectCache::accessibilityEnabled):
3814 * kwq/KWQAccObjectCache.mm:
3815 (KWQAccObjectCache::accObject):
3816 (KWQAccObjectCache::setAccObject):
3817 (KWQAccObjectCache::removeAccObject):
3818 (KWQAccObjectCache::detach):
3819 (KWQAccObjectCache::childrenChanged):
3820 (KWQAccObjectCache::postNotification):
3821 * kwq/WebCoreBridge.mm:
3822 (-[WebCoreBridge accessibilityTree]):
3824 2004-05-19 Chris Blumenberg <cblu@apple.com>
3826 Tweaks for forthcoming dragging improvements.
3830 * kwq/WebCoreBridge.h:
3831 * kwq/WebCoreBridge.mm:
3832 (-[WebCoreBridge moveDragCaretToPoint:]): renamed for future reasons, removed text only restrictions
3834 2004-05-19 Ken Kocienda <kocienda@apple.com>
3836 Reviewed by Hyatt and Darin
3840 <rdar://problem/3643230>: "can't tab out of contentEditable Elements"
3842 * khtml/xml/dom_elementimpl.cpp: Now checks if key event was intercepted by the editing
3843 key-handler before setting the event as defaultHandled.
3844 (ElementImpl::defaultEventHandler):
3845 * kwq/KWQKHTMLPart.h: Name change from editingKeyEvent.
3846 Also now returns a BOOL to report whether the event was handled or not.
3847 * kwq/KWQKHTMLPart.mm:
3848 (KWQKHTMLPart::interceptEditingKeyEvent): Ditto.
3849 * kwq/WebCoreBridge.h: Renamed from _editingKeyDown.
3851 2004-05-19 Ken Kocienda <kocienda@apple.com>
3857 <rdar://problem/3655601>: "deleting characters is much slower than inserting them"
3859 Cleaned up the way selections are set in edit commands, and how KHTMLPart is
3860 notified of these changes. This clears up a number of inefficiencies, including unnecessary repaints
3861 which were causing the performace problem.
3863 * khtml/editing/htmlediting.cpp: Removed moveToStartingSelection and moveToEndingSelection functions.
3864 This work is going to be done using another pre-existing communication facility shared by edit commands
3866 * khtml/editing/htmlediting.h: Ditto.
3867 * khtml/editing/htmlediting_impl.cpp:
3868 (khtml::EditCommandImpl::setStartingSelection): Fix coding mistake which caused double recursion while setting
3870 (khtml::EditCommandImpl::setEndingSelection): Ditto.
3871 (khtml::CompositeEditCommandImpl::doUnapply): No longer calls moveToStartingSelection. Work done in the part now.
3872 (khtml::CompositeEditCommandImpl::doReapply): No longer calls moveToEndingSelection. Work done in the part now.
3873 (khtml::TypingCommandImpl::typingAddedToOpenCommand): New function. Provides a hook for
3874 typing commands to tell the part about additional typing that has been done.
3875 (khtml::TypingCommandImpl::insertText): Now calls typingAddedToOpenCommand.
3876 (khtml::TypingCommandImpl::insertNewline): Ditto.
3877 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Ditto.
3878 (khtml::TypingCommandImpl::deleteKeyPressed): Ditto.
3879 * khtml/editing/htmlediting_impl.h: Removed moveToStartingSelection and moveToEndingSelection functions.
3880 * khtml/khtml_part.cpp:
3881 (KHTMLPart::setSelection): Modified to take an argument which tells whether the set closes an active
3883 (KHTMLPart::notifySelectionChanged): Changed endTyping variable to be consistent with "close typing"
3884 terminology used elsewhere.
3885 (KHTMLPart::appliedEditing): Now sets the selection using the value of the passed-in command. Added
3886 an assert for typing cases. Fixed problem where didChangeNotification was not being posted for typing
3887 changes after the first one.
3888 (KHTMLPart::unappliedEditing): Now sets the selection using the value of the passed-in command.
3889 (KHTMLPart::reappliedEditing): Now sets the selection using the value of the passed-in command.
3890 * khtml/khtml_part.h:
3891 * khtml/rendering/render_canvas.cpp:
3892 (RenderCanvas::clearSelection): Do not call repaint when the selection is a caret.
3894 2004-05-19 Ken Kocienda <kocienda@apple.com>
3898 * khtml/html/html_elementimpl.cpp:
3899 (HTMLElementImpl::isContentEditable): Ask if the part is contenteditable.
3900 True value is treated as an "override" and will short-circuit, returning true.
3901 * khtml/khtml_part.cpp:
3902 (KHTMLPart::isContentEditable): Call over bridge. Has the effect of checking the
3903 isEditable method on the WebView which contains this part.