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