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