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