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