Safari-187 stamp
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 === Safari-187 ===
2
3 2005-02-17  Richard Williamson   <rjw@apple.com>
4
5         Fixed <rdar://problem/4008163> dynamic support for -apple-dashboard-region is flakey
6
7         Style operator== wasn't including regions.
8
9         Reviewed by Darin.
10
11         * khtml/rendering/render_style.cpp:
12         (StyleCSS3NonInheritedData::operator==):
13
14 2005-02-17  Adele Amchan  <adele@apple.com>
15
16         Reviewed by Chris.
17
18         fix for <rdar://problem/4010028> 8A383: Safari v185 crash loading united.com multi city fare finder page.
19
20         * khtml/dom/dom_string.cpp: (DOM::DOMString::operator += ): prevent nil dereference when DOMString being added is nil
21
22 2005-02-17  Jens Alfke  <jens@apple.com>
23
24         Reviewed by Hyatt.
25
26         Fix for rdar://3963151 "Mail only pasted ~950 of 1407 text lines into my message!"
27         Force tokenizer to run synchronously while parsing document fragments, so it doesn't stop halfway through and cause truncated content.
28
29         * khtml/html/html_elementimpl.cpp:
30         (HTMLElementImpl::createContextualFragment):
31         * khtml/html/htmltokenizer.cpp:
32         (khtml::HTMLTokenizer::reset):
33         (khtml::HTMLTokenizer::begin):
34         (khtml::HTMLTokenizer::setForceSynchronous):
35         (khtml::HTMLTokenizer::continueProcessing):
36         * khtml/html/htmltokenizer.h:
37
38 2005-02-17  Ken Kocienda  <kocienda@apple.com>
39
40         Reviewed by Hyatt
41
42         Fix for this bug:
43         
44         <rdar://problem/3982183> Mail's HTML paragraphs appear with unintended margins in Entourage and Eudora
45
46         * khtml/editing/htmlediting.cpp:
47         (khtml::createDefaultParagraphElement): Change element we make from <p> to <div>.
48         This fixes the problem, as these other mailers show <div> elements without margins.
49         
50         Some test files needed to change to preserve the ability to "eyeball" the results.
51         Many others changed just because their <p> elements changed to <div> elements.
52         
53         * layout-tests/editing/deleting/delete-3928305-fix-expected.txt
54         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt
55         * layout-tests/editing/inserting/insert-div-013-expected.txt
56         * layout-tests/editing/inserting/insert-div-013.html
57         * layout-tests/editing/inserting/insert-div-014-expected.txt
58         * layout-tests/editing/inserting/insert-div-014.html
59         * layout-tests/editing/inserting/insert-div-018-expected.txt
60         * layout-tests/editing/inserting/insert-div-018.html
61         * layout-tests/editing/inserting/insert-div-019-expected.txt
62         * layout-tests/editing/inserting/insert-div-019.html
63         * layout-tests/editing/inserting/insert-div-020-expected.txt
64         * layout-tests/editing/inserting/insert-div-020.html
65         * layout-tests/editing/inserting/insert-div-021-expected.txt
66         * layout-tests/editing/inserting/insert-div-021.html
67         * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
68         * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
69         * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt
70         * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt
71
72 2005-02-17  Ken Kocienda  <kocienda@apple.com>
73
74         Reviewed by Hyatt
75
76         Fix for this bug:
77         
78         <rdar://problem/3996737> REGRESSION (Mail): Copy/paste in Mail inserts returns
79
80         The root cause of the problem is that a couple of pieces of code in AppKit and Mail 
81         insert newlines into markup as it is generated, and the paste code in WebCore was 
82         not smart about nodes that do not render (as is the case with these added newlines). 
83         So, the solution is to remove these unrendered nodes in the paste code in a pre-pass. 
84         Fortunately, my recent addition of such a pass to the paste code to handle styles 
85         gave me a convenient place to put this new logic.
86
87         * khtml/editing/htmlediting.cpp:
88         (khtml::ReplacementFragment::ReplacementFragment): Use new name for function below.
89         (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Name change from computeStylesForNodes().
90         Now does the additional work of removing unrendered nodes, as mentioned above.
91         (khtml::isNodeRendered): New helper function.
92         * khtml/editing/htmlediting.h: Updated as necessary.
93
94 2005-02-17  Ken Kocienda  <kocienda@apple.com>
95
96         Reviewed by Hyatt
97
98         Fix for this bug:
99         
100         <rdar://problem/3998892> REGRESSION (Mail): bolding a selection from end of line changes unselected text on starting line.
101         
102         The styling code did not move to the next node when the starting position was 
103         at the last offset of a node. Instead, it styled it. Clearly wrong. Solution 
104         is to borrow a check from the delete algorithm. Though I call caretMaxOffset(),
105         which I consider deprecated, it is still the simplest and most strightforward
106         way to ask the right question for this kind of problem.
107
108         * khtml/editing/htmlediting.cpp:
109         (khtml::ApplyStyleCommand::applyInlineStyle): Fixed, as described above.
110         * layout-tests/editing/style/style-3998892-fix-expected.txt: Added.
111         * layout-tests/editing/style/style-3998892-fix.html: Added.
112
113 2005-02-16  Chris Blumenberg  <cblu@apple.com>
114         
115         Fixed: <rdar://problem/3954842> Forward/reply to an HTML email can result in nothing (in cases with <link> tags for CSS)
116
117         Reviewed by john.
118
119         * khtml/xml/dom_nodeimpl.cpp:
120         (NodeBaseImpl::addChild): don't call insertedIntoDocument on the added child if "this" itself is not in the document.
121
122 2005-02-16  John Sullivan  <sullivan@apple.com>
123
124         Written by Darin, reviewed by Maciej and me
125         
126         - change required to make previous checkin work with English language RSS pages
127
128         * kwq/KWQKURL.h:
129         new private method isHierarchical
130         * kwq/KWQKURL.mm:
131         (KURL::KURL):
132         add hierarchical base URL check when determining whether the URL is absolute
133         (KURL::isHierarchical):
134         new method, returns true if this is a valid URL with a slash just past the scheme's trailing colon
135
136 2005-02-16  John Sullivan  <sullivan@apple.com>
137
138         Written by Darin, reviewed by me.
139         
140         - WebCore part of fix for <rdar://problem/4007384> 
141         FILTER: Bookmark of RSS with Japanese search word & multiple RSS pages loses filter
142
143         * kwq/DOM.mm:
144         (-[DOMElement _getURLAttribute:]):
145         new SPI method, uses parseURL and completeURL to get valid URL from attribute value
146
147         * kwq/DOMPrivate.h:
148         declare new SPI method
149
150 2005-02-15  Maciej Stachowiak  <mjs@apple.com>
151
152         Reviewed by Darin.
153
154         <rdar://problem/3942428> reproducible crash loading cbs.sportsline.com
155         
156         This change reverts the fix for <rdar://problem/3805311>, and
157         re-fixes it in a different (better) way. Instead of preventing
158         programmatic open from setting the parsing flag, instead make sure
159         that programmatic close resets it.
160
161         * khtml/khtml_part.cpp:
162         (KHTMLPart::openURL):
163         (KHTMLPart::didExplicitOpen):
164         (KHTMLPart::closeURL):
165         (KHTMLPart::begin):
166         (KHTMLPart::end):
167         (KHTMLPart::endIfNotLoading):
168         (KHTMLPart::slotFinishedParsing):
169         (KHTMLPart::checkEmitLoadEvent):
170         * khtml/khtml_part.h:
171         * khtml/khtmlpart_p.h:
172         (KHTMLPartPrivate::KHTMLPartPrivate):
173         * khtml/xml/dom_docimpl.cpp:
174         (DocumentImpl::open):
175         (DocumentImpl::implicitOpen):
176         (DocumentImpl::close):
177         (DocumentImpl::implicitClose):
178         * khtml/xml/dom_docimpl.h:
179
180 2005-02-15  David Harrison  <harrison@apple.com>
181
182         Reviewed by Maciej.
183
184         <rdar://problem/3933665> smart delete seems to delete too much after expanding selection with arrow keys
185
186         Fixed by updating the selection granularity.  Only byWord granularity enables smart delete, but in this
187         case the granularity changed from byWord to byCharacter.
188
189         * khtml/khtml_part.cpp:
190         (KHTMLPart::setSelectionGranularity):
191         * khtml/khtml_part.h:
192         * kwq/WebCoreBridge.mm:
193         (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
194         (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
195         (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
196
197 2005-02-15  David Harrison  <harrison@apple.com>
198
199         Reviewed by Darin.
200
201         (continued) <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
202
203         This was supposed have been committed yesterday with the other part of the fix, but was not.
204         
205         * khtml/editing/visible_units.cpp:
206         (khtml::endOfWord):
207
208 2005-02-15  Ken Kocienda  <kocienda@apple.com>
209
210         Reviewed by John
211         
212         Fix for this bug:
213         
214         <rdar://problem/3951178> REGRESSION (Mail): blank line lost after pasting as quotation
215         
216         Problem was that the blank line after the selection was getting deleted incorrectly since the
217         paste code thought this was an unneeded placeholder rather than a placeholder outside of the
218         selection.
219
220         * khtml/editing/htmlediting.cpp:
221         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now calls findBlockPlaceholder.
222         (khtml::CompositeEditCommand::findBlockPlaceholder): Moved finding code formerly in 
223         removeBlockPlaceholderIfNeeded to this new helper.
224         (khtml::ReplaceSelectionCommand::doApply): Do not delete placeholder up front. Call 
225         findBlockPlaceholder, and delete it later if needed in the already-existing cleanup step.
226         * khtml/editing/htmlediting.h: Add new function.
227
228         New layout test.
229
230         * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Added.
231         * layout-tests/editing/pasteboard/paste-text-017.html: Added.
232
233         Result changed for the better.
234
235         * layout-tests/editing/pasteboard/paste-text-011-expected.txt
236
237 2005-02-14  David Harrison  <harrison@apple.com>
238
239         Reviewed by Darin.
240
241         <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
242
243         Reviewed by Darin.
244
245         <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
246
247         * khtml/editing/visible_text.cpp:
248         (khtml::SimplifiedBackwardsTextIterator::advance):
249         Add BR in for <rdar://problem/3917929> fix only if leaving a visible text node.
250         
251         * khtml/editing/visible_units.cpp:
252         (khtml::endOfWord):
253         Do not move left over a paragraph boundary.
254
255 2005-02-14  Darin Adler  <darin@apple.com>
256
257         Reviewed by John.
258
259         - fixed <rdar://problem/3686434> Safari uses too much RAM on file upload, leading to malloc errors and crashes (HP printers)
260
261         * khtml/html/html_formimpl.cpp:
262         (DOM::FormDataList::begin): Updated to use a list of FormDataListItem instead of QCString.
263         (DOM::FormDataList::end): Ditto.
264         (DOM::HTMLFormElementImpl::formData): Same here, and also use appendFile rather than appendData
265         when we encounter a path name rather than data.
266         (DOM::HTMLInputElementImpl::appendFormData): Use appendFile here rather than reading the file
267         in; the reading now happens inside WebKit.
268         (DOM::FormDataList::appendString): Updated for FormDataListItem.
269         (DOM::FormDataList::appendFile): Added.
270
271         * ForwardingHeaders/kfileitem.h: Emptied out the file; no longer includes KWQKFileItem.h.
272         * ForwardingHeaders/netaccess.h: Emptied out the file; no longer includes KWQKIONetAccess.h.
273         * kwq/KWQKFileItem.h: Removed.
274         * kwq/KWQKFileItem.mm: Removed.
275         * kwq/KWQKIONetAccess.h: Removed.
276         * kwq/KWQKIONetAccess.mm: Removed.
277         * WebCore.pbproj/project.pbxproj: Removed the 4 files above.
278
279         - small unrelated fix (not reviewed by John)
280
281         * khtml/ecma/kjs_window.cpp: (Window::isSafeScript): Put some logging code outside if statements so it works all the time.
282
283 2005-02-14  David Harrison  <harrison@apple.com>
284
285         Reviewed by Darin.
286
287         <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
288
289         Fixed nextLinePosition to calculate affinity rather than take it as a parameter.  Propagated the parameter change out to related methods.
290
291         * khtml/editing/htmlediting.cpp:
292         (khtml::DeleteSelectionCommand::initializePositionData):
293         (khtml::InsertLineBreakCommand::doApply):
294         (khtml::InsertParagraphSeparatorCommand::doApply):
295         (khtml::InsertTextCommand::input):
296         (khtml::ReplaceSelectionCommand::doApply):
297         (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes):
298         * khtml/editing/selection.cpp:
299         (khtml::Selection::modifyExtendingRightForward):
300         (khtml::Selection::modifyMovingRightForward):
301         (khtml::Selection::modifyExtendingLeftBackward):
302         (khtml::Selection::modifyMovingLeftBackward):
303         (khtml::Selection::modify):
304         (khtml::Selection::validate):
305         * khtml/editing/visible_position.cpp:
306         (khtml::visiblePositionsOnDifferentLines):
307         * khtml/editing/visible_units.cpp:
308         (khtml::rootBoxForLine):
309         (khtml::startOfLine):
310         (khtml::endOfLine):
311         (khtml::inSameLine):
312         (khtml::isStartOfLine):
313         (khtml::isEndOfLine):
314         (khtml::previousLinePosition):
315         (khtml::nextLinePosition):
316         (khtml::previousSentencePosition):
317         (khtml::nextSentencePosition):
318         (khtml::previousParagraphPosition):
319         (khtml::nextParagraphPosition):
320         * khtml/editing/visible_units.h:
321         * khtml/khtml_events.cpp:
322         (khtml::MouseEvent::offset):
323         * khtml/khtml_part.cpp:
324         (KHTMLPart::isPointInsideSelection):
325         (KHTMLPart::selectClosestWordFromMouseEvent):
326         (KHTMLPart::handleMousePressEventTripleClick):
327         (KHTMLPart::handleMousePressEventSingleClick):
328         (KHTMLPart::handleMouseMoveEventSelection):
329         (KHTMLPart::khtmlMouseReleaseEvent):
330         * khtml/rendering/render_block.cpp:
331         (khtml::RenderBlock::positionForCoordinates):
332         * khtml/rendering/render_block.h:
333         * khtml/rendering/render_br.cpp:
334         (RenderBR::positionForCoordinates):
335         * khtml/rendering/render_br.h:
336         * khtml/rendering/render_container.cpp:
337         (RenderContainer::positionForCoordinates):
338         * khtml/rendering/render_container.h:
339         * khtml/rendering/render_inline.cpp:
340         (RenderInline::positionForCoordinates):
341         * khtml/rendering/render_inline.h:
342         * khtml/rendering/render_object.cpp:
343         (RenderObject::caretRect):
344         (RenderObject::positionForCoordinates):
345         * khtml/rendering/render_object.h:
346         * khtml/rendering/render_replaced.cpp:
347         (RenderReplaced::positionForCoordinates):
348         * khtml/rendering/render_replaced.h:
349         * khtml/rendering/render_text.cpp:
350         (RenderText::positionForCoordinates):
351         * khtml/rendering/render_text.h:
352         * khtml/xml/dom_position.cpp:
353         (DOM::Position::previousCharacterPosition):
354         (DOM::Position::nextCharacterPosition):
355         (DOM::Position::leadingWhitespacePosition):
356         (DOM::Position::trailingWhitespacePosition):
357         * khtml/xml/dom_position.h:
358         * kwq/KWQAccObject.mm:
359         (-[KWQAccObject value]):
360         (-[KWQAccObject accessibilityAttributeValue:]):
361         (-[KWQAccObject doAXLineForTextMarker:]):
362         (-[KWQAccObject doAXTextMarkerRangeForLine:]):
363         (-[KWQAccObject doAXTextMarkerForPosition:]):
364         (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
365         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
366         (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
367         (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
368         * kwq/KWQKHTMLPart.mm:
369         * kwq/WebCoreBridge.mm:
370         (-[WebCoreBridge _visiblePositionForPoint:]):
371
372 05-02-07  Maciej Stachowiak  <mjs@apple.com>
373
374         Reviewed by Ken and John.
375
376         Re-fixed a specific case of the following:
377
378         <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
379
380         Oddly, Cmd-B, Cmd-U, type some text, return, Cmd-U, Cmd-B, type
381         some text, worked fine. But hitting the second Cmd-B before the
382         second Cmd-U still failed to remove underlining. The reason for
383         this is that our code to compute the style of the current position
384         did not work when you had a typing style and were positioned right
385         at a <br> element. For various reasons, this did not show up for
386         bold and italic, since those are handled through the font manager.
387
388         The following change fixes this - for elements that can't have
389         children, we add the dummy span after the element of interest,
390         rather than as a child of it.
391         
392         * khtml/khtml_part.cpp:
393         (KHTMLPart::selectionComputedStyle): 
394
395 2005-02-11  David Harrison  <harrison@apple.com>
396
397         Reviewed by Darin.
398
399         <rdar://problem/3978980> Double Clicking on a line in Mail selected the entire body
400
401         * khtml/editing/visible_units.cpp:
402         (khtml::startOfWord):
403         (khtml::endOfWord):
404         Pay attention to being at the end of a paragraph.
405         
406         (khtml::previousLinePosition):
407         (khtml::nextLinePosition):
408         (khtml::endOfParagraph):
409         Use DOWNSTREAM per recent affinity changes.
410
411 2005-02-11  Richard Williamson   <rjw@apple.com>
412
413         Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
414
415         Re-factored how 'native' wrappers for JS objects are created.  The interpreter now
416         creates these wrappers.  The WebCore subclass of the interpreter now overrides
417         createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
418
419         * WebCore.pbproj/project.pbxproj:
420         * khtml/ecma/kjs_binding.cpp:
421         (ScriptInterpreter::createLanguageInstanceForValue):
422         * khtml/ecma/kjs_binding.h:
423         * kwq/DOMUtility.mm: Added.
424         (KJS::ScriptInterpreter::createObjcInstanceForValue):
425         * kwq/KWQKHTMLPart.mm:
426         (KWQKHTMLPart::getAppletInstanceForView):
427         (getInstanceForView):
428         (KWQKHTMLPart::getEmbedInstanceForView):
429         (KWQKHTMLPart::getObjectInstanceForView):
430
431 2005-02-11  Chris Blumenberg  <cblu@apple.com>
432
433         Fixed: <rdar://problem/3937352> Quote level not maintained when copied and pasted within a Mail message
434
435         Reviewed by harrison.
436
437         * khtml/editing/markup.cpp:
438         (khtml::isMailBlockquote): new 
439         (khtml::createMarkup): retain the Mail quote level by including all ancestor mail block quotes
440         * khtml/rendering/render_block.cpp:
441         (khtml::RenderBlock::positionForCoordinates): default to downstream for the affinity since the affinity is only upstream when the cursor is clicked to the right of a wrapped line
442         * khtml/rendering/render_text.cpp:
443         (RenderText::positionForCoordinates): ditto
444
445 2005-02-11  Adele Amchan  <adele@apple.com>
446
447         Reviewed by Darin.
448
449         fix for <rdar://problem/4004004> no need to add body element for xml documents
450
451         In the fix for <rdar://problem/3758785> we decided to add a body element when closing a document 
452         to ensure that the onload handler would fire.  This is unnecessary for xml documents, 
453         so now we also check to see if we're dealing with an html document before adding the body element.
454
455         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): 
456
457 2005-02-11  Adele Amchan  <adele@apple.com>
458
459         Reviewed by Darin.
460
461         * layout-tests/apple-only/base/www.excite.com/index-expected.txt: updates tests because of custom tag change.
462         * layout-tests/apple-only/base/www.msnbc.com/index-expected.txt:
463         * layout-tests/apple-only/base/www.time.com/index-expected.txt:
464         * layout-tests/apple-only/base/www.travelocity.com/index-expected.txt:
465         * layout-tests/apple-only/base/www.zdnet.com/index-expected.txt:
466         * layout-tests/fast/overflow/003-expected.txt:
467
468         * layout-tests/fast/js/window-object-cross-frame-calls-expected.txt: updated test because of added Body (see rdar://problem/3758785)
469
470 === Safari-186 ===
471
472 2005-02-11  Darin Adler  <darin@apple.com>
473
474         Reviewed by John.
475
476         - fixed <rdar://problem/3915449> paths are relative to the old src URL after document.open, which is supposed to clear the document, including the URL
477
478         * khtml/xml/dom_docimpl.h: Added a new openInternal function for use by KHTMLPart.
479         * khtml/xml/dom_docimpl.cpp:
480         (DocumentImpl::open): Changed to do everything we did before, but also clear the URL and set the
481         base URL based on the enclosing document. This is the basic JavaScript/DOM operation of opening a
482         document, which is supposed to clear the document, including the URL. In the long run we might want
483         to do even more document "resetting and clearing" in here, but this URL clearing is what's needed
484         now to fix the most important problem.
485         (DocumentImpl::openInternal): Moved the old open code in here, except for the "parsing" check, which
486         is unnecessary and inappropriate in the one place we call this.
487
488         * khtml/khtml_part.cpp: (KHTMLPart::begin): Call openInternal instead of open.
489
490 2005-02-10  Ken Kocienda  <kocienda@apple.com>
491
492         Reviewed by Hyatt
493
494         Fix for this bug:
495         
496         <rdar://problem/3992092> 8A374: Mail crash while pasting - RemoveNodeCommand
497
498         * khtml/editing/htmlediting.cpp:
499         (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in 
500         the document. We try to do a good job of detecting all these cases, and generally do. This
501         one was missed. Fixed.
502
503 2005-02-10  Darin Adler  <darin@apple.com>
504
505         Reviewed by Harrison.
506
507         - added support needed to fix <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined
508
509         * kwq/WebCoreBridge.h: Added selectionHasStyle: method.
510         * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part.
511
512 2005-02-10  Darin Adler  <darin@apple.com>
513
514         Reviewed by Harrison.
515
516         - fixed <rdar://problem/3990484> cursor changes to I-beam when moving over text in widgets, even when selection off via CSS
517
518         * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent): Changed code to check canSelect when deciding
519         whether to show an I-beam cursor.
520
521         * khtml/rendering/render_object.h: Added canSelect.
522         * khtml/rendering/render_object.cpp:
523         (selectStartNode): Added. Helper function with the guts of shouldSelect.
524         (RenderObject::canSelect): Added. Like shouldSelect, but does not call the "start selecting" event handler.
525         (RenderObject::shouldSelect): Refactored to use selectStartNode.
526
527         * khtml/css/cssvalues.c: Regnerated with newer gperf.
528
529 2005-02-10  David Hyatt  <hyatt@apple.com>
530
531         Fix for 3867759, .mac regression where scrollers don't show up.  Make sure you can set the .width and
532         .height properties on the Image object.
533         
534         Reviewed by John Sullivan
535
536         * khtml/ecma/kjs_html.cpp:
537         (ImageConstructorImp::construct):
538         (Image::getValueProperty):
539         (Image::putValue):
540         (Image::Image):
541         * khtml/ecma/kjs_html.h:
542
543 2005-02-10  Ken Kocienda  <kocienda@apple.com>
544
545         Reviewed by Chris
546
547         Fix for this bug:
548         
549         <rdar://problem/3965158> Drag-n-drop within a rich text message sometimes changes the color of the dragged text
550         
551         This change fixes the bug....and much more. Now, for the first time, the paste code can do "smart merging"
552         or "smooshing" of styles during its operation. Since this new code is actively, rather than passively
553         working with styles, it fixes the bug, and lays the groundwork for similar work we need to do to
554         preserve quote levels in Mail.
555
556         * khtml/css/css_valueimpl.cpp:
557         (DOM::CSSMutableStyleDeclarationImpl::clear): New method.
558         (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
559         (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): Ditto.
560         (DOM::operator==): Add operator for CSSProperty.
561         * khtml/css/css_valueimpl.h: Declare new functions.
562         * khtml/editing/htmlediting.cpp:
563         (khtml::isEmptyStyleSpan): Improved the test in this function, rolling together the old implementation
564         with some code that did this work inline elsewhere. Sum of the parts is better than either test was by itself.
565         (khtml::isStyleSpan): Check for ID_SPAN.
566         (khtml::ApplyStyleCommand::removeCSSStyle): Call isEmptyStyleSpan. This was the place with an inline implementation before.
567         (khtml::ReplacementFragment::ReplacementFragment): Now takes a DocumentImpl argument. No longer does a "default style"
568         check, but rather calls functions which do a similar check to that, and much more.
569         (khtml::ReplacementFragment::~ReplacementFragment): Deref document, and computed styles.
570         (khtml::ReplacementFragment::styleForNode): New helper. Looks up and returns computed style for a node.
571         (khtml::ReplacementFragment::removeNodePreservingChildren): New helper.
572         (khtml::ReplacementFragment::computeStylesForNodes): New function which computes the "desired" style for
573         every node in the fragment. This information is used later after paste is done as a reference for testing
574         what styles need to be added, and which can be removed as redundant, from all the nodes inserted by the
575         replacement code.
576         (khtml::ReplacementFragment::removeStyleNodes): Clears out all style nodes from the fragment. They are
577         no longer needed after the call to computeStylesForNodes(),
578         (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): Add a document to the call to initialize the
579         command's ReplacementFragment.
580         (khtml::ReplaceSelectionCommand::doApply): Call applyStyleToInsertedNodes() after inserting nodes to make
581         styles come out right.
582         (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): This is the "style smooshing" function. It 
583         computes the styles that need to be added to each node inserted, comparing the style it gets from just
584         being inserted into its correct destination with the computed "desired style" done in the 
585         ReplacementFragment constructor. It then adds in all the necessary styles, and will also remove redundant styles.
586         * khtml/editing/htmlediting.h: Update declarations and member variables as needed.
587         * khtml/editing/markup.cpp:
588         (khtml::startMarkup): Add additional style annotations to the markup we generate, so that paste code can preserve it.
589         (khtml::markup): Ditto.
590         (khtml::createMarkup): Ditto.
591         
592         These test results are subtly better with this change. They no longer have an unneeded empty span.
593         Visually the same as before.
594         
595         * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
596         * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
597         * layout-tests/editing/style/remove-underline-expected.txt
598         * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt
599
600         New tests:
601
602         * layout-tests/editing/style/smoosh-styles-001-expected.txt
603         * layout-tests/editing/style/smoosh-styles-002-expected.txt
604         * layout-tests/editing/style/smoosh-styles-001.html
605         * layout-tests/editing/style/smoosh-styles-002.html
606
607 2005-02-10  Darin Adler  <darin@apple.com>
608
609         Reviewed by Adele.
610
611         - fixed <rdar://problem/3974988> WebHTMLView drops scroll wheel events when deltas are 0
612
613         * kwq/WebCoreScrollView.m: (-[WebCoreScrollView autoforwardsScrollWheelEvents]): Added, for Tiger only.
614         For Tiger, removed the override of scrollWheel:, which doesn't work quite right because of how the
615         delta attributes return all 0 for newfangled scrolling events from the new trackpads.
616
617 2005-02-10  David Harrison  <harrison@apple.com>
618
619         Reviewed by Darin.
620
621         <rdar://problem/3991532> REGRESSION (Mail): Triple-click on trailing blank line should select previous line but doesn't
622
623         * khtml/css/cssvalues.c:
624         (hash_val):
625         (findValue):
626         * khtml/editing/selection.cpp:
627         (khtml::Selection::validate):
628         Do moral equiavalent of LeftWordIfOnBoundary for PARAGRAPH.
629
630 2005-02-10  David Harrison  <harrison@apple.com>
631
632         Reviewed by Darin.
633
634         <rdar://problem/3991848> Double-click on first character selects wrong item
635
636         * khtml/editing/selection.cpp:
637         (khtml::Selection::validate):
638         Honor the fact that clicking on a character positions the cursor on the left side of the character.
639
640 2005-02-10  David Hyatt  <hyatt@apple.com>
641
642         Fix for 3980778, repro crash in RootInlineBox::paint.  Make sure that when merging blocks we dirty them for layout
643         up front. That way as we do the merge, we dont attempt to examine the lines in dirtyLinesForChangedChild.
644         
645         Reviewed by mjs
646
647         * khtml/rendering/render_block.cpp:
648         (khtml::RenderBlock::removeChild):
649
650 2005-02-10  David Hyatt  <hyatt@apple.com>
651
652         Fix for 3987010, fix a bug that caused the self-collapsing-block-cleared-float bit to never get set correctly.
653         
654         Reviewed by mjs
655
656         * khtml/rendering/render_block.h:
657         (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
658
659 2005-02-10  David Hyatt  <hyatt@apple.com>
660
661         Fix  for 3992440, text not wrapping correctly on half moon bay web site.  Refine an incorrect optimization I
662         added to be less restrictive.
663         
664         Reviewed by mjs
665
666         * khtml/rendering/render_block.cpp:
667         (khtml::RenderBlock::layoutBlockChildren):
668
669 2005-02-08  Maciej Stachowiak  <mjs@apple.com>
670
671         Reviewed by Darin.
672
673         <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
674
675         I fixed this by removing all event listeners for a document, it's
676         children, and any disconnected nodes that used to be in the
677         document at document detach time. Mozilla temporarily disables
678         event listeners on such nodes, but re-enables them if you
679         re-parant a node into a new document. However, in WebCore, you
680         can't re-parent a node into another document, so there is no
681         observable change in behavior.
682
683         We have to do this to break the possible reference cycles between
684         event listeners and the dom nodes they are attached to (e.g. via
685         scope chain, as in this case).
686
687         * khtml/xml/dom_docimpl.cpp:
688         (DocumentImpl::detach):
689         (DocumentImpl::removeAllEventListenersFromAllNodesx):
690         (DocumentImpl::registerDisconnectedNodeWithEventListeners):
691         (DocumentImpl::unregisterDisconnectedNodeWithEventListeners):
692         (DocumentImpl::removeAllDisconnectedNodeEventListeners):
693         * khtml/xml/dom_docimpl.h:
694         * khtml/xml/dom_nodeimpl.cpp:
695         (NodeImpl::~NodeImpl):
696         (NodeImpl::addEventListener):
697         (NodeImpl::removeEventListener):
698         (NodeImpl::removeAllEventListeners):
699         (NodeImpl::removeHTMLEventListener):
700         (NodeImpl::insertedIntoDocument):
701         (NodeImpl::removedFromDocument):
702         * khtml/xml/dom_nodeimpl.h:
703
704 2005-02-09  Chris Blumenberg  <cblu@apple.com>
705
706         Fixed: <rdar://problem/3999213> Sometimes 2 Windows Media Player plugin instances are loaded
707
708         Reviewed by hyatt.
709
710         * khtml/html/html_objectimpl.cpp:
711         (HTMLObjectElementImpl::attach): Set needWidgetUpdate to false before calling updateWidget because updateWidget may cause this method or another method (which also calls updateWidget) to be called.
712         (HTMLObjectElementImpl::recalcStyle): ditto
713
714 2005-02-09  David Harrison  <harrison@apple.com>
715
716         Reviewed by Darin.
717         
718         <rdar://problem/3937447> Mail-689: Arrow key navigation in new message body stops working when a line ends with a bold word
719         
720         Added affinity to VisiblePosition.  Changed Selection code to use affinity more.
721         
722         (Partial) <rdar://problem/3982096> editing/pasteboard/paste-text-007 is failing
723         
724         Changed ReplaceSelectionCommand to also pay attention to the top children of the incoming fragment, not just the very last node inserted, when deciding whether to insert a paragraph for the Apple interchange newline.
725
726         * khtml/ecma/kjs_window.cpp:
727         (SelectionFunc::tryCall):
728         * khtml/editing/htmlediting.cpp:
729         (khtml::EditCommandPtr::setStartingSelection):
730         (khtml::EditCommandPtr::setEndingSelection):
731         (khtml::EditCommand::setStartingSelection):
732         (khtml::EditCommand::setEndingSelection):
733         (khtml::CompositeEditCommand::deleteInsignificantTextDownstream):
734         (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
735         (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
736         (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
737         (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
738         (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
739         (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
740         (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
741         (khtml::ApplyStyleCommand::joinChildTextNodes):
742         (khtml::DeleteSelectionCommand::initializePositionData):
743         (khtml::DeleteSelectionCommand::handleGeneralDelete):
744         (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
745         (khtml::DeleteSelectionCommand::doApply):
746         (khtml::InsertLineBreakCommand::doApply):
747         (khtml::InsertParagraphSeparatorCommand::doApply):
748         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
749         (khtml::InsertTextCommand::input):
750         (khtml::MoveSelectionCommand::doApply):
751         (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
752         (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
753         (khtml::ReplaceSelectionCommand::doApply):
754         (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
755         (khtml::ReplaceSelectionCommand::updateNodesInserted):
756         (khtml::TypingCommand::deleteKeyPressed):
757         (khtml::TypingCommand::forwardDeleteKeyPressed):
758         (khtml::TypingCommand::markMisspellingsAfterTyping):
759         * khtml/editing/htmlediting.h:
760         * khtml/editing/selection.cpp:
761         (khtml::Selection::Selection):
762         (khtml::Selection::init):
763         (khtml::Selection::moveTo):
764         (khtml::Selection::modifyExtendingRightForward):
765         (khtml::Selection::modifyMovingRightForward):
766         (khtml::Selection::modifyExtendingLeftBackward):
767         (khtml::Selection::modifyMovingLeftBackward):
768         (khtml::Selection::modify):
769         (khtml::Selection::xPosForVerticalArrowNavigation):
770         (khtml::Selection::clear):
771         (khtml::Selection::setBase):
772         (khtml::Selection::setExtent):
773         (khtml::Selection::setBaseAndExtent):
774         (khtml::Selection::layout):
775         (khtml::Selection::validate):
776         * khtml/editing/selection.h:
777         (khtml::Selection::startAffinity):
778         (khtml::Selection::endAffinity):
779         (khtml::Selection::baseAffinity):
780         (khtml::Selection::extentAffinity):
781         (khtml::operator==):
782         * khtml/editing/text_affinity.h:
783         (khtml::):
784         * khtml/editing/visible_position.cpp:
785         (khtml::VisiblePosition::VisiblePosition):
786         (khtml::VisiblePosition::init):
787         (khtml::VisiblePosition::initUpstream):
788         (khtml::VisiblePosition::initDownstream):
789         (khtml::VisiblePosition::next):
790         (khtml::VisiblePosition::previous):
791         (khtml::startVisiblePosition):
792         (khtml::endVisiblePosition):
793         * khtml/editing/visible_position.h:
794         (khtml::VisiblePosition::):
795         (khtml::VisiblePosition::VisiblePosition):
796         (khtml::VisiblePosition::affinity):
797         (khtml::VisiblePosition::setAffinity):
798         (khtml::operator==):
799         * khtml/editing/visible_units.cpp:
800         (khtml::previousBoundary):
801         (khtml::nextBoundary):
802         (khtml::startOfLine):
803         (khtml::endOfLine):
804         (khtml::previousLinePosition):
805         (khtml::nextLinePosition):
806         (khtml::startOfParagraph):
807         (khtml::endOfParagraph):
808         (khtml::previousParagraphPosition):
809         (khtml::nextParagraphPosition):
810         (khtml::startOfBlock):
811         (khtml::endOfBlock):
812         (khtml::startOfDocument):
813         (khtml::endOfDocument):
814         * khtml/editing/visible_units.h:
815         * khtml/khtml_part.cpp:
816         (KHTMLPart::findTextNext):
817         (KHTMLPart::selectClosestWordFromMouseEvent):
818         (KHTMLPart::handleMousePressEventTripleClick):
819         (KHTMLPart::handleMousePressEventSingleClick):
820         (KHTMLPart::handleMouseMoveEventSelection):
821         (KHTMLPart::khtmlMouseReleaseEvent):
822         (KHTMLPart::selectAll):
823         (KHTMLPart::computeAndSetTypingStyle):
824         (KHTMLPart::selectionComputedStyle):
825         * khtml/rendering/render_br.cpp:
826         (RenderBR::positionForCoordinates):
827         * khtml/xml/dom_docimpl.cpp:
828         (DocumentImpl::updateSelection):
829         * khtml/xml/dom_nodeimpl.cpp:
830         (NodeBaseImpl::setFocus):
831         * khtml/xml/dom_position.cpp:
832         (DOM::Position::previousCharacterPosition):
833         (DOM::Position::nextCharacterPosition):
834         * khtml/xml/dom_position.h:
835         * kwq/KWQAccObject.mm:
836         (-[KWQAccObject value]):
837         (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
838         (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
839         (-[KWQAccObject accessibilityAttributeValue:]):
840         (-[KWQAccObject doAXLineForTextMarker:]):
841         (-[KWQAccObject doAXTextMarkerRangeForLine:]):
842         (-[KWQAccObject doAXTextMarkerForPosition:]):
843         (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
844         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
845         (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
846         (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
847         (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
848         (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
849         (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
850         * kwq/KWQAccObjectCache.mm:
851         (KWQAccObjectCache::textMarkerForVisiblePosition):
852         (KWQAccObjectCache::visiblePositionForTextMarker):
853         * kwq/KWQKHTMLPart.mm:
854         (KWQKHTMLPart::findString):
855         (KWQKHTMLPart::advanceToNextMisspelling):
856         (KWQKHTMLPart::styleForSelectionStart):
857         (KWQKHTMLPart::baseWritingDirectionForSelectionStart):
858         (KWQKHTMLPart::setSelectionFromNone):
859         (KWQKHTMLPart::respondToChangedSelection):
860         * kwq/WebCoreBridge.mm:
861         (-[WebCoreBridge setSelectedDOMRange:affinity:]):
862         (-[WebCoreBridge selectionAffinity]):
863         (-[WebCoreBridge setMarkDOMRange:]):
864         (-[WebCoreBridge _visiblePositionForPoint:]):
865         (-[WebCoreBridge moveDragCaretToPoint:]):
866         (-[WebCoreBridge editableDOMRangeForPoint:]):
867         (-[WebCoreBridge ensureSelectionVisible]):
868         (-[WebCoreBridge rangeOfCharactersAroundCaret]):
869
870 2005-02-09  Chris Blumenberg  <cblu@apple.com>
871
872         Fixed: <rdar://problem/3985211> Seed: Mail: Drag-and-drop destination indicator / insertion point disappears
873
874         Reviewed by kocienda.
875
876         * khtml/rendering/render_block.cpp:
877         (khtml::RenderBlock::paintCaret): new
878         (khtml::RenderBlock::paintObject): call paintCaret for the cursor caret and the drag caret
879         * khtml/rendering/render_block.h:
880
881 === Safari-185 ===
882
883 2005-02-08  Ken Kocienda  <kocienda@apple.com>
884
885         Reviewed by John
886
887         Fix for this bug:
888         
889         <rdar://problem/3996344> Entire document content is deleted when only the first paragraph was supposed to be
890
891         Problem stems from my attempt to fix this bug: <rdar://problem/3986155> Insertion point goes 
892         to beginning of doc after deleting.
893         
894         I added an "optimization" that proved to do more harm than good. So, basically, the fix is to remove code.
895
896         * khtml/editing/htmlediting.cpp:
897         (khtml::DeleteSelectionCommand::handleGeneralDelete)
898
899 2005-02-07  Darin Adler  <darin@apple.com>
900
901         Reviewed by Kevin.
902
903         - fixed <rdar://problem/3890352> REGRESSION (125-170, Panther-only): pasted textarea contents disappear (exception in NSText)
904
905         * kwq/KWQTextArea.mm: (-[KWQTextArea tile]): Don't resize the text view immediately here.
906         Use performWithDelay to defer it to avoid the re-entrancy that bothers the Panther version
907         of NSTextView. On Tiger, leave the code alone.
908
909 2005-02-07  Adele Amchan  <adele@apple.com>
910
911         Reviewed by Darin.
912
913         Fix for <rdar://problem/3993628> REGRESSION (180-181): Logitelnet bank's website doesn't work
914
915         This fixes an oversight in the fix for <rdar://problem/3964286>.  
916         We're now making sure there is a document before calling checkCompleted in slotLoaderRequestDone.
917         That function is called even when other parts finish loads of their subresources, so we could end
918         up calling checkCompleted before we had a document. We also looked over all the other calls to
919         checkCompleted to convince ourselves no other call sites had a similar issue.
920
921         * khtml/khtml_part.cpp: (KHTMLPart::slotLoaderRequestDone): Check if doc is nil before calling
922         checkCompleted.
923
924 2005-02-07  Ken Kocienda  <kocienda@apple.com>
925
926         Reviewed by Darin
927
928         Fix for this bug:
929         
930         <rdar://problem/3953302> Replacing quoted text ends up with blue-colored text that is not quoted
931
932         * khtml/editing/htmlediting.cpp:
933         (khtml::DeleteSelectionCommand::doApply): Removed special case delete code for select all. It was
934         causing as many bugs as it fixed. What's more, the design concept is a bit shaky. By removing
935         this special case, the bug goes away.
936         * khtml/editing/htmlediting.h: Remove declaration.
937         
938         Test results using selectAll() updated to reflect changed behavior.
939         
940         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
941         * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
942         * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
943         * layout-tests/editing/inserting/insert-3654864-fix-expected.txt:
944         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
945         * layout-tests/editing/inserting/insert-3851164-fix-expected.txt:
946         * layout-tests/editing/inserting/insert-3907422-fix-expected.txt:
947         * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
948
949 2005-02-06  Darin Adler  <darin@apple.com>
950
951         Reviewed by Ken.
952
953         - fixed <rdar://problem/3994164> setting a new style attribute with setAttribute("style") doesn't blow away the old style
954
955         * khtml/css/css_valueimpl.h: Renamed parseProperty to parseDeclaration, since it's used to parse
956         an entire style declaration, not a single property.
957         * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::parseDeclaration): Renamed,
958         and added code to clear m_values.
959         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Call function by its
960         new name, and remove some unnecessary comments.
961
962 2005-02-06  Darin Adler  <darin@apple.com>
963
964         Reviewed by Maciej.
965
966         - fixed <rdar://problem/3993722> need oncut and onpaste handlers implemented for <textarea> (needed for widgets)
967
968         * kwq/KWQTextArea.mm:
969         (-[KWQTextAreaTextView dispatchHTMLEvent:]): Added.
970         (-[KWQTextAreaTextView cut:]): Dispatch "before cut" and "cut" events.
971         (-[KWQTextAreaTextView copy:]): Dispatch "before copy" and "copy" events.
972         (-[KWQTextAreaTextView paste:]): Dispatch "before paste" and "paste" events.
973         (-[KWQTextAreaTextView pasteAsPlainText:]): Ditto.
974         (-[KWQTextAreaTextView pasteAsRichText:]): Ditto.
975
976 2005-02-06  Darin Adler  <darin@apple.com>
977
978         Reviewed by Maciej.
979
980         - fixed <rdar://problem/3943038> <input type=search> that is focused in onload handler doesn't have a visible editor
981
982         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setFocusNode): Always update layout before giving focus to a widget.
983         This prevents the bad case where we give a widget focus before it has been positioned or sized, causing us to
984         exercise edge cases AppKit doesn't handle well.
985
986         * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Remove workaround code I added
987         to fix bug 3943049. Updating the layout fixes the same problem in a cleaner, safer way, and solves another problem,
988         with the way the clip view is set up.
989
990 2005-02-06  Darin Adler  <darin@apple.com>
991
992         Reviewed by Maciej.
993
994         - fixed <rdar://problem/3425232> textarea won't trigger onchange action when clicking to new field
995
996         * khtml/rendering/render_form.h: Added new m_dirty data member.
997         * khtml/rendering/render_form.cpp:
998         (RenderTextArea::RenderTextArea): Initialize m_dirty to false.
999         (RenderTextArea::detach): Call value() on the DOM element to cause it to fetch the value from this object.
1000         (RenderTextArea::handleFocusOut): Ditto. Also send the onchange event based only on the m_dirty flag.
1001         (RenderTextArea::updateFromElement): Clear the m_dirty flag if the edited value is blown away by a value
1002         that comes from the DOM element. Remove code to clear the element's m_dirtyvalue flag; that's an unnecessary
1003         optimization, and ideally we'll stop having code in the render object that knows about that flag later.
1004         (RenderTextArea::slotTextChanged): Set the m_dirty flag.
1005
1006 2005-02-06  Darin Adler  <darin@apple.com>
1007
1008         Reviewed by Maciej.
1009
1010         - re-fixed <rdar://problem/3760910> please add support for custom tag names in HTML
1011
1012         * khtml/xml/dom_docimpl.cpp:
1013         (DocumentImpl::tagId): Use ID_LAST_TAG + 1 for the ID of the first assigned tag ID. Before we'd use ID_LAST_TAG,
1014         which resulted in the same number being used for ID_COMMENT and the first custom tag.
1015         (DocumentImpl::tagName): Use ID_LAST_TAG + 1, as above.
1016         (DocumentImpl::namespaceURI): Change a < ID_LAST_TAG to <= ID_LAST_TAG in the same spirit as above.
1017
1018 2005-02-06  Darin Adler  <darin@apple.com>
1019
1020         Reviewed by Maciej.
1021
1022         - fixed <rdar://problem/3986639> Crash occurs after choosing Undo Typing from the Edit menu
1023
1024         * kwq/KWQTextArea.mm: (-[KWQTextArea viewWillMoveToWindow:]): Remove actions from undo manager when the view is
1025         removed from the window. Unfortunately, to do this the code has to know that the target of NSTextView actions
1026         will be the text storage object, but given the NSText architecture, that's pretty clear.
1027
1028 2005-02-05  Chris Blumenberg  <cblu@apple.com>
1029
1030         Fixed: <rdar://problem/3991974> REGRESSION: www.jabra.com world location screen does not work
1031
1032         Reviewed by hyatt.
1033
1034         * kwq/KWQKJavaAppletWidget.mm:
1035         (KJavaAppletWidget::KJavaAppletWidget): fallback to the document's base URL if there is no baseURL attribute
1036         * kwq/WebCoreBridge.h:
1037         * kwq/WebCoreBridge.mm:
1038         (-[WebCoreBridge baseURL]): new
1039
1040 2005-02-04  David Harrison  <harrison@apple.com>
1041
1042         Reviewed by Darin.
1043
1044         Rolled out Ken's accidental checkin when committing <rdar://problem/3986155> fix yesterday.
1045         
1046         * khtml/editing/selection.cpp:
1047         (khtml::Selection::validate):
1048
1049 2005-02-04  Adele Amchan  <adele@apple.com>
1050
1051         Reviewed by Darin.
1052
1053         Fix for <rdar://problem/3758785> Safari no longer works at BankOfAmerica online banking for military users
1054   
1055         When closing the document, if a body doesn't exist we now create one.  This bug was preventing the onload handler from
1056         firing in cases where there wasn't a body.  In the BankOfAmerica case, the page was just a bit of script where the onload
1057         handler redirected to the correct page.
1058
1059         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
1060
1061 2005-02-03  Ken Kocienda  <kocienda@apple.com>
1062
1063         Reviewed by Chris
1064
1065         Fix for this bug:
1066         
1067         <rdar://problem/3986155> Insertion point goes to beginning of doc after deleting
1068
1069         * khtml/editing/htmlediting.cpp:
1070         (khtml::DeleteSelectionCommand::setStartNode): New convenience to handle reference counting when setting.
1071         (khtml::DeleteSelectionCommand::handleGeneralDelete): This contains the crux of the bug fix. Improve tests
1072         that detect when a selected node needs to be retained, rather than deleted, to preserve the intent of the user.
1073         This has the side effect of causing the insertion point placement code to succeed rather than fail. Before
1074         this fix, the failure of the insertion point placement code caused the insertion point to jump to the start
1075         of the document, which is the symptom that can be perceived by users when editing.
1076         * khtml/editing/htmlediting.h: Add setStartNode declaration.
1077         * khtml/editing/visible_units.cpp:
1078         (khtml::startOfBlock): This function had a stubbed-in non-tested implementation. Implement and 
1079         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001-expected.txt: Added.
1080         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001.html: Added.
1081         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt: Added.
1082         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002.html: Added.
1083         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt: Added.
1084         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003.html: Added.
1085         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt: Added.
1086         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004.html: Added.
1087         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005-expected.txt: Added.
1088         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005.html: Added.
1089         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006-expected.txt: Added.
1090         * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006.html: Added.
1091
1092 === Safari-183 ===
1093
1094 2005-02-03  Richard Williamson   <rjw@apple.com>
1095
1096         Fixed <rdar://problem/3987419> Stocks and Weather leak what appears to XMLHTTPRequest results
1097
1098         XMLHTTPRequests were causing massive leaks.  _webcore_initWithHeaderString: did funky things with
1099         self replacement.  Re-wrote to use more traditional factory constructor avoiding self replacement.
1100         
1101         Reviewed by David Harrison.
1102
1103         * kwq/KWQLoader.mm:
1104         (+[NSDictionary _webcore_dictionaryWithHeaderString:]):
1105         (KWQServeRequest):
1106         (KWQServeSynchronousRequest):
1107
1108 2005-02-03  Chris Blumenberg  <cblu@apple.com>
1109
1110         Fixed: <rdar://problem/3938763> Cannot view Windows Media Player videos (soundtrack is played twice with delay)
1111
1112         Reviewed by hyatt.
1113
1114         * khtml/html/html_objectimpl.cpp:
1115         (HTMLObjectElementImpl::attach): set needWidgetUpdate to false right after calling updateWidget because dispatchHTMLEvent can end up calling this method again
1116         (HTMLObjectElementImpl::recalcStyle): ditto
1117
1118 2005-02-02  John Sullivan  <sullivan@apple.com>
1119
1120         Reviewed by Chris.
1121
1122         - WebCore part of fix for <rdar://problem/3980651> REGRESSION (125-180): Huge number of pages printed from certain page, 
1123         iFrame involved
1124         
1125         This also fixes the problems with printing from GMail, yay!
1126
1127         * khtml/rendering/render_flow.cpp:
1128         (RenderFlow::paintLines):
1129         If the current line is taller than the entire page height (e.g. tall iFrame), don't try
1130         to avoid splitting it across pages.
1131         
1132         * kwq/WebCoreBridge.mm:
1133         (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
1134         Handle error cases in a more obvious manner; this will cause future problems like this
1135         to print a blank page and complain to the console on debug builds, rather than print a 
1136         zillionty mostly-blank pages.
1137
1138 2005-02-02  Chris Blumenberg  <cblu@apple.com>
1139
1140         Fixed: <rdar://problem/3960304> can't load a particular applet (at www.escape.de) unless it's the first applet to be loaded
1141
1142         Reviewed by hyatt.
1143
1144         * khtml/rendering/render_frames.cpp:
1145         (RenderPartObject::updateWidget): when getting the MIME type from the PARAM tag, make sure the MIME type is the text from the left of the semi-colon if there is one. We do this elsewhere as well.
1146
1147 2005-02-02  Chris Blumenberg  <cblu@apple.com>
1148
1149         Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)
1150
1151         Reviewed by rjw.
1152
1153         * kwq/KWQKHTMLPart.mm:
1154         (KWQKHTMLPart::sendContextMenuEvent): check if SPI to always enable selecting closest word is enabled
1155         * kwq/WebCoreBridge.h:
1156
1157 2005-02-02  Ken Kocienda  <kocienda@apple.com>
1158
1159         Reviewed by me
1160
1161         * khtml/editing/markup.cpp:
1162         (khtml::createMarkup): Removed debug spam I committed earlier in error.
1163
1164 2005-02-02  Ken Kocienda  <kocienda@apple.com>
1165
1166         Reviewed by Darin
1167
1168         Fix for this bug:
1169         
1170         <rdar://problem/3823109> WebKit should support -toggleBaseWritingDirection: (bidi editing support)
1171
1172         Since base writing direction is a paragraph-level property in AppKit, and we use the CSS direction
1173         property in WebCore, which can be applied to inline elements as well as blocks, a new notion has
1174         been added to the WebCore apply style logic. It is now possible to force all properties in a 
1175         style declaration to be applied as though they were block properties.
1176
1177         * khtml/editing/htmlediting.cpp:
1178         (khtml::ApplyStyleCommand::ApplyStyleCommand): Add an enum and a flag to this command that controls whether to force all
1179         properties in the style to be applied as block styles. Default is "no", retaining previous behavior.
1180         (khtml::ApplyStyleCommand::doApply): Switch on new flag to apply styles as before, or force all preoperties to be applied
1181         as block styles.
1182         * khtml/editing/htmlediting.h:
1183         (khtml::ApplyStyleCommand::): Add an enum and a flag, as above.
1184         * khtml/khtml_part.cpp:
1185         (KHTMLPart::applyParagraphStyle): New method to force application of all style properties as block styles.
1186         * khtml/khtml_part.h: Update header declarations.
1187         * kwq/KWQKHTMLPart.h: Update header declarations.
1188         * kwq/KWQKHTMLPart.mm:
1189         (KWQKHTMLPart::baseWritingDirectionForSelectionStart): Accessor to help WebKit do a toggle operation on 
1190         writing direction.
1191         * kwq/WebCoreBridge.h: Update header declarations.
1192         * kwq/WebCoreBridge.mm:
1193         (-[WebCoreBridge applyParagraphStyle:withUndoAction:]): New method to force application of all style properties as block styles.
1194         (-[WebCoreBridge baseWritingDirectionForSelectionStart]): Accessor to help WebKit do a toggle operation on 
1195         writing direction.
1196
1197         Fix for this bug:
1198         
1199         <rdar://problem/3985035> REGRESSION (Mail): Text copied from wrapped line contains extra character when pasted
1200
1201         * khtml/editing/markup.cpp:
1202         (khtml::renderedText): Add an enum and a flag to this command that controls whether to force all
1203         This is the result of an error in the code that computes the rendered text that is selected 
1204         when copying. Since spaces collapse at the end of lines, and these spaces need to be copied 
1205         when the selection spans line endings, code runs to compute this text. However, this code 
1206         was also running incorrectly in cases where lines wrapped. I have now added the missing 
1207         test to check that the selection does indeed extend to the end of the line.
1208
1209
1210 2005-02-02  Ken Kocienda  <kocienda@apple.com>
1211
1212         Reviewed by Darin
1213
1214         Fix for these bugs:
1215         
1216         <rdar://problem/3984894> REGRESSION (Mail): Command-right-arrow in reply does the wrong thing (two ways)
1217         <rdar://problem/3985130> REGRESSION (Mail): command-right-arrow in pasted RTF selects only up to tab
1218
1219         * khtml/editing/visible_units.cpp:
1220         (khtml::endOfLine): Two separate problems in this new function recently added to take the place of
1221         selectionForLine. In the first, endOfLine did not stop at BR elements, and returned the position
1222         beyond them. In the second, the VisiblePosition constructor gives the wrong answer in certain cases.
1223         Darin is going to work on a solution for that problem. In the meantime, I can fix the symptom of this
1224         bug by going down to the last leaf child of the root line box; a one line change we will roll out when
1225         Darin's fix is in.
1226
1227 2005-02-01  Richard Williamson   <rjw@apple.com>
1228
1229         Fixed <rdar://problem/3985535> QT Plug-in JavaScript support now fails in <embed> tag only case
1230
1231         Reviewed by Maciej.
1232
1233         * khtml/ecma/kjs_html.cpp:
1234         (KJS::HTMLDocument::tryGet):
1235
1236 2005-02-01  John Sullivan  <sullivan@apple.com>
1237
1238         Written by Darin, reviewed and tested by me
1239         
1240         - fixed <rdar://problem/3969684> Panther-only: extra blank lines between 
1241         pasted content from Blot
1242
1243         * kwq/KWQKHTMLPart.mm:
1244         (KWQKHTMLPart::attributedString):
1245         don't emit paragraph breaks if the margins are tiny; matches what
1246         we do for plain-text conversion
1247
1248 === Safari-182 ===
1249
1250 2005-02-01  Ken Kocienda  <kocienda@apple.com>
1251
1252         Reviewed by John
1253
1254         Fix for this bug:
1255         
1256         <rdar://problem/3985160> Deficiencies in pasting architecture blocking progress on other bugs
1257
1258         * khtml/editing/html_interchange.h: Move style span text used to mark element added to 
1259         add style to this header.
1260         * khtml/editing/htmlediting.cpp:
1261         (khtml::styleSpanClassString): Change to use constant moved to html_interchange.h.
1262         (khtml::isStyleSpan): New helper function. Checks if this is a span we added to apply style.
1263         (khtml::CompositeEditCommand::insertNodeBefore): Added an assert to check that the node
1264         we are inserting before is not the body.
1265         (khtml::CompositeEditCommand::insertNodeAfter): Ditto, but check is for after.
1266         (khtml::ReplacementFragment::ReplacementFragment): Added code to process the "default style"
1267         that is added by the copy code.
1268         (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): first and last nodes inserted are
1269         now member variables instead of function locals. Initialize them here.
1270         (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): Deref first and last nodes inserted
1271         if necessary.
1272         (khtml::ReplaceSelectionCommand::doApply): Change design to fix the bug. Major change is to
1273         separate out the code that inserts nodes into the tree so additional styling checks can
1274         be done in a centralized way. Also got rid of the notion of "merging into the end block." That
1275         concept was just wrong.
1276         (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Tweak interface now that first and 
1277         last nodes inserted are member variables.
1278         (khtml::ReplaceSelectionCommand::insertNodeAfterAndUpdateNodesInserted): New helper used
1279         by replace code to do the stated DOM operation and update state internal to the command.
1280         This will also be a catch point to handle the kinds of additional style checks needed to
1281         make paste work right.
1282         (khtml::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted): Ditto.
1283         (khtml::ReplaceSelectionCommand::insertNodeBeforeAndUpdateNodesInserted): Ditto.
1284         (khtml::ReplaceSelectionCommand::updateNodesInserted): Ditto.
1285         * khtml/editing/htmlediting.h: Update declarations as needed.
1286         * khtml/editing/markup.cpp:
1287         (khtml::createMarkup): Adds a "default style" span to the content written to the pasteboard.
1288         This will help us to fix some of the bugs blocked by the bug above.
1289         * khtml/xml/dom_nodeimpl.cpp:
1290         (NodeImpl::lastDescendent): New helper.
1291         * khtml/xml/dom_nodeimpl.h: Ditto.
1292         * khtml/xml/dom_position.cpp:
1293         (DOM::Position::upstream): Fixed a bug which would allow the upstream position returned to be
1294         in unrendered content.
1295         (DOM::Position::downstream): Ditto.
1296
1297         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Ending positions tweaked due to 
1298         changes in upstream() and downstream() functions.
1299         * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Ditto
1300         * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Ditto
1301         * layout-tests/editing/selection/extend-by-character-006-expected.txt: Ditto
1302
1303         * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Changed what we expect, given
1304         new behavior of paste code.
1305
1306 2005-01-31  John Sullivan  <sullivan@apple.com>
1307
1308         Reviewed by Dave Hyatt.
1309         
1310         - fixed <rdar://problem/3983097> Tabbing on RSS pages gets stuck in search field 
1311         with "full keyboard navigation" off
1312
1313         * kwq/KWQSlider.h:
1314         * kwq/KWQSlider.mm:
1315         (QSlider::focusPolicy):
1316         Implemented this method for KWQSlider. It is needed for our widget subclasses that
1317         can become focused in some situations. I missed this when fixing 3949203 because
1318         it only comes into play when tab-to-controls is on, and because the other relevant
1319         methods are objective-C methods.
1320
1321 2005-01-31  David Harrison  <harrison@apple.com>
1322
1323         Reviewed by Darin.
1324
1325         <rdar://problem/3964164> AXWebArea needs to unregister on going invisible
1326
1327         * khtml/xml/dom_docimpl.cpp:
1328         (DocumentImpl::detach):
1329         Detach the AX UIElement for the AXWebArea.
1330
1331 2005-01-31  David Harrison  <harrison@apple.com>
1332
1333         Reviewed by Darin
1334
1335         <rdar://problem/3850876> AX: button exposed as only an AXImage at http://appleseed.apple.com/ site (<input type=image>)
1336
1337         * khtml/rendering/render_form.h:
1338         (khtml::RenderImageButton::isImageButton):
1339         New.
1340         * khtml/rendering/render_image.h:
1341         (khtml::RenderImage::isImageButton):
1342         New.
1343         * kwq/KWQAccObject.mm:
1344         (-[KWQAccObject isImageButton]):
1345         (-[KWQAccObject actionElement]):
1346         (-[KWQAccObject role]):
1347         (-[KWQAccObject accessibilityActionNames]):
1348         (-[KWQAccObject accessibilityPerformAction:]):
1349         Represent RenderImageButton elements as buttons instead of images.
1350
1351 2005-01-31  David Harrison  <harrison@apple.com>
1352
1353         Prevent nil dereference in debug code.
1354
1355         * khtml/xml/dom_nodeimpl.cpp:
1356         (NodeImpl::displayTree):
1357         Stop when parent is 0, too.
1358
1359 2005-01-31  John Sullivan  <sullivan@apple.com>
1360
1361         Reviewed by Dave Hyatt.
1362         
1363         - fixed <rdar://problem/3949203> cannot tab to, within, or out of the RSS sidebar
1364
1365         * kwq/KWQSlider.mm:
1366         (-[KWQSlider becomeFirstResponder]):
1367         (-[KWQSlider resignFirstResponder]):
1368         (-[KWQSlider nextKeyView]):
1369         (-[KWQSlider previousKeyView]):
1370         (-[KWQSlider canBecomeKeyView]):
1371         (-[KWQSlider nextValidKeyView]):
1372         (-[KWQSlider previousValidKeyView]):
1373         Copied these methods from KWQButton. The lack of special handling for first-responder-ness
1374         here was causing the focus to get "stuck" on the RSS page's slider widget. Added FIXME
1375         about how it would be nice to share more of this code rather than replicating it in each
1376         KWQ widget subclass.
1377
1378 2005-01-31  Darin Adler  <darin@apple.com>
1379
1380         Reviewed by Harrison.
1381
1382         - fixed <rdar://problem/3980066> Double-click on single character moves insertion point to previous line
1383
1384         * khtml/khtml_part.cpp:
1385         (KHTMLPart::selectClosestWordFromMouseEvent): Set affinity too.
1386         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1387         (KHTMLPart::handleMouseMoveEventSelection): Ditto.
1388         (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
1389
1390         * khtml/editing/selection.cpp:
1391         (khtml::Selection::modifyExtendingRightForward): Use endOfLine and endOfDocument.
1392         (khtml::Selection::modifyMovingRightForward): Ditto.
1393         (khtml::Selection::modifyExtendingLeftBackward): Use startOfLine and startOfDocument.
1394         (khtml::Selection::modifyMovingLeftBackward): Ditto.
1395         (khtml::Selection::validate): Rewrote the section that handles double-click. Two main fixes: 1) use isStartOfLine to
1396         check for another case where we want to select the word to the right, and 2) use isEndOfParagraph, which seems
1397         to work correctly in cases where isLastVisiblePositionInParagraph is giving the wrong answer. Also changed the line
1398         code to use startOfLine/endOfLine and the document code to use startOfDocument/endOfDocument.
1399
1400 2005-01-31  Darin Adler  <darin@apple.com>
1401
1402         Reviewed by Harrison.
1403
1404         - fixed <rdar://problem/3935275> unexpected quit scrolling over link; last.fm (works in IE and Firefox)
1405
1406         * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): By using the correct document, fix the crash reported here.
1407         The page still crashes when you close the browser window, but it's not trivial to fix so I'll file a new bug after that.
1408
1409 2005-01-31  Darin Adler  <darin@apple.com>
1410
1411         Reviewed by Ken and Harrison.
1412
1413         - fixed <rdar://problem/3947901> REGRESSION (Mail): Pasting paragraph of rich text leaves insertion point before pasted text
1414         - fixed <rdar://problem/3949790> hitting return after underlined line results in too much or too little underlined
1415         - fixed <rdar://problem/3981759> nil-deref and crash when pasting just a paragraph break
1416         - fixed a couple problems I discovered while working with bug 3949790
1417
1418         * khtml/editing/htmlediting.cpp:
1419         (khtml::ApplyStyleCommand::applyInlineStyle): Pass StayInBlock to upstream. Without this, we end up going too far
1420         upstream in the test case in bug 3949790.
1421         (khtml::ApplyStyleCommand::removeInlineStyle): Pass StayInBlock to upstream and downstream. Same reason as above.
1422         (khtml::ReplaceSelectionCommand::doApply): Update endPos if inserting a new node and endPos is using that node's
1423         parent and an offset past the node being inserted. That change fixes a problem with the position of the insertion point
1424         after pasting into the top level of a document (from test cases in 3947901 and 3949790). When setting insertionPos, use
1425         code that works when lastNodeInserted is a block rather than a text node. That change fixes a problem where a newline is
1426         not added when pasting an entire paragraph into the end of a document (from test case in 3949790). Added nil check before
1427         checking if lastNodeInserted is a <br> element, which fixes the crash when pasting just a paragraph break.
1428
1429         * khtml/editing/visible_units.h: Filled out the set of calls to add some boolean checks for lines (needed for the
1430         bug fix), and calls for blocks (not yet implemented), and documents. The document checks may need refinement to
1431         properly handle documents with a mix of editable and non-editable content, but for now they just refactor code
1432         and make things a little clearer. Also removed the "include line break" parameter from endOfSentence.
1433         * khtml/editing/visible_units.cpp:
1434         (khtml::rootBoxForLine): Added.
1435         (khtml::startOfLine): Added. Algorithm taken from selectionForLine in selection.cpp.
1436         (khtml::endOfLine): Ditto.
1437         (khtml::inSameLine): Added.
1438         (khtml::isStartOfLine): Added.
1439         (khtml::isEndOfLine): Added.
1440         (khtml::endOfSentence): Removed "include line break" parameter.
1441         (khtml::inSameParagraph): Added a null check.
1442         (khtml::isStartOfParagraph): Ditto.
1443         (khtml::isEndOfParagraph): Ditto.
1444         (khtml::startOfBlock): Added.
1445         (khtml::endOfBlock): Added.
1446         (khtml::inSameBlock): Added.
1447         (khtml::isStartOfBlock): Added.
1448         (khtml::isEndOfBlock): Added.
1449         (khtml::startOfDocument): Added.
1450         (khtml::endOfDocument): Added.
1451         (khtml::inSameDocument): Added.
1452         (khtml::isStartOfDocument): Added.
1453         (khtml::isEndOfDocument): Added.
1454
1455 2005-01-30  Darin Adler  <darin@apple.com>
1456
1457         Reviewed by John.
1458
1459         - fixed <rdar://problem/3977000> form data set posted for <input type="image" ...> omits name/value pair
1460
1461         * khtml/html/html_formimpl.cpp:
1462         (DOM::HTMLInputElementImpl::appendFormData): Append a name/value pair for type IMAGE in addition to the X/Y
1463         coordinates.
1464
1465 2005-01-30  Darin Adler  <darin@apple.com>
1466
1467         Reviewed by John.
1468
1469         - fixed <rdar://problem/3974246> REGRESSION (125-180): popup menus are missing item text on Harmony Remote web site
1470
1471         * khtml/html/html_formimpl.cpp: (DOM::HTMLOptionElementImpl::text): Change this function to traverse the entire tree
1472         and gather all the text rather than just looking at immediate children.
1473
1474         * khtml/xml/dom_nodeimpl.h: Added const.
1475         * khtml/xml/dom_nodeimpl.cpp:
1476         (NodeImpl::traverseNextNode): Added const.
1477         (NodeImpl::traverseNextSibling): Ditto.
1478         (NodeImpl::traversePreviousNodePostOrder): Ditto.
1479         (NodeImpl::detach): Add a missing nil check.
1480
1481 2005-01-30  Darin Adler  <darin@apple.com>
1482
1483         Reviewed by John.
1484
1485         - fixed <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
1486
1487         * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Added missing ref/deref of newly created element.
1488
1489 2005-01-28  Darin Adler  <darin@apple.com>
1490
1491         * khtml/css/cssproperties.c: Regenerated with newer gperf.
1492
1493 2005-01-28  David Harrison  <harrison@apple.com>
1494
1495         Reviewed by John Sullivan.
1496
1497         <rdar://problem/3968144> AX need to be able to focus an AXLink by setting AXFocused to true
1498         
1499         * kwq/KWQAccObject.mm:
1500         (-[KWQAccObject accessibilityPerformAction:]):
1501         (-[KWQAccObject accessibilityIsAttributeSettable:]):
1502         Add AXFocused for AXLinks.
1503
1504 2005-01-28  David Harrison  <harrison@apple.com>
1505
1506         Reviewed by Darin.
1507
1508         <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
1509
1510         Use AppKit SPI _accessibilityParentForSubview to return KWQAccObject parent of AppKit AX object.
1511         
1512         * kwq/KWQAccObject.mm:
1513         (-[KWQAccObject _accessibilityParentForSubview:]):
1514         New.
1515
1516 2005-01-27  Adele Amchan  <adele@apple.com>
1517
1518         fixed by Darin, reviewed by me.
1519
1520         <rdar://problem/3976314> REGRESSION (180-TOT): submitting password fields fail on Panther
1521
1522         * kwq/KWQTextField.mm: (-[KWQTextFieldController string]): on panther, the secure text field's editor 
1523         does not contain the real string, so now we just call stringValue on the field in that case.
1524
1525 2005-01-26  Maciej Stachowiak  <mjs@apple.com>
1526
1527         Reviewed by Darin, Hyatt and Ken.
1528
1529         <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
1530         
1531         * khtml/css/css_computedstyle.cpp:
1532         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support
1533         for -khtml-text-decorations-in-effect property. This works like text-docration
1534         but follows proper inline semantics, that is, if a parent is causing text
1535         decoration then -khtml-text-decorations-in-effect on this element will reflect that.
1536         * khtml/css/cssproperties.in: Add -khtml-text-decorations-in-effect property.
1537         * khtml/css/cssproperties.h: regenerated
1538         * khtml/css/cssvalues.c: regenerated
1539         * khtml/css/cssparser.cpp: regenerated
1540         * khtml/css/cssproperties.c: regenerated
1541
1542         * khtml/css/css_valueimpl.h: Made copyPropertiesInSet public.
1543
1544         * khtml/editing/htmlediting.cpp:
1545         (khtml::StyleChange::init): Handle -khtml-text-decorations-in-effect
1546         specially, translate to text-decoration
1547         (khtml::ApplyStyleCommand::applyInlineStyle): Fix a comment.
1548         (khtml::ApplyStyleCommand::removeInlineStyle): Add new way of pushing down
1549         text-decoration styles around the edges of the selected range.
1550         (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAroundNode): Helper for this.
1551         (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): ditto
1552         (khtml::ApplyStyleCommand::nodeFullyUnselected): ditto
1553         (khtml::hasTextDecorationProperty): ditto
1554         (khtml::highestAncestorWithTextDecoration): ditto
1555         (khtml::ApplyStyleCommand::extractTextDecorationStyle): ditto
1556         (khtml::ApplyStyleCommand::extractAndNegateTextDecorationStyle): ditto
1557         (khtml::ApplyStyleCommand::applyTextDecorationStyle): ditto
1558         * khtml/editing/htmlediting.h: Prototype new methods.
1559         * khtml/editing/jsediting.cpp: Make underline execCommand use the new CSS property.
1560
1561         - as a necessary part of the fix, fixed the longstanding problem
1562         that mutating an element's inlineStyleDecl would not property
1563         update its style attribute. now it does.
1564         
1565         * khtml/css/css_valueimpl.cpp:
1566         (DOM::CSSMutableStyleDeclarationImpl::setChanged): If this is an inline style
1567         declaration, tell the element it's style attribute needs updating.
1568         * khtml/html/html_elementimpl.cpp:
1569         (HTMLElementImpl::invalidateStyleAttribute): New method, just calls down
1570         to the dom element.
1571         (HTMLElementImpl::updateStyleAttribute): Regenerate style attribute from
1572         inline style declaration.
1573         * khtml/html/html_elementimpl.h: Prototype new stuff.
1574         * khtml/xml/dom_elementimpl.cpp:
1575         (ElementImpl::ElementImpl): Initialize new attribute.
1576         (ElementImpl::updateStyleAttributeIfNeeded): New method to check if the style
1577         is dirty and this is an html element, and if so call the html element to
1578         regenerate the style attribute.
1579         (ElementImpl::attributes): update style if needed
1580         (ElementImpl::getAttribute): ditto
1581         (ElementImpl::hasAttributes): ditto
1582         (ElementImpl::dump): ditto
1583         (XMLElementImpl::cloneNode): ditto
1584         * khtml/xml/dom_elementimpl.h:
1585         (DOM::ElementImpl::isStyleAttributeValid): new method to manage style attr
1586         dirty bit
1587         (DOM::ElementImpl::setStyleAttributeValid): ditto
1588
1589         - added new layout tests for underlining:
1590         
1591         * layout-tests/editing/editing.js:
1592         * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt: Added.
1593         * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt: Added.
1594         * layout-tests/editing/style/remove-underline-across-paragraph-in-bold.html: Added.
1595         * layout-tests/editing/style/remove-underline-across-paragraph.html: Added.
1596         * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt: Added.
1597         * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt: Added.
1598         * layout-tests/editing/style/remove-underline-after-paragraph-in-bold.html: Added.
1599         * layout-tests/editing/style/remove-underline-after-paragraph.html: Added.
1600         * layout-tests/editing/style/remove-underline-expected.txt: Added.
1601         * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt: Added.
1602         * layout-tests/editing/style/remove-underline-from-stylesheet.html: Added.
1603         * layout-tests/editing/style/remove-underline-in-bold-expected.txt: Added.
1604         * layout-tests/editing/style/remove-underline-in-bold.html: Added.
1605         * layout-tests/editing/style/remove-underline.html: Added.
1606         * layout-tests/editing/style/underline-expected.txt: Added.
1607         * layout-tests/editing/style/underline.html: Added.
1608
1609 2005-01-27  David Hyatt  <hyatt@apple.com>
1610
1611         Fix for 3875199, search field needs to be able to  show a magnifying  glass without a dropdown menu.
1612         
1613         Reviewed by kocienda
1614
1615         * khtml/html/html_formimpl.cpp:
1616         (DOM::HTMLInputElementImpl::HTMLInputElementImpl):
1617         (DOM::HTMLInputElementImpl::parseHTMLAttribute):
1618         * kwq/KWQLineEdit.mm:
1619         (QLineEdit::setMaxResults):
1620
1621 2005-01-27  Ken Kocienda  <kocienda@apple.com>
1622
1623         Reviewed by Maciej
1624
1625         Fix for this bug:
1626         
1627         <rdar://problem/3973254> Deletions of ranges does not coalesce correctly with subsequent typing
1628
1629         * khtml/editing/htmlediting.cpp:
1630         (khtml::InsertTextCommand::deleteCharacter): Remove this dead code.
1631         (khtml::ReplaceSelectionCommand::editingAction): Moved this code to a better place in the file. 
1632         It was in with unrelated functions.
1633         (khtml::TypingCommand::TypingCommand): Reorganize initialization list so it is easier to read.
1634         (khtml::TypingCommand::issueCommandForDeleteKey): Remove dead code. Roll in remaining code into deleteKeyPressed.
1635         (khtml::TypingCommand::deleteKeyPressed): Add in support for carrying along smart delete flag.
1636         (khtml::TypingCommand::forwardDeleteKeyPressed): New function. Makes forward delete work like
1637         "regular" delete in terms of coalescing typing.
1638         (khtml::TypingCommand::doApply): Add case for ForwardDeleteKey.
1639         (khtml::TypingCommand::preservesTypingStyle): Ditto.
1640         * khtml/editing/htmlediting.h:
1641         (khtml::TypingCommand::): Add ForwardDeleteKey constant. Remove a couple declarations for now-dead code.
1642         (khtml::TypingCommand::smartDelete): New accessor.
1643         (khtml::TypingCommand::setSmartDelete): Ditto.
1644         * kwq/WebCoreBridge.h:
1645         * kwq/WebCoreBridge.mm:
1646         (-[WebCoreBridge deleteKeyPressedWithSmartDelete:]): Add smart delete flag.
1647         (-[WebCoreBridge forwardDeleteKeyPressedWithSmartDelete:]): New method.
1648         * khtml/editing/jsediting.cpp: Add supprt for ForwardDelete command
1649         * layout-tests/editing/editing.js: Ditto.
1650         * layout-tests/editing/deleting/delete-and-undo-expected.txt: Added.
1651         * layout-tests/editing/deleting/delete-and-undo.html: Added.
1652         * layout-tests/editing/deleting/forward-delete-expected.txt: Added.
1653         * layout-tests/editing/deleting/forward-delete.html: Added.
1654
1655 === Safari-181 ===
1656
1657 2005-01-27  David Harrison  <harrison@apple.com>
1658
1659         Reviewed by Ken.
1660
1661         <rdar://problem/3962214> AX: AXLeftLineTextMarkerRangeForTextMarker returns incorrect range
1662
1663         * kwq/KWQAccObject.mm:
1664         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
1665         Allowed for selection to end of line including the linebreak.
1666         
1667 2005-01-27  David Harrison  <harrison@apple.com>
1668
1669         Reviewed by Darin, Ken.
1670
1671         <rdar://problem/3964470> AX: Include attachments in AXAttributedStringForTextMarkerRange
1672
1673         * kwq/KWQAccObject.mm:
1674         (-[KWQAccObject isAttachment]):
1675         (-[KWQAccObject attachmentView]):
1676         (-[KWQAccObject role]):
1677         (-[KWQAccObject subrole]):
1678         (-[KWQAccObject roleDescription]):
1679         (-[KWQAccObject value]):
1680         (-[KWQAccObject title]):
1681         (-[KWQAccObject accessibilityDescription]):
1682         (-[KWQAccObject accessibilityIsIgnored]):
1683         (-[KWQAccObject accessibilityAttributeNames]):
1684         (-[KWQAccObject accessibilityAttributeValue:]):
1685         Make attachments accessible.
1686         
1687         (CreateCGColorIfDifferent):
1688         (AXAttributeStringSetColor):
1689         (AXAttributeStringSetNumber):
1690         (AXAttributeStringSetFont):
1691         (AXAttributeStringSetStyle):
1692         (AXAttributeStringSetElement):
1693         (AXLinkElementForNode):
1694         (AXAttributedStringAppendText):
1695         (AXAttributedStringAppendReplaced):
1696         (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
1697         Add attachments and more text attributes to AXAttributedStringForTextMarkerRange.
1698
1699 2005-01-27  Darin Adler  <darin@apple.com>
1700
1701         Reviewed by John.
1702
1703         - fixed <rdar://problem/3807935> DOM CSS computed style line-height is wrong in two ways
1704
1705         * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1706         Use specified size rather than computed size when dealing with a percentage for line height.
1707
1708 2005-01-27  Darin Adler  <darin@apple.com>
1709
1710         Reviewed by John.
1711
1712         - fixed <rdar://problem/3971372> SWB: template function DOM_cast() won't compile with gcc 4.0
1713         - fixed other gcc 4.0 compiling problems Patrick Beard pointed out on the phone
1714
1715         * kwq/DOMInternal.h: (DOM_cast): Change the "failToCompile()" trick to use a dependent name.
1716         Nowadays, if a name is not dependent, it is checked at template definition time. But we want
1717         a failure only at template instantiation time.
1718
1719         * ForwardingHeaders/editing/text_granularity.h: Added. Needed but a bug in the 3.3 compiler made
1720         it compile anyway without this.
1721
1722         - other changes
1723
1724         * khtml/html/html_miscimpl.h: For clarity, mark these functions virtual too. They are automatically
1725         virtual because the base class ones are virtual, but it's ugly to leave it this way.
1726
1727 2005-01-26  Ken Kocienda  <kocienda@apple.com>
1728
1729         Reviewed by Hyatt
1730
1731         Fix for this bug:
1732         
1733         <rdar://problem/3971609> REGRESSION (Mail): up/down arrow navigation broken after rewrapping text by resizing window
1734         <rdar://problem/3975661> REGRESSION (Mail): left/right arrow navigation can place insertion point after last character on line
1735
1736         * khtml/editing/selection.cpp:
1737         (khtml::Selection::modifyAffinity): PARAGRAPH and LINE movements should not alter affinity. This was
1738         just a mistake before when it reset to upstream in some cases.
1739         * khtml/rendering/render_line.cpp:
1740         (khtml::RootInlineBox::closestLeafChildForXPos): Move this function down from InlineBox, and 
1741         rework the implementation. This fixes 3971609.
1742         * khtml/rendering/render_line.h:
1743         * khtml/rendering/render_text.cpp:
1744         (RenderText::caretRect): Rework the algorithm to fix 3975661. This regressed when we began placing
1745         the spaces on the end of lines in text boxes when lines wrap.
1746
1747 2005-01-26  Richard Williamson   <rjw@apple.com>
1748
1749         Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
1750
1751         I added a member variable to ObjectImp.  This changed it's size and consequently
1752         hampered the optimizations built into the garbage collector.  Objects no longer
1753         fit within the allocators cell size, and thus allocation fell back to a slower
1754         allocator.
1755
1756         As a result of this fix I also dramatically cleaned up how runtime objects are
1757         accessed.  The path mostly *removes* code.
1758         
1759         Reviewed by Chris.
1760
1761         * khtml/ecma/kjs_dom.cpp:
1762         (DOMDocumentProtoFunc::tryCall):
1763         (DOMElementProtoFunc::tryCall):
1764         (KJS::getRuntimeObject):
1765         * khtml/ecma/kjs_dom.h:
1766         * khtml/ecma/kjs_html.cpp:
1767         (KJS::HTMLDocument::tryGet):
1768         (KJS::HTMLElement::tryGet):
1769         (KJS::HTMLElement::implementsCall):
1770         (KJS::HTMLElement::call):
1771         (KJS::HTMLElement::tryPut):
1772         (KJS::HTMLCollection::tryGet):
1773         (KJS::HTMLCollection::getNamedItems):
1774         * khtml/ecma/kjs_html.h:
1775         * khtml/ecma/kjs_window.cpp:
1776         (Window::get):
1777
1778 2005-01-26  Richard Williamson   <rjw@apple.com>
1779
1780         Fixed <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
1781
1782         For now we are using ICU UBreakIterator to determine grapheme boundaries for
1783         cursor and deletion.  This does not match what Cocoa does exactly, but does match
1784         what Carbon does.  The areas are difference are obscure, but, according to
1785         Deborah Goldsmith, using the UBreakIterator is the reasonable approach.
1786
1787         Reviewed by Ken.
1788
1789         * khtml/rendering/render_text.cpp:
1790         (RenderText::previousOffset):
1791         (RenderText::nextOffset):
1792
1793 2005-01-25  David Harrison  <harrison@apple.com>
1794
1795         Reviewed by Maciej and Richard.
1796
1797         <rdar://problem/3963731> AX VO: Changing window sizes causes a crash using with Voice Over - KWQPtrDictImpl::clear
1798
1799         * khtml/html/html_miscimpl.cpp:
1800         (HTMLCollectionImpl::HTMLCollectionImpl):
1801         Ensure that isHTMLDocument before calling HTMLDocument-only method.
1802
1803 2005-01-25  Richard Williamson   <rjw@apple.com>
1804
1805         Part one of fix for <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
1806
1807         This patch changes the semantics of next() and previous() on
1808         VisiblePosition to move a grapheme (character cluster) at a
1809         time.  This means that cursor navigation with correctly move
1810         over an entire cluster.
1811
1812         However, the expected behavior for deleting a grapheme is to
1813         delete individual code points, thus decomposing the grapheme
1814         into it constituent parts.  That will be addressed in the next
1815         part of the fix.
1816
1817         Reviewed by Ken.
1818
1819         * khtml/editing/visible_position.cpp:
1820         (khtml::VisiblePosition::previousPosition):
1821         (khtml::VisiblePosition::nextPosition):
1822         * khtml/editing/visible_position.h:
1823         * khtml/rendering/render_object.cpp:
1824         (RenderObject::previousOffset):
1825         (RenderObject::nextOffset):
1826         * khtml/rendering/render_object.h:
1827         * khtml/rendering/render_text.cpp:
1828         (RenderText::previousOffset):
1829         (RenderText::nextOffset):
1830         (RenderText::findNextInlineTextBox):
1831         * khtml/rendering/render_text.h:
1832         * khtml/xml/dom_nodeimpl.cpp:
1833         (NodeImpl::previousOffset):
1834         (NodeImpl::nextOffset):
1835         * khtml/xml/dom_nodeimpl.h:
1836
1837 2005-01-25  David Harrison  <harrison@apple.com>
1838
1839         Reviewed by Maciej.
1840
1841         <rdar://problem/3973067> AXWebArea for http://apple.netscape.com/ has an empty AXLinkUIElements
1842
1843         * kwq/KWQAccObject.mm:
1844         (-[KWQAccObject accessibilityAttributeValue:]):
1845         Omit ignored AXLinks from AXLinkUIElements result
1846
1847 2005-01-25  Ken Kocienda  <kocienda@apple.com>
1848
1849         Reviewed by John
1850
1851         Fix for this bug:
1852         
1853         <rdar://problem/3972851> REGRESSION (179-180+): Repro crash in ApplyStyleCommand::cleanUpEmptyStyleSpans
1854
1855         * khtml/editing/htmlediting.cpp:
1856         (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans): Added two null checks.
1857
1858 2005-01-25  Ken Kocienda  <kocienda@apple.com>
1859
1860         Reviewed by John
1861
1862         Fix for this bug:
1863         
1864         <rdar://problem/3954710> Mail crashed while editing signatures - NodeImpl::isBlockFlow
1865
1866         The fix is more general than for this one bug, and may work to fix many crashers. The problem
1867         is that the ReplaceSelectionCommand never checked whether its starting selection is empty. If
1868         it is, then we need to bail before doing the work of the command, which we need to deref the
1869         start and end points of the selection in order to do its work. I think you can see the crash
1870         potential.
1871
1872         * khtml/editing/htmlediting.cpp:
1873         (khtml::ReplaceSelectionCommand::doApply): Assert selection is not empty.
1874         * kwq/WebCoreBridge.mm:
1875         (partHasSelection): New helper function to test that bridge has a part with a selection.
1876         
1877         Use new helper function to test part and selection; return from these function if this test fails.
1878         
1879         (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:])
1880         (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:])
1881         (-[WebCoreBridge alterCurrentSelection:direction:granularity:])
1882         (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:])
1883         (-[WebCoreBridge alterCurrentSelection:verticalDistance:])
1884         (-[WebCoreBridge documentFragmentWithText:])
1885         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
1886         (-[WebCoreBridge insertLineBreak])
1887         (-[WebCoreBridge insertParagraphSeparator])
1888         (-[WebCoreBridge insertParagraphSeparatorInQuotedContent])
1889         (-[WebCoreBridge insertText:selectInsertedText:])
1890         (-[WebCoreBridge deleteSelectionWithSmartDelete:])
1891         (-[WebCoreBridge ensureSelectionVisible])
1892
1893 2005-01-24  Kevin Decker  <kdecker@apple.com>
1894
1895         Reviewed by Darin.
1896
1897         Fixed <rdar://problem/3932374> REGRESSION: 'ReferenceError - Can't find variable' JavaScript error at webxpress.fidelity.com
1898
1899         * khtml/html/html_miscimpl.h: Missing virtual identifiers for namedItem() and nextNamedItem() exposed a flaw that prevented finding variables in form [HTMLFormCollectionImpl] scopes.
1900         
1901
1902 2005-01-24  Vicki Murley <vicki@apple.com>
1903
1904         Reviewed by kocienda.
1905
1906         - fix <rdar://problem/3810661> computed style not handled for Apple extensions
1907  
1908         * khtml/css/css_computedstyle.cpp: (DOM::):
1909         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): add -apple-line-clamp and -apple-text-size-adjust
1910
1911 2005-01-24  Darin Adler  <darin@apple.com>
1912
1913         Reviewed by Kevin.
1914
1915         - fixed <rdar://problem/3969884> REGRESSION (179-180): Typing password not echoed as "bullets" at paypal.com when field is first focused
1916
1917         * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]):
1918         Sizing up the form editor, which fixes things for normal fields and search fields,
1919         screws things up for password fields. Eventually, I'll need to figure out why this is
1920         and file a bug so that the AppKit team fixes it. In the mean time, just check for the
1921         case of the secure text field, and don't size up in that case.
1922
1923 2005-01-24  Ken Kocienda  <kocienda@apple.com>
1924
1925         Reviewed by Hyatt
1926
1927         Fix for this bug:
1928         
1929         <rdar://problem/3963560> 8A354: Inserting Japanese text to the line head causes line break
1930
1931         * khtml/editing/htmlediting.cpp:
1932         (khtml::ReplaceSelectionCommand::doApply): Add one more case where we merge content into the
1933         existing line. This covers the situation see using the steps to reproduce this bug.
1934
1935 2005-01-21  Maciej Stachowiak  <mjs@apple.com>
1936
1937         Reviewed by Darin.
1938
1939         <rdar://problem/3967572> Editing should split elements before removing style
1940         
1941         * khtml/editing/htmlediting.cpp:
1942         (khtml::CompositeEditCommand::splitElement):
1943         (khtml::CompositeEditCommand::mergeIdenticalElements):
1944         (khtml::CompositeEditCommand::wrapContentsInDummySpan):
1945         (khtml::CompositeEditCommand::splitTextNodeContainingElement):
1946         (khtml::ApplyStyleCommand::applyInlineStyle):
1947         (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
1948         (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
1949         (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
1950         (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
1951         (khtml::areIdenticalElements):
1952         (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
1953         (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
1954         (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans):
1955         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
1956         (khtml::InsertParagraphSeparatorCommand::doApply):
1957         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1958         (khtml::InsertTextCommand::prepareForTextInsertion):
1959         (khtml::SplitTextNodeCommand::doUnapply):
1960         (khtml::SplitElementCommand::SplitElementCommand):
1961         (khtml::SplitElementCommand::~SplitElementCommand):
1962         (khtml::SplitElementCommand::doApply):
1963         (khtml::SplitElementCommand::doUnapply):
1964         (khtml::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand):
1965         (khtml::MergeIdenticalElementsCommand::~MergeIdenticalElementsCommand):
1966         (khtml::MergeIdenticalElementsCommand::doApply):
1967         (khtml::MergeIdenticalElementsCommand::doUnapply):
1968         (khtml::WrapContentsInDummySpanCommand::WrapContentsInDummySpanCommand):
1969         (khtml::WrapContentsInDummySpanCommand::~WrapContentsInDummySpanCommand):
1970         (khtml::WrapContentsInDummySpanCommand::doApply):
1971         (khtml::WrapContentsInDummySpanCommand::doUnapply):
1972         (khtml::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand):
1973         (khtml::SplitTextNodeContainingElementCommand::~SplitTextNodeContainingElementCommand):
1974         (khtml::SplitTextNodeContainingElementCommand::doApply):
1975         * khtml/editing/htmlediting.h:
1976
1977         New layout test that shows the side benefit of this.
1978         
1979         * layout-tests/editing/style/unbold-in-bold-expected.txt: Added.
1980         * layout-tests/editing/style/unbold-in-bold.html: Added.
1981
1982 2005-01-24  Darin Adler  <darin@apple.com>
1983
1984         Reviewed by John.
1985
1986         - fixed <rdar://problem/3933435> -[DOMRange cloneContents] sometimes alters the original DOMRange
1987
1988         * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Fixed code that was collapsing
1989         the range after processing the contents. That's right for extract and delete, but not clone.
1990
1991         - fixed <rdar://problem/3714184> inline input works incorrectly when I type Korean slowly in textfield in form on www.google.co.kr
1992         - fixed <rdar://problem/3193848> Can't enter SSN to sign up for Chase visa online account (changing focus inside key press handler)
1993         - fixed <rdar://problem/3874683> REGRESSION (161-162): Crash after typing command-Z to undo after pasting text with newline in it into a text field <input type=text>
1994
1995         * kwq/KWQLineEdit.mm:
1996         (QLineEdit::text): Changed to call a new string method on the controller instead of calling
1997         stringValue, since stringValue has a bad side effect of ending inline input.
1998         (QLineEdit::selectAll): Changed to only call selectText: when the field is already selected.
1999         When you are giving the field focus, it automatically gets all selected, and this change
2000         is required in the case where we defer the focus change.
2001
2002         * kwq/KWQTextField.h: Added a new string method to the controller.
2003         * kwq/KWQTextField.mm:
2004         (-[KWQTextFieldController setMaximumLength:]): Call the new string method instead of using stringValue.
2005         (-[KWQTextFieldController controlTextDidChange:]): Removed the code to truncate at the first CR or LF.
2006         That's now handled in the shouldChangeTextInRange method instead.
2007         (-[KWQTextFieldController textView:shouldHandleEvent:]): Add new logic to defer responder changes until
2008         after the event is handled. This makes sure the key gets into the field that's already handling it at
2009         rather than ending up in the newly-focused field if the key press handler focuses a different element.
2010         (-[KWQTextFieldController textView:didHandleEvent:]): Turn off deferral here, now that the key press
2011         has been handled.
2012         (-[KWQTextFieldController string]): Added. Calls stringValue only if there's no editor. If there is
2013         an editor, calls string on that instead.
2014         (-[KWQTextFieldController textView:shouldChangeTextInRange:replacementString:]): Added. Called by
2015         the three field subclasses. Truncates incoming strings at the first CR or LF character. This works
2016         properly with Undo, and the old technique did not.
2017         (-[KWQTextFieldController preprocessString:]): Added. Helper used for all the setStringValue methods
2018         so they all truncate at the first CR or LF as well as truncating to the appropriate length.
2019         (-[KWQTextField setStringValue:]): Changed to call the controller.
2020         (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): Added. Calls the controller.
2021         (-[KWQSecureTextField setStringValue:]): More of the same.
2022         (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
2023         (-[KWQSearchField setStringValue:]): Ditto.
2024         (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
2025
2026         * kwq/KWQWidget.h: Added the new setDeferFirstResponderChanges function.
2027         * kwq/KWQWidget.mm:
2028         (QWidget::~QWidget): Clear out the deferredFirstResponder global just in case we are destroyed
2029         while we "have the ball".
2030         (QWidget::hasFocus): If we are in the deferred mode, use the global to decide who to say is focused.
2031         (QWidget::setFocus): If we are in the deferred mode, set the global instead of making something be
2032         the first responder.
2033         (QWidget::setDeferFirstResponderChanges): Set the boolean. If the boolean is being cleared, then
2034         get the deferred first responder and call setFocus on it again, which will do the work we didn't
2035         want to do earlier.
2036
2037 2005-01-24  Ken Kocienda  <kocienda@apple.com>
2038
2039         Reviewed by John
2040
2041         Fix for this bug:
2042         
2043         <rdar://problem/3964350> Deleting all content and typing in a message gets one letter, then beeps
2044
2045         This is a problem with the way we turn key events, when a user starts typing, into editing commands. 
2046         Right now, that initial delete key in an empty window is turned into an editing command, and much 
2047         editing code runs that need not run. What's more, this is confusing the selection machinery. The
2048         solution is to detect the "delete in an empty window" case and don't turn this into an editing
2049         command at all.
2050
2051         * khtml/editing/htmlediting.cpp:
2052         (khtml::TypingCommand::deleteKeyPressed)
2053
2054 2005-01-23  Adele Amchan  <adele@apple.com>
2055
2056         Fixed <rdar://problem/3964286> REGRESSION (178-179): menus and "go to old site" link at Ameritrade's new site don't work
2057
2058         Removed check for document from checkCompleted.  In this case, WebCore never knew that a WebImageView was complete because 
2059         it fell into this document check case in checkCompleted.  
2060         Added check for document to tokenizerProcessedData (see <rdar://problem/3807144>)
2061
2062         Reviewed by Darin.
2063
2064         * khtml/khtml_part.cpp:
2065         (KHTMLPart::stop):
2066         (KHTMLPart::checkCompleted):
2067         * khtml/khtml_part.h:
2068         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::tokenizerProcessedData):
2069
2070 2005-01-21  Richard Williamson   <rjw@apple.com>
2071
2072         Fixed <rdar://problem/3759399> Javascript / Liveconnect problems ((event handler):Undefined value)
2073
2074         Java applets specified with <object> or <embed> weren't scriptable.  Now they are.
2075
2076         Reviewed by Chris.
2077
2078         * khtml/html/html_objectimpl.cpp:
2079         (HTMLEmbedElementImpl::getEmbedInstance):
2080         (HTMLObjectElementImpl::getObjectInstance):
2081
2082 2005-01-21  Ken Kocienda  <kocienda@apple.com>
2083
2084         Reviewed by John
2085
2086         Fix for this bug:
2087         
2088         <rdar://problem/3959464> REGRESSION (Mail): Insertion point goes back to beginning of document after deleting
2089
2090         * khtml/editing/htmlediting.cpp:
2091         (khtml::DeleteSelectionCommand::handleGeneralDelete): Add special case to handle retaining a fully-selected block.
2092         This fixes the bug.
2093         * layout-tests/editing/deleting/delete-3959464-fix-expected.txt: Added.
2094         * layout-tests/editing/deleting/delete-3959464-fix.html: Added.
2095
2096 2005-01-21  Richard Williamson   <rjw@apple.com>
2097
2098         Fixed <rdar://problem/3966998> REGRESSION(179-TOT) clicking on gmail message brings me to blank screen
2099
2100         getElementById() sometimes returns Undefined() instead of Null().
2101
2102         Reviewed by Hyatt.
2103
2104         * khtml/ecma/kjs_dom.cpp:
2105         (DOMDocumentProtoFunc::tryCall):
2106
2107 2005-01-21  David Hyatt  <hyatt@apple.com>
2108
2109         Fix for 3773809, make sure that overflow regions never end up at an invalid scroll offset because of a layout change.
2110         
2111         Reviewed by kocienda
2112
2113         * khtml/rendering/render_layer.cpp:
2114         (RenderLayer::updateScrollInfoAfterLayout):
2115
2116 2005-01-21  David Hyatt  <hyatt@apple.com>
2117
2118         Fix for 3966349, hang loading page.  Make sure that loops using popOneBlock properly check for a null
2119         blockStack to avoid an infinite loop.
2120         
2121         Reviewed by kocienda
2122
2123         * khtml/html/htmlparser.cpp:
2124         (KHTMLParser::parseToken):
2125         (KHTMLParser::insertNode):
2126         (KHTMLParser::popInlineBlocks):
2127
2128 2005-01-21  Ken Kocienda  <kocienda@apple.com>
2129
2130         Reviewed by John
2131
2132         Fix for this bug:
2133         
2134         <rdar://problem/3957204> Mail crashed when sending a message in ~InsertParagraphSeparatorInQuotedContentCommand
2135
2136         * khtml/editing/htmlediting.cpp:
2137         (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
2138         InsertParagraphSeparatorInQuotedContentCommand has this member variable: DOM::ElementImpl *m_breakNode;
2139         I failed to initialize this variable to null in the constructor, and there is an uncommonly-traveled 
2140         code path which does not set this variable to something good. In the destructor, we check for null, 
2141         and deref if non-null. Obvious "BOOM" potential. Fixed.
2142
2143 2005-01-21  Ken Kocienda  <kocienda@apple.com>
2144
2145         Reviewed by John
2146
2147         Fix for this bug:
2148         
2149         <rdar://problem/3966311> REGRESSION (Mail): Hitting return makes space character disappear
2150
2151         * khtml/editing/htmlediting.cpp:
2152         (khtml::InsertParagraphSeparatorCommand::doApply): When writing the code to insert a block
2153         in response to the return key, I did not write code to cover the case described in the bug.
2154         Now I have.
2155         * layout-tests/editing/inserting/insert-div-025-expected.txt: Added.
2156         * layout-tests/editing/inserting/insert-div-025.html: Added.
2157
2158 2005-01-20  Maciej Stachowiak  <mjs@apple.com>
2159
2160         Reviewed by Ken.
2161
2162         <rdar://problem/3965196> security fix for javascript: exploit missed one case (already fixed in updates)
2163         
2164         * khtml/ecma/kjs_window.cpp:
2165         (WindowFunc::tryCall): correct mistake in earlier fix for the following bug, caught by Adele:
2166
2167 2005-01-20  Maciej Stachowiak  <mjs@apple.com>
2168
2169         Reviewed by Ken.
2170
2171         <rdar://problem/3965466> editing needs to insert text before applying typing style
2172         
2173         * khtml/editing/htmlediting.cpp:
2174         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Remove a FIXME comment.
2175         (khtml::InsertLineBreakCommand::doApply): Apply style to the BR
2176         node after inserting it.
2177         (khtml::InsertTextCommand::prepareForTextInsertion): Don't try to
2178         apply style to any new nodes created before inserting.
2179         (khtml::InsertTextCommand::input): Apply style to the inserted range
2180         after doing the text insert.
2181         * khtml/editing/htmlediting.h:
2182
2183         This change leads to improved results on one of the layout tests:
2184         
2185         * layout-tests/editing/inserting/insert-div-024-expected.txt:
2186
2187 === Safari-180 ===
2188
2189 2005-01-20  Ken Kocienda  <kocienda@apple.com>
2190
2191         Reviewed by John
2192
2193         Fix for this bug:
2194         
2195         <rdar://problem/3964646> REGRESSION (179-180): Typing space at end of line makes following paragraph disappear
2196
2197         * khtml/editing/htmlediting.cpp:
2198         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Recent change to block placeholder removal code 
2199         caused this regression. The code became too aggressive in removing block placeholders, and would remove them
2200         from blocks other than the block containing the selection.
2201         * layout-tests/editing/inserting/insert-div-023-expected.txt: This file had a spurious BR element in it that
2202         I did not notice earlier.
2203         * layout-tests/editing/inserting/insert-div-024-expected.txt: Ditto.
2204
2205 2005-01-20  David Hyatt  <hyatt@apple.com>
2206
2207         Fix for oddness on albertsons.com.  Make sure not to crash when setting/removing style properties on a node
2208         with no document.  The bug # is 3813900.
2209         
2210         Reviewed by john
2211
2212 2005-01-20  David Harrison  <harrison@apple.com>
2213
2214         Reviewed by Darin.
2215
2216         PARTIAL fix for following bug.  Create attributed string with fonts and links.  Still need to add attachments.
2217         <rdar://problem/3942606> AX: Support kAXAttributedStringForTextMarkerRangeParameterizedAttribute
2218         
2219         * kwq/KWQAccObject.mm:
2220         (-[KWQAccObject textUnderElement]):
2221         Touched up previous checkin to match code review comments.
2222         
2223         (-[KWQAccObject value]):
2224         Use plainText for this one instead of obsolete attributedString.
2225         
2226         (-[KWQAccObject accessibilityParameterizedAttributeNames]):
2227         Advertise AXAttributedStringForTextMarkerRange.
2228         
2229         (AXAttributeStringAddFont):
2230         (AXAttributeStringAddElement):
2231         (-[KWQAccObject linkUIElementForNode:]):
2232         (-[KWQAccObject _addAttachmentForElement:URL:needsParagraph:usePlaceholder:]):
2233         (-[KWQAccObject accessibilityAttributedStringForRange:]):
2234         New routines to support AXAttributedStringForTextMarkerRange.
2235         
2236         (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
2237         Use new routines instead of obsolete attributedString.
2238
2239 2005-01-20  David Harrison  <harrison@apple.com>
2240
2241         Reviewed by Darin.
2242
2243         <rdar://problem/3960196> AX Crash in DOM::Range::setStartBefore
2244
2245         * khtml/xml/dom_docimpl.cpp:
2246         (DocumentImpl::getAccObjectCache):
2247         Adjust when detecting cache in non-top level WebArea.
2248         * kwq/KWQAccObject.mm:
2249         (-[KWQAccObject textUnderElement]):
2250         (-[KWQAccObject accessibilityAttributeValue:]):
2251         Make sure the elements document is the current one for the part.
2252
2253 2005-01-20  Darin Adler  <darin@apple.com>
2254
2255         Reviewed by John.
2256
2257         - fixed <rdar://problem/3922980> Mail not crashing, just quitting itself suddenly in -[WebHTMLView(MailExtras) findString:options:]
2258
2259         * khtml/dom/dom2_range.cpp: (DOM::operator==): Handle null and detached ranges without raising exceptions.
2260         The uncaught exception would make the entire program terminate.
2261
2262         - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
2263
2264         * kwq/DOM-CSS.mm: (-[DOMCSSStyleDeclaration setProperty:::]): Uncommented this code which I had to disable
2265         back in November because Mail was stumbling over it.
2266
2267         - fixed <rdar://problem/3943049> focus() called during onload handler results in square text field on <input type=search>        
2268
2269         * kwq/KWQLineEdit.mm: (QLineEdit::baselinePosition): Change computation so it will work even for fields
2270         that position their text in a way that depends on vertical size. In the case of a search field, the text
2271         is centered, so the old logic was broken.
2272         * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Set the frame size to
2273         something large enough to accomodate the field editor. If we start the frame at size 0,0 we run into
2274         AppKit trouble when it insets the frame to figure out the frame for the field editor. In the case of this
2275         bug this happens because we become first responder before being sized and positioned by the HTML layout code.
2276
2277         - improved debugging output when using "po" from gdb with Objective-C DOM
2278
2279         * kwq/DOM.mm:
2280         (-[DOMNode description]): Added. Includes node name ("<tr>") and node value (e.g., string for text node).
2281         (-[DOMRange description]): Tweaked format.
2282
2283 2005-01-19  Richard Williamson   <rjw@apple.com>
2284
2285         After further discussion with Real we have decided to NOT include the
2286         additional CLSID for the real plugin.  See 3958601.
2287
2288         Reviewed by Darin.
2289
2290         * khtml/rendering/render_frames.cpp:
2291         (RenderPartObject::updateWidget):
2292
2293 2005-01-19  David Harrison  <harrison@apple.com>
2294
2295         Reviewed by Maciej.
2296
2297         <rdar://problem/3949429> AX: word marker routines returns incorrect data for empty line
2298
2299         Previous checkin for this bug was missing some of the patch.  Editing snafu with multiple changes in tree.
2300         
2301         * kwq/KWQAccObject.mm:
2302         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2303         (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
2304         (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
2305         (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2306         (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
2307         (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
2308         (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
2309
2310 2005-01-19  Ken Kocienda  <kocienda@apple.com>
2311
2312         Reviewed by John
2313
2314         * khtml/editing/htmlediting.cpp:
2315         (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Small, cosmetic change John and I decided
2316         to do on my last checkin, but I forgot to do before landing.
2317
2318 2005-01-19  Ken Kocienda  <kocienda@apple.com>
2319
2320         Reviewed by John
2321
2322         Fix for this bug:
2323         
2324         <rdar://problem/3959727> REGRESSION (Mail): Style not preserved on blank lines
2325
2326         * khtml/editing/htmlediting.cpp:
2327         (khtml::CompositeEditCommand::applyStyle):
2328         (khtml::CompositeEditCommand::insertBlockPlaceholder): New function that unconditionally adds a block placeholder.
2329         (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Now returns bool based on whether
2330         placeholder was added or not.
2331         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now searches all the descendents of a block
2332         looking for a placeholder. The old code, which just looked at the last child of a node, started missing
2333         once block placeholders became styled (which started happening with this patch).
2334         (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Now handles applying typing style
2335         to a block placeholder at call time, rather than setting the typing style as a latent style that
2336         might be applied later. This is an important part of the bug fix.
2337         (khtml::DeleteSelectionCommand::doApply): Now uses bool return value from insertBlockPlaceholderIfNeeded()
2338         and passes it along to calculateStyleBeforeInsertion, so the case where a block placeholder needs to
2339         be styled can be detected.
2340         (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Changed the way this class
2341         managed style. Before it would calculate and set typing style for the block added. This is not
2342         sufficient. Added blocks need to styled immediately. Some name changes to instance variables in 
2343         this class due to the change to accommodate this change.
2344         (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Name changes, as above.
2345         (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Ditto.
2346         (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Ditto.
2347         (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
2348         (khtml::ReplaceSelectionCommand::doApply): Improve check for testing when a placeholder
2349         block can be removed in its entirety after the insertion.
2350         * khtml/editing/htmlediting.h: Update header accordingly.
2351         * khtml/khtml_part.cpp:
2352         (KHTMLPart::selectionComputedStyle): Move position for computed style check downstream before
2353         doing check when the position is in an empty block (this makes sure any style on any block
2354         placeholder is accounted for).
2355
2356         New layout tests to check bug fix.
2357
2358         * layout-tests/editing/style/block-style-004-expected.txt: Added.
2359         * layout-tests/editing/style/block-style-004.html: Added.
2360         * layout-tests/editing/style/block-style-005-expected.txt: Added.
2361         * layout-tests/editing/style/block-style-005.html: Added.
2362         * layout-tests/editing/style/block-style-006-expected.txt: Added.
2363         * layout-tests/editing/style/block-style-006.html: Added.
2364
2365         Results updated to reflect new block placeholder code.
2366
2367         * layout-tests/editing/inserting/insert-div-004-expected.txt 
2368         * layout-tests/editing/inserting/insert-div-005-expected.txt
2369         * layout-tests/editing/inserting/insert-div-006-expected.txt
2370         * layout-tests/editing/inserting/insert-div-008-expected.txt
2371         * layout-tests/editing/inserting/insert-div-011-expected.txt
2372         * layout-tests/editing/inserting/insert-div-012-expected.txt
2373         * layout-tests/editing/inserting/insert-div-013-expected.txt
2374         * layout-tests/editing/inserting/insert-div-014-expected.txt
2375         * layout-tests/editing/inserting/insert-div-015-expected.txt
2376         * layout-tests/editing/inserting/insert-div-016-expected.txt
2377         * layout-tests/editing/inserting/insert-div-017-expected.txt
2378         * layout-tests/editing/inserting/insert-div-018-expected.txt
2379         * layout-tests/editing/inserting/insert-div-019-expected.txt
2380         * layout-tests/editing/inserting/insert-div-021-expected.txt
2381         * layout-tests/editing/inserting/insert-div-022-expected.txt
2382         * layout-tests/editing/inserting/insert-div-023-expected.txt
2383         * layout-tests/editing/inserting/insert-div-024-expected.txt
2384
2385 2005-01-19  David Hyatt  <hyatt@apple.com>
2386
2387         Dont null-check the renderer before submitting, since a script can set it to display:none and still expect the
2388         submission to occur.  Fixes bug #3477282.
2389         
2390         Reviewed by kdecker
2391
2392         (DOM::HTMLInputElementImpl::defaultEventHandler):
2393
2394 2005-01-18  Richard Williamson   <rjw@apple.com>
2395         
2396         Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
2397
2398         Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
2399         Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
2400         Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
2401         Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
2402
2403         We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
2404         tags.  Also, if any of these elements are named they can be accessed from the document or window objects.
2405         Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
2406
2407         Reviewed by Chris.
2408
2409         * khtml/dom/html_document.cpp:
2410         (HTMLDocument::objects):
2411         * khtml/dom/html_document.h:
2412         * khtml/ecma/kjs_dom.cpp:
2413         (DOMDocumentProtoFunc::tryCall):
2414         (DOMElementProtoFunc::tryCall):
2415         (KJS::getRuntimeObject):
2416         * khtml/ecma/kjs_dom.h:
2417         * khtml/ecma/kjs_html.cpp:
2418         (KJS::HTMLDocument::tryGet):
2419         (KJS::HTMLElement::tryGet):
2420         (KJS::HTMLCollection::tryGet):
2421         (KJS::HTMLCollection::getNamedItems):
2422         * khtml/ecma/kjs_window.cpp:
2423         (Window::get):
2424         * khtml/html/html_miscimpl.cpp:
2425         (HTMLCollectionImpl::traverseNextItem):
2426         * khtml/html/html_miscimpl.h:
2427         (DOM::HTMLCollectionImpl::):
2428         * khtml/html/html_objectimpl.cpp:
2429         (HTMLAppletElementImpl::getAppletInstance):
2430         (HTMLObjectElementImpl::HTMLObjectElementImpl):
2431         (HTMLObjectElementImpl::getObjectInstance):
2432         * khtml/html/html_objectimpl.h:
2433         * khtml/rendering/render_frames.cpp:
2434         (RenderPartObject::updateWidget):
2435         * kwq/KWQKHTMLPart.h:
2436         * kwq/KWQKHTMLPart.mm:
2437         (KWQKHTMLPart::getObjectInstanceForView):
2438
2439 2005-01-18  David Hyatt  <hyatt@apple.com>
2440
2441         Fix for 3948123, rolling over link erases nearby text.  The repaint rect check for lines was wrong whenever
2442         two lines overlapped.
2443         
2444         Reviewed by kocienda
2445
2446         * khtml/rendering/render_flow.cpp:
2447         (RenderFlow::paintLines):
2448
2449 2005-01-18  Ken Kocienda  <kocienda@apple.com>
2450
2451         Reviewed by Hyatt
2452         
2453         Fix for this bug:
2454         
2455         <rdar://problem/3960116> Focus rings paint incorrectly for contenteditable blocks in web pages
2456
2457         * khtml/rendering/render_flow.cpp:
2458         (RenderFlow::addFocusRingRects): Fix painting of focus rings so that ring only paints around
2459         outermost contenteditable elements.
2460
2461 2005-01-18  David Harrison  <harrison@apple.com>
2462
2463         Reviewed by Darin.
2464
2465         <rdar://problem/3959668> accessibilityFocusedUIElement sometimes returns an ignored element; it must not
2466
2467         * kwq/KWQAccObject.mm:
2468         (-[KWQAccObject accessibilityFocusedUIElement]):
2469         Return parentObjectUnignored if focused object is ignored.
2470
2471 2005-01-18  Ken Kocienda  <kocienda@apple.com>
2472
2473         Reviewed by John
2474
2475         Fix for this bug:
2476         
2477         <rdar://problem/3952877> REGRESSION (Mail): Command-left/right-arrows don't work with file attachment
2478
2479         * khtml/editing/selection.cpp:
2480         (khtml::nodeForInlineBox): New helper function used in reimplementation of function below.
2481         (khtml::selectionForLine): Reimplemented using line box smarts. I originally wrote this code when
2482         I had a less than full understanding of line layout. I can do better now, and my new version no
2483         longer fails to notice attachments when doing the kind of navigation mentioned in the bug.
2484
2485 2005-01-17  David Harrison  <harrison@apple.com>
2486
2487         Reviewed by John Sullivan.
2488
2489         <rdar://problem/3949429> AX: word marker routines returns incorrect data for empty line
2490         <rdar://problem/3949848> AX: paragraph marker routines do not work when given a paragraph end marker
2491
2492         Also fixed sentence support in the same way.
2493         
2494         * kwq/KWQAccObject.mm:
2495         (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2496         (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
2497         (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
2498         (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
2499         (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
2500         Move one position in desired direction before calling visible_units.cpp code.
2501
2502 2005-01-17  David Harrison  <harrison@apple.com>
2503
2504         Updated expected test results.
2505         
2506         <rdar://problem/3945880> line-ending space seems not to be present
2507
2508         * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt:
2509         * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt:
2510         * layout-tests/editing/inserting/insert-div-020-expected.txt:
2511         * layout-tests/editing/inserting/insert-div-021-expected.txt:
2512         * layout-tests/editing/inserting/insert-div-022-expected.txt:
2513         * layout-tests/editing/inserting/insert-div-023-expected.txt:
2514         * layout-tests/editing/inserting/insert-div-024-expected.txt:
2515
2516 2005-01-17  David Harrison  <harrison@apple.com>
2517
2518         Reviewed by Dave Hyatt (bidi.cpp) and Darin Adler (selection.cpp).
2519
2520         <rdar://problem/3945880> line-ending space seems not to be present
2521
2522         * khtml/editing/selection.cpp:
2523         (khtml::Selection::validate):
2524         Extend AFTER_WHITE_SPACE code to support white spac in the middle of paragraphs, not just the end.
2525         * khtml/rendering/bidi.cpp:
2526         (khtml::RenderBlock::findNextLineBreak):
2527         Pick left/rightness of word selection based on being at the end of paragraph (i.e. after a hard line break).
2528
2529 2005-01-17  Darin Adler  <darin@apple.com>
2530
2531         Reviewed by John Louch.
2532
2533         - fixed <rdar://problem/3958503> need screenX and screenY to use WebKit windowFrame delegate
2534
2535         * khtml/ecma/kjs_window.cpp: (Window::get): Change screenX and screenY to use frameGeometry instead
2536         of using mapToGlobal and screen in a complicated way.
2537         * kwq/KWQKHTMLView.mm: Removed unused mapToGlobal function.
2538         * kwq/KWQWindowWidget.h: Ditto.
2539         * kwq/KWQWindowWidget.mm: Ditto.
2540
2541 2005-01-17  David Hyatt  <hyatt@apple.com>
2542
2543         Fix a screwup in rightmost/lowets position computation.  3955207.  Make sure floats with layers are still checked.
2544
2545         Reviewed by kocienda
2546         
2547         * khtml/rendering/render_block.cpp
2548
2549 2005-01-17  Ken Kocienda  <kocienda@apple.com>
2550
2551         Reviewed by John
2552
2553         <rdar://problem/3953366> Problems with typing attributes in HTML compose
2554
2555         * khtml/editing/htmlediting.cpp:
2556         (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Remove misguided "optimization"
2557         that tried to sense when typing style could be cleared without actually doing a style diff between
2558         before-delete and after-delete positions. Removing this extra check and running the 
2559         general-purpose code fixes the bug.
2560
2561 2005-01-17  Richard Williamson   <rjw@apple.com>
2562
2563         Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
2564
2565         Keep track of originating execution context and target execution
2566         context for native JS object wrappers, and perform appropriate
2567         security checks.
2568
2569         Reviewed by David Harrison.
2570
2571         * khtml/ecma/kjs_binding.cpp:
2572         (ScriptInterpreter::isGlobalObject):
2573         (ScriptInterpreter::isSafeScript):
2574         (ScriptInterpreter::interpreterForGlobalObject):
2575         * khtml/ecma/kjs_binding.h:
2576         * khtml/ecma/kjs_window.cpp:
2577         (Window::interpreter):
2578         (Window::isSafeScript):
2579         * khtml/ecma/kjs_window.h:
2580         * kwq/DOMInternal.mm:
2581         (-[WebScriptObject _initializeScriptDOMNodeImp]):
2582         * kwq/KWQKHTMLPart.mm:
2583         (KWQKHTMLPart::windowScriptObject):
2584         (KWQKHTMLPart::windowScriptNPObject):
2585         * kwq/WebCoreBridge.mm:
2586         (rootForView):
2587         (-[WebCoreBridge init]):
2588
2589 2005-01-17  Ken Kocienda  <kocienda@apple.com>
2590
2591         Reviewed by John
2592
2593         Fix for this bug:
2594         
2595         <rdar://problem/3786659> REGRESSION (Mail): editable WebViews don't work with 
2596         "size up" and "size down" NSFontManager changes
2597
2598         * khtml/css/cssparser.cpp:
2599         (CSSParser::parseValue): Add support for parsing new font size delta property.
2600         * khtml/css/cssproperties.c: Generated file.
2601         * khtml/css/cssproperties.h: Ditto.
2602         * khtml/css/cssproperties.in: Add support for parsing new font size delta property.
2603         * khtml/editing/htmlediting.cpp:
2604         (khtml::isEmptyStyleSpan): New helper function. Code existed before, but now factored out for convenient use.
2605         (khtml::CompositeEditCommand::removeNodeAttribute): Does check on value to see it exists before creating
2606         and running command to do the removal.
2607         (khtml::ApplyStyleCommand::doApply): Now calls new applyRelativeFontStyleChange() function as part of its work.
2608         (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): New function that does the "heavy lifting" to handle 
2609         relative font size changes.
2610         (khtml::ApplyStyleCommand::applyInlineStyle): Range check the start and end positions to make sure the start is
2611         before or equal to the end. Swap them if not true. I ran into this problem in some similar code in 
2612         applyRelativeFontStyleChange(). Moving that goodness here too.
2613         (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded): Uses a local variable to save a value used often.
2614         Code is the same, but reads better now. Function now returns bool as well, just like splitTextAtStartIfNeeded.
2615         I use the bool return value now (I obviously did not need it before).
2616         (khtml::ApplyStyleCommand::computedFontSize): New helper function.
2617         (khtml::ApplyStyleCommand::joinChildTextNodes): Ditto.
2618         (khtml::createStyleSpanElement): Ditto.
2619         * khtml/editing/htmlediting.h: Update header accordingly.
2620         * khtml/editing/jsediting.cpp: Add new command string to enable relative font size changes.
2621         * kwq/DOM-CSS.mm:
2622         (-[DOMCSSStyleDeclaration _fontSizeDelta]): New convenience.
2623         (-[DOMCSSStyleDeclaration _setFontSizeDelta:]): Ditto.
2624         * kwq/DOMPrivate.h: Declare new conveniences.
2625         * layout-tests/editing/editing.js: Add new JS to enable relative font size changes, as well as explicit font size setting.
2626         * layout-tests/editing/style/relative-font-size-change-001-expected.txt: Added.
2627         * layout-tests/editing/style/relative-font-size-change-001.html: Added.
2628         * layout-tests/editing/style/relative-font-size-change-002-expected.txt: Added.
2629         * layout-tests/editing/style/relative-font-size-change-002.html: Added.
2630         * layout-tests/editing/style/relative-font-size-change-003-expected.txt: Added.
2631         * layout-tests/editing/style/relative-font-size-change-003.html: Added.
2632         * layout-tests/editing/style/relative-font-size-change-004-expected.txt: Added.
2633         * layout-tests/editing/style/relative-font-size-change-004.html: Added.
2634
2635 2005-01-14  Darin Adler  <darin@apple.com>
2636
2637         * khtml/css/cssproperties.c: Regenerated with gperf 3.0.1.
2638         * khtml/css/cssvalues.c: Regenerated with gperf 3.0.1.
2639         * khtml/misc/htmlattrs.c: Regenerated with gperf 3.0.1.
2640         * khtml/misc/htmltags.c: Regenerated with gperf 3.0.1.
2641
2642 2005-01-14  Chris Blumenberg  <cblu@apple.com>
2643
2644         Fixed: <rdar://problem/3886415> arrow keys don't work when the user hits Back to return to RSS page
2645
2646         Reviewed by hyatt.
2647
2648         (KWQKHTMLPart::openURLFromPageCache): restore mousePressNode
2649         (KWQKHTMLPart::mousePressNode): new
2650         * kwq/KWQPageState.h:
2651         * kwq/KWQPageState.mm:
2652         (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]): save the mousePressNode
2653         (-[KWQPageState clear]): clear the mousePressNode
2654         (-[KWQPageState dealloc]): deref the mousePressNode
2655         (-[KWQPageState mousePressNode]): new
2656
2657 === Safari-179 ===
2658
2659 2005-01-13  Vicki Murley <vicki@apple.com>
2660
2661         Reviewed by Adele.
2662
2663         - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
2664
2665         * WebCore.pbproj/project.pbxproj: bump "2004" to "2005"
2666
2667 2005-01-13  David Harrison  <harrison@apple.com>
2668
2669         Reviewed by Ken Kocienda.
2670         
2671         Better fix for 3905066.
2672         
2673         * khtml/editing/htmlediting.cpp:
2674         (khtml::InsertParagraphSeparatorCommand::doApply):
2675
2676 2005-01-10  Maciej Stachowiak  <mjs@apple.com>
2677
2678         Reviewed by Darin.
2679
2680         <rdar://problem/3758033> REGRESSION (Mail): Support attributes in marked text (International input)
2681         
2682         * khtml/rendering/render_text.cpp:
2683         (InlineTextBox::paint): Support painting custom underline markers for
2684         marked text in place of generic yellow.
2685         (InlineTextBox::paintMarkedTextUnderline): New method that handles this.
2686         * khtml/rendering/render_text.h:
2687         * kwq/KWQKHTMLPart.h: Declare new methods and structs.
2688         * kwq/KWQKHTMLPart.mm:
2689         (KWQKHTMLPart::clear): Clear marked test underlines.
2690         (KWQKHTMLPart::setMarkedTextRange): Takes attributes and ranges now.
2691         (convertAttributesToUnderlines): Converts NSAttributedString attributes
2692         to simplified and C++-friendly form.
2693         (KWQKHTMLPart::markedTextUsesUnderlines): New method.
2694         (KWQKHTMLPart::markedTextUnderlines): New method.
2695         * kwq/KWQPainter.mm:
2696         (QPainter::drawLineForText): Handle pen width.
2697         * kwq/WebCoreBridge.h:
2698         * kwq/WebCoreBridge.mm:
2699         (-[WebCoreBridge setMarkedTextDOMRange:customAttributes:ranges:]): Take attributes
2700         and ranges.
2701         * kwq/WebCoreTextRenderer.h:
2702
2703 2005-01-12  David Harrison  <harrison@apple.com>
2704
2705         Reviewed by Dave Hyatt.
2706
2707         <rdar://problem/3888973> AX: Parent AXWebArea of nested AXWebAreas is messed up
2708         
2709         * kwq/KWQAccObject.mm:
2710         (-[KWQAccObject addChildrenToArray:]):
2711         Use the widget's outer view.
2712
2713 2005-01-12  David Harrison  <harrison@apple.com>
2714
2715         Reviewed by Darin Adler.
2716
2717         <rdar://problem/3949908> Crash when asking for the kAXLengthForTextMarkerRangeParameterizedAttribute
2718         
2719         * khtml/xml/dom_nodeimpl.cpp:
2720         (NodeImpl::displayNode):
2721         Add quotes around text node content.
2722         (NodeBaseImpl::childNode):
2723         Add nil check to return nil rather than crash when child node not found.
2724         * kwq/KWQAccObject.mm:
2725         (-[KWQAccObject doAXStringForTextMarkerRange:]):
2726         Pass range compliant positions to TextIterator.
2727
2728 2005-01-12  David Hyatt  <hyatt@apple.com>
2729
2730         Fix for 3951203, CSS border style incorrectly clipped on inline elements.  Make sure the repaint rect set during
2731         line layout is smarter about including the overflow for both old states and new states.
2732         
2733         Reviewed by john
2734
2735         * khtml/rendering/bidi.cpp:
2736         (khtml::RenderBlock::layoutInlineChildren):
2737
2738 2005-01-12  David Hyatt  <hyatt@apple.com>
2739
2740         Fix for bug 3937608, versiontracker.com flashes and displays the right column below content.  Make sure to move
2741         tables/overflows that dont fit within a block only in strict mode.
2742
2743         Fix for bug 3931049, characters dont show up when typing.  Make sure to dirty the right lines when this specific
2744         case in editing is hit.
2745         
2746         Reviewed by darin (first one), kocienda (second one)
2747
2748         * khtml/rendering/render_block.cpp:
2749         (khtml::RenderBlock::getClearDelta):
2750         * khtml/rendering/render_flow.cpp:
2751         (RenderFlow::dirtyLinesFromChangedChild):
2752         * khtml/rendering/render_line.cpp:
2753         (khtml::InlineFlowBox::verticallyAlignBoxes):
2754
2755 2005-01-12  Ken Kocienda  <kocienda@apple.com>
2756
2757         Reviewed by John
2758
2759         Fix for this bug:
2760         
2761         <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
2762
2763         * khtml/editing/htmlediting.cpp:
2764         (khtml::DeleteSelectionCommand::initializePositionData): Change test that will prevent block
2765         merging. End-of-line test was just wrong. Call new start-of and end-of paragraph functions
2766         added to visible_position files.
2767         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Add tests for BR elements, which makes
2768         tests to determine when to stop moving nodes more complete and correct. Also improved comments.
2769         * khtml/editing/visible_position.cpp:
2770         (khtml::isFirstVisiblePositionInParagraph): New function.
2771         (khtml::isLastVisiblePositionInParagraph): New function.
2772         * khtml/editing/visible_position.h: Update header accordingly.
2773         * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: New results, slightly different from former
2774         results but still correct.
2775         * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Ditto.
2776         * layout-tests/editing/deleting/delete-block-merge-contents-018-expected.txt: Added.
2777         * layout-tests/editing/deleting/delete-block-merge-contents-018.html: Added.
2778         * layout-tests/editing/deleting/delete-block-merge-contents-019-expected.txt: Added.
2779         * layout-tests/editing/deleting/delete-block-merge-contents-019.html: Added.
2780         * layout-tests/editing/deleting/delete-block-merge-contents-020-expected.txt: Added.
2781         * layout-tests/editing/deleting/delete-block-merge-contents-020.html: Added.
2782         * layout-tests/editing/deleting/delete-block-merge-contents-021-expected.txt: Added.
2783         * layout-tests/editing/deleting/delete-block-merge-contents-021.html: Added.
2784         * layout-tests/editing/deleting/delete-line-014-expected.txt: These new results are actually better, and fix a bug.
2785
2786 2005-01-11  Richard Williamson   <rjw@apple.com>
2787
2788         Fixed 3922875.  Fall back to DOM object is EMBED element
2789         has no associated runtime object.
2790
2791         Reviewed by Chris.
2792
2793         * khtml/ecma/kjs_dom.cpp:
2794         (KJS::getRuntimeObject):
2795         * khtml/ecma/kjs_html.cpp:
2796         (KJS::HTMLDocument::tryGet):
2797         (KJS::HTMLElement::tryGet):
2798         (KJS::HTMLCollection::tryGet):
2799         (KJS::HTMLCollection::getNamedItems):
2800
2801 2005-01-11  David Hyatt  <hyatt@apple.com>
2802
2803         Fix for 3882299, missing content on gibson.com.  Change our handling of " and ' in certain states of the parser to match
2804         other browsers.
2805         
2806         Reviewed by Maciej
2807
2808         * khtml/html/htmltokenizer.cpp:
2809         (khtml::HTMLTokenizer::parseTag):
2810
2811 2005-01-11  Chris Blumenberg  <cblu@apple.com>
2812
2813         Fixed: <rdar://problem/3930733> Mail prints second page of email blank
2814
2815         Reviewed by dave.
2816
2817         * khtml/rendering/render_canvas.cpp:
2818         (RenderCanvas::paint): cache the print rect since the dirty rect can get changed during printing
2819         * khtml/rendering/render_flow.cpp:
2820         (RenderFlow::paintLines): removed null check since the print rect should never be null
2821         * khtml/rendering/render_list.cpp:
2822         (RenderListMarker::paint): ditto
2823         * kwq/KWQKHTMLPart.mm:
2824         (KWQKHTMLPart::adjustPageHeight): don't set the print rect here since this method is not called for the last page
2825
2826 2005-01-10  Ken Kocienda  <kocienda@apple.com>
2827
2828         Reviewed by Hyatt
2829
2830         Fix for this bug:
2831         
2832         <rdar://problem/3943648> extra line is inserted after pressing return within quoted text of reply
2833
2834         * khtml/editing/htmlediting.cpp:
2835         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): This bug was the result of a 
2836         simple coding mistake. A local variable was erroneously redefined in a deeper scope, and so the 
2837         result calculated in that deeper scope was not available when tested.
2838
2839 2005-01-10  Ken Kocienda  <kocienda@apple.com>
2840
2841         Reviewed by John
2842
2843         Fix for this bug:
2844         
2845         <rdar://problem/3946852> Option-e goes to next line
2846
2847         * khtml/editing/htmlediting.cpp:
2848         (khtml::ReplaceSelectionCommand::doApply): Tweak case used to determine when merging content
2849         into the start line is done. We plan to change pretty substantially soon to better handle
2850         the problem described in <rdar://problem/3937352> Quote level not maintained when copied 
2851         and pasted within a Mail message. In the meantime, this change does no harm, and fixes the bug.
2852
2853 2005-01-10  Ken Kocienda  <kocienda@apple.com>
2854
2855         Reviewed by Darin
2856
2857         Fix for this bug:
2858         
2859         <rdar://problem/3907005> Applying block styles to a line of text can unexpectedly affect other lines
2860
2861         * khtml/editing/htmlediting.cpp:
2862         (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): New function which moves "paragraphs"
2863         to their own blocks if needed so that a block style can be applied.
2864         (khtml::CompositeEditCommand::isMailBlockquote): Moved this function to base class so it can be used more generally.
2865         (khtml::ApplyStyleCommand::applyBlockStyle): Pass a node instead of a block to addBlockStyleIfNeeded().
2866         (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Now accepts a node instead of a block for styling.
2867         This function also now calls moveParagraphContentsToNewBlockIfNecessary() to make sure that only the current
2868         paragraph is styled.
2869         (khtml::SetNodeAttributeCommand::doUnapply): Should not assert on undo if old value of attribute was null.
2870         Should remove attributue instead.
2871         * khtml/editing/htmlediting.h: Touch function declarations accordingly.
2872         * layout-tests/editing/style/create-block-for-style-001-expected.txt: Added.
2873         * layout-tests/editing/style/create-block-for-style-001.html: Added.
2874         * layout-tests/editing/style/create-block-for-style-002-expected.txt: Added.
2875         * layout-tests/editing/style/create-block-for-style-002.html: Added.
2876         * layout-tests/editing/style/create-block-for-style-003-expected.txt: Added.
2877         * layout-tests/editing/style/create-block-for-style-003.html: Added.
2878         * layout-tests/editing/style/create-block-for-style-004-expected.txt: Added.
2879         * layout-tests/editing/style/create-block-for-style-004.html: Added.
2880         * layout-tests/editing/style/create-block-for-style-005-expected.txt: Added.
2881         * layout-tests/editing/style/create-block-for-style-005.html: Added.
2882         * layout-tests/editing/style/create-block-for-style-006-expected.txt: Added.
2883         * layout-tests/editing/style/create-block-for-style-006.html: Added.
2884         * layout-tests/editing/style/create-block-for-style-007-expected.txt: Added.
2885         * layout-tests/editing/style/create-block-for-style-007.html: Added.
2886         * layout-tests/editing/style/create-block-for-style-008-expected.txt: Added.
2887         * layout-tests/editing/style/create-block-for-style-008.html: Added.
2888         * layout-tests/editing/style/create-block-for-style-009-expected.txt: Added.
2889         * layout-tests/editing/style/create-block-for-style-009.html: Added.
2890         * layout-tests/editing/style/create-block-for-style-010-expected.txt: Added.
2891         * layout-tests/editing/style/create-block-for-style-010.html: Added.
2892         * layout-tests/editing/style/create-block-for-style-011-expected.txt: Added.
2893         * layout-tests/editing/style/create-block-for-style-011.html: Added.
2894         * layout-tests/editing/style/create-block-for-style-012-expected.txt: Added.
2895         * layout-tests/editing/style/create-block-for-style-012.html: Added.
2896         * layout-tests/editing/style/create-block-for-style-013-expected.txt: Added.
2897         * layout-tests/editing/style/create-block-for-style-013.html: Added.
2898
2899         Unrelated updates to these expected results.
2900         * layout-tests/editing/inserting/insert-div-007-expected.txt
2901         * layout-tests/editing/pasteboard/paste-text-013-expected.txt
2902
2903 2005-01-10  Chris Blumenberg  <cblu@apple.com>
2904
2905         Fixed: <rdar://problem/3936844> Mail: Messages with rich text do not print
2906
2907         Reviewed by john.
2908
2909         * khtml/rendering/render_flow.cpp:
2910         (RenderFlow::paintLines): don't do pagination work if printRect is not set
2911         * khtml/rendering/render_list.cpp:
2912         (RenderListMarker::paint): ditto
2913
2914 2005-01-10  David Harrison  <harrison@apple.com>
2915
2916         Reviewed by Darin.
2917
2918         * kwq/KWQTextUtilities.mm:
2919         (currentTextBreakLocaleID):
2920         Return empty string (AKA root locale) if locale pref can not be canonicalized.
2921
2922 2005-01-10  John Sullivan  <sullivan@apple.com>
2923
2924         Fixed broken Panther build.
2925
2926         * kwq/KWQTextUtilities.mm:
2927         (currentTextBreakLocaleID):
2928         This recently-added function was using code copy/pasted from CarbonCore UnicodeUtilities.
2929         That code used a Tiger-only function, CFLocaleCreateCanonicalLanguageIdentifierFromString.
2930         To fix the build, I added a BUILDING_ON_PANTHER #ifdef that avoids the call to the Tiger
2931         function. However, the Tiger-only code was wrong; the string generated using 
2932         CFLocaleCreateCanonicalLanguageIdentifierFromString was not used at all, so I fixed that
2933         as well.
2934
2935 2005-01-09  David Harrison  <harrison@apple.com>
2936
2937         Reviewed by Ken Kocienda.
2938
2939         <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
2940         
2941         * khtml/editing/htmlediting.cpp:
2942         (khtml::ReplaceSelectionCommand::doApply):
2943         Tune check for need for insertParagraphSeparator when hasInterchangeNewline.
2944
2945 2005-01-09  Darin Adler  <darin@apple.com>
2946
2947         Reviewed by Harrison.
2948
2949         - fixed <rdar://problem/3939176> select() method does not work on <input type=search>
2950
2951         * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::select): Changed if statement
2952         to a switch statement. Added SEARCH to the set of types that treat the renderer as a
2953         RenderLineEdit.
2954
2955 2005-01-09  David Harrison  <harrison@apple.com>
2956
2957         Reviewed by Ken Kocienda.
2958
2959         <rdar://problem/3905066> REGRESSION (Mail): Hitting return key with caret in front of space causes space to become lost (resize fixes)
2960
2961         Problem was that InsertParagraphSeparatorCommand::doApply() was not collapsing
2962         whitespace to a single non-breaking space when splitting a text node.
2963
2964         * khtml/editing/htmlediting.cpp:
2965         (khtml::InsertParagraphSeparatorCommand::doApply):
2966
2967 2005-01-08  Kevin Decker  <kdecker@apple.com>
2968
2969         Reviewed by Ken.
2970
2971         Fixed: <rdar://problem/3924219> Calling setOuterHTML: on a DOMHTMLHtmlElement can crash a program
2972
2973         * khtml/html/html_elementimpl.cpp:
2974         (HTMLElementImpl::setOuterHTML): Added a nil check for fragments who don't have parents.
2975
2976 2005-01-07  Maciej Stachowiak  <mjs@apple.com>
2977
2978         Reviewed by Darin.
2979         
2980         <rdar://problem/3807144> REGRESSION (125-TOT): my bank's website doesn't work (Societe Generale, socgen.com)
2981
2982         * Khtml/khtml_part.cpp:
2983         (KHTMLPart::checkCompleted): If the document is NULL, assume this frame has
2984         not started loading yet so it could not possibly be finishing here...
2985         (KHTMLPart::stop): ...unless the part is explicitly stopped and there is still
2986         no document, in this case we must have hit an error or been loading a non-HTML
2987         frame.
2988         * khtml/khtml_part.h:
2989
2990 2005-01-08  David Harrison  <harrison@apple.com>
2991
2992         Reviewed by Maciej.
2993
2994         <rdar://problem/3943415> REGRESSION (Mail): double-clicking past word selects previous word instead of only blank space
2995         
2996         * khtml/editing/selection.cpp:
2997         (khtml::Selection::validate):
2998         Tune word selections left/right choice to use right if on empty last line.
2999
3000 2005-01-07  David Harrison  <harrison@apple.com>
3001
3002         Reviewed by Darin.
3003
3004         <rdar://problem/3942619> AX: Support sentence ax attributes
3005
3006         Needed to use the unicode utilities properly.  Twas lame before.
3007
3008         * khtml/editing/visible_units.cpp:
3009         (khtml::previousBoundary):
3010         (khtml::nextBoundary):
3011         (khtml::startOfWord):
3012         (khtml::endOfWord):
3013         (khtml::previousWordPosition):
3014         (khtml::nextWordPosition):
3015         (khtml::startOfSentence):
3016         (khtml::endOfSentence):
3017         (khtml::previousSentencePosition):
3018         (khtml::nextSentencePosition):
3019         * kwq/KWQAccObject.mm:
3020         (-[KWQAccObject accessibilityAttributeNames]):
3021         (-[KWQAccObject accessibilityAttributeValue:]):
3022         (-[KWQAccObject accessibilityParameterizedAttributeNames]):
3023         (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
3024         * kwq/KWQTextUtilities.mm:
3025         (currentTextBreakLocaleID):
3026         (KWQFindSentenceBoundary):
3027         (KWQFindNextSentenceFromIndex):
3028
3029 2005-01-07  Ken Kocienda  <kocienda@apple.com>
3030
3031         Reviewed by Kevin
3032
3033         Fix for these bugs:
3034         
3035         <rdar://problem/3939523> in some cases, text does not retain style info after pressing return twice
3036         <rdar://problem/3944492> after pressing return twice, text is bold when it shouldn't be
3037
3038         * khtml/editing/htmlediting.cpp:
3039         (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion):
3040         Merge the typing style with the computed style for the current position. Fixes both bugs.
3041         * khtml/editing/htmlediting.h:
3042         * layout-tests/editing/inserting/insert-div-023-expected.txt: Added.
3043         * layout-tests/editing/inserting/insert-div-023.html: Added.
3044         * layout-tests/editing/inserting/insert-div-024-expected.txt: Added.
3045         * layout-tests/editing/inserting/insert-div-024.html: Added.
3046
3047 2005-01-07  David Hyatt  <hyatt@apple.com>
3048
3049         Fix for 3941364, make sure tables reset overflowWidth/Height when they lay out again.  Fixes the odd scrolling
3050         behavior on worldofwarcraft.com.
3051         
3052         Reviewed by kevin
3053
3054         * khtml/rendering/render_table.cpp:
3055         (RenderTable::layout):
3056
3057 2005-01-06  David Hyatt  <hyatt@apple.com>
3058
3059         Fix for 3932418 and 3920998, assertion failures caused by stray inline content inside tables.  Bulletproof the hit testing to
3060         ignore inline flows in this case.
3061         
3062         Reviewed by kevin
3063
3064         * khtml/rendering/render_block.cpp:
3065         (khtml::RenderBlock::nodeAtPoint):
3066
3067 2005-01-07  Ken Kocienda  <kocienda@apple.com>
3068
3069         Reviewed by Hyatt
3070
3071         Fix for this bug:
3072         
3073         <rdar://problem/3848412> for forwarded message, tabbing to message view scrolls to bottom of view
3074
3075         * kwq/KWQKHTMLPart.mm:
3076         (KWQKHTMLPart::nextKeyViewInFrame): Don't scroll the focus node to visible if it is not
3077         in the document, or if it is not a descendent of the document element. In the case of the bug,
3078         since the selection has not yet been set up, the focus node passed here is the HTML element, and
3079         that does not yield a rect that is useful to us here. So now, in the case the bug mentions, we do nothing.
3080
3081 2005-01-06  Kevin Decker  <kdecker@apple.com>
3082
3083         Reviewed by mjs.
3084
3085         Fixed: <rdar://problem/3932215> REGRESSION (125-177): iFrame example at developer.apple.com fails in Safari
3086
3087         * khtml/khtml_part.cpp:
3088         (KHTMLPart::processObjectRequest): m_bComplete was never true for frames generated by Javascript due to our synchronous loading and as a result, scheduled redirects wouldn't fire in KHTMLPart::scheduleLocationChange().  By virtue of being an empty document, a document is complete.  In this special case it's safe at this point to call checkCompleted() which sets m_bComplete true. 
3089
3090 === Safari-178 ===
3091
3092 2005-01-06  David Harrison  <harrison@apple.com>
3093
3094         Reviewed by Chris.
3095
3096         (addendum to previous checkin for this bug) 
3097         <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
3098
3099         Fix line navigation.  Add AXUIElementForTextMarker.
3100
3101         * kwq/KWQAccObject.mm:
3102         (-[KWQAccObject accessibilityParameterizedAttributeNames]):
3103         (-[KWQAccObject doAXUIElementForTextMarker:]):
3104         (-[KWQAccObject doAXLineForTextMarker:]):
3105         (-[KWQAccObject doAXTextMarkerRangeForLine:]):
3106         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
3107         (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
3108         (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
3109         (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
3110
3111 2005-01-06  Darin Adler  <darin@apple.com>
3112
3113         Reviewed by Ken.
3114
3115         - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
3116
3117         (turns out the PLT regression was a false alarm)
3118
3119         * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
3120         the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
3121         much larger number.
3122         * khtml/html/htmlparser.cpp:
3123         (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
3124         sense to just have the array be a member so we don't have to use new and delete on it. Also needed
3125         to eliminate code that used ID_CLOSE_TAG for an array size.
3126         (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
3127         that manages isindex to use deref instead of delete.
3128         (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
3129         mistake of using ID_CLOSE_TAG for the array size too.
3130         (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
3131         there and it would prevent custom tags from working. Added range check before using the forbidden
3132         tag array with the token ID since custom tags will use index values past the end of the array.
3133         (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
3134         inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
3135         createElement call is still here. Last time I left out a few form element types from this switch;
3136         fixed now.
3137         * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
3138         document if getTagID fails; this creates a unique per-document ID.
3139
3140         * khtml/misc/htmltags.c: Regenerated.
3141         * khtml/misc/htmltags.h: Regenerated.
3142
3143         * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
3144         Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
3145         Also rewrote getTagName to work with the new scheme.
3146
3147 2005-01-06  David Harrison  <harrison@apple.com>
3148         
3149         Fixed Panther build.  Also, do not advertize sentence support since it is incomplete.
3150         
3151         * kwq/KWQAccObject.mm:
3152         (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
3153         (-[KWQAccObject accessibilityParameterizedAttributeNames]):
3154         (-[KWQAccObject accessibilityIsAttributeSettable:]):
3155
3156 2005-01-06  David Harrison  <harrison@apple.com>
3157
3158         Reviewed by Dave Hyatt.
3159
3160         <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
3161         <rdar://problem/3588548> AX: tabbing does not work correctly with the screen reader and a focused link; need AXFocusedUIElement to work
3162         
3163         Many more AX attributes supported.  Numerous fixes to previous AX work.
3164         
3165         * khtml/editing/visible_units.cpp:
3166         (khtml::startSentenceBoundary):
3167         (khtml::startOfSentence):
3168         (khtml::endSentenceBoundary):
3169         (khtml::endOfSentence):
3170         (khtml::previousSentencePositionBoundary):
3171         (khtml::previousSentencePosition):
3172         (khtml::nextSentencePositionBoundary):
3173         (khtml::nextSentencePosition):
3174         * khtml/editing/visible_units.h:
3175         * khtml/khtmlview.cpp:
3176         (KHTMLView::layout):
3177         * khtml/misc/helper.cpp:
3178         (khtml::findSentenceBoundary):
3179         (khtml::nextSentenceFromIndex):
3180         * khtml/misc/helper.h:
3181         * khtml/misc/htmltags.c:
3182         (hash_tag):
3183         (findTag):
3184         * khtml/rendering/render_container.cpp:
3185         (RenderContainer::removeChildNode):
3186         (RenderContainer::appendChildNode):
3187         (RenderContainer::insertChildNode):
3188         * khtml/rendering/render_object.cpp:
3189         (RenderObject::remove):
3190         * khtml/xml/dom_docimpl.cpp:
3191         (DocumentImpl::getAccObjectCache):
3192         (DocumentImpl::updateSelection):
3193         (DocumentImpl::close):
3194         (DocumentImpl::setFocusNode):
3195         (DocumentImpl::parentDocument):
3196         (DocumentImpl::topDocument):
3197         * khtml/xml/dom_docimpl.h:
3198         * kwq/KWQAccObject.mm:
3199         (-[KWQAccObject accessibilityShouldUseUniqueId]):
3200         (-[KWQAccObject detach]):
3201         (-[KWQAccObject anchorElement]):
3202         (-[KWQAccObject firstChild]):
3203         (-[KWQAccObject lastChild]):
3204         (-[KWQAccObject previousSibling]):
3205         (-[KWQAccObject nextSibling]):
3206         (-[KWQAccObject parentObject]):
3207         (-[KWQAccObject value]):
3208         (-[KWQAccObject accessibilityAttributeNames]):
3209         (-[KWQAccObject accessibilityPerformAction:]):
3210         (-[KWQAccObject textMarkerForVisiblePosition:]):
3211         (-[KWQAccObject visiblePositionForTextMarker:]):
3212         (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
3213         (-[KWQAccObject topDocument]):
3214         (-[KWQAccObject topRenderer]):
3215         (-[KWQAccObject topView]):
3216         (-[KWQAccObject accessibilityAttributeValue:]):
3217         (-[KWQAccObject accessibilityParameterizedAttributeNames]):
3218         (-[KWQAccObject doAXLineForTextMarker:]):
3219         (-[KWQAccObject doAXTextMarkerRangeForLine:]):
3220         (-[KWQAccObject doAXStringForTextMarkerRange:]):
3221         (-[KWQAccObject doAXTextMarkerForPosition:]):
3222         (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
3223         (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
3224         (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
3225         (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
3226         (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
3227         (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
3228         (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
3229         (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
3230         (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
3231         (-[KWQAccObject doAXSentenceTextMarkerRangeForTextMarker:]):
3232         (-[KWQAccObject doAXParagraphTextMarkerRangeForTextMarker:]):
3233         (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
3234         (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
3235         (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
3236         (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
3237         (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
3238         (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
3239         (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
3240         (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
3241         (-[KWQAccObject doAXLengthForTextMarkerRange:]):
3242         (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
3243         (-[KWQAccObject accessibilityHitTest:]):
3244         (-[KWQAccObject accessibilityFocusedUIElement]):
3245         (-[KWQAccObject accessibilityIsAttributeSettable:]):
3246         (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
3247         (-[KWQAccObject setAccObjectID:]):
3248         (-[KWQAccObject removeAccObjectID]):
3249         * kwq/KWQAccObjectCache.h:
3250         * kwq/KWQAccObjectCache.mm:
3251         (KWQAccObjectCache::setAccObject):
3252         (KWQAccObjectCache::removeAccObject):
3253         (KWQAccObjectCache::visiblePositionForTextMarker):
3254         (KWQAccObjectCache::postNotificationToTopWebArea):
3255         (KWQAccObjectCache::postNotification):
3256         (KWQAccObjectCache::handleFocusedUIElementChanged):
3257         * kwq/KWQKHTMLPart.mm:
3258         (KWQKHTMLPart::respondToChangedContents):
3259         * kwq/KWQTextUtilities.h:
3260         * kwq/KWQTextUtilities.mm:
3261         (KWQFindNextWordFromIndex):
3262         (KWQFindSentenceBoundary):
3263         (KWQFindNextSentenceFromIndex):
3264         * kwq/WebCoreBridge.mm:
3265         (-[WebCoreBridge accessibilityTree]):
3266
3267 2005-01-05  Darin Adler  <darin@apple.com>
3268
3269         Reviewed by Ken.
3270
3271         - re-landing a subset of my custom tag change that does not fix the bug, but also does
3272           not introduce a performance regression
3273
3274         * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
3275         some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
3276
3277         * khtml/editing/htmlediting.cpp:
3278         (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
3279         per-document tags and is just better all around for things like the document.
3280         (khtml::debugNode): Ditto.
3281         * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
3282         * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
3283         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
3284         * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
3285
3286         * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
3287         non-HTML elements to be nested as desired.
3288
3289         * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
3290         * khtml/misc/htmlhashes.cpp:
3291         (khtml::getTagID): Changed return type to unsigned short.
3292         (khtml::getAttrID): Ditto.
3293
3294         * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
3295         * khtml/xml/dom_docimpl.cpp:
3296         (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
3297         Also updated for a few tags that the parser handled but this did not.
3298
3299         * kwq/KWQRenderTreeDebug.cpp:
3300         (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
3301         the tag ID directly, which only works for standard nodes.
3302         (operator<<): Update to call getTagName.
3303         (nodePositionRelativeToRoot): Ditto.
3304         (writeSelection): Ditto.
3305
3306 2005-01-05  Ken Kocienda  <kocienda@apple.com>
3307
3308         Reviewed by Hyatt
3309
3310         Fix for this bug:
3311         
3312         <rdar://problem/3941203> REGRESSION (Mail): Paste inserts content in wrong place
3313
3314         * khtml/editing/htmlediting.cpp:
3315         (khtml::ReplaceSelectionCommand::doApply): Some cleanup and refinement of the concepts used to make
3316         this operation work correctly, particularly in the logic to figure out whether to merge content, and
3317         also performing merges.
3318         * khtml/editing/visible_position.cpp: