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