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