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