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