2 2004-07-09 Kevin Decker <kdecker@apple.com>
6 fixes the width:auto problem in
7 <rdar://problem/3698344> REGRESSION (143?-144): macrumors.com tabs are compressed and illegible
9 * khtml/css/cssstyleselector.cpp:
10 (khtml::CSSStyleSelector::applyProperty):
13 2004-07-09 Ken Kocienda <kocienda@apple.com>
17 Updated some layout test results.
19 * layout-tests/editing/deleting/delete-image-004-expected.txt:
20 * layout-tests/editing/selection/extend-by-character-006-expected.txt:
23 2004-07-09 Chris Blumenberg <cblu@apple.com>
25 Allowed my change for 3715785 to compile on Jaguar.
29 * kwq/WebCoreBridge.h:
30 * kwq/WebCoreBridge.mm:
31 (-[WebCoreBridge domain]): new, allows access to the domain without using the DOM API which doesn't exist on Jaguar
33 2004-07-09 Ken Kocienda <kocienda@apple.com>
37 Some improvements to fix:
39 <rdar://problem/3723111> Caret not drawn when selection set to unrendered content
41 * khtml/editing/htmlediting_impl.cpp:
42 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Adjust selection to delete if
43 selected position is not rendered.
44 * khtml/rendering/render_block.cpp:
45 (khtml::RenderBlock::paintObject): Use new caretPosition() function on Selection to
46 figure out whether to paint.
47 * khtml/xml/dom_position.cpp:
48 (DOM::Position::previousCharacterPosition): Now correctly deals with a start
49 position that is not rendered.
50 (DOM::Position::nextCharacterPosition): Ditto.
51 (DOM::Position::closestRenderedPosition): New helper.
52 * khtml/xml/dom_position.h:
53 (DOM::): Moved in EAffinity from Selection header. Now used in closestRenderedPosition function.
54 * khtml/xml/dom_selection.cpp:
55 (DOM::Selection::Selection): Added new m_caretPosition member. This is the position of the caret
56 after a caret layout. This may be different from start or end if start and end are not rendered.
57 (DOM::Selection::init):
58 (DOM::Selection::modifyExtendingRightForward): New helper to clean up modify() and make it more readble.
59 (DOM::Selection::modifyMovingRightForward): Ditto.
60 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
61 (DOM::Selection::modifyMovingLeftBackward): Ditto.
62 (DOM::Selection::modify): Use new helpers to make this more readble.
63 (DOM::Selection::layoutCaret): Uses new closestRenderedPosition helper to place the caret if in unrendered
65 (DOM::Selection::paintCaret): Remove moveToRenderedContent. obsolete.
66 * khtml/xml/dom_selection.h:
67 (DOM::Selection::caretPosition): New accessor.
68 * kwq/WebCoreBridge.mm:
69 (-[WebCoreBridge setSelectedDOMRange:affinity:]): EAffinity no longer a member enum of Selection class.
71 2004-07-08 David Hyatt <hyatt@apple.com>
73 Fix for the table layout test that failed because of a change in how innerText worked. We need to do
74 updateLayout now when using innerText, since the method has been changed to use line boxes in the render tree
75 that might otherwise be out of date.
79 * khtml/html/html_elementimpl.cpp:
80 (HTMLElementImpl::innerText):
82 2004-07-08 John Sullivan <sullivan@apple.com>
86 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
87 now also extends selection (even if there wasn't one before)
89 * khtml/khtml_part.cpp:
90 (KHTMLPart::handleMousePressEventSingleClick):
91 if there's a URL associated with the event, don't extend the selection
93 2004-07-08 Ken Kocienda <kocienda@apple.com>
97 Added some helper functions which provide strings to display in the
98 Xcode debugger's variable inspector window. These functions are called
99 from the LabyrinthDataFormatter debugger plugin I just checked in to
100 the Labyrinth/Tools directory.
102 Note that these functions are compiled in on Development builds only.
104 * WebCore-combined.exp:
105 * WebCore-tests.exp: Export all the formatForDebugger symbols so the
106 debugger program can link with them.
107 * khtml/xml/dom2_rangeimpl.cpp:
108 (DOM::RangeImpl::formatForDebugger):
109 * khtml/xml/dom2_rangeimpl.h:
110 * khtml/xml/dom_elementimpl.cpp:
111 (ElementImpl::formatForDebugger):
112 * khtml/xml/dom_elementimpl.h:
113 * khtml/xml/dom_nodeimpl.cpp:
114 * khtml/xml/dom_nodeimpl.h:
115 * khtml/xml/dom_position.cpp:
116 (DOM::Position::formatForDebugger):
117 * khtml/xml/dom_position.h:
118 * khtml/xml/dom_selection.cpp:
119 (DOM::Selection::formatForDebugger):
120 * khtml/xml/dom_selection.h:
121 * khtml/xml/dom_textimpl.cpp:
122 (TextImpl::formatForDebugger):
123 * khtml/xml/dom_textimpl.h:
125 2004-07-08 John Sullivan <sullivan@apple.com>
129 - fixed <rdar://problem/3721544> crash increasing font size;
130 entrezeroetun.com (works in IE and Firefox)
132 * khtml/rendering/render_block.cpp:
133 (khtml::RenderBlock::updateFirstLetter):
134 Check for nil originalString() before dereffing
136 2004-07-08 David Hyatt <hyatt@apple.com>
138 Fix for 3721453, CSS3 initial property caused crashes because the macros were not written correctly.
142 * khtml/css/cssstyleselector.cpp:
146 2004-07-07 David Hyatt <hyatt@apple.com>
148 Fix for 3712133, crash from first-line pseudo-style use.
152 * khtml/css/cssstyleselector.cpp:
153 (khtml::CSSStyleSelector::styleForElement):
154 * khtml/css/cssstyleselector.h:
155 * khtml/rendering/render_object.cpp:
156 (RenderObject::getPseudoStyle):
158 2004-07-07 Ken Kocienda <kocienda@apple.com>
164 <rdar://problem/3716479> calling setInnerHTML during a webViewDidChange delegate call causes a crash
166 The fix involves some rearrangement of code in TypingCommand and TypingCommandImpl.
167 Formerly, new TypingCommands would apply themselves (which was a no-op) and then
168 do their action in some code a way different than other commands. This type of command
169 application is different than for all other commands since TypingCommands can be coalesced.
170 The crash occurred as a result of the "no-op" TypingCommand having the unconsidered
171 consequence of causing editing delegate notifications to be sent before the command
172 has actually run. This change takes a small step towards making TypingCommandImpl function like
173 other commands, where the command work is done in doApply. This makes the notification
174 happen in the right order.
176 * khtml/editing/htmlediting.cpp:
177 (khtml::TypingCommand::TypingCommand):
178 (khtml::TypingCommand::insertText):
179 (khtml::TypingCommand::insertNewline):
180 (khtml::TypingCommand::deleteKeyPressed):
181 * khtml/editing/htmlediting.h:
182 (khtml::TypingCommand::):
183 * khtml/editing/htmlediting_impl.cpp:
184 (khtml::TypingCommandImpl::TypingCommandImpl):
185 (khtml::TypingCommandImpl::doApply):
186 * khtml/editing/htmlediting_impl.h:
188 2004-07-06 Ken Kocienda <kocienda@apple.com>
192 * khtml/html/html_tableimpl.cpp:
193 (HTMLTableElementImpl::addChild): Added a better comment in the
194 code I just checked in a few minutes ago.
196 2004-07-06 Ken Kocienda <kocienda@apple.com>
202 <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply
203 due to non-0 exception code trying to insert a DIV markup string
205 The solution was to revert to the code that was rolled out, and removing
206 the child checks from NodeImpl::checkAddChild. However, this time, I added
207 code very similar to this check into the code that runs while HTML is
208 being parsed to build up tables. This code relies on child-add failure
209 to ensure the proper construction of well-formed tables (as gross as that
210 sounds), so the check needs to be retained there. No other code seems to
211 be so affected. Layout tests are unchanged by this patch.
213 * khtml/html/html_tableimpl.cpp:
214 (HTMLTableElementImpl::addChild):
215 * khtml/xml/dom_nodeimpl.cpp:
216 (NodeImpl::checkAddChild):
218 2004-07-06 Ken Kocienda <kocienda@apple.com>
222 Simple change. I switched the arguments of the appendNode helper function
223 and the AppendNodeCommand and AppendNodeCommandImpl classes. The node to
224 insert now comes before the parent node in the argument list. I did this
225 to make this function match the convention of others in the HTML editing code.
226 This was the only one that was "different" in the way that it ordered arguments.
227 As a result, I was always looking to see that I was passing things in the right
230 * khtml/editing/htmlediting.cpp:
231 (khtml::AppendNodeCommand::AppendNodeCommand):
232 (khtml::AppendNodeCommand::appendChild):
233 (khtml::AppendNodeCommand::parentNode):
234 * khtml/editing/htmlediting.h:
235 * khtml/editing/htmlediting_impl.cpp:
236 (khtml::CompositeEditCommandImpl::insertNodeAfter):
237 (khtml::CompositeEditCommandImpl::insertNodeAt):
238 (khtml::CompositeEditCommandImpl::appendNode):
239 (khtml::AppendNodeCommandImpl::AppendNodeCommandImpl):
240 (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl):
241 (khtml::AppendNodeCommandImpl::doApply):
242 (khtml::AppendNodeCommandImpl::doUnapply):
243 (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
244 (khtml::DeleteSelectionCommandImpl::doApply):
245 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition):
246 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition):
247 (khtml::InputTextCommandImpl::prepareForTextInsertion):
248 * khtml/editing/htmlediting_impl.h:
249 (khtml::AppendNodeCommandImpl::parentNode):
251 2004-07-06 Ken Kocienda <kocienda@apple.com>
255 Fixed several problems with traversal classes. For one, NodeIterators treat
256 FILTER_REJECT and FILTER_SKIP the same, since it treats the DOM tree as a
257 flat collection of nodes free of hierarchy. The code before this change did
258 not do this correctly. It sure pays to go back and read the specs. :)
260 Also, the code to traverse from node to node when filters were applied was
261 not working correctly. My first attemmpt to implement this was just plain
262 buggy, as I discovered when I tried to write tests for my WWDC talk. I have
263 settled on an implementation which is much simpler and worked for all the
266 * khtml/xml/dom2_traversalimpl.cpp:
267 (DOM::NodeIteratorImpl::findNextNode):
268 (DOM::NodeIteratorImpl::nextNode):
269 (DOM::NodeIteratorImpl::findPreviousNode):
270 (DOM::NodeIteratorImpl::previousNode):
271 (DOM::TreeWalkerImpl::parentNode):
272 (DOM::TreeWalkerImpl::firstChild):
273 (DOM::TreeWalkerImpl::lastChild):
274 (DOM::TreeWalkerImpl::previousSibling):
275 (DOM::TreeWalkerImpl::nextSibling):
276 (DOM::TreeWalkerImpl::previousNode):
277 (DOM::TreeWalkerImpl::nextNode):
278 (DOM::TreeWalkerImpl::ancestorRejected):
279 * khtml/xml/dom2_traversalimpl.h:
281 2004-07-06 Vicki Murley <vicki@apple.com>
283 Reviewed by kocienda.
285 - added backColorCommand, foreColorCommand, fontNameCommand,
288 * layout-tests/editing/editing.js:
290 2004-07-06 Trey Matteson <trey@apple.com>
292 3716053 - www.theage.com.au has extra back/forward items due to ads
294 This turned out to be easily fixed by generalizing the fix to 3438441. We prevent
295 addition to the b/f list not just during an onload event, but during any non-user
296 gesture, which includes top level script executing.
300 * kwq/KWQKHTMLPart.mm:
301 (KWQKHTMLPart::openURL): Only real change - prevent adding to b/f list if not
303 (KWQKHTMLPart::openURLRequest): Rename "onLoadEvent" to "userGesture", swap sense
304 (KWQKHTMLPart::submitForm): Ditto
305 (KWQKHTMLPart::urlSelected): Ditto
306 * kwq/KWQKHTMLPartBrowserExtension.mm:
307 (KHTMLPartBrowserExtension::createNewWindow): Ditto
308 * kwq/WebCoreBridge.h:
310 2004-07-02 Darin Adler <darin@apple.com>
314 - fixed half of <rdar://problem/3709244> utf-8 meta tag not parsed when page title contains angle brackets or if </meta> tag used
316 * khtml/misc/decoder.cpp: (Decoder::decode): Allow </meta> tags without deciding we
317 are done with the header.
319 2004-06-30 Trey Matteson <trey@apple.com>
321 Dragging within a web view should be allowed to start when the window isn't key.
323 A few months ago, Chris made this work, but it relied on the fact that all dragging
324 was done in WebKit. When WebCore got involved in dragging, it was broken. Now we
325 have a new scheme that gets it working again that properly involves WebCore.
327 The general idea is that when AK asks us whether to accept the first mouse and do
328 "delayed window ordering", we must consult WC to see if we might start a drag. In
329 addition, instead of these drags in non-active windows being started as a special
330 case in WK, they go through the normal WK-WC drag machinery.
334 * khtml/khtml_part.cpp:
335 (KHTMLPart::shouldDragAutoNode): New x,y args.
336 * khtml/khtml_part.h:
337 * khtml/rendering/render_object.cpp:
338 (RenderObject::draggableNode): Pass through new x,y args.
339 * khtml/rendering/render_object.h:
340 * kwq/KWQKHTMLPart.h:
341 (KWQKHTMLPart::setActivationEventNumber): New setter.
342 * kwq/KWQKHTMLPart.mm:
343 (KWQKHTMLPart::KWQKHTMLPart): Init new ivar.
344 (KWQKHTMLPart::eventMayStartDrag): New routine that checks if we might start
345 a drag in response to a mouseDown.
346 (KWQKHTMLPart::khtmlMouseMoveEvent): Pass x,y to the routine that finds a draggable
347 node. This eventually gets back up to WK's _mayStartDragAtEventLocation:.
348 Delay requirement when dragging the selection now implemented here.
349 (KWQKHTMLPart::khtmlMouseReleaseEvent): Must avoid changing the selection if we
350 wind up here as part of the first click in a window (because we started handling
351 the click to possible start a drag, but that never came through).
352 (KWQKHTMLPart::mouseDown): Save away event timestamp.
353 (KWQKHTMLPart::shouldDragAutoNode): Pass location up to WK instead of the
354 most recent event we stashed.
355 * kwq/WebCoreBridge.h:
356 * kwq/WebCoreBridge.mm:
357 (-[WebCoreBridge setActivationEventNumber:]): Trivial glue.
358 (-[WebCoreBridge eventMayStartDrag:]): Ditto.
360 2004-06-29 Trey Matteson <trey@apple.com>
362 Need to tighten up JS error checking for requesting drag props
367 * khtml/ecma/kjs_events.cpp:
368 (Clipboard::getValueProperty): Assert if someone somehow set
369 dropEffect or effectAllowed and it's a copy/paste clipboard
370 instead of a dragging clipboard.
371 (Clipboard::putValue): Don't let anyone set dropEffect or
372 effectAllowed on a copy/paste clipboard.
373 (ClipboardProtoFunc::tryCall): Disallow setting dragImage on
374 a copy/paste clipboard.
376 2004-06-29 Trey Matteson <trey@apple.com>
378 DHTML dragging - source should have access to the operation chosen
383 * kwq/KWQKHTMLPart.h:
384 * kwq/KWQKHTMLPart.mm:
385 (KWQKHTMLPart::dragSourceEndedAt): Set the destination's operation
387 * kwq/WebCoreBridge.mm:
388 (-[WebCoreBridge dragExitedWithDraggingInfo:]): For completeness
389 we set the source op for the ondragexit event.
390 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto for the
392 (-[WebCoreBridge dragSourceEndedAt:operation:]): Pass through of operation.
394 2004-06-24 Trey Matteson <trey@apple.com>
396 3710422 - REGRESSION: Safari crashes trying to send onbeforecut event at about://blank
398 Simple fix - don't try to send the event to the body element if we have no body element.
402 * kwq/KWQKHTMLPart.mm:
403 (KWQKHTMLPart::dispatchCPPEvent):
405 2004-06-24 Trey Matteson <trey@apple.com>
407 3704950 drag image in DB ConfigBar has horizontal graphics turd WebCore JavaScript
409 When we generate a drag image (or a selection image too, for that matter) we
410 translate the CTM using a CG call. Later, WebImageRenderer adjusts the pattern
411 phase based on the CTM of the focused view, which doesn't include our translate.
412 So we must inform WebKit about the additional phase adjustment.
416 * kwq/KWQKHTMLPart.mm: Tell WebKit about the phase adjustment.
417 (KWQKHTMLPart::imageFromRect):
418 * kwq/WebCoreGraphicsBridge.h:
419 * kwq/WebCoreGraphicsBridge.m:
420 (-[WebCoreGraphicsBridge setAdditionalPatternPhase:]): New routine to receive
421 the phase adjustment.
423 2004-06-24 Trey Matteson <trey@apple.com>
425 3679986 - screenX and screenY are flipped and relative to the bottom left of the WebView, rather than the screen
426 3699510 - synthesized click events have bogus screen coords
430 * khtml/khtmlview.cpp:
431 (KHTMLView::dispatchDragEvent): Generate screen coords for drag events using new func.
432 (KHTMLView::dispatchMouseEvent): Ditto.
434 * khtml/xml/dom_nodeimpl.cpp:
435 (NodeImpl::dispatchMouseEvent): Comment tricky semantics.
436 Calc screen coords in apple-specific way.
437 * kwq/KWQKHTMLView.mm:
438 (KHTMLView::viewportToGlobal): Passthrough to window widget.
439 * kwq/KWQScrollView.mm:
440 * kwq/KWQWindowWidget.h:
441 * kwq/KWQWindowWidget.mm:
442 (KWQWindowWidget::mapToGlobal): Call former code factored to new method below.
443 (KWQWindowWidget::viewportToGlobal): New method to convert "viewport" (which for us
444 really means NSWindow coords) to screen coords.
446 2004-06-24 Trey Matteson <trey@apple.com>
448 3693420 - onbeforecut and onbeforepaste need real implementaion
452 * kwq/KWQKHTMLPart.h:
453 * kwq/KWQKHTMLPart.mm:
454 (KWQKHTMLPart::mayCut): Dispatch event to DHTML.
455 (KWQKHTMLPart::mayCopy): Ditto
456 (KWQKHTMLPart::mayPaste): Ditto
457 (KWQKHTMLPart::tryCut): No more need to send fake onbefore event
458 (KWQKHTMLPart::tryCopy): Ditto
459 (KWQKHTMLPart::tryPaste): Ditto
460 * kwq/WebCoreBridge.h:
461 * kwq/WebCoreBridge.mm:
462 (-[WebCoreBridge mayDHTMLCut]): Standard glue
463 (-[WebCoreBridge mayDHTMLCopy]): Ditto
464 (-[WebCoreBridge mayDHTMLPaste]): Ditto
466 2004-06-24 Darin Adler <darin@apple.com>
470 - fixed <rdar://problem/3709385> Find on page doesn't find a string at the very end of the file
472 * khtml/misc/khtml_text_operations.cpp: (khtml::findPlainText): Rearrange loop to avoid an early
473 exit once we have all the characters we need, but are at the end of the range we are searching.
475 - fixed <rdar://problem/3102271>: (text areas have scroll bars even when they don't need them)
476 - fixed <rdar://problem/3665430>: (horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode)
478 * kwq/KWQTextArea.mm:
479 (-[KWQTextArea _configureTextViewForWordWrapMode]): Added. Helper method that sets up the
480 view for a new word wrap mode.
481 (-[KWQTextArea _createTextView]): Moved much of the code inside _configureTextViewForWordWrapMode.
482 (-[KWQTextArea _frameSizeChanged]): Added. Method shared by setFrame: and initWithFrame: to
483 avoid duplicate code that was there before. The old code also had redundant code to update
484 the text container size, but NSText handles that automatically.
485 (-[KWQTextArea initWithFrame:]): Set wrap to YES by default, which is the key to fixing bug 3665430.
486 Call setAutohidesScrollers:YES, which fixes bug 3102271. Also call the new _frameSizeChanged method.
487 (-[KWQTextArea setWordWrap:]): Call _configureTextViewForWordWrapMode instead of trying
488 to do the work here. The old version did both too little and too much.
489 (-[KWQTextArea setFrame:]): Call _frameSizeChanged instead of trying to do the work here.
490 The old version did both too little and too much.
492 2004-06-24 John Sullivan <sullivan@apple.com>
494 Darin made this change on my machine; I reviewed it.
496 - fixed <rdar://problem/3698333> Find on page doesn't find a particular string
497 with a newline in the source
499 * khtml/misc/khtml_text_operations.cpp:
500 (khtml::TextIterator::handleTextBox):
501 Clear m_lastTextNodeEndedWithCollapsedSpace after taking it into account.
503 2004-06-23 Richard Williamson <rjw@apple.com>
505 Implemented changes for latest npruntime.h.
509 * kwq/KWQKHTMLPart.h:
510 * kwq/KWQKHTMLPart.mm:
511 (KWQKHTMLPart::KWQKHTMLPart):
512 (KWQKHTMLPart::windowScriptNPObject):
513 (KWQKHTMLPart::getEmbedInstanceForView):
514 * kwq/WebCoreBridge.h:
515 * kwq/WebCoreBridge.mm:
516 (-[WebCoreBridge windowScriptObject]):
517 (-[WebCoreBridge windowScriptNPObject]):
519 2004-06-22 Richard Williamson <rjw@apple.com>
521 Fixed <rdar://problem/3707162>: accessing embeds[] plug-in interface may crash
523 embedInstance was uninitialized.
527 * khtml/html/html_objectimpl.cpp:
528 (HTMLEmbedElementImpl::HTMLEmbedElementImpl):
530 2004-06-18 John Sullivan <sullivan@apple.com>
534 - fixed <rdar://problem/3534851> Pop up windows not showing up within SAP's
535 BW Module (changing location.href on new window created by window.open)
537 * khtml/khtml_part.cpp:
538 (KHTMLPart::scheduleRedirection):
539 allow new redirect to win if delay <= current delay, not just <
541 === WebCore-146.1 ===
543 2004-06-18 Trey Matteson <trey@apple.com>
545 3702053 - DHTML dragging destination can't control the cursor (by setting the drop operation)
547 Fallout from security work, but an easy fix.
551 * kwq/KWQClipboard.mm:
552 (KWQClipboard::setDropEffect): Allow dest side to set dropEffect.
554 2004-06-18 Darin Adler <darin@apple.com>
558 - re-fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)
560 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
561 Check !isInlineFlow rather than checking hasMarkupTruncation. Otherwise, we break
562 plain old non-markup truncation.
564 2004-06-18 Darin Adler <darin@apple.com>
568 - fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)
570 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
571 Only walk the ellipsis list if hasMarkupTruncation is true.
575 2004-06-17 Richard Williamson <rjw@apple.com>
577 Fixed <rdar://problem/3698867> setting the canvas or parent to display:none and updating the causes a nil-deref
579 Ensured that we have a renderer before rendering.
583 * khtml/ecma/kjs_html.cpp:
584 (KJS::Context2DFunction::tryCall):
586 2004-06-17 David Hyatt <hyatt@apple.com>
588 Fix for 3674601, "Read More..." links should trail articles in Emerson.
592 * khtml/rendering/bidi.cpp:
593 (khtml::RenderBlock::layoutInlineChildren):
594 (khtml::RenderBlock::deleteEllipsisLineBoxes):
595 (khtml::RenderBlock::checkLinesForTextOverflow):
596 * khtml/rendering/render_block.cpp:
597 (khtml:::RenderFlow):
598 (khtml::RenderBlock::paintEllipsisBoxes):
599 (khtml::RenderBlock::nodeAtPoint):
600 (khtml::shouldCheckLines):
601 (khtml::getLineAtIndex):
602 (khtml::getHeightForLineCount):
603 (khtml::RenderBlock::lineAtIndex):
604 (khtml::RenderBlock::lineCount):
605 (khtml::RenderBlock::heightForLineCount):
606 (khtml::RenderBlock::clearTruncation):
607 * khtml/rendering/render_block.h:
608 (khtml::RenderBlock::setHasMarkupTruncation):
609 (khtml::RenderBlock::hasMarkupTruncation):
610 * khtml/rendering/render_flexbox.cpp:
611 (khtml::RenderFlexibleBox::layoutVerticalBox):
612 * khtml/rendering/render_line.cpp:
613 (khtml::EllipsisBox::m_str):
614 (khtml::InlineBox::adjustPosition):
615 (khtml::InlineFlowBox::adjustPosition):
616 (khtml::InlineFlowBox::clearTruncation):
617 (khtml::EllipsisBox::paint):
618 (khtml::EllipsisBox::nodeAtPoint):
619 (khtml::RootInlineBox::clearTruncation):
620 (khtml::RootInlineBox::placeEllipsis):
621 (khtml::RootInlineBox::paintEllipsisBox):
622 (khtml::RootInlineBox::hitTestEllipsisBox):
623 (khtml::RootInlineBox::adjustPosition):
624 (khtml::RootInlineBox::childRemoved):
625 * khtml/rendering/render_line.h:
626 (khtml::InlineBox::clearTruncation):
627 * khtml/rendering/render_text.cpp:
628 * khtml/rendering/render_text.h:
629 (khtml::InlineTextBox::clearTruncation):
631 2004-06-17 Trey Matteson <trey@apple.com>
633 3698514 - coordinates in ondragstart and ondrag events are wrong
635 This part fixes the ondragstart coords. We salt away the window-based mouseDown
636 location, since we need that when we dispatch the ondragstart event. Previously
637 we were errantly using a mouseDown point that had already been converted to view
638 coords, and then the dispatch converted it again.
642 * kwq/KWQKHTMLPart.h:
643 * kwq/KWQKHTMLPart.mm:
644 (KWQKHTMLPart::khtmlMouseMoveEvent): Use window based mouse event coords to dispatch event.
645 (KWQKHTMLPart::mouseDown): Save window based mouse event coords .
647 2004-06-16 David Hyatt <hyatt@apple.com>
649 Fix for 3596620, implement a subset of CSS3 text truncation for Emerson.
653 * khtml/rendering/bidi.cpp:
654 (khtml::RenderBlock::checkLinesForTextOverflow):
655 * khtml/rendering/font.cpp:
656 (Font::checkSelectionPoint):
657 * khtml/rendering/font.h:
658 * khtml/rendering/render_block.cpp:
659 (khtml::RenderBlock::paintObject):
660 (khtml::RenderBlock::paintFloats):
661 (khtml::RenderBlock::paintEllipsisBoxes):
662 * khtml/rendering/render_block.h:
663 * khtml/rendering/render_line.cpp:
664 (InlineBox::canAccommodateEllipsis):
665 (InlineBox::placeEllipsisBox):
666 (InlineFlowBox::paintDecorations):
667 (InlineFlowBox::placeEllipsisBox):
668 (EllipsisBox::paint):
669 (RootInlineBox::placeEllipsis):
670 (RootInlineBox::placeEllipsisBox):
671 * khtml/rendering/render_line.h:
672 (khtml::EllipsisBox::m_str):
673 (khtml::RootInlineBox::ellipsisBox):
674 * khtml/rendering/render_text.cpp:
675 (InlineTextBox::placeEllipsisBox):
676 (InlineTextBox::paintDecoration):
677 (InlineTextBox::offsetForPosition):
678 (RenderText::positionForCoordinates):
680 * khtml/rendering/render_text.h:
681 * kwq/KWQFontMetrics.h:
682 * kwq/KWQFontMetrics.mm:
683 (QFontMetrics::checkSelectionPoint):
684 * kwq/WebCoreTextRenderer.h:
686 === WebCore-145.1 ===
688 2004-06-16 Maciej Stachowiak <mjs@apple.com>
692 <rdar://problem/3697602> REGRESSION (144.2-TOT) Selection highlight does not draw
694 * khtml/rendering/render_canvas.cpp:
695 (RenderCanvas::setSelection):
699 2004-06-16 Richard Williamson <rjw@apple.com>
701 Fixed 3695730: Added support for embeds[], much like
702 applets[], to allow access to a plugin's exported interface.
706 * khtml/dom/html_document.cpp:
707 (HTMLDocument::embeds):
708 * khtml/dom/html_document.h:
709 * khtml/ecma/kjs_dom.cpp:
710 (KJS::getRuntimeObject):
711 * khtml/ecma/kjs_html.cpp:
712 (KJS::HTMLDocument::tryGet):
713 (KJS::HTMLElement::tryGet):
714 (KJS::HTMLCollection::tryGet):
715 (KJS::HTMLCollection::getNamedItems):
716 * khtml/ecma/kjs_html.h:
717 (KJS::HTMLDocument::):
718 * khtml/ecma/kjs_html.lut.h:
720 * khtml/html/html_miscimpl.cpp:
721 (HTMLCollectionImpl::calcLength):
722 (HTMLCollectionImpl::getItem):
723 (HTMLCollectionImpl::getNamedItem):
724 * khtml/html/html_miscimpl.h:
725 (DOM::HTMLCollectionImpl::):
726 * khtml/html/html_objectimpl.cpp:
727 (HTMLEmbedElementImpl::getEmbedInstance):
728 * khtml/html/html_objectimpl.h:
729 * kwq/KWQKHTMLPart.h:
730 * kwq/KWQKHTMLPart.mm:
731 (KWQKHTMLPart::getEmbedInstanceForView):
733 2004-06-15 Maciej Stachowiak <mjs@apple.com>
737 <rdar://problem/3695907>: (can't enable selection inside parent where it is disabled via CSS)
739 * khtml/css/cssparser.cpp:
740 (CSSParser::parseValue):
741 * khtml/css/cssstyleselector.cpp:
742 (khtml::CSSStyleSelector::applyProperty):
743 * khtml/rendering/render_object.cpp:
744 (RenderObject::shouldSelect):
745 * khtml/rendering/render_style.h:
747 (khtml::RenderStyle::userSelect):
748 (khtml::RenderStyle::setUserSelect):
749 (khtml::RenderStyle::initialUserSelect):
751 2004-06-15 David Hyatt <hyatt@apple.com>
753 Initial impl of the EllipsisBox. This code just gets the box created and gets it placed vertically. The next
754 stage will be to position the box horizontally as well.
758 * khtml/rendering/bidi.cpp:
759 (khtml::RenderBlock::checkLinesForTextOverflow):
760 * khtml/rendering/render_line.cpp:
761 (RootInlineBox::placeEllipsis):
762 * khtml/rendering/render_line.h:
763 (khtml::EllipsisBox::m_str):
765 2004-06-15 David Hyatt <hyatt@apple.com>
767 Implement canAccommodateEllipsis. The basic idea is that everything on a line will allow an ellipsis to be
768 drawn on top of it unless it's a replaced element. Then, if the replaced element overlaps, the ellipsis won't
773 * khtml/rendering/bidi.cpp:
774 (khtml::RenderBlock::checkLinesForTextOverflow):
775 * khtml/rendering/render_line.cpp:
776 (InlineBox::closestLeafChildForXPos):
777 (InlineBox::canAccommodateEllipsis):
778 (InlineFlowBox::canAccommodateEllipsis):
779 (RootInlineBox::canAccommodateEllipsis):
780 * khtml/rendering/render_line.h:
782 2004-06-15 Vicki Murley <vicki@apple.com>
784 - added a few layout tests, rdar://3694510
786 * layout-tests/editing/deleting/delete-image-004-expected.txt: Added.
787 * layout-tests/editing/deleting/delete-image-004.html: Added.
788 * layout-tests/editing/selection/extend-by-character-006-expected.txt: Added.
789 * layout-tests/editing/selection/extend-by-character-006.html: Added.
791 2004-06-15 Trey Matteson <trey@apple.com>
793 Dragging tweak: We pass the mouse down coords instead of the
794 latest mouse drag coords to the ondragstart event. This makes it
795 easy for the client to figure the correct drag image offset,
796 whereas the mouse drag location is next to useless for that.
800 * kwq/KWQKHTMLPart.mm:
801 (KWQKHTMLPart::khtmlMouseMoveEvent):
803 2004-06-15 Maciej Stachowiak <mjs@apple.com>
807 <rdar://problem/3685236>: (Safari does not support onselectstart event handler)
809 * khtml/ecma/kjs_dom.cpp:
810 (DOMNode::getValueProperty):
812 * khtml/ecma/kjs_dom.h:
814 * khtml/ecma/kjs_dom.lut.h:
816 * khtml/html/html_elementimpl.cpp:
817 (HTMLElementImpl::parseHTMLAttribute):
818 * khtml/misc/htmlattrs.c:
821 * khtml/misc/htmlattrs.h:
822 * khtml/misc/htmlattrs.in:
823 * khtml/rendering/render_object.cpp:
824 (RenderObject::shouldSelect):
825 * khtml/xml/dom2_eventsimpl.cpp:
826 (EventImpl::typeToId):
827 (EventImpl::idToType):
828 * khtml/xml/dom2_eventsimpl.h:
831 2004-06-15 Maciej Stachowiak <mjs@apple.com>
835 Fix crash with last checkin.
837 * khtml/ecma/kjs_binding.cpp:
838 (ScriptInterpreter::domObjectsPerDocument): check the same
839 property we want to initialize.
841 2004-06-15 Maciej Stachowiak <mjs@apple.com>
845 <rdar://problem/3685309>: (properties not shared for JS wrappers of same DOM object, accessed from different frames)
847 * khtml/ecma/kjs_binding.cpp:
848 (ScriptInterpreter::domObjects):
849 (ScriptInterpreter::domObjectsPerDocument):
850 (ScriptInterpreter::ScriptInterpreter):
851 (ScriptInterpreter::forgetDOMObject):
852 (ScriptInterpreter::getDOMObjectForDocument):
853 (ScriptInterpreter::putDOMObjectForDocument):
854 (ScriptInterpreter::deleteDOMObjectsForDocument):
855 (ScriptInterpreter::mark):
856 (ScriptInterpreter::forgetDOMObjectsForDocument):
857 (ScriptInterpreter::updateDOMObjectDocument):
858 * khtml/ecma/kjs_binding.h:
859 (KJS::ScriptInterpreter::getDOMObject):
860 (KJS::ScriptInterpreter::putDOMObject):
861 (KJS::ScriptInterpreter::deleteDOMObject):
863 2004-06-15 Darin Adler <darin@apple.com>
865 - 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
866 (it was making most layout tests fail)
868 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::checkAddChild): Rolled check back in.
870 2004-06-15 David Hyatt <hyatt@apple.com>
872 Add a truncation variable to text run boxes that will eventually be used to know how to cut out some of the glyphs when
877 * khtml/rendering/render_text.cpp:
878 (RenderText::clearTextOverflowTruncation):
879 * khtml/rendering/render_text.h:
880 (khtml::InlineTextBox:::InlineRunBox):
881 (khtml::InlineTextBox::clearTruncation):
883 2004-06-14 Darin Adler <darin@apple.com>
887 - fixed some things for GC that Patrick missed, or that happened after the branch
890 (-[DOMStyleSheet finalize]): Added.
891 (-[DOMStyleSheetList finalize]): Added.
892 (-[DOMCSSStyleSheet finalize]): Added.
893 (-[DOMMediaList finalize]): Added.
894 (-[DOMCSSRuleList finalize]): Added.
895 (-[DOMCSSRule finalize]): Added.
896 (-[DOMCSSStyleDeclaration finalize]): Added.
897 (-[DOMCSSValue finalize]): Added.
898 (-[DOMRGBColor finalize]): Added.
899 (-[DOMRect finalize]): Added.
900 (-[DOMCounter finalize]): Added.
902 (-[DOMObject finalize]): Added.
903 (-[DOMNode finalize]): Added.
904 (-[DOMNamedNodeMap finalize]): Added.
905 (-[DOMNodeList finalize]): Added.
906 (-[DOMImplementation finalize]): Added.
907 (-[DOMRange finalize]): Added.
908 (-[DOMNodeFilter finalize]): Added.
909 (-[DOMNodeIterator finalize]): Added.
910 (-[DOMTreeWalker dealloc]): Removed unneeded nil check.
911 (-[DOMTreeWalker finalize]): Added.
913 (-[DOMHTMLCollection finalize]): Added.
914 (-[DOMHTMLOptionsCollection finalize]): Added.
915 * kwq/KWQClipboard.mm:
916 (KWQClipboard::KWQClipboard): Use KWQRetain instead of retain.
917 (KWQClipboard::~KWQClipboard): Use KWQRelease instead of release.
918 * kwq/KWQEditCommand.mm:
919 (-[KWQEditCommand finalize]): Added.
921 (QFont::~QFont): Use KWQRelease instead of release.
922 * kwq/KWQKHTMLPart.mm:
923 (KWQKHTMLPart::keyEvent): Use KWQRetain instead of retain, and KWQRelease instead of release.
924 (KWQKHTMLPart::mouseDown): Use KWQRetain instead of retain, and KWQRelease instead of release.
925 (KWQKHTMLPart::mouseDragged): Use KWQRetain instead of retain, and KWQRelease instead of release.
926 (KWQKHTMLPart::mouseUp): Use KWQRetain instead of retain, and KWQRelease instead of release.
927 (KWQKHTMLPart::mouseMoved): Use KWQRetain instead of retain, and KWQRelease instead of release.
928 (KWQKHTMLPart::sendContextMenuEvent): Use KWQRetain instead of retain, and KWQRelease instead of release.
929 * kwq/KWQPageState.mm:
930 (-[KWQPageState finalize]): Added. Filed <rdar://problem/3694163> about the fact that this is not right.
932 (-[KWQSingleShotTimerTarget finalize]): Added.
933 * kwq/WebCoreBridge.mm:
934 (-[WebCoreBridge finalize]): Added. Filed <rdar://problem/3694165> about the fact that this is not right.
936 2004-06-15 David Hyatt <hyatt@apple.com>
938 Initial work on text truncation. Working top-down, I think I've made all the changes I will need to bidi.cpp
939 and to the block code itself. The rest of the code can be concentrated in the render_line and render_text files.
943 * khtml/rendering/bidi.cpp:
944 (khtml::RenderBlock::layoutInlineChildren):
945 (khtml::RenderBlock::findNextLineBreak):
946 (khtml::RenderBlock::deleteEllipsisLineBoxes):
947 (khtml::RenderBlock::checkLinesForTextOverflow):
948 * khtml/rendering/render_block.h:
949 * khtml/rendering/render_line.cpp:
950 (RootInlineBox::detach):
951 (RootInlineBox::detachEllipsisBox):
952 (RootInlineBox::canAccommodateEllipsis):
953 (RootInlineBox::placeEllipsis):
954 * khtml/rendering/render_line.h:
955 (khtml::RootInlineBox::RootInlineBox):
956 * khtml/rendering/render_text.cpp:
957 (RenderText::clearTextOverflowTruncation):
958 * khtml/rendering/render_text.h:
960 2004-06-14 Trey Matteson <trey@apple.com>
962 3692690 - REGRESSION: canceling drag from WebView cause link to load
963 Just need to take extra care to cancel any click handling in
964 all cases once we're committed to doing the drag.
968 * kwq/KWQKHTMLPart.mm:
969 (KWQKHTMLPart::khtmlMouseMoveEvent): Call invalidateClick once
970 we're past the hysteresis point, and definitely going to try
971 to start a drag and drop.
973 2004-06-14 Darin Adler <darin@apple.com>
975 - fixed crash on boot
977 * kwq/KWQFoundationExtras.h: (KWQRetainNSRelease):
978 Fixed return value of this method; was uninitialized.
980 2004-06-14 Trey Matteson <trey@apple.com>
982 Dashboard wants access to pastboard data during the drag gesture.
984 We address this need be allowing docs that are local files to access the
985 pasteboard data during a drag, while other pages can only get at the types
986 list until the drop happens. This is deemed safe because local files already
987 have such broad super powers.
993 (KURL::isLocalFile): Implement this QT method to look for the file scheme.
994 * kwq/WebCoreBridge.mm:
995 (-[WebCoreBridge dragOperationForDraggingInfo:]): Use more relaxed clipboard
996 security for local file pages.
997 (-[WebCoreBridge dragExitedWithDraggingInfo:]): Ditto.
999 2004-06-14 Darin Adler <darin@apple.com>
1001 Reviewed by me, code changes by Patrick Beard.
1003 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
1005 * WebCore.pbproj/project.pbxproj: Added KWQFoundationExtras.h.
1006 * kwq/KWQFoundationExtras.h: Added.
1007 (KWQRetain): Cover for CFRetain that is tolerant of nil.
1008 (KWQRelease): Cover for CFRelease that is tolerant of nil.
1009 (KWQRetainNSRelease): Combination of a CFRetain and an -[NSObject release] that is tolerant of nil.
1010 Also includes a declaration of finalize so we can call [super finalize] without warnings on Panther.
1013 (ObjCNodeFilterCondition::ObjCNodeFilterCondition): Use CFRetain instead of retain.
1014 (ObjCNodeFilterCondition::~ObjCNodeFilterCondition): Use CFRelease instead of release.
1015 * kwq/KWQComboBox.mm:
1016 (QComboBox::~QComboBox): Use KWQRelease instead of release.
1017 (QComboBox::setFont): Use KWQRelease instead of release.
1018 (QComboBox::labelFont): Use KWQRetain instead of retain.
1020 (QCursor::QCursor): Use KWQRetain instead of retain.
1021 (QCursor::~QCursor): Use KWQRelease instead of release.
1022 (QCursor::operator=): More of the same.
1023 * kwq/KWQFileButton.mm:
1024 (KWQFileButton::KWQFileButton): Use KWQRetainNSRelease to retain a newly-allocated object.
1025 (KWQFileButton::~KWQFileButton): Use CFRelease instead of release.
1027 (QFont::QFont): Use KWQRetain instead of retain.
1028 (QFont::operator=): More of the same.
1029 (QFont::setFamily): Use KWQRelease instead of release.
1030 (QFont::setFirstFamily): Use KWQRelease instead of release.
1031 (QFont::setPixelSize): Use KWQRelease instead of release.
1032 (QFont::setWeight): Use KWQRelease instead of release.
1033 (QFont::setItalic): Use KWQRelease instead of release.
1034 (QFont::getNSFont): Use KWQRetain instead of retain.
1035 * kwq/KWQFontMetrics.mm:
1036 (QFontMetricsPrivate::~QFontMetricsPrivate): Use KWQRelease instead of release.
1037 (QFontMetricsPrivate::getRenderer): Use KWQRetain instead of retain.
1038 (QFontMetricsPrivate::setFont): Use KWQRelease instead of release.
1039 * kwq/KWQKHTMLPart.mm:
1040 (KWQKHTMLPart::~KWQKHTMLPart): Use KWQRelease instead of release.
1041 (KWQKHTMLPart::clearRecordedFormValues): Use KWQRelease instead of release.
1042 (KWQKHTMLPart::recordFormValue): Use KWQRetainNSRelease and use KWQRetain instead of retain.
1043 (KWQKHTMLPart::windowScriptObject): Use KWQRetainNSRelease.
1044 * kwq/KWQKJobClasses.mm:
1045 (KIO::TransferJobPrivate::TransferJobPrivate): Use KWQRetainNSRelease.
1046 (KIO::TransferJobPrivate::~TransferJobPrivate): Use KWQRelease instead of release.
1047 (KIO::TransferJob::setLoader): More of the same.
1049 (KWQRetainResponse): Use KWQRetain instead of retain.
1050 (KWQReleaseResponse): Use KWQRelease instead of release.
1051 * kwq/KWQPainter.mm:
1052 (QPainterPrivate::~QPainterPrivate): Use KWQRelease instead of release.
1053 (QPainter::_updateRenderer): More of the same.
1054 (QPainter::initFocusRing): Use KWQRetainNSRelease.
1055 (QPainter::clearFocusRing): Use KWQRelease instead of release.
1057 (QPixmap::QPixmap): Use KWQRetain instead of retain.
1058 (QPixmap::~QPixmap): Use KWQRelease instead of release.
1059 (QPixmap::receivedData): Use KWQRetain instead of retain.
1060 (QPixmap::resize): Use KWQRetainNSRelease and use KWQRelease instead of release.
1061 (QPixmap::operator=): More of the same.
1063 (QRegion::QRegion): Use KWQRetain instead of retain.
1064 (QRegion::~QRegion): Use KWQRelease instead of release.
1065 (QRegion::operator=): More of the same.
1067 (QTimer::start): Use KWQRetain instead of retain.
1068 (QTimer::stop): Use KWQRelease instead of release.
1069 (QTimer::fire): Use KWQRelease instead of release.
1071 (QWidget::QWidget): Use KWQRetain instead of retain.
1072 (QWidget::~QWidget): Use KWQRelease instead of release.
1073 (QWidget::setView): More of the same.
1074 * kwq/WebCoreSettings.mm: (-[WebCoreSettings finalize]):
1075 Delete the storage here, as well as in dealloc.
1077 2004-06-14 Maciej Stachowiak <mjs@apple.com>
1081 <rdar://problem/3693818>: (Safari should use CG calls for circle drawing for better performance)
1083 * kwq/KWQPainter.mm:
1084 (QPainter::drawEllipse): Use CG calls instead of NS calls for faster circle drawing.
1085 (QPainter::drawArc): Ditto.
1087 2004-06-14 Ken Kocienda <kocienda@apple.com>
1093 <rdar://problem/3690115> Crash deleting text out of iChat's profile (an editable Webview)
1095 * khtml/html/html_elementimpl.cpp:
1096 (HTMLElementImpl::isFocusable): Added null-check of parent node before deref'ing it.
1098 2004-06-14 Trey Matteson <trey@apple.com>
1100 Two tweaks to recently added "drag" pseudo-class, as suggested by
1101 Dave. The class is renamed to "-khtml-drag", and we update layout
1102 when using it, instead of only updating styles.
1106 * khtml/css/css_base.cpp:
1107 (CSSSelector::extractPseudoType):
1108 * kwq/KWQKHTMLPart.mm:
1109 (KWQKHTMLPart::snapshotDragImage):
1111 2004-06-13 Trey Matteson <trey@apple.com>
1113 Support for DHTML cut/copy/paste. We now support oncut, oncopy, onpaste. The events
1114 are sent to the first node in the selection, or else the body. Current holes are
1115 that we do not send events for operations in text fields or text areas (because it
1116 is hard to get the right hooks into the AppKit).
1118 We also send onbeforecut, onbeforecopy, onbeforepaste before the other events, which
1119 isn't really WinIE compatible, but is close. WinIE uses these to enable cut/paste
1120 menu items in its UI. DB doesn't need this for now.
1124 * khtml/ecma/kjs_dom.cpp:
1125 (DOMNode::getValueProperty): Boilerplate for new events
1126 (DOMNode::putValue): Boilerplate for new events
1127 * khtml/ecma/kjs_dom.h:
1128 (KJS::DOMNode::): Boilerplate for new events
1129 * khtml/ecma/kjs_dom.lut.h:
1130 * khtml/ecma/kjs_events.cpp:
1131 (DOMEvent::DOMEvent): "dataTransfer" and "clipboardData" properties are conditionally
1132 defined on DOMEvent, depending on if the event is a dragging or clipboard event.
1133 (DOMMouseEvent::mark): Pass mark along to any clipboard object we have.
1134 (DOMEvent::getValueProperty): Return "dataTransfer" or "clipboardData".
1135 (DOMMouseEvent::getValueProperty): Returning "dataTransfer" now handled by
1137 * khtml/ecma/kjs_events.h:
1139 (KJS::DOMMouseEvent::DOMMouseEvent):
1140 (KJS::DOMMouseEvent::):
1141 (KJS::DOMMouseEvent::toMouseEvent):
1142 * khtml/ecma/kjs_events.lut.h:
1143 * khtml/html/html_elementimpl.cpp:
1144 (HTMLElementImpl::parseHTMLAttribute): Boilerplate for new events
1145 * khtml/misc/htmlattrs.c:
1146 * khtml/misc/htmlattrs.h:
1147 * khtml/misc/htmlattrs.in: Boilerplate for new events
1148 * khtml/xml/dom2_eventsimpl.cpp:
1149 (EventImpl::typeToId): Boilerplate for new events
1150 (EventImpl::idToType): Boilerplate for new events
1151 (EventImpl::isDragEvent): New utility
1152 (EventImpl::isClipboardEvent): New utility
1153 (MouseEventImpl::isDragEvent): New utility
1154 (ClipboardEventImpl::ClipboardEventImpl): ref optional clipboard
1155 (ClipboardEventImpl::~ClipboardEventImpl): deref optional clipboard
1156 (ClipboardEventImpl::isClipboardEvent): New utility
1157 * khtml/xml/dom2_eventsimpl.h:
1158 (DOM::EventImpl::): Boilerplate for new events
1159 (DOM::ClipboardEventImpl::clipboard):
1160 * kwq/KWQClipboard.h: Monkey business so this file is includable in C++.
1161 * kwq/KWQClipboard.mm:
1162 * kwq/KWQKHTMLPart.h:
1163 * kwq/KWQKHTMLPart.mm:
1164 (KWQKHTMLPart::dispatchCPPEvent): Send one of the new events.
1165 (KWQKHTMLPart::tryCut): Declare pasteboard types, send cut events.
1166 (KWQKHTMLPart::tryCopy): Declare pasteboard types, send copy events.
1167 (KWQKHTMLPart::tryPaste): Send paste events.
1168 * kwq/WebCoreBridge.h:
1169 * kwq/WebCoreBridge.mm:
1170 (-[WebCoreBridge tryDHTMLCut]): Pass through to part
1171 (-[WebCoreBridge tryDHTMLCopy]): Ditto
1172 (-[WebCoreBridge tryDHTMLPaste]): Ditto
1174 2004-06-14 Trey Matteson <trey@apple.com>
1176 A new CSS pseudo-class ".drag" is added. Analogous to the "hover" class,
1177 this class determines styles used while an element is generating a drag
1182 * khtml/css/css_base.cpp:
1183 (CSSSelector::extractPseudoType): Boilerplate for adding new class.
1184 * khtml/css/css_base.h: Boilerplate for adding new class.
1185 * khtml/css/cssstyleselector.cpp:
1186 (khtml::CSSStyleSelector::checkOneSelector): Match new class against
1187 elements being dragged.
1188 * khtml/css/cssstyleselector.h:
1189 (khtml::StyleSelector::): Boilerplate for adding new class.
1190 * khtml/rendering/render_object.cpp:
1191 (RenderObject::RenderObject): Init new member.
1192 (RenderObject::isDragging): Return whether this object is being dragged.
1193 (RenderObject::updateDragState): Paint us an all children with a new dragged state.
1194 * khtml/rendering/render_object.h:
1195 * khtml/rendering/render_style.h: Boilerplate for adding new class.
1196 (khtml::RenderStyle::NonInheritedFlags::operator==):
1197 (khtml::RenderStyle::setBitDefaults):
1198 (khtml::RenderStyle::affectedByDragRules):
1199 (khtml::RenderStyle::setAffectedByDragRules):
1200 * kwq/KWQClipboard.mm:
1201 (KWQClipboard::dragNSImage): Method rename.
1202 * kwq/KWQKHTMLPart.h:
1203 * kwq/KWQKHTMLPart.mm:
1204 (KWQKHTMLPart::snapshotDragImage): Mark the element as being dragged before
1205 we snapshot it, so new style class will apply.
1207 2004-06-14 Ken Kocienda <kocienda@apple.com>
1211 Added a few more editing-related layout tests.
1213 * layout-tests/editing/inserting/insert-3654864-fix-expected.txt: Added.
1214 * layout-tests/editing/inserting/insert-3654864-fix.html: Added.
1215 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt: Added.
1216 * layout-tests/editing/inserting/insert-3659587-fix.html: Added.
1217 * layout-tests/editing/inserting/insert-after-delete-001-expected.txt: Added.
1218 * layout-tests/editing/inserting/insert-after-delete-001.html: Added.
1219 * layout-tests/editing/inserting/insert-br-case1-expected.txt: Added.
1220 * layout-tests/editing/inserting/insert-br-case1.html: Added.
1221 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Added.
1222 * layout-tests/editing/inserting/insert-br-case2.html: Added.
1223 * layout-tests/editing/inserting/insert-br-case3-expected.txt: Added.
1224 * layout-tests/editing/inserting/insert-br-case3.html: Added.
1226 2004-06-14 Ken Kocienda <kocienda@apple.com>
1230 Regarding the bug below, removing some tests since we have removed the execCommand("paste")
1231 feature, at least for now.
1233 <rdar://problem/3684792>: (JavaScript execCommand("paste") presents security issues)
1235 * layout-tests/editing/pasteboard/copy-paste-text-001-expected.txt: Removed.
1236 * layout-tests/editing/pasteboard/copy-paste-text-001.html: Removed.
1237 * layout-tests/editing/pasteboard/cut-paste-text-002-expected.txt: Removed.
1238 * layout-tests/editing/pasteboard/cut-paste-text-002.html: Removed.
1240 2004-06-14 Ken Kocienda <kocienda@apple.com>
1246 <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply due to non-0 exception code trying to insert a DIV markup string
1248 * khtml/xml/dom_nodeimpl.cpp:
1249 (NodeImpl::checkAddChild): This function was being too strict in disallowing certain nodes
1250 to be added as other child nodes, applying rules we typically use for parsing. However,
1251 those parsing rules are primarily for dealing with "bad" HTML, and should not be
1252 applied to programmatic DOM operations. The fix involves removing calls to childAllowed().
1254 2004-06-12 Trey Matteson <trey@apple.com>
1256 The drag image may be updated during a DHTML drag. This includes updating
1257 from a Timer instead of a drag event handler. In addition, an arbitrary
1258 element can be set as the one to snapshot for the drag image.
1262 * khtml/ecma/kjs_events.cpp:
1263 (ClipboardProtoFunc::tryCall): setDragImage accepts a node. Previously,
1264 it had to be an Image object.
1265 * khtml/rendering/render_object.cpp:
1266 (RenderObject::paintingRootRect): Also returns top element's rect.
1267 * khtml/rendering/render_object.h:
1268 * khtml/xml/dom2_eventsimpl.h:
1269 * kwq/KWQClipboard.h: New security mode where image is still writable, but
1272 (KWQClipboard::setDragHasStarted):
1273 * kwq/KWQClipboard.mm:
1274 (KWQClipboard::KWQClipboard): Part may be passed. Needed in the source
1275 case to generate an image from an element.
1276 (KWQClipboard::setAccessPolicy): New, replaces former becomeNumb method
1277 which wasn't flexible enough.
1278 (KWQClipboard::accessPolicy): New getter.
1279 (KWQClipboard::dragImage): No change, diff confusion.
1280 (KWQClipboard::setDragImage): Call new helper, below.
1281 (KWQClipboard::dragImageElement): New, return any element set.
1282 (KWQClipboard::setDragImageElement): New, call new helper.
1283 (KWQClipboard::setDragImage): New helper, set the image via either a
1284 pixmap or an element to snapshot, pushes the result to WebKit if we've
1285 already started the drag.
1286 (KWQClipboard::dragNSImage): Generate an NSImage and mouse offset, no
1287 matter how the drag image was set (Image or element).
1288 * kwq/KWQKHTMLPart.h: A single clipboard is kept over the life of a
1289 source drag instead of making one for each event.
1290 * kwq/KWQKHTMLPart.mm:
1291 (KWQKHTMLPart::KWQKHTMLPart): Init clipboard.
1292 (KWQKHTMLPart::~KWQKHTMLPart): Free clipboard.
1293 (KWQKHTMLPart::freeClipboard): New helper.
1294 (KWQKHTMLPart::dispatchDragSrcEvent): Most code moved to caller.
1295 (KWQKHTMLPart::khtmlMouseMoveEvent): Make clipboard for this drag session.
1296 Init clipboard to make an image from the dragSource element. Mark the
1297 drag as having started.
1298 (KWQKHTMLPart::dragSourceMovedTo): Clipboard will update WK with any new
1299 drag image, so we don't need to.
1300 (KWQKHTMLPart::dragSourceEndedAt): Ditto.
1301 (KWQKHTMLPart::elementImage): Also return element rect.
1302 * kwq/WebCoreBridge.h: Glue moved to WebCoreGraphicsBridge.
1303 * kwq/WebCoreBridge.mm:
1304 (-[WebCoreBridge dragOperationForDraggingInfo:]): Use new method.
1305 (-[WebCoreBridge dragExitedWithDraggingInfo:]): Ditto
1306 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto
1307 * kwq/WebCoreGraphicsBridge.h:
1308 * kwq/WebCoreGraphicsBridge.m:
1309 (-[WebCoreGraphicsBridge setDraggingImage:at:]): Glue moved from WebBridge
1311 2004-06-11 Chris Blumenberg <cblu@apple.com>
1313 Support for WebKit drag & drop API.
1317 * kwq/WebCoreBridge.h:
1318 * kwq/WebCoreBridge.mm:
1319 (-[WebCoreBridge _positionForPoint:]): new
1320 (-[WebCoreBridge moveDragCaretToPoint:]): call _positionForPoint
1321 (-[WebCoreBridge editableDOMRangeForPoint:]): new
1323 2004-06-11 Darin Adler <darin@apple.com>
1327 - fixed <rdar://problem/3645846>: (REGRESSION: Stuck "Loading" when logging into Google's Gmail on newer versions of Safari)
1329 * khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::parseHTMLAttribute):
1330 Call through to base class for ATTR_ID so the "has ID" bit gets set.
1331 * khtml/html/html_imageimpl.cpp:
1332 (HTMLImageElementImpl::parseHTMLAttribute): Move ATTR_COMPOSITE code up and out of the way so
1333 it doesn't screw up ATTR_ID parsing.
1334 (HTMLMapElementImpl::parseHTMLAttribute): Call through to base class for ATTR_ID
1335 so the "has ID" bit gets set.
1336 * khtml/html/html_objectimpl.cpp:
1337 (HTMLAppletElementImpl::parseHTMLAttribute): Remove ATTR_ID case; not needed.
1338 (HTMLParamElementImpl::parseHTMLAttribute): Call through to base class for ATTR_ID
1339 so the "has ID" bit gets set.
1341 2004-06-11 Ken Kocienda <kocienda@apple.com>
1347 <rdar://problem/3659587>: "when typing in Blot, bold style does not carry over to next line after pressing 'return'"
1349 Did some work to improve the insert newline command. The refinement is to insert the newline
1350 at the upstream position of the caret, ensuring that the newline takes on the
1351 appropriate style, and does not let the caret "escape" from an element that is
1354 * khtml/editing/htmlediting_impl.cpp:
1355 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition): New helper. Adds smarts about adding
1356 newlines when the selection is a caret in a block.
1357 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition): Ditto.
1358 (khtml::InputNewlineCommandImpl::doApply): Simplified cases. One case in the code could not
1360 * khtml/editing/htmlediting_impl.h:
1364 <rdar://problem/3654864>: "Pasting content at start of line places it at end of previous line"
1366 (khtml::InputTextCommandImpl::prepareForTextInsertion): Simple code mistake. Content was indeed
1367 being added to the line before. Fixed to add new content after the line break.
1369 2004-07-10 Trey Matteson <trey@apple.com>
1371 Prep work for latest delegate API for dragging. In addition, I also straightened out all
1372 the cases of DHTML setting a drag image or setting pasteboard data, and how that would
1373 override WebKit's default behavior (which follows how WinIE does things).
1377 * khtml/rendering/render_object.cpp:
1378 (RenderObject::draggableNode): Obey new params for whether a DHTML or UserAgent (i.e.,
1379 WebKit) drag source is allowed.
1380 * khtml/rendering/render_object.h:
1381 * kwq/KWQKHTMLPart.h:
1382 * kwq/KWQKHTMLPart.mm:
1383 (KWQKHTMLPart::dispatchDragSrcEvent): Setting pasteboard data was moved out of here, now
1384 caller's responsibility.
1385 (KWQKHTMLPart::khtmlMouseMoveEvent): Ask bridge for allowable drag actions (DHTML vs UA).
1386 Only send drag events if DHTML is allowed. Only generate a drag image if the source is
1387 a DHTML element. Note whether event handler set any pasteboard data, and pass that fact
1389 (KWQKHTMLPart::dragSourceMovedTo): Only send drag events if DHTML is allowed.
1390 (KWQKHTMLPart::dragSourceEndedAt): Only send drag events if DHTML is allowed.
1391 * kwq/WebCoreBridge.h:
1393 2004-06-11 Ken Kocienda <kocienda@apple.com>
1397 Lay some groundwork for better testing of inserting newlines. Layout
1398 tests that use this new code will be coming soon.
1400 * khtml/editing/jsediting.cpp: Add commands for bold and inserting newlines.
1401 * layout-tests/editing/editing.js: Added new insertNewline command.
1402 which calls through to TypingCommand::insertNewline. There was no way to get
1403 to this command from JS before this addition.
1405 2004-06-11 Ken Kocienda <kocienda@apple.com>
1409 Javascript execCommand system wants to use case-insensitive QDict.
1410 The interface for QDict offers this feature, but it was never implemented.
1413 * kwq/KWQDictImpl.h: Declare bool to store case-sensitive bit.
1414 * kwq/KWQDictImpl.mm:
1415 (KWQDictImpl::KWQDictImpl): No longer drops caseSensitive on the floor; stores
1416 it in instance variable.
1417 (KWQDictImpl::insert): Make lowercase version of key for operation, if necessary.
1418 (KWQDictImpl::remove): Ditto.
1419 (KWQDictImpl::find): Ditto.
1420 (KWQDictIteratorImpl::currentStringKey): Whitespace cleanup.
1424 2004-06-10 Ken Kocienda <kocienda@apple.com>
1430 <rdar://problem/3654850>: "Style changes do not work across blocks"
1432 Now, applying styles works across blocks. I did quite a bit
1433 of internal redsign on the member functions of this class to
1434 make this work. As a bonus, from an architectural standpoint,
1435 all style changes are now done "in place". There is no more
1436 copying of content in order to perform style changes.
1438 * khtml/editing/htmlediting_impl.cpp:
1439 (khtml::ApplyStyleCommandImpl::doApply):
1440 (khtml::ApplyStyleCommandImpl::removeHTMLStyleNode):
1441 (khtml::ApplyStyleCommandImpl::removeCSSStyle):
1442 (khtml::ApplyStyleCommandImpl::removeStyle):
1443 (khtml::ApplyStyleCommandImpl::nodeFullySelected):
1444 (khtml::ApplyStyleCommandImpl::splitTextAtStartIfNeeded):
1445 (khtml::ApplyStyleCommandImpl::splitTextAtEndIfNeeded):
1446 (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
1447 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded):
1448 (khtml::ApplyStyleCommandImpl::positionInsertionPoint):
1449 * khtml/editing/htmlediting_impl.h:
1451 2004-06-10 Darin Adler <darin@apple.com>
1455 - filled out execCommand a lot more
1456 - fixed <rdar://problem/3685231>: (execCommand italic is not implemented)
1457 - fixed <rdar://problem/3685232>: (execCommand bold is not implemented)
1458 - fixed <rdar://problem/3675899>: (Make queryCommandIndeterm work as specified in the Javascript execCommand Compatibility Plan)
1459 - fixed <rdar://problem/3675901>: (Make queryCommandState work as specified in the Javascript execCommand Compatibility Plan)
1460 - fixed <rdar://problem/3675904>: (Make queryCommandValue work as specified in the Javascript execCommand Compatibility Plan)
1462 * khtml/editing/jsediting.cpp:
1463 (DOM::JSEditor::queryCommandIndeterm): Changed to use KHTMLPart::TriState instead of CommandState.
1464 (DOM::JSEditor::queryCommandState): Ditto.
1465 (execStyleChange): Changed to use KHTMLPart::applyStyle.
1466 (stateStyle): Used KHTMLPart::selectionHasStyle for this.
1467 (selectionStartHasStyle): Use KHTMLPart::selectionStartHasStyle for this.
1468 (valueStyle): Used KHTMLPart::selectionStartStylePropertyValue for this.
1469 (execBold): Implemented toggling, using selectionStartHasStyle.
1470 (execItalic): Implemented toggling, using selectionStartHasStyle.
1471 (execPrint): Implemented.
1472 (enabledRedo): Implemented, using canRedo.
1473 (enabledUndo): Implemented, using canUndo.
1474 (stateNone): Renamed from stateNo.
1475 (valueBackColor): Implemented, using valueStyle.
1476 (valueFontName): Implemented, using valueStyle.
1477 (valueFontSize): Implemented, using valueStyle.
1478 (valueForeColor): Implemented, using valueStyle.
1479 (valueFontSize): Implemented, using valueStyle.
1481 * khtml/khtml_part.h: Added editing operations.
1482 * khtml/khtml_part.cpp:
1483 (KHTMLPart::copyToPasteboard): Added.
1484 (KHTMLPart::cutToPasteboard): Added.
1485 (KHTMLPart::redo): Added.
1486 (KHTMLPart::undo): Added.
1487 (KHTMLPart::applyStyle): Added.
1488 (updateState): Added.
1489 (KHTMLPart::selectionHasStyle): Added.
1490 (KHTMLPart::selectionStartHasStyle): Added.
1491 (KHTMLPart::selectionStartStylePropertyValue): Added.
1492 (KHTMLPart::selectionComputedStyle): Added.
1493 (KHTMLPart::print): Added.
1495 * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Call print() on plain old part, not KWQ(part).
1497 * kwq/KWQKHTMLPart.h: Removed print(), added _haveUndoRedoOperations.
1498 * kwq/KWQKHTMLPart.mm:
1499 (KHTMLPart::print): Moved from KWQKHTMLPart to KHTMLPart.
1500 (KWQKHTMLPart::registerCommandForUndo): Moved code here from bridge.
1501 (KWQKHTMLPart::registerCommandForRedo): Moved code here from bridge.
1502 (KWQKHTMLPart::clearUndoRedoOperations): Moved code here from bridge.
1503 (KWQKHTMLPart::issueUndoCommand): Moved code here from bridge.
1504 (KWQKHTMLPart::issueRedoCommand): Moved code here from bridge.
1505 (KWQKHTMLPart::issuePasteCommand): Moved code here from bridge.
1506 (KHTMLPart::canUndo): Added.
1507 (KHTMLPart::canRedo): Added.
1509 * kwq/WebCoreBridge.h: Added undoManager, removed undo-related methods.
1510 * kwq/WebCoreBridge.mm: (-[WebCoreBridge applyStyle:]): Changed to call
1511 KHTMLPart::applyStyle.
1513 * WebCore.pbproj/.cvsignore: Updated for new Xcode files.
1515 2004-06-09 Maciej Stachowiak <mjs@apple.com>
1519 <rdar://problem/3671555>: Blot scrolls to the top every time you type
1521 * khtml/xml/dom_selection.cpp:
1522 (DOM::Selection::getRepaintRect): If the caret position is invalid, recompute it.
1524 2004-06-09 David Hyatt <hyatt@apple.com>
1526 Fix for 3607091, implement a style that prevents zoom and min font size from taking effect.
1527 The name of the new style is "-apple-text-size-adjust" with values of "none" and "auto." The default
1532 * khtml/css/cssparser.cpp:
1533 (CSSParser::parseValue):
1534 * khtml/css/cssproperties.c:
1537 * khtml/css/cssproperties.h:
1538 * khtml/css/cssproperties.in:
1539 * khtml/css/cssstyleselector.cpp:
1540 (khtml::CSSStyleSelector::styleForElement):
1541 (khtml::CSSStyleSelector::pseudoStyleForElement):
1542 (khtml::CSSStyleSelector::applyDeclarations):
1543 (khtml::CSSStyleSelector::applyProperty):
1544 (khtml::CSSStyleSelector::checkForTextSizeAdjust):
1545 * khtml/css/cssstyleselector.h:
1546 * khtml/rendering/render_style.cpp:
1548 (StyleCSS3InheritedData):
1549 (StyleCSS3InheritedData::operator==):
1550 (RenderStyle::diff):
1551 * khtml/rendering/render_style.h:
1552 (khtml::RenderStyle::lineClamp):
1553 (khtml::RenderStyle::textSizeAdjust):
1554 (khtml::RenderStyle::setTextSizeAdjust):
1555 (khtml::RenderStyle::initialTextSizeAdjust):
1557 2004-06-09 David Hyatt <hyatt@apple.com>
1559 Implement parsing and setting of the text-overflow CSS3 property.
1561 Reviewed by kocienda
1563 * khtml/css/cssparser.cpp:
1564 (CSSParser::parseValue):
1565 * khtml/css/cssproperties.c:
1568 * khtml/css/cssproperties.h:
1569 * khtml/css/cssproperties.in:
1570 * khtml/css/cssstyleselector.cpp:
1571 (khtml::CSSStyleSelector::applyProperty):
1572 * khtml/css/cssvalues.c:
1575 * khtml/css/cssvalues.h:
1576 * khtml/css/cssvalues.in:
1577 * khtml/rendering/render_style.cpp:
1579 (StyleCSS3NonInheritedData::operator==):
1580 (RenderStyle::diff):
1581 * khtml/rendering/render_style.h:
1582 (khtml::RenderStyle::textOverflow):
1583 (khtml::RenderStyle::setTextOverflow):
1584 (khtml::RenderStyle::initialTextOverflow):
1586 2004-06-09 David Hyatt <hyatt@apple.com>
1588 Fix for 3678031, implement better flexing for Emerson headers. This involved adding support for max-width: intrinsic,
1589 fixing the box layout algorithm to properly deal with max-widths, and implementing support for baseline alignment
1590 so that boxes can be aligned vertically along their interior baselines.
1592 Reviewed by kocienda
1594 * khtml/css/cssparser.cpp:
1595 (CSSParser::parseValue):
1596 (CSSParser::parseShadow):
1597 * khtml/css/cssparser.h:
1598 * khtml/css/cssproperties.c:
1601 * khtml/css/cssproperties.h:
1602 * khtml/css/cssproperties.in:
1603 * khtml/css/cssstyleselector.cpp:
1604 (khtml::CSSStyleSelector::applyProperty):
1605 * khtml/css/cssvalues.c:
1608 * khtml/css/cssvalues.h:
1609 * khtml/css/cssvalues.in:
1610 * khtml/misc/khtmllayout.h:
1612 * khtml/rendering/render_block.cpp:
1613 (khtml::RenderBlock::baselinePosition):
1614 (khtml::RenderBlock::getBaselineOfFirstLineBox):
1615 * khtml/rendering/render_block.h:
1616 * khtml/rendering/render_box.cpp:
1617 (RenderBox::RenderBox):
1618 (RenderBox::overrideWidth):
1619 (RenderBox::overrideHeight):
1620 (RenderBox::calcWidth):
1621 (RenderBox::calcHeight):
1622 * khtml/rendering/render_box.h:
1623 (khtml::RenderBox::overrideSize):
1624 (khtml::RenderBox::setOverrideSize):
1625 * khtml/rendering/render_flexbox.cpp:
1626 (khtml::RenderFlexibleBox::calcMinMaxWidth):
1627 (khtml::RenderFlexibleBox::layoutBlock):
1628 (khtml::RenderFlexibleBox::layoutHorizontalBox):
1629 (khtml::RenderFlexibleBox::layoutVerticalBox):
1630 (khtml::RenderFlexibleBox::placeChild):
1631 (khtml::RenderFlexibleBox::allowedChildFlex):
1632 * khtml/rendering/render_flexbox.h:
1633 * khtml/rendering/render_image.cpp:
1634 (RenderImage::isWidthSpecified):
1635 (RenderImage::isHeightSpecified):
1636 * khtml/rendering/render_object.h:
1637 (khtml::RenderObject::getBaselineOfFirstLineBox):
1638 (khtml::RenderObject::overrideSize):
1639 (khtml::RenderObject::overrideWidth):
1640 (khtml::RenderObject::overrideHeight):
1641 (khtml::RenderObject::setOverrideSize):
1642 * khtml/rendering/render_style.cpp:
1643 (StyleFlexibleBoxData::StyleFlexibleBoxData):
1644 (StyleFlexibleBoxData::operator==):
1645 (ShadowData::operator==):
1646 * khtml/rendering/render_style.h:
1647 (khtml::RenderStyle::boxPack):
1648 (khtml::RenderStyle::setBoxPack):
1649 * khtml/rendering/table_layout.cpp:
1650 (AutoTableLayout::layout):
1652 2004-06-09 Richard Williamson <rjw@apple.com>
1654 Added support for drawing un-rasterized transformed PDFs.
1658 * khtml/ecma/kjs_html.cpp:
1659 (KJS::Context2DFunction::tryCall):
1661 2004-06-09 Darin Adler <darin@apple.com>
1665 - implemented still more execCommand commands
1667 * khtml/editing/jsediting.cpp: Added a lot more commands, and reformatted a bit.
1669 2004-06-08 Darin Adler <darin@apple.com>
1673 - implemented a bunch more execCommand commands
1674 - fixed <rdar://problem/3684792>: (JavaScript execCommand("paste") presents security issues)
1675 - fixed <rdar://problem/3675898>: (Make queryCommandEnabled work as specified in the Javascript execCommand Compatibility Plan)
1676 - fixed <rdar://problem/3675903>: (Make queryCommandSupported work as specified in the Javascript execCommand Compatibility Plan)
1677 - about half of <rdar://problem/3685231>: (execCommand italic is not implemented)
1678 - about half of <rdar://problem/3685232>: (execCommand bold is not implemented)
1680 * khtml/editing/jsediting.h: Made constructor inline. Deleted a few unneeded member functions
1681 that are now just private functions inside jsediting.cpp.
1683 * khtml/editing/jsediting.cpp:
1684 (commandImp): Changed this around, so the dictionary is a static local to this function,
1685 and initialized with C++ "first time initialization" rule.
1686 (DOM::JSEditor::execCommand): Got rid of special case for 0 for function pointer and added const.
1687 (DOM::JSEditor::queryCommandEnabled): Ditto.
1688 (DOM::JSEditor::queryCommandIndeterm): Got rid of special case for 0 for function pointer, added const,
1689 and use a common three-state state function rather than a separate "indeterm" function.
1690 (DOM::JSEditor::queryCommandState): Ditto.
1691 (DOM::JSEditor::queryCommandValue): More of the same.
1692 (execNotImplemented): Added. Used for unimplemented commands; there are only a few left.
1693 (execCopy): Renamed.
1695 (execDelete): Renamed.
1696 (execInsertText): Renamed.
1697 (execPaste): Renamed, and disabled.
1698 (execRedo): Renamed.
1699 (execSelectAll): Renamed.
1700 (execUndo): Renamed.
1701 (execStyleChange): Added. Helper function for commands that are style changes.
1703 (execItalic): Added.
1704 (execJustifyCenter): Added.
1705 (execJustifyFull): Added.
1706 (execJustifyLeft): Added.
1707 (execJustifyRight): Added.
1708 (execSubscript): Added.
1709 (execSuperscript): Added.
1710 (execUnselect): Added.
1711 (stateNotImplemented): Added. Used for unimplemented state queries; there are a few left.
1713 (valueNotImplemented): Added. Used for unimplemented value queries; there are a few left.
1714 (nullStringValue): Added.
1715 (createCommandDictionary): Changed the initDict function into this function. Added implementations
1716 for many commands and condensed format so it's easier to work with.
1718 2004-06-08 Darin Adler <darin@apple.com>
1722 - our part of fix to <rdar://problem/3629334>: (REGRESSION (Tiger): titles on pop-ups menus are truncated and show ellipses)
1724 * kwq/KWQComboBox.mm: (QComboBox::QComboBox): Call setLineBreakMode:NSLineBreakByClipping.
1725 In the current version of Tiger I am using, this is not implemented yet.
1727 - a couple of other unrelated changes
1729 * khtml/rendering/render_form.cpp: (RenderTextArea::calcMinMaxWidth): Put a little more code
1730 inside the APPLE_CHANGES ifdef.
1731 * kwq/KWQTextEdit.h: Remove unused setTabStopWidth function, and make empty setTextFormat
1732 function an inline for slightly smaller code size.
1733 * kwq/KWQTextEdit.mm: Ditto.
1734 * kwq/KWQTextField.mm: Update copyright date.
1736 2004-06-08 Trey Matteson <trey@apple.com>
1738 A DHTML drag source can now change the dragging image during the drag. Currently
1739 it may only be set to a static image.
1743 * kwq/KWQKHTMLPart.mm:
1744 (KWQKHTMLPart::dragSourceMovedTo): If the ondrag event handler set an image,
1746 * kwq/WebCoreBridge.h:
1748 2004-06-08 Ken Kocienda <kocienda@apple.com>
1752 Changes to the selection state for these tests as a result of my previous
1753 checkin. The changes are minor to a couple of offsets. I looked at the
1754 changes and approve them.
1756 * layout-tests/editing/deleting/delete-block-contents-001-expected.txt
1757 * layout-tests/editing/deleting/delete-block-contents-002-expected.txt
1758 * layout-tests/editing/deleting/delete-block-contents-003-expected.txt
1760 2004-06-08 Ken Kocienda <kocienda@apple.com>
1766 <rdar://problem/3654841>: "Hitting delete key with start of block selected
1767 does not merge content with preceding block"
1769 Selections that span blocks now work correctly for deleting the selection and inserting
1770 over the selection. The largest part of the change is adding a new field to the
1771 RemoveNodeAndPruneCommand and its impl version. This was done since the starting block
1772 for a multi-block selection should always be preserved when deleting, and this was
1773 a convenient way to express this using the code structure already in place.
1775 * khtml/editing/htmlediting.cpp:
1776 (khtml::RemoveNodeAndPruneCommand::RemoveNodeAndPruneCommand): Modify this command to
1777 take two nodes: the node to remove and a node to stop at when pruning back up the tree.
1778 (khtml::RemoveNodeAndPruneCommand::pruneNode): New accessor, replaces old node() accessor.
1779 (khtml::RemoveNodeAndPruneCommand::stopNode): New accessor for additional feature described
1781 * khtml/editing/htmlediting.h:
1782 * khtml/editing/htmlediting_impl.cpp:
1783 (khtml::shouldPruneNode): blow flow renderers can now be deleted, but not if they are a
1784 rootEditableElement.
1785 (khtml::CompositeEditCommandImpl::removeNodeAndPrune): Pass new stopNode param and change the
1786 name of the existing node argument to pruneNode to distinguish it.
1787 (khtml::DeleteSelectionCommandImpl::doApply): Pass the block containing the start of the
1788 selection to removeNodeAndPrune in each case. Also, add one little loop to move all
1789 the content from the block containing the end of the selection if that block is different
1790 than the start block.
1791 (khtml::RemoveNodeAndPruneCommandImpl::RemoveNodeAndPruneCommandImpl): Implement the
1792 pruneNode/stopNode design already described.
1793 (khtml::RemoveNodeAndPruneCommandImpl::~RemoveNodeAndPruneCommandImpl): Manage the
1794 lifecycle of stopNode.
1795 (khtml::RemoveNodeAndPruneCommandImpl::doApply): Add a check to stop at the stop
1797 * khtml/editing/htmlediting_impl.h:
1798 (khtml::RemoveNodeAndPruneCommandImpl::pruneNode): New accessor.
1799 (khtml::RemoveNodeAndPruneCommandImpl::stopNode): Ditto.
1801 2004-06-07 Trey Matteson <trey@apple.com>
1803 Clipboard access during DHTML dragging is made secure.
1807 * kwq/KWQClipboard.h:
1809 * kwq/KWQClipboard.mm:
1810 (KWQClipboard::KWQClipboard): Init new policy and changeCount members.
1811 (KWQClipboard::becomeNumb): Set policy to numb.
1812 (KWQClipboard::clearData): Check policy.
1813 (KWQClipboard::clearAllData): Check policy.
1814 (KWQClipboard::getData): Check policy and changeCount.
1815 (KWQClipboard::setData): Check policy.
1816 (KWQClipboard::types): Check policy and ChangeCount.
1817 (KWQClipboard::setDragLocation): Check policy.
1818 (KWQClipboard::setDragImage): Check policy.
1819 (KWQClipboard::setDropEffect): Check policy.
1820 (KWQClipboard::setEffectAllowed): Check policy.
1821 * kwq/KWQKHTMLPart.mm:
1822 (KWQKHTMLPart::dispatchDragSrcEvent): Set policy when creating clipboard,
1823 and numb-ify it when we're done.
1824 * kwq/WebCoreBridge.mm:
1825 (-[WebCoreBridge dragOperationForDraggingInfo:]): Set policy when creating clipboard,
1826 and numb-ify it when we're done.
1827 (-[WebCoreBridge dragExitedWithDraggingInfo:]): Ditto
1828 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto
1830 2004-06-08 Ken Kocienda <kocienda@apple.com>
1834 * khtml/editing/jsediting.cpp:
1835 (DOM::EditorCommand::): Stray capital letter in "selectAll" command static
1836 initializer prevented the command from ever working since the command
1837 strings are lower-cased when trying to find a match, but not when they
1838 are inserted into the dictionary. This is a one character change to make
1839 the string "selectall" in the initializer.
1841 2004-06-07 Trey Matteson <trey@apple.com>
1843 WebCore will now generate a default drag image when an element serves as a drag
1844 source. The basic idea is the image contains the element and all its children.
1846 As for the implementation, instead of adding a new paintAction I added a new
1847 field to the paintInfo struct, "paintingRoot". If this field is set, painting will
1848 only paint that root's descendants.
1850 Some code also moved from the bridge to the part, to be available within WebCore.
1854 * khtml/rendering/render_block.cpp:
1855 (khtml::RenderBlock::paintObject): Pass along paintingRoot to kids.
1856 (khtml::RenderBlock::paintFloats): Pass along paintingRoot to kids.
1857 * khtml/rendering/render_box.cpp:
1858 (RenderBox::paintBoxDecorations): Test paintingRoot before painting.
1859 * khtml/rendering/render_canvasimage.cpp:
1860 (RenderCanvasImage::paint): Test paintingRoot before painting.
1861 * khtml/rendering/render_flow.cpp:
1862 (RenderFlow::paintLineBoxBackgroundBorder): Test paintingRoot before painting.
1863 (RenderFlow::paintLineBoxDecorations): Test paintingRoot before painting.
1864 * khtml/rendering/render_image.cpp:
1865 (RenderImage::paint): Test paintingRoot before painting.
1866 * khtml/rendering/render_inline.cpp:
1867 (RenderInline::paint): Pass along paintingRoot to kids.
1868 * khtml/rendering/render_layer.cpp:
1869 (RenderLayer::paint): Pass along paintingRoot to kids.
1870 (RenderLayer:: paintLayer): Pass along paintingRoot to kids. Test if we are within the
1871 paintingRoot to decide whether to pass the root to our renderer.
1872 * khtml/rendering/render_layer.h:
1873 * khtml/rendering/render_object.cpp:
1874 (RenderObject::hasAncestor): New utility.
1875 (RenderObject::absoluteBoundingBoxRect): Helper for paintingRootRect
1876 (RenderObject::addAbsoluteRectForLayer): Helper for paintingRootRect
1877 (RenderObject::paintingRootRect): Return rect that will be painted if we are
1879 (RenderObject::draggableNode): Add test to avoid rare NULL ptr crash.
1880 * khtml/rendering/render_object.h:
1881 (khtml::RenderObject::PaintInfo::PaintInfo): Add paintingRoot field.
1882 (khtml::RenderObject::paintingRootForChildren): New utility. Return the current
1883 paintingRoot, or nil if we are the root (so kids draw normally).
1884 (khtml::RenderObject::shouldPaintWithinRoot): New utility. We can paint if we
1885 are the paintingRoot, or no root is set.
1886 * khtml/rendering/render_replaced.cpp:
1887 (RenderReplaced::shouldPaint): Pass along paintingRoot to kids.
1888 * khtml/rendering/render_table.cpp:
1889 (RenderTable::paint): Pass along paintingRoot to kids.
1890 * khtml/rendering/render_text.cpp:
1891 (RenderText::paint): Test paintingRoot before painting.
1892 * kwq/KWQKHTMLPart.h:
1893 * kwq/KWQKHTMLPart.mm:
1894 (KWQKHTMLPart::KWQKHTMLPart): Init new _elementToDraw member.
1895 (KWQKHTMLPart::paint): Generalized to handle cases of painting selection or a
1897 (KWQKHTMLPart::khtmlMouseMoveEvent): Make a default image if dragSrc didn't
1899 (KWQKHTMLPart::selectionRect): Moved from bridge.
1900 (KWQKHTMLPart::visibleSelectionRect): Ditto.
1901 (KWQKHTMLPart::imageFromRect): Newly factored code, from bridge.
1902 (KWQKHTMLPart::selectionImage): Moved from bridge, wrapper around imageFromRect.
1903 (KWQKHTMLPart::elementImage): New method, wrapper around imageFromRect.
1904 * kwq/WebCoreBridge.h:
1905 * kwq/WebCoreBridge.mm:
1906 (-[WebCoreBridge drawRect:withPainter:]): Just call part to draw.
1907 (-[WebCoreBridge visibleSelectionRect]): Guts moved to part.
1908 (-[WebCoreBridge selectionImage]): Ditto.
1910 2004-06-07 Darin Adler <darin@apple.com>
1914 - fixed <rdar://problem/3682821>: (setTimeout fails when additional parameters are used and timeout function is a string)
1916 * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Ignore excess arguments instead
1917 of rejecting the argument list for window.scrollBy, scroll, scrollTo, moveBy, moveTo,
1918 resizeBy, resizeTo, and setTimeout (when the timeout is a string rather than an object).
1920 - did a refinement of JSEditor to be slightly more efficient, and not have to edit
1921 both the .cpp file and the .h when adding more implementation
1923 * khtml/khtml_part.h: Hack so we can get to the docImpl and xmlDocImpl without being a friend.
1924 * khtml/editing/jsediting.h: Simplified a bit.
1925 * khtml/editing/jsediting.cpp: Redid to use a table, and simplified a bit.
1927 2004-06-07 Ken Kocienda <kocienda@apple.com>
1933 <rdar://problem/3682354>: "Typing style does not work yet"
1935 Did the final hook-up of support that has landed in the tree in the
1936 recent past as part of ongoing style-application work.
1938 For the most part, this patch modifies the InputNewlineCommandImpl and
1939 InputTextCommandImpl commands to insert a styling span when there is
1940 a typing style active.
1942 * khtml/editing/htmlediting_impl.cpp:
1943 (khtml::CompositeEditCommandImpl::createTypingStyleElement): Helper
1944 shared by the two commands modified.
1945 (khtml::InputNewlineCommandImpl::doApply): Create a styling span if the
1946 part has a typing style. Maintain a nodeToInsert local variable, which is
1947 either the break to insert or a styling span containing the break. Also,
1948 remove some utterly bogus derefs. They are just plain wrong.
1949 (khtml::InputTextCommandImpl::InputTextCommandImpl): Don't need to keep
1950 m_insertedTextNode. The composite commands this command uses will keep
1951 track of that object's lifetime. We do not need to do that here.
1952 (khtml::InputTextCommandImpl::~InputTextCommandImpl): No longer need
1953 to deref obsolete m_insertedTextNode.
1954 (khtml::InputTextCommandImpl::prepareForTextInsertion): Handle the case
1955 where a styling span needs to be added.
1956 (khtml::TypingCommandImpl::insertText): Create a new InputTextCommand when
1957 there is an active typping style.
1958 * khtml/editing/htmlediting_impl.h: Declare createTypingStyleElement helper.
1959 Remove m_insertedTextNode from InputTextCommandImpl.
1960 * kwq/WebCoreBridge.mm:
1961 (-[WebCoreBridge applyStyle:]): Swicth on the state of the selection, calling
1962 setTypingStyle when a caret and ApplyStyleCommand when a range.
1964 2004-06-07 Darin Adler <darin@apple.com>
1968 * khtml/editing/jsediting.h: Elide some unnecessary namespace prefixes.
1969 * khtml/editing/jsediting.cpp: Make typed constants instead of macros.
1970 (DOM::JSEditor::commandDict): Elide unnecessary namespace prefix.
1971 (DOM::JSEditor::execCommand): Remove xxxNotImplemented functions; just return false instead.
1972 (DOM::JSEditor::queryCommandEnabled): Ditto.
1973 (DOM::JSEditor::queryCommandIndeterm): Ditto.
1974 (DOM::JSEditor::queryCommandState): Ditto.
1975 (DOM::JSEditor::queryCommandSupported): Ditto.
1976 (DOM::JSEditor::queryCommandValue): Ditto.
1978 2004-06-05 Trey Matteson <trey@apple.com>
1980 As agreed with Hyatt and Louch, do not post incoming dragging events
1985 * khtml/khtmlview.cpp:
1986 (KHTMLView::updateDragAndDrop): For any drag target that is a text node,
1987 use its parent instead.
1989 2004-06-03 Trey Matteson <trey@apple.com>
1991 DHTML dragging uses the Cocoa NSDragOperation on both the source and dest ends.
1993 In addition, I caught a prime gaffe where I had used "dropAllowed" instead of "effectAllowed"
1994 for that particular WinIE property. That is renamed throughout.
1998 * khtml/ecma/kjs_events.cpp:
1999 (stringOrUndefined): New little helper.
2000 (Clipboard::getValueProperty): Return Undefined if dropEffect or effectAllowed are not set.
2001 (Clipboard::putValue): Rename.
2002 * khtml/ecma/kjs_events.h:
2003 (KJS::Clipboard::): Rename.
2004 * khtml/ecma/kjs_events.lut.h:
2005 * khtml/xml/dom2_eventsimpl.h: Rename.
2006 * kwq/KWQClipboard.h: Rename, add access to Cocoa drag op.
2007 * kwq/KWQClipboard.mm:
2008 (KWQClipboard::dropEffect): These 4 just moved in the file.
2009 (KWQClipboard::setDropEffect):
2010 (KWQClipboard::effectAllowed):
2011 (KWQClipboard::setEffectAllowed):
2012 (cocoaOpFromIEOp): Convert from an IE operation string to a Cocoa DragOp
2013 (IEOpFromCocoaOp): and vice-versa
2014 (KWQClipboard::sourceOperation): Return effectAllowed, converted to a NSDragOp
2015 (KWQClipboard::destinationOperation): Return dropEffect, converted to a NSDragOp
2016 (KWQClipboard::setSourceOperation): Set effectAllowed, using a Cocoa value
2017 (KWQClipboard::setDestinationOperation): Set dropEffect, using a Cocoa value
2018 * kwq/KWQKHTMLPart.h:
2019 * kwq/KWQKHTMLPart.mm:
2020 (KWQKHTMLPart::dispatchDragSrcEvent): Return the drag op specified by the source element.
2021 (KWQKHTMLPart::khtmlMouseMoveEvent): Pass our drag op up to WebKit.
2022 (KWQKHTMLPart::dragSourceMovedTo): Pass NULL for new arg.
2023 (KWQKHTMLPart::dragSourceEndedAt): Ditto
2024 * kwq/WebCoreBridge.h:
2025 * kwq/WebCoreBridge.mm:
2026 (-[WebCoreBridge dragOperationForDraggingInfo:]): Set the incoming dragOp onto the clipboard
2027 so DHTML can access it. In addition, validate whatever op DHTML returns so we play well
2030 2004-06-04 David Hyatt <hyatt@apple.com>
2032 Add support for auto values in flex transitions. Add support for mapping the back end values to
2033 front end values. Next it's time to actually try to use this stuff in render_flexbox.
2037 * khtml/css/css_valueimpl.cpp:
2039 * khtml/css/css_valueimpl.h:
2040 (DOM::FlexGroupTransitionValueImpl::isAuto):
2041 * khtml/css/cssparser.cpp:
2042 (FlexGroupTransitionParseContext::length):
2043 (FlexGroupTransitionParseContext::commitAutoValue):
2044 (FlexGroupTransitionParseContext::commitValue):
2045 (CSSParser::parseFlexGroupTransition):
2046 * khtml/css/cssstyleselector.cpp:
2047 (khtml::CSSStyleSelector::applyProperty):
2048 * khtml/rendering/render_style.cpp:
2049 (FlexGroupTransitionData::operator==):
2050 * khtml/rendering/render_style.h:
2051 (khtml::FlexGroupTransitionData::next):
2052 (khtml::FlexGroupTransitionData::isAuto):
2056 2004-06-04 Kevin Decker <kdecker@apple.com>
2060 - kwq/KWQKHTMLPart.mm: addMessagetoConsole places sourceURL in the dictionary
2061 - khtml/xml/dom_docimpl.cpp: right now, we don't have a way to get a url,
2062 so we leave this blank
2063 - khtml/ecma/kjs_window.cpp: still need to get the real line number and sourceURL
2064 - khtml/ecma/kjs_proxy.cpp: now passing the sourceURL to addMessageToConsole
2065 - khtml/ecma/kjs_events.cpp: still need to grab an accurate line number and sourceURL
2067 * khtml/ecma/kjs_events.cpp:
2068 (JSEventListener::handleEvent):
2069 (JSLazyEventListener::handleEvent):
2070 * khtml/ecma/kjs_proxy.cpp:
2071 (KJSProxyImpl::evaluate):
2072 * khtml/ecma/kjs_window.cpp:
2073 (Window::isSafeScript):
2074 (ScheduledAction::execute):
2075 * khtml/xml/dom_docimpl.cpp:
2076 (DocumentImpl::open):
2077 * kwq/KWQKHTMLPart.h:
2078 * kwq/KWQKHTMLPart.mm:
2079 (KWQKHTMLPart::addMessageToConsole):
2081 2004-06-04 Ken Kocienda <kocienda@apple.com>
2085 Fix a comical little bug where the style-applying code did not take into
2086 account deleting content from the start of a block. After the deletion,
2087 the caret is placed in the node before the deleted content and so
2088 inserting a styled fragment after the deletion position works great.
2089 The problem is that if the selectionis at the start of a block, there
2090 is no "position before the deletion" and the caret is placed in the new
2091 first child of the block. Inserting the styled content after this
2092 node is just plain wrong. Now, this case is handled correctly, and the
2093 styled content is inserted in the proper position.
2095 * khtml/editing/htmlediting_impl.cpp:
2096 (khtml::ApplyStyleCommandImpl::insertFragment):
2098 2004-06-04 Ken Kocienda <kocienda@apple.com>
2102 * khtml/rendering/bidi.cpp:
2103 (khtml::RenderBlock::layoutInlineChildren): Only add additional line height
2104 in for root editable elements. This helps to keep layout from deviating too
2105 much from the intended page layout, but still gives an empty document a line
2106 in which it can blink the caret.
2108 2004-06-04 Ken Kocienda <kocienda@apple.com>
2112 Made some progress on this set of related bugs:
2114 <rdar://problem/3675867>: "Make execCommand work as specified in the Javascript execCommand Compatibility Plan"
2115 <rdar://problem/3675898>: "Make queryCommandEnabled work as specified in the Javascript execCommand Compatibility Plan"
2116 <rdar://problem/3675899>: "Make queryCommandIndeterm work as specified in the Javascript execCommand Compatibility Plan"
2117 <rdar://problem/3675901>: "Make queryCommandState work as specified in the Javascript execCommand Compatibility Plan"
2118 <rdar://problem/3675903>: "Make queryCommandSupported work as specified in the Javascript execCommand Compatibility Plan"
2119 <rdar://problem/3675904>: "Make queryCommandValue work as specified in the Javascript execCommand Compatibility Plan"
2121 I did several things to move the ahead with the plan:
2123 1. The latter five methods did not appear in the tree at all. Now they do, although
2125 2. I removed the implementation for these editing methods from dom_docimpl.cpp, and moved
2126 them out to new js_editing.cpp/js_editing.h files. The remaining code in dom_docimpl.cpp
2127 is glue to call over to the new JSEditor object defined in the new files.
2129 3. For a couple of the command implementations in js_editing.cpp, I made a stab at returning sensible values.
2130 For others, I just return place-holder values. I have added some comments to describe what has been done and
2131 what still needs to be done.
2133 * WebCore.pbproj/project.pbxproj:
2134 * khtml/dom/dom_doc.cpp: Add call-overs for these methods.
2135 (DOM::Document::queryCommandEnabled):
2136 (DOM::Document::queryCommandIndeterm):
2137 (DOM::Document::queryCommandState):
2138 (DOM::Document::queryCommandSupported):
2139 (DOM::Document::queryCommandValue):
2140 * khtml/dom/dom_doc.h:
2141 * khtml/ecma/kjs_dom.cpp: Add queryCommandXXX terminology.
2142 (DOMDocumentProtoFunc::tryCall):
2143 * khtml/ecma/kjs_dom.h:
2144 (KJS::DOMDocument::):
2145 * khtml/ecma/kjs_dom.lut.h:
2147 * khtml/editing/jsediting.cpp: Added. This file implements the guts of editing-related JS methods.
2148 (DOM::execCommandNotImplemented):
2149 (DOM::queryBoolNotImplemented):
2150 (DOM::queryValueNotImplemented):
2151 (DOM::JSEditor::commandDict):
2152 (DOM::JSEditor::JSEditor):
2153 (DOM::JSEditor::~JSEditor):
2154 (DOM::JSEditor::commandIdentifier):
2155 (DOM::JSEditor::addCommand):
2156 (DOM::JSEditor::initDict):
2157 (DOM::JSEditor::execCommand):
2158 (DOM::JSEditor::queryCommandEnabled):
2159 (DOM::JSEditor::queryCommandIndeterm):
2160 (DOM::JSEditor::queryCommandState):
2161 (DOM::JSEditor::queryCommandSupported):
2162 (DOM::JSEditor::queryCommandValue):
2163 (DOM::JSEditor::execCommandCopy):
2164 (DOM::JSEditor::execCommandCut):
2165 (DOM::JSEditor::execCommandDelete):
2166 (DOM::JSEditor::execCommandInsertText):
2167 (DOM::JSEditor::execCommandPaste):
2168 (DOM::JSEditor::execCommandRedo):
2169 (DOM::JSEditor::execCommandSelectAll):
2170 (DOM::JSEditor::execCommandUndo):
2171 (DOM::JSEditor::enabledIfPartNotNull):
2172 (DOM::JSEditor::enabledIfSelectionNotEmpty):
2173 (DOM::JSEditor::enabledIfSelectionIsRange):
2174 (DOM::JSEditor::commandSupported):
2175 * khtml/editing/jsediting.h: Added.
2176 (DOM::JSEditor::CommandIdentifier::CommandIdentifier):
2177 (DOM::JSEditor::document):
2178 (DOM::JSEditor::part):
2179 * khtml/xml/dom_docimpl.cpp: Rework JS editing support into glue that calls over into new JSEditor object.
2180 (DocumentImpl::DocumentImpl):
2181 (DocumentImpl::~DocumentImpl):
2182 (DocumentImpl::jsEditor):
2183 (DocumentImpl::execCommand):
2184 (DocumentImpl::queryCommandEnabled):
2185 (DocumentImpl::queryCommandIndeterm):
2186 (DocumentImpl::queryCommandState):
2187 (DocumentImpl::queryCommandSupported):
2188 (DocumentImpl::queryCommandValue):
2189 * khtml/xml/dom_docimpl.h:
2191 2004-06-03 Richard Williamson <rjw@apple.com>
2193 Added setCompositeOperation method to Context2D.
2194 Actually pass composite operation to drawPixmap (instead of 1).
2198 * khtml/ecma/kjs_html.cpp:
2199 (KJS::Context2DFunction::tryCall):
2200 * khtml/ecma/kjs_html.h:
2202 * khtml/ecma/kjs_html.lut.h:
2205 * kwq/KWQPainter.mm:
2206 (QPainter::compositeOperatorFromString):
2207 (QPainter::drawPixmap):
2209 2004-06-03 David Hyatt <hyatt@apple.com>
2211 Add support for box-flex-group-transition (whew!), a new property that is going to enable some incredibly
2212 complicated flexing layouts in HTML.
2214 This is Stage 1 - wire up the CSS property and make it get parsed into front-end data. Nobody actually looks
2219 * khtml/css/css_valueimpl.cpp:
2220 (CSSInheritedValueImpl::cssText):
2221 (ShadowValueImpl::cssText):
2223 (FlexGroupTransitionValueImpl::~FlexGroupTransitionValueImpl):
2224 (FlexGroupTransitionValueImpl::cssText):
2225 * khtml/css/css_valueimpl.h:
2226 (DOM::FlexGroupTransitionValueImpl::cssValueType):
2227 * khtml/css/cssparser.cpp:
2228 (CSSParser::parseValue):
2229 (CSSParser::parseShadow):
2230 (FlexGroupTransitionParseContext::length):
2231 (FlexGroupTransitionParseContext::~FlexGroupTransitionParseContext):
2232 (FlexGroupTransitionParseContext::failed):
2233 (FlexGroupTransitionParseContext::allowGroup):
2234 (FlexGroupTransitionParseContext::commitGroup):
2235 (FlexGroupTransitionParseContext::commitSlash):
2236 (FlexGroupTransitionParseContext::commitLength):
2237 (FlexGroupTransitionParseContext::commitValue):
2238 (CSSParser::parseFlexGroupTransition):
2239 * khtml/css/cssparser.h:
2240 * khtml/css/cssproperties.c:
2243 * khtml/css/cssproperties.h:
2244 * khtml/css/cssproperties.in:
2245 * khtml/rendering/render_style.cpp:
2246 (StyleFlexibleBoxData::StyleFlexibleBoxData):
2247 (StyleFlexibleBoxData::operator==):
2248 (StyleFlexibleBoxData::transitionDataEquivalent):
2249 (StyleCSS3InheritedData::operator==):
2250 (StyleCSS3InheritedData::shadowDataEquivalent):
2251 (ShadowData::operator==):
2252 (RenderStyle::setBoxFlexGroupTransition):
2254 (FlexGroupTransitionData::operator==):
2255 * khtml/rendering/render_style.h:
2256 (khtml::FlexGroupTransitionData::next):
2257 (khtml::FlexGroupTransitionData::~FlexGroupTransitionData):
2258 (khtml::FlexGroupTransitionData::operator!=):
2259 (khtml::StyleFlexibleBoxData::~StyleFlexibleBoxData):
2260 (khtml::RenderStyle::boxFlexGroupTransition):
2262 2004-06-03 Richard Williamson <rjw@apple.com>
2264 Add extra sanity check to Image parameter of drawImage...
2268 * khtml/ecma/kjs_html.cpp:
2269 (KJS::Context2DFunction::tryCall):
2271 2004-06-02 David Hyatt <hyatt@apple.com>
2273 Fix for 3673931, negative margins on objects that dodge floats not handled correctly.
2277 * khtml/rendering/render_block.cpp:
2278 (khtml::RenderBlock::layoutBlockChildren):
2280 2004-06-03 Ken Kocienda <kocienda@apple.com>
2284 Fix for layout regression I caused when fixing:
2286 <rdar://problem/3668619>: "REGRESSION: text placed on pasteboard by WebKit is offset by one character"
2288 Extra height is added to empty blocks that are editable, so we can click to place
2289 the caret in them. This extra height was erroneously being added to non-editable
2290 blocks as a result of my earlier change. After looking at this and doing some
2291 code review, there are the following changes:
2293 Change away from "containingBlock" terminology in the NodeImpl class. The
2294 operation we are doing in NodeImpl is not the same as what is done in CSS
2295 when it uses the term "containingBlock" so:
2296 containingBlock changes to enclosingBlockFlowElement, and
2297 rootEditableBlock changes to rootEditableElement
2299 The vast majority of changes here are to make these name changes. The other
2300 significant piece of work, and the fix for the regression, is to change
2301 bidi.cpp to only include this extra line height if a block is empty
2302 and is content-editable.
2304 * khtml/editing/htmlediting_impl.cpp:
2305 (khtml::leadingWhitespacePosition):
2306 (khtml::trailingWhitespacePosition):
2307 (khtml::DeleteSelectionCommandImpl::doApply):
2308 (khtml::InputNewlineCommandImpl::doApply):
2309 (khtml::RemoveNodeAndPruneCommandImpl::doApply):
2310 (khtml::TypingCommandImpl::issueCommandForDeleteKey):
2311 * khtml/rendering/bidi.cpp:
2312 (khtml::RenderBlock::layoutInlineChildren):
2313 * khtml/xml/dom_docimpl.cpp:
2314 (DocumentImpl::relinquishesEditingFocus):
2315 (DocumentImpl::acceptsEditingFocus):
2316 * khtml/xml/dom_nodeimpl.cpp:
2317 * khtml/xml/dom_nodeimpl.h:
2318 * khtml/xml/dom_position.cpp:
2319 (DOM::Position::equivalentLeafPosition):
2320 (DOM::Position::previousCharacterPosition):
2321 (DOM::Position::nextCharacterPosition):
2322 (DOM::Position::previousLinePosition):
2323 (DOM::Position::nextLinePosition):
2324 (DOM::Position::equivalentUpstreamPosition):
2325 (DOM::Position::equivalentDownstreamPosition):
2326 (DOM::Position::atStartOfRootEditableElement):
2327 (DOM::Position::inRenderedContent):
2328 (DOM::Position::rendersOnSameLine):
2329 (DOM::Position::rendersInDifferentPosition):
2330 (DOM::Position::isLastRenderedPositionInEditableBlock):
2331 (DOM::Position::inFirstEditableInRootEditableElement):
2332 (DOM::Position::inLastEditableInRootEditableElement):
2333 (DOM::Position::inFirstEditableInContainingEditableBlock):
2334 (DOM::Position::inLastEditableInContainingEditableBlock):
2335 * khtml/xml/dom_position.h:
2336 * khtml/xml/dom_selection.cpp:
2337 (DOM::Selection::moveToRenderedContent):
2339 2004-06-02 Trey Matteson <trey@apple.com>
2341 Added types property to JS clipboard object.
2343 Reviewed by Richard.
2345 * khtml/ecma/kjs_events.cpp:
2346 (Clipboard::getValueProperty): Create JS array for strings coming from the clipboard impl.
2347 * khtml/ecma/kjs_events.h:
2349 * khtml/ecma/kjs_events.lut.h:
2350 * kwq/KWQClipboard.mm:
2351 (MIMETypeFromCocoaType): New helper routine to map types.
2352 (KWQClipboard::types): Implement based on NSPasteboard's types.
2354 2004-06-02 Richard Williamson <rjw@apple.com>
2356 Corrected typo ID_IMG should have been ID_CANVAS when
2357 checking for the canvas composite operator.
2361 * khtml/rendering/render_canvasimage.cpp:
2362 (RenderCanvasImage::paint):
2364 2004-06-02 Richard Williamson <rjw@apple.com>
2366 Correctly size the <CANVAS> if margins, borders, or
2371 * khtml/rendering/render_canvasimage.cpp:
2372 (RenderCanvasImage::createDrawingContext):
2374 2004-06-01 Trey Matteson <trey@apple.com>
2376 First cut at the source side of DHTML dragging. Following IE, new events are added:
2377 ondragstart, ondrag, ondragend. The recently added CSS property -khtml-user-drag can
2378 be used to make an element draggable. event.dataTransfer.setDragImage(ImageObject,x,y)
2379 can be used from ondragstart to set a static image for the dragImage. x,y is the location
2380 of the mouse within the image from the upper right corner. clipboard methods setdata
2381 and cleardata are implemented.
2385 * khtml/ecma/kjs_dom.cpp:
2386 (DOMNode::getValueProperty): Boilerplate for new events
2387 (DOMNode::putValue): Boilerplate for new events
2388 * khtml/ecma/kjs_dom.h:
2389 (KJS::DOMNode::): Boilerplate for new events
2390 * khtml/ecma/kjs_dom.lut.h:
2391 * khtml/ecma/kjs_events.cpp:
2392 (DOMMouseEvent::getValueProperty): Return undefined for clipboard when its not a drag event.
2393 (ClipboardProtoFunc::tryCall): setDragImage glue to clipboard routine.
2394 * khtml/ecma/kjs_events.h:
2396 * khtml/ecma/kjs_events.lut.h:
2397 * khtml/html/html_elementimpl.cpp:
2398 (HTMLElementImpl::parseHTMLAttribute): Boilerplate for new events
2399 * khtml/khtml_part.cpp:
2400 (KHTMLPart::shouldDragAutoNode): Empty impl of new method, where UA determines
2401 draggability for events with -khtml-user-drag=auto
2402 * khtml/khtml_part.h:
2403 * khtml/misc/htmlattrs.c:
2404 * khtml/misc/htmlattrs.h:
2405 * khtml/misc/htmlattrs.in: Boilerplate for new events
2406 * khtml/rendering/render_object.cpp:
2407 (RenderObject::draggableNode): Find the node or parent node which might be dragged.
2408 * khtml/rendering/render_object.h:
2409 * khtml/xml/dom2_eventsimpl.cpp:
2410 (EventImpl::typeToId): Boilerplate for new events
2411 (EventImpl::idToType): Boilerplate for new events
2412 * khtml/xml/dom2_eventsimpl.h:
2413 (DOM::EventImpl::): Boilerplate for new events
2414 * kwq/KWQClipboard.h:
2415 * kwq/KWQClipboard.mm:
2416 (KWQClipboard::clearData): Implemented to call NSPasteboard
2417 (KWQClipboard::clearAllData): ditto
2418 (KWQClipboard::getData): fix corner case that came up testing
2419 (KWQClipboard::setData): Implemented to call NSPasteboard
2420 (KWQClipboard::dragLocation): Simple setter/getters
2421 (KWQClipboard::setDragLocation):
2422 (KWQClipboard::dragImage):
2423 (KWQClipboard::setDragImage):
2424 (KWQClipboard::dragNSImage):
2425 * kwq/KWQKHTMLPart.h:
2426 * kwq/KWQKHTMLPart.mm:
2427 (KWQKHTMLPart::KWQKHTMLPart): init new member var
2428 (KWQKHTMLPart::dragHysteresisExceeded): Hysteresis moved here from WebKit
2429 (KWQKHTMLPart::dispatchDragSrcEvent): Send a dragging event to the current dragSource
2430 (KWQKHTMLPart::khtmlMouseMoveEvent): Initiate dragging, now including consulting DHTML,
2431 hysteresis and sending ondragstart.
2432 (KWQKHTMLPart::dragSourceMovedTo): simple passthrough
2433 (KWQKHTMLPart::dragSourceEndedAt): simple passthrough
2434 (KWQKHTMLPart::mouseDown): salt away _mouseDownX, _mouseDownY
2435 (KWQKHTMLPart::shouldDragAutoNode): Called for -khtml-user-drag=auto. We just call
2437 * kwq/WebCoreBridge.h:
2438 * kwq/WebCoreBridge.mm:
2439 (-[WebCoreBridge dragSourceMovedTo:]): New glue to drive new dragging events.
2440 (-[WebCoreBridge dragSourceEndedAt:operation:]):
2442 2004-06-02 Ken Kocienda <kocienda@apple.com>
2446 Finish off name change from previous check-in by changing dom_edititerator
2447 file names to dom_positioniterator. Files copied and renamed in repository.
2448 Includes updated as needed.
2450 * ForwardingHeaders/xml/dom_edititerator.h: Removed.
2451 * ForwardingHeaders/xml/dom_positioniterator.h: Added.
2452 * WebCore.pbproj/project.pbxproj:
2453 * khtml/editing/htmlediting_impl.cpp:
2454 * khtml/xml/dom_edititerator.cpp: Removed.
2455 * khtml/xml/dom_edititerator.h: Removed.
2456 * khtml/xml/dom_position.cpp:
2457 * khtml/xml/dom_positioniterator.cpp: Added.
2458 (DOM::PositionIterator::peekPrevious):
2459 (DOM::PositionIterator::peekNext):
2460 (DOM::PositionIterator::atStart):
2461 (DOM::PositionIterator::atEnd):
2462 * khtml/xml/dom_positioniterator.h: Added.
2463 (DOM::PositionIterator::PositionIterator):
2464 (DOM::PositionIterator::current):
2465 (DOM::PositionIterator::previous):
2466 (DOM::PositionIterator::next):
2467 (DOM::PositionIterator::setPosition):
2468 (DOM::PositionIterator::isEmpty):
2469 * khtml/xml/dom_selection.cpp:
2471 2004-06-02 Ken Kocienda <kocienda@apple.com>
2475 Probable fix for this bug:
2477 <rdar://problem/3668619>: "REGRESSION: text placed on pasteboard by WebKit is offset by one character"
2479 I could not reproduce the bug myself, which is why I call the fix
2482 Darin and I did some code inspection and found some problems
2483 with the equivalentUpstreamPosition and
2484 equivalentDownstreamPosition functions on DOM::Position and how
2485 these functions dealt with changing from editable to
2486 non-editable content. As a result of these discoveries, I went
2487 over this code and the helpers and functions which support them,
2488 and made some corrections and simplifications. The big changes
2491 1. Rename EditIterator class to PositionIterator. This class needs
2492 to run code for selections in non-editable content, so the name
2493 change is appropriate.
2495 2. Change containingEditableBlock to containingBlock. It turns out
2496 that none of the editing code relies on the distinction between
2497 editable blocks and non-editable blocks. The important distinction
2498 is the block boundary. The notion of rootEditableBlock remains.
2500 * khtml/editing/htmlediting_impl.cpp:
2501 (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): PositionIterator name change.
2502 (khtml::DeleteSelectionCommandImpl::joinTextNodesWithSameStyle): Ditto.
2503 (khtml::DeleteSelectionCommandImpl::containsOnlyWhitespace): Ditto.
2504 (khtml::DeleteSelectionCommandImpl::doApply): Ditto.
2505 (khtml::InputNewlineCommandImpl::doApply): Ditto.
2506 (khtml::RemoveNodeAndPruneCommandImpl::doApply): Ditto.
2507 * khtml/rendering/bidi.cpp:
2508 (khtml::RenderBlock::layoutInlineChildren): Ditto.
2509 * khtml/xml/dom_edititerator.cpp:
2510 (DOM::PositionIterator::peekPrevious): Call for previousLeafNode instead of previousEditable.
2511 Editable check is not appropriate as this class is used for non-editable content.
2512 (DOM::PositionIterator::peekNext): Call nextLeafNode instead of nextEditable, as above.
2513 (DOM::PositionIterator::atStart): Call for previousLeafNode instead of previousEditable, as above.
2514 (DOM::PositionIterator::atEnd): Call nextLeafNode instead of nextEditable, as above.
2515 * khtml/xml/dom_edititerator.h:
2516 (DOM::PositionIterator::PositionIterator): PositionIterator name change. Remove unused and unneeded constructors.
2517 * khtml/xml/dom_nodeimpl.cpp:
2518 (NodeImpl::previousEditable): Simplify. Rely on previousLeafNode as a helper.
2519 (NodeImpl::nextEditable): Ditto, but rely on nextLeafNode.
2520 (NodeImpl::previousLeafNode): Remove tree-walking code. Rely on traversePreviousNode as a helper.
2521 (NodeImpl::nextLeafNode): Ditto, but rely on traverseNextNode.
2522 (NodeImpl::containingBlock): Renamed replacement for containingEditableBlock.
2523 (NodeImpl::inSameContainingEditableBlock): Call renamed containingBlock.
2524 * khtml/xml/dom_nodeimpl.h:
2525 * khtml/xml/dom_position.cpp:
2526 (DOM::Position::previousCharacterPosition): Various name changes, as described above.
2527 (DOM::Position::nextCharacterPosition): Ditto.
2528 (DOM::Position::previousWordPosition): Ditto.
2529 (DOM::Position::nextWordPosition): Ditto.
2530 (DOM::Position::previousLinePosition): Ditto.
2531 (DOM::Position::nextLinePosition): Ditto.
2532 (DOM::Position::equivalentUpstreamPosition): Remove bogus check for editable node in loop. Perform
2533 improved block-crossing check at start of loop which works for editable and non-editable content.
2534 This is the crux of the fix for the bug.
2535 (DOM::Position::equivalentDownstreamPosition): Ditto.
2536 (DOM::Position::inRenderedContent): Various name changes, as described above.
2537 (DOM::Position::rendersOnSameLine): Ditto.
2538 (DOM::Position::rendersInDifferentPosition): Ditto.
2539 (DOM::Position::isFirstRenderedPositionOnLine): Ditto.
2540 (DOM::Position::isLastRenderedPositionOnLine): Ditto.
2541 (DOM::Position::isLastRenderedPositionInEditableBlock): Ditto.
2542 (DOM::Position::inFirstEditableInRootEditableBlock): Ditto.
2543 (DOM::Position::inLastEditableInRootEditableBlock): Ditto.
2544 (DOM::Position::inFirstEditableInContainingEditableBlock): Ditto.
2545 (DOM::Position::inLastEditableInContainingEditableBlock): Ditto.
2547 2004-06-01 Richard Williamson <rjw@apple.com>
2549 Fixed deployment build warning.
2551 * khtml/rendering/render_canvasimage.cpp:
2552 (RenderCanvasImage::paint):
2554 2004-06-01 Richard Williamson <rjw@apple.com>
2556 Added support for composite attribute to <CANVAS>
2557 Added support for drawImage and drawImageFromRect to <CANVAS>, i.e.:
2563 var img = new Image(600,600);
2565 function drawImage()
2567 var aCanvas = document.getElementById ("canvas1");
2568 var context = aCanvas.getContext("context-2d");
2569 context.drawImage (img, 0, 0, 600, 600, "copy");
2572 img.onload = drawImage;
2573 img.src = "http://www.google.com/images/logo.gif";
2578 <canvas id="canvas1" width=600 height=600>
2584 * khtml/ecma/kjs_html.cpp:
2585 (KJS::Context2DFunction::tryCall):
2586 (Context2D::Context2D):
2587 * khtml/ecma/kjs_html.h:
2588 * khtml/rendering/render_canvasimage.cpp:
2589 (RenderCanvasImage::paint):
2591 * kwq/KWQPainter.mm:
2592 (QPainter::getCompositeOperation):
2593 (QPainter::setCompositeOperation):
2594 (QPainter::drawPixmap):
2595 (QPainter::drawTiledPixmap):
2598 (QPixmap::flushRasterCache):
2599 * kwq/WebCoreImageRenderer.h:
2600 * kwq/WebCoreImageRendererFactory.h:
2602 2004-06-01 Ken Kocienda <kocienda@apple.com>
2608 <rdar://problem/3655028>: "Text styles have hard-coded values making bold the only supported text style"
2609 <rdar://problem/3656969>: "HTML Editing: Font panel doesn't work"
2611 * khtml/css/css_valueimpl.cpp:
2612 (FontFamilyValueImpl::cssText): Added implementation for this subclass. Returns parsedFontName.
2613 * khtml/css/css_valueimpl.h: Declare cssText() on FontFamilyValueImpl.
2614 (DOM::CSSProperty::value):
2615 * khtml/editing/htmlediting.cpp:
2616 (khtml::ApplyStyleCommand::ApplyStyleCommand): Changed signature to take a CSSStyleDeclarationImpl.
2617 (khtml::ApplyStyleCommand::style): Added accessor.
2618 * khtml/editing/htmlediting.h: Changed constructor signature to take a CSSStyleDeclarationImpl.
2619 * khtml/editing/htmlediting_impl.cpp:
2620 (khtml::styleSpanClassString): Added helper to return attribute used to tag spans we add to apply styles.
2621 (khtml::ApplyStyleCommandImpl::ApplyStyleCommandImpl): Ref style passed in.
2622 (khtml::ApplyStyleCommandImpl::~ApplyStyleCommandImpl): Deref style passed in.
2623 (khtml::ApplyStyleCommandImpl::doApply): m_removingStyle is obsolete. Removed.
2624 (khtml::ApplyStyleCommandImpl::isHTMLStyleNode): Now checks all properties in the object's declaration.
2625 (khtml::ApplyStyleCommandImpl::removeCSSStyle): Again, now is multi-property-savvy. Will now remove an empty span
2627 (khtml::ApplyStyleCommandImpl::currentlyHasStyle): Replaced, bold-only code with code that can handle all styles.
2628 (khtml::ApplyStyleCommandImpl::computeStyleChange): Helper which helps to determine whether we want to apply
2629 HTML-style markup for bold and italic, and gathers up all style changes that need to be done.
2630 (khtml::ApplyStyleCommandImpl::positionInsertionPoint): Added comment explaining possible optimization that might be
2632 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Significant reworking; now handles applying multiple styles.
2633 (khtml::ApplyStyleCommandImpl::cloneSelection): Assert fragment has at least one child. Don't want to work
2635 (khtml::ApplyStyleCommandImpl::surroundContentsWithElement): New helper.
2636 (khtml::RemoveCSSPropertyCommandImpl::~RemoveCSSPropertyCommandImpl): Juggle asserts and lifecycle methods to be
2637 more like other commands.
2638 (khtml::RemoveCSSPropertyCommandImpl::doApply): Ditto.
2639 (khtml::RemoveNodeAttributeCommandImpl::~RemoveNodeAttributeCommandImpl): Ditto.
2640 (khtml::RemoveNodeAttributeCommandImpl::doApply):Ditto.
2641 * khtml/editing/htmlediting_impl.h:
2642 (khtml::ApplyStyleCommandImpl::style): Added.
2643 (khtml::ApplyStyleCommandImpl::StyleChange::StyleChange): Added.
2645 (-[DOMCSSStyleDeclaration setProperty:::]): Fix problem where passing an empty NSString to a function expecting a boolean
2646 made all properties important priority.
2647 * kwq/WebCoreBridge.mm:
2648 (-[WebCoreBridge applyStyle:]): Remove provisional code and comment. Now pass along style, following the intended design.
2650 2004-06-01 Chris Blumenberg <cblu@apple.com>
2652 Reviewed by kocienda.
2654 * kwq/WebCoreBridge.h:
2655 * kwq/WebCoreBridge.mm:
2656 (-[WebCoreBridge dragCaretDOMRange]): new, lets WebKit pass the drag caret DOM range to the editing delegate
2658 2004-05-28 John Louch <ouch@apple.com>
2662 - removed setShadowWithColor and change setShadow to work with optional attributes
2663 it follows the same rules as setFill/StrokeColor
2664 - Fixed bug in setFillColor and setStrokeColor for CMYK colors (missing break in case).
2666 * khtml/ecma/kjs_html.cpp:
2667 (KJS::Context2DFunction::tryCall):
2668 * khtml/ecma/kjs_html.h:
2670 * khtml/ecma/kjs_html.lut.h:
2673 2004-05-28 Darin Adler <darin@apple.com>
2677 - various editing-related improvements
2679 * khtml/xml/dom_selection.h: Removed UP and DOWN directions, and added PARAGRAPH granularity.
2680 * khtml/xml/dom_selection.cpp:
2681 (DOM::Selection::modify): Got rid of the UP and DOWN directions, and made movement
2682 between lines happen when granularity is LINE. Added a new unimplemented granularity:
2684 (DOM::Selection::validate): Remove some unneeded APPLE_CHANGES. The code need not be ifdef'd.
2685 (DOM::Selection::debugPosition): Ditto.
2687 * kwq/WebCoreBridge.h: Removed WebSelectUp and WebSelectDown, and added WebSelectByParagraph.
2688 Added stringForRange: and selectedDOMRangeWithGranularity:, and renamed replaceSelectionWithNewline
2689 to insertNewline because it has the insertText: semantic, not the replaceSelectionWithText: one.
2690 * kwq/WebCoreBridge.mm:
2691 (-[WebCoreBridge stringForRange:]): Added.
2692 (-[WebCoreBridge selectedDOMRangeWithGranularity:]): Added.
2693 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Updated code to understand
2694 that vertical movement is based on granularity now, not direction.
2695 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]): Moved an ensureCaretVisible
2696 from the WebKit down here. I think perhaps this should go down even further in WebCore.
2697 (-[WebCoreBridge insertNewline]): Renamed, and moved ensureCaretVisible here.
2698 (-[WebCoreBridge insertText:]): Moved ensureCaretVisible here.
2699 (-[WebCoreBridge deleteKeyPressed]): Moved ensureCaretVisible here.
2701 * khtml/xml/dom_position.cpp: Some ifdef tweaks.
2703 * khtml/misc/helper.cpp: Namespace and formatting tweaks.
2704 * khtml/misc/helper.h: Removed some unused stuff.
2706 * khtml/dom/dom2_range.h: Make range constructor public so that anyone with
2707 a RangeImpl can easily make a Range.
2709 2004-05-28 Richard Williamson <rjw@apple.com>
2711 setStrokeColor and setFillColor now support
2712 old school web color string, oswcs+alpha, gray, gray+alpha,
2717 * khtml/css/cssparser.cpp:
2718 (CSSParser::parseColor):
2719 (CSSParser::parseColorFromValue):
2720 * khtml/css/cssparser.h: Made parseColor static public class method
2721 * khtml/ecma/kjs_html.cpp:
2722 (KJS::Context2DFunction::tryCall):
2724 2004-05-28 David Hyatt <hyatt@apple.com>
2726 Implement -khtml-user-select and add support for the property -khtml-user-drag (although someone will still
2727 need to wire it up).
2731 * khtml/css/cssparser.cpp:
2732 (CSSParser::parseValue):
2733 * khtml/css/cssproperties.c:
2736 * khtml/css/cssproperties.h:
2737 * khtml/css/cssproperties.in:
2738 * khtml/css/cssstyleselector.cpp:
2739 (khtml::CSSStyleSelector::applyProperty):
2740 * khtml/css/cssvalues.c:
2743 * khtml/css/cssvalues.h:
2744 * khtml/css/cssvalues.in:
2745 * khtml/khtml_part.cpp:
2746 (KHTMLPart::handleMousePressEventDoubleClick):
2747 (KHTMLPart::handleMousePressEventTripleClick):
2748 (KHTMLPart::handleMousePressEventSingleClick):
2749 (KHTMLPart::handleMouseMoveEventSelection):
2750 * khtml/rendering/render_canvas.cpp:
2751 (RenderCanvas::setSelection):
2752 * khtml/rendering/render_object.cpp:
2753 (RenderObject::shouldSelect):
2754 * khtml/rendering/render_object.h:
2755 * khtml/rendering/render_style.cpp:
2757 (StyleCSS3NonInheritedData::operator==):
2758 (RenderStyle::diff):
2759 * khtml/rendering/render_style.h:
2761 (khtml::RenderStyle::userDrag):
2762 (khtml::RenderStyle::userSelect):
2763 (khtml::RenderStyle::setUserDrag):
2764 (khtml::RenderStyle::setUserSelect):
2765 (khtml::RenderStyle::initialUserDrag):
2766 (khtml::RenderStyle::initialUserSelect):
2768 2004-05-28 John Louch <set EMAIL_ADDRESS environment variable>
2769 added addArc and clip 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-28 John Louch <ouch@apple.com>
2782 Added addArcToPoint and addRect path routines.
2784 Reviewed by sullivan.
2786 * khtml/ecma/kjs_html.cpp:
2787 (KJS::Context2DFunction::tryCall):
2788 * khtml/ecma/kjs_html.h:
2790 * khtml/ecma/kjs_html.lut.h:
2793 2004-05-27 Ken Kocienda <kocienda@apple.com>
2797 * khtml/xml/dom_selection.cpp:
2798 (DOM::Selection::toRange): Add call to update document layout before returning a Range.
2799 This is done to ensure recently-done editing changes are reflected in the calculation
2800 of the Range. This change solves a specific problem with updating the font panel, where
2801 the wrong Range was used, resulting in an incorrect font. Also, defer converting
2802 positions to be range-compliant positions. The nodeIsBeforeNode function is not
2803 range-compliant-position-savvy.
2805 2004-05-27 Kevin Decker <kdecker@apple.com>
2809 - added support for the new JavaScript error console
2810 - error messages are now wired directly to the bridge
2811 - revised generated error message content
2813 * khtml/ecma/kjs_events.cpp:
2814 (JSEventListener::handleEvent):
2815 * khtml/ecma/kjs_proxy.cpp:
2816 (KJSProxyImpl::evaluate):
2817 * khtml/ecma/kjs_window.cpp:
2818 (Window::isSafeScript):
2819 (ScheduledAction::execute):
2820 * kwq/KWQKHTMLPart.h:
2821 * kwq/KWQKHTMLPart.mm:
2822 (KWQKHTMLPart::addMessageToConsole):
2823 * kwq/WebCoreBridge.h:
2824 * kwq/WebCoreBridge.mm:
2826 2004-05-27 Trey Matteson <trey@apple.com>
2828 Two dragging tweaks: ondragleave events are sent before ondragenter events when
2829 going across element boundaries, to match WinIE.
2830 For compatibility with WinIE, we honor MIME types of "Text" and "URL".
2834 * khtml/khtmlview.cpp:
2835 (KHTMLView::updateDragAndDrop):
2836 * kwq/KWQClipboard.mm:
2837 (cocoaTypeFromMIMEType):
2841 2004-05-27 Vicki Murley <vicki@apple.com>
2845 - Fix Tiger build failure. Rename constant "S" to "WHITESPACE",
2846 and change all instances of S to WHITESPACE.
2848 * khtml/css/cssparser.cpp:
2849 (DOM::CSSParser::lex): S to WHITESPACE
2850 * khtml/css/parser.cpp: regenerated file
2851 * khtml/css/parser.h: regenerated file
2852 * khtml/css/parser.y: S to WHITESPACE
2853 * khtml/css/tokenizer.cpp: regenerated file
2854 * khtml/css/tokenizer.flex: S to WHITESPACE
2856 2004-05-27 John Louch <set EMAIL_ADDRESS environment variable>
2858 Reviewed by NOBODY (OOPS!).
2860 * khtml/ecma/kjs_html.cpp:
2861 (KJS::Context2DFunction::tryCall):
2862 * khtml/ecma/kjs_html.h:
2864 * khtml/ecma/kjs_html.lut.h:
2867 2004-05-27 Trey Matteson <trey@apple.com>
2869 First cut at DHTML dragging, destination side. Dragging text, files
2870 and URLs onto elements works. Type conversion from NSPasteboard to
2871 MIME types is hardwired. No JS access yet to modifier keys, or
2872 drag operations mask.
2874 Per IE's dragging API, we have the new DOM events ondragenter,
2875 ondragover, ondragleave and ondrop.
2876 We also have an event.dataTransfer object providing access to the
2877 NSPasteboard bearing the incoming data.
2881 * WebCore.pbproj/project.pbxproj: add 2 new files.
2882 * khtml/ecma/kjs_dom.cpp:
2883 (DOMNode::getValueProperty): JS access to ondragenter and pals
2884 (DOMNode::putValue): Ditto
2885 * khtml/ecma/kjs_dom.h:
2886 (KJS::DOMNode::): New attr enum values.
2887 * khtml/ecma/kjs_dom.lut.h:
2889 * khtml/ecma/kjs_events.cpp:
2890 (DOMMouseEvent::mark): Pass along mark to dataTransfer we hold.
2891 (DOMMouseEvent::getValueProperty): Create and return dataTransfer.
2892 (Clipboard::Clipboard): New class exposed in JS.
2893 (Clipboard::~Clipboard):
2894 (Clipboard::tryGet): Boilerplate.
2895 (Clipboard::getValueProperty): Return the clipboard's props.
2896 (Clipboard::tryPut): Boilerplate.
2897 (Clipboard::putValue): Set the clipboard's props.
2898 (ClipboardProtoFunc::tryCall): Implement clipboard's funcs.
2899 * khtml/ecma/kjs_events.h:
2900 (KJS::DOMMouseEvent::DOMMouseEvent): Init clipboard ptr.
2901 (KJS::DOMMouseEvent::):
2902 (KJS::Clipboard::toBoolean):
2903 (KJS::Clipboard::classInfo):
2905 * khtml/ecma/kjs_events.lut.h:
2907 * khtml/html/html_elementimpl.cpp:
2908 (HTMLElementImpl::parseHTMLAttribute): Enable setting ondragenter
2909 and friends as html attributes.
2910 * khtml/khtmlview.cpp:
2911 (KHTMLView::dispatchDragEvent): Send a drag related event to the DOM.
2912 (KHTMLView::updateDragAndDrop): Handle a dragenter or dragupdate.
2913 (KHTMLView::cancelDragAndDrop): Handle a dragexit.
2914 (KHTMLView::performDragAndDrop): Handle an actual drop.
2915 * khtml/khtmlview.h:
2916 * khtml/misc/htmlattrs.c: Generated code.
2917 * khtml/misc/htmlattrs.h: Generated code.
2918 * khtml/misc/htmlattrs.in: Add ondragenter, etc
2919 * khtml/xml/dom2_eventsimpl.cpp:
2920 (EventImpl::typeToId): Handle new event types for dragging.
2921 (EventImpl::idToType): Ditto.
2922 (MouseEventImpl::MouseEventImpl): Init new clipboard ptr.
2923 (MouseEventImpl::~MouseEventImpl): Deref clipboard.
2924 (ClipboardImpl::ClipboardImpl):
2925 (ClipboardImpl::~ClipboardImpl):
2926 * khtml/xml/dom2_eventsimpl.h:
2927 (DOM::EventImpl::): New event enums.
2928 (DOM::MouseEventImpl::clipboard):
2929 * kwq/KWQClipboard.h: Added.
2930 * kwq/KWQClipboard.mm: Added.
2931 (KWQClipboard::KWQClipboard):
2932 (KWQClipboard::~KWQClipboard):
2933 (KWQClipboard::isForDragging): Trivial getter/setters.
2934 (KWQClipboard::dropEffect):
2935 (KWQClipboard::setDropEffect):
2936 (KWQClipboard::dropAllowed):
2937 (KWQClipboard::setDropAllowed):
2938 (cocoaTypeFromMIMEType): Convert MIME pboard type to Cocoa type.
2939 (KWQClipboard::clearData): OSX specific clipboard impl. of IE func
2940 (KWQClipboard::clearAllData): Ditto
2941 (KWQClipboard::getData): Ditto
2942 (KWQClipboard::setData): Ditto
2943 * kwq/WebCoreBridge.h:
2944 * kwq/WebCoreBridge.mm:
2945 (-[WebCoreBridge dragOperationForDraggingInfo:]): Passthrough from WebKit to khtmlpart
2946 (-[WebCoreBridge dragExitedWithDraggingInfo:]): Ditto
2947 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto
2949 2004-05-27 Ken Kocienda <kocienda@apple.com>
2953 * kwq/KWQKHTMLPart.h: Declare new fontForCurrentPosition helper.
2954 * kwq/KWQKHTMLPart.mm:
2955 (KWQKHTMLPart::fontForCurrentPosition): Determines the "current font" in the way that Cocoa
2956 does. Either the font of the character before the caret, when the selection is a caret, or
2957 the font of the first character selected, when the selection is a range.
2958 * kwq/WebCoreBridge.h: Declare bridge method so this can be called from WebKit.
2959 * kwq/WebCoreBridge.mm:
2960 (-[WebCoreBridge fontForCurrentPosition]): Calls through to fontForCurrentPosition on KWQKHTMLPart.
2962 2004-05-27 Ken Kocienda <kocienda@apple.com>
2966 Adds a typing style member variable to khtml part.
2967 This patch adds basic life-cycle management and
2968 accessors. In addition, one essential piece of
2969 behavior has been added: Clearing the typing style
2970 whenever the selection changes.
2972 Follow-on work will make this typing style a fully
2973 functional part of applying styles to text while typing.
2975 * khtml/khtml_part.cpp:
2976 (KHTMLPart::notifySelectionChanged): Clear typing style.
2977 (KHTMLPart::typingStyle): Getter.
2978 (KHTMLPart::setTypingStyle): Setter.
2979 (KHTMLPart::clearTypingStyle): Convenience. Sets to 0.
2980 * khtml/khtml_part.h: Function declarations.
2981 * khtml/khtmlpart_p.h:
2982 (KHTMLPartPrivate::KHTMLPartPrivate): Initialize member variable.
2983 (KHTMLPartPrivate::~KHTMLPartPrivate): Deref if necessary.
2985 2004-05-27 Ken Kocienda <kocienda@apple.com>
2989 Add helper to get the DOM element for a Position.
2991 * khtml/xml/dom_position.cpp:
2992 (DOM::Position::element): Returns the Position's node if it is an element, or
2993 the first ancestor of the node that is an element. Returns 0 if node is not
2994 an element and has no parent that is an element.
2995 * khtml/xml/dom_position.h: Added declaration.
2997 2004-05-27 Darin Adler <darin@apple.com>
3001 - moved to new symlink technique for embedding frameworks
3003 * WebCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
3004 because we don't need it any more.
3006 2004-05-27 Darin Adler <darin@apple.com>
3008 - fixed bug where all pages with images would cause a crash
3009 - fixed Deployment build
3011 * kwq/KWQPainter.mm: (QPainter::drawPixmap): Put #if 0 around placeholder code
3012 for setting up the graphics context.
3014 2004-05-26 Richard Williamson <rjw@apple.com>
3016 Added shadow support (w/ Louch).
3017 Added infrastructure for drawing images.
3019 New context methods:
3025 Reviewed by me and Louch.
3027 * khtml/ecma/kjs_html.cpp:
3028 (KJS::Context2DFunction::tryCall):
3029 * khtml/ecma/kjs_html.h:
3030 (KJS::Image::image):
3032 * khtml/ecma/kjs_html.lut.h:
3035 * kwq/KWQPainter.mm:
3036 (QPainter::drawPixmap):
3038 2004-05-26 Richard Williamson <rjw@apple.com>
3042 * khtml/ecma/kjs_html.cpp:
3043 (KJS::Context2DFunction::tryCall):
3044 * khtml/ecma/kjs_html.h:
3046 * khtml/ecma/kjs_html.lut.h:
3049 2004-05-26 Richard Williamson <rjw@apple.com>
3051 Part 2 of the new <CANVAS> tag implementation. This adds the
3052 basic machinery and draw operations for the <CANVAS> tag. Pretty cool.
3054 function drawLine() {
3055 var canvas1 = document.getElementById ("canvas1");
3056 var context = canvas1.getContext("context-2d");
3058 context.setStrokeColor ("red");
3059 context.setLineWidth (10);
3060 context.beginPath();
3061 context.moveToPoint (0,0);
3062 context.addLineToPoint (400,400);
3063 context.strokePath();
3068 <canvas id="canvas1" width="400" height="400">
3070 Currently supported operations on the 2D context are:
3073 Scale, Rotate, Translate,
3074 BeginPath, ClosePath,
3075 SetStrokeColor, SetFillColor, SetLineWidth, SetLineCap, SetLineJoin, SetMiterLimit,
3076 FillPath, StrokePath,
3077 MoveToPoint, AddLineToPoint, AddQuadraticCurveToPoint, AddBezierCurveToPoint,
3084 * khtml/ecma/kjs_html.cpp:
3085 (KJS::HTMLElementFunction::tryCall):
3086 (KJS::Context2DFunction::tryCall):
3087 (Context2D::tryGet):
3088 (Context2D::getValueProperty):
3089 (Context2D::tryPut):
3090 (Context2D::putValue):
3091 (Context2D::Context2D):
3092 (Context2D::~Context2D):
3093 * khtml/ecma/kjs_html.h:
3094 (KJS::Context2D::toBoolean):
3095 (KJS::Context2D::classInfo):
3097 * khtml/ecma/kjs_html.lut.h:
3099 * khtml/html/html_canvasimpl.cpp:
3100 (HTMLCanvasElementImpl::HTMLCanvasElementImpl):
3101 * khtml/html/htmlparser.cpp:
3102 (KHTMLParser::getElement):
3103 * khtml/rendering/render_canvasimage.cpp:
3104 (RenderCanvasImage::RenderCanvasImage):
3105 (RenderCanvasImage::~RenderCanvasImage):
3106 (RenderCanvasImage::createDrawingContext):
3107 (RenderCanvasImage::drawingContext):
3108 (RenderCanvasImage::setNeedsImageUpdate):
3109 (RenderCanvasImage::updateDrawnImage):
3110 (RenderCanvasImage::drawnImage):
3111 (RenderCanvasImage::paint):
3112 (RenderCanvasImage::layout):
3113 * khtml/rendering/render_canvasimage.h:
3114 * khtml/rendering/render_image.cpp:
3115 (RenderImage::paint):
3116 * khtml/rendering/render_image.h:
3117 * khtml/rendering/render_replaced.cpp:
3118 (RenderReplaced::shouldPaint):
3119 (RenderWidget::paint):
3121 * kwq/KWQPainter.mm:
3122 (QPainter::currentContext):
3124 2004-05-26 Darin Adler <darin@apple.com>
3126 - fixed warning that prevents Deployment build from compiling
3128 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMousePressEvent):
3129 Moved use of single-click boolean outside the scope of the "block exceptions" macros.
3131 2004-05-25 Chris Blumenberg <cblu@apple.com>
3133 Fixed a regression where selections that were created via double or triple were not draggable.
3137 * kwq/KWQKHTMLPart.mm:
3138 (KWQKHTMLPart::khtmlMousePressEvent): if the click count is greater than 1, don't allow drags
3139 (KWQKHTMLPart::khtmlMouseMoveEvent): allow drags to occur even if the selection was originally created via double or triple click
3141 2004-05-25 Chris Blumenberg <cblu@apple.com>
3143 Fixed regression where undoing typing would undo character-by-character.
3145 Reviewed by kocienda.
3147 * kwq/WebCoreBridge.h:
3148 * kwq/WebCoreBridge.mm:
3149 (-[WebCoreBridge insertText:]): new, this method used to be replaceSelectionWithText, but replaceSelectionWithText now is one operation whereas calls to insertText: are coalesced
3151 2004-05-25 Ken Kocienda <kocienda@apple.com>
3155 Change postDidChangeSelectionNotification and postDidChangeNotification tp
3156 respondToChangedSelection and respondToChangedContents, respectively, to
3157 account for the fact that we do work in these calls other than post a
3160 * khtml/khtml_part.cpp:
3161 (KHTMLPart::notifySelectionChanged): Use new names.
3162 (KHTMLPart::appliedEditing): Ditto.
3163 (KHTMLPart::unappliedEditing): Ditto.
3164 (KHTMLPart::reappliedEditing): Ditto.
3165 * kwq/KWQKHTMLPart.h: Change name of functions as described.
3166 * kwq/KWQKHTMLPart.mm:
3167 (KWQKHTMLPart::respondToChangedSelection): Ditto.
3168 (KWQKHTMLPart::respondToChangedContents): Ditto.
3169 * kwq/WebCoreBridge.h: Ditto.
3171 2004-05-25 Maciej Stachowiak <mjs@apple.com>
3175 * ForwardingHeaders/misc/khtml_text_operations.h: Added.
3177 2004-05-25 Richard Williamson <rjw@apple.com>
3179 Part 1 of the new <CANVAS> tag implementation. This patch
3180 adds the boiler plate for the new element.
3184 * ForwardingHeaders/html/html_canvasimpl.h: Added.
3185 * ForwardingHeaders/rendering/render_canvasimage.h: Added.
3186 * WebCore.pbproj/project.pbxproj:
3187 * khtml/ecma/kjs_html.cpp:
3188 (KJS::HTMLElement::classInfo):
3189 (KJS::HTMLElementFunction::tryCall):
3190 * khtml/ecma/kjs_html.h:
3191 (KJS::HTMLElement::):
3192 * khtml/ecma/kjs_html.lut.h:
3194 * khtml/html/dtd.cpp:
3196 * khtml/html/html_canvasimpl.cpp: Added.
3197 (HTMLCanvasElementImpl::HTMLCanvasElementImpl):
3198 (HTMLCanvasElementImpl::~HTMLCanvasElementImpl):
3199 (HTMLCanvasElementImpl::id):
3200 (HTMLCanvasElementImpl::mapToEntry):
3201 (HTMLCanvasElementImpl::parseHTMLAttribute):
3202 (HTMLCanvasElementImpl::createRenderer):
3203 (HTMLCanvasElementImpl::attach):
3204 (HTMLCanvasElementImpl::detach):
3205 (HTMLCanvasElementImpl::isURLAttribute):
3206 * khtml/html/html_canvasimpl.h: Added.
3207 * khtml/html/htmlparser.cpp:
3208 (KHTMLParser::getElement):
3209 * khtml/misc/htmltags.c:
3212 * khtml/misc/htmltags.h:
3213 * khtml/misc/htmltags.in:
3214 * khtml/rendering/render_canvasimage.cpp: Added.
3215 (RenderCanvasImage::RenderCanvasImage):
3216 (RenderCanvasImage::~RenderCanvasImage):
3217 (RenderCanvasImage::paint):
3218 (RenderCanvasImage::layout):
3219 * khtml/rendering/render_canvasimage.h: Added.
3220 (khtml::RenderCanvasImage::renderName):
3221 (khtml::RenderCanvasImage::element):
3223 2004-05-25 Chris Blumenberg <cblu@apple.com>
3225 Fixed: <rdar://problem/3546418>: (when dragging text within an editable HTML doc, the selection should be moved not copied)
3227 Reviewed by kocienda.
3229 * khtml/editing/htmlediting_impl.cpp:
3230 (khtml::MoveSelectionCommandImpl::doApply): implemented
3231 * khtml/khtml_part.cpp:
3232 (KHTMLPart::setDragCaret): make the old drag cursor rect dirty
3233 * khtml/khtml_part.h:
3235 2004-05-25 Maciej Stachowiak <mjs@apple.com>
3239 - fixed <rdar://problem/3657363>: (Editing: export innerText, innerHTML, outerText, outerHTML and setters to Objective-C)
3240 - partial fix for <rdar://problem/3656706>: (Fix innerText and setInnerText DOM extensions)
3242 * khtml/html/html_elementimpl.cpp:
3243 (HTMLElementImpl::innerText): Use plainText() to make the text, to
3244 match other browsers.
3245 (HTMLElementImpl::outerText): Extended comment.
3246 * khtml/misc/khtml_text_operations.h:
3247 * kwq/DOMExtensions.h:
3249 (-[DOMHTMLElement outerText]): Added new ObjC wrapper for this.
3250 (-[DOMHTMLElement setOuterText:]): Ditto.
3252 2004-05-25 Ken Kocienda <kocienda@apple.com>
3256 Defer setting the selection to delete when none has been passed in to the
3257 time that the command is run. This fixes a problem where a command nested
3258 in a composite was not correctly picking up the right selection to begin
3259 its work. Now, the command will correctly use the ending selection of
3260 its parent when no selection has been passed in.
3262 * khtml/editing/htmlediting_impl.cpp:
3263 (khtml::DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl):
3264 (khtml::DeleteCollapsibleWhitespaceCommandImpl::doApply):
3265 (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
3266 (khtml::DeleteSelectionCommandImpl::doApply):
3267 * khtml/editing/htmlediting_impl.h:
3269 2004-05-24 Maciej Stachowiak <mjs@apple.com>
3273 Added a new simple layout test for outerText.
3275 * layout-tests/fast/dom/outerText-expected.txt: Added.
3276 * layout-tests/fast/dom/outerText.html: Added.
3278 2004-05-24 Darin Adler <darin@apple.com>
3282 - fixed <rdar://problem/3665813>: (iBench is crashing in TOT)
3284 * khtml/html/html_formimpl.cpp: (HTMLSelectElementImpl::HTMLSelectElementImpl):
3285 Initialize m_options to 0.
3287 2004-05-24 Ken Kocienda <kocienda@apple.com>
3291 * khtml/xml/dom_selection.cpp:
3292 (DOM::Selection::toRange): Improved the code to return ranges that are
3293 convenient to use by WebKit code which needs to perform text-editor-like
3294 operations with ranges. Comments in the code describe this behavior.
3295 (DOM::Selection::nodeIsBeforeNode): Make this method const.
3296 * khtml/xml/dom_selection.h: Ditto.
3298 2004-05-24 Chris Blumenberg <cblu@apple.com>
3300 Improved editing via drag.
3302 Reviewed by kocienda.
3304 * khtml/editing/htmlediting.cpp: Renamed PasteMarkupCommand to ReplaceSelectionCommand
3305 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
3306 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
3307 (khtml::ReplaceSelectionCommand::impl):
3308 (khtml::MoveSelectionCommand::MoveSelectionCommand):
3309 (khtml::MoveSelectionCommand::~MoveSelectionCommand):
3310 (khtml::MoveSelectionCommand::impl):
3311 * khtml/editing/htmlediting.h:
3313 * khtml/editing/htmlediting_impl.cpp:
3314 (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl):
3315 (khtml::ReplaceSelectionCommandImpl::~ReplaceSelectionCommandImpl):
3316 (khtml::ReplaceSelectionCommandImpl::commandID):
3317 (khtml::ReplaceSelectionCommandImpl::doApply):
3318 (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): new command
3319 (khtml::MoveSelectionCommandImpl::~MoveSelectionCommandImpl):
3320 (khtml::MoveSelectionCommandImpl::commandID):
3321 (khtml::MoveSelectionCommandImpl::doApply):
3322 * khtml/editing/htmlediting_impl.h:
3323 * khtml/khtml_part.cpp:
3324 (KHTMLPart::dragCaret): new
3325 (KHTMLPart::setDragCaret): new
3326 (KHTMLPart::notifyDragCaretChanged): new
3327 (KHTMLPart::paintDragCaret): new
3328 * khtml/khtml_part.h:
3329 * khtml/khtmlpart_p.h:
3330 * khtml/rendering/render_block.cpp:
3331 (khtml::RenderBlock::paintObject): paint the drag caret
3333 (+[DOMDocumentFragment _documentFragmentWithImpl:]): made internally available
3334 (-[DOMDocumentFragment _fragmentImpl]):
3335 * kwq/DOMInternal.h:
3336 * kwq/WebCoreBridge.h:
3337 * kwq/WebCoreBridge.mm:
3338 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): new
3339 (-[WebCoreBridge documentFragmentWithText:]): new
3340 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]): new
3341 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:]): renamed to take the selectReplacement BOOL
3342 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:]): ditto
3343 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:]): ditto
3344 (-[WebCoreBridge replaceSelectionWithNewline]): moved
3345 (-[WebCoreBridge setSelectionToDragCaret]): new
3346 (-[WebCoreBridge moveSelectionToDragCaret:]): new
3347 (-[WebCoreBridge moveDragCaretToPoint:]): set the drag caret, not the selection
3348 (-[WebCoreBridge removeDragCaret]): new
3350 2004-05-24 Ken Kocienda <kocienda@apple.com>
3354 Fixed some life-cycle issues with node iterators and detaching. Big deal is
3355 to detach in DOMNodeIterator dealloc. Otherwise, NodeIterators created from
3358 * khtml/xml/dom2_traversalimpl.cpp:
3359 (DOM::NodeIteratorImpl::detach): Only detach if not yet detached.
3360 * khtml/xml/dom2_traversalimpl.h:
3361 (DOM::NodeIteratorImpl::setDetached): New convenience.