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