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