Reviewed by Kevin.
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 2004-11-13  Maciej Stachowiak  <mjs@apple.com>
2
3         Reviewed by Kevin.
4
5         <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
6
7         * khtml/dom/dom_node.cpp:
8         (NodeList::itemById): New method, just forward to impl.
9         * khtml/dom/dom_node.h: Prototype it.
10         * khtml/ecma/kjs_dom.cpp:
11         (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
12         let the NodeList do it. The NodeList might be able to do it more efficiently.
13         * khtml/xml/dom_nodeimpl.cpp:
14         (NodeListImpl::itemById): Optimize for the case where the NodeList
15         covers the whole document. In this case, just use getElementById,
16         then check that the element satisfies the list criteria.
17         (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
18         (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
19         * khtml/xml/dom_nodeimpl.h:
20
21 2004-11-12  Maciej Stachowiak  <mjs@apple.com>
22
23         Reviewed by Gramps.
24
25         - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
26         sometimes using a huge bogus length value.
27         
28         * khtml/xml/dom_nodeimpl.cpp:
29         (NodeListImpl::NodeListImpl): Initialize isCacheValid.
30
31 2004-11-12  Darin Adler  <darin@apple.com>
32
33         Reviewed by Maciej.
34
35         - fixed an infinite loop in that last check-in
36
37         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
38         Added a ++i to the loop so it won't get stuck on the first element in the list.
39
40 2004-11-12  Maciej Stachowiak  <mjs@apple.com>
41
42         Reviewed by Kevin.
43
44         - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
45         
46         I fixed this by changing NodeLists to cache their length, but
47         invalidate it whenever there is a change in the DOM subtree at
48         which they are rooted. This makes NodeListImpl::recursiveLength()
49         drop completely off the profile, since we were repeatedly getting
50         a length for the same NodeList over and over.
51         
52         * khtml/xml/dom_nodeimpl.cpp:
53         (NodeImpl::NodeImpl):
54         (NodeImpl::~NodeImpl):
55         (NodeImpl::registerNodeList):
56         (NodeImpl::unregisterNodeList):
57         (NodeImpl::notifyLocalNodeListsSubtreeModified):
58         (NodeImpl::notifyNodeListsSubtreeModified):
59         (NodeImpl::dispatchSubtreeModifiedEvent):
60         (NodeListImpl::NodeListImpl):
61         (NodeListImpl::~NodeListImpl):
62         (NodeListImpl::recursiveLength):
63         (NodeListImpl::recursiveItem):
64         (NodeListImpl::rootNodeSubtreeModified):
65         (ChildNodeListImpl::ChildNodeListImpl):
66         (ChildNodeListImpl::length):
67         (ChildNodeListImpl::item):
68         (TagNodeListImpl::TagNodeListImpl):
69         (TagNodeListImpl::length):
70         (TagNodeListImpl::item):
71         (NameNodeListImpl::NameNodeListImpl):
72         (NameNodeListImpl::length):
73         (NameNodeListImpl::item):
74         * khtml/xml/dom_nodeimpl.h:
75
76 2004-11-12  Darin Adler  <darin@apple.com>
77
78         Reviewed by Maciej.
79
80         - various small cleanups
81
82         * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
83         * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
84
85         * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
86         * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
87         * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
88         * khtml/html/htmltokenizer.cpp:
89         (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
90         (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
91
92         * khtml/khtml_part.h: Removed docImpl function.
93         * khtml/khtml_part.cpp: Ditto.
94
95         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
96         the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
97
98         * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
99         * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
100         part of the change last time, which is why the build broke).
101         (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
102         (KWQKHTMLPart::setPolicyBaseURL): Ditto.
103         (KWQKHTMLPart::keyEvent): Ditto.
104         (KWQKHTMLPart::dispatchCPPEvent): Ditto.
105         (KWQKHTMLPart::bodyBackgroundColor): Ditto.
106
107 2004-11-12  Chris Blumenberg  <cblu@apple.com>
108
109         <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
110
111         Reviewed by rjw.
112
113         * kwq/KWQKHTMLPart.mm:
114         (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
115
116 === Safari-171 ===
117
118 2004-11-12  Darin Adler  <darin@apple.com>
119
120         Reviewed by Kevin.
121
122         - fixed a couple places that would not work for XML documents
123
124         * khtml/ecma/kjs_window.cpp:
125         (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
126         is present on the base class.
127         (WindowFunc::tryCall): More of the same.
128
129 2004-11-12  Darin Adler  <darin@apple.com>
130
131         - land versions of these files generated by the newer gperf
132
133         People building on Panther will continue to see these files modified.
134         A workaround would be to install the newer gperf on our Tiger build machines.
135
136         * khtml/css/cssproperties.c: Regenerated.
137         * khtml/css/cssvalues.c: Regenerated.
138         * khtml/html/doctypes.cpp: Regenerated.
139         * khtml/html/kentities.c: Regenerated.
140         * khtml/misc/htmlattrs.c: Regenerated.
141         * khtml/misc/htmltags.c: Regenerated.
142         * kwq/KWQColorData.c: Regenerated.
143
144 2004-11-11  Richard Williamson   <rjw@apple.com>
145         
146         Fix build horkage from previous checkin.
147                 
148         * kwq/KWQKHTMLPart.h:
149
150 2004-11-11  Darin Adler  <darin@apple.com>
151
152         Reviewed by John.
153
154         - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
155
156         * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
157
158         * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
159         * kwq/KWQKHTMLPart.mm:
160         (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
161         method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
162         we started with the NSTextField as first responder, and then took focus away and gave it back, which
163         makes dragging text work again.
164         (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
165
166 2004-11-11  David Hyatt  <hyatt@apple.com>
167
168         Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
169         
170         Reviewed by vicki
171
172         * khtml/html/htmltokenizer.cpp:
173         (khtml::HTMLTokenizer::continueProcessing):
174
175 2004-11-11  Ken Kocienda  <kocienda@apple.com>
176
177         Reviewed by Maciej
178
179         * khtml/editing/htmlediting.cpp:
180         (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
181         of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
182         with the prevailing style for the VisiblePosition class.
183         * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files. 
184         * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
185         (khtml::visiblePositionsInDifferentBlocks): New helper method.
186         (khtml::isLastVisiblePositionInBlock): Ditto.
187         (khtml::isLastVisiblePositionInNode): Ditto.
188         * khtml/editing/visible_position.h: Add declarations for new functions.
189
190 2004-11-11  Ken Kocienda  <kocienda@apple.com>
191
192         Reviewed by Hyatt
193
194         * khtml/editing/htmlediting.cpp:
195         (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
196         (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
197         (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
198         (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
199         (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
200         * khtml/xml/dom2_rangeimpl.cpp:
201         (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
202         * khtml/xml/dom2_rangeimpl.h: Ditto.
203
204 2004-11-11  Ken Kocienda  <kocienda@apple.com>
205
206         Reviewed by Harrison
207
208         Some improvements to deleting when complete lines are selected.
209
210         * khtml/editing/htmlediting.cpp:
211         (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
212         the end of a selection is fully selected. Turn off block merging in this case.
213         (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
214         whether a BR immediately followed a block. The old code could erroneously skip nodes.
215         (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
216         start block is selected. This new code will now delete this block in one call, rather
217         than iterating over each child.
218         * khtml/editing/visible_position.cpp:
219         (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
220         to do the work mentioned above in the comment for that function.
221         (khtml::isFirstVisiblePositionOnLine): Ditto.
222         (khtml::isLastVisiblePositionOnLine): Ditto.
223         * khtml/editing/visible_position.h: Add new functions.
224         * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
225         * layout-tests/editing/deleting/delete-line-001.html: Added.
226         * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
227         * layout-tests/editing/deleting/delete-line-002.html: Added.
228         * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
229         * layout-tests/editing/deleting/delete-line-003.html: Added.
230         * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
231         * layout-tests/editing/deleting/delete-line-004.html: Added.
232         * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
233         * layout-tests/editing/deleting/delete-line-005.html: Added.
234         * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
235         * layout-tests/editing/deleting/delete-line-006.html: Added.
236         * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
237         * layout-tests/editing/deleting/delete-line-007.html: Added.
238         * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
239         * layout-tests/editing/deleting/delete-line-008.html: Added.
240         * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
241         * layout-tests/editing/deleting/delete-line-009.html: Added.
242         * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
243         * layout-tests/editing/deleting/delete-line-010.html: Added.
244         * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
245         * layout-tests/editing/deleting/delete-line-011.html: Added.
246         * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
247         * layout-tests/editing/deleting/delete-line-012.html: Added.
248
249 2004-11-11  Ken Kocienda  <kocienda@apple.com>
250
251         Reviewed by Adele
252
253         * khtml/editing/htmlediting.cpp:
254         (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
255
256 2004-11-11  Ken Kocienda  <kocienda@apple.com>
257
258         Reviewed by John
259
260         Fix for these bugs:
261
262         <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
263         <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
264
265         * khtml/editing/selection.cpp:
266         (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
267         the next line position when necessary.
268         * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
269         * layout-tests/editing/selection/move-3875618-fix.html: Added.
270         * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
271         * layout-tests/editing/selection/move-3875641-fix.html: Added.
272
273 2004-11-11  Ken Kocienda  <kocienda@apple.com>
274
275         Reviewed by John
276
277         Improved some function names, at John's urging. No changes to the
278         functions themselves.
279         
280         canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
281         canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
282         performGeneralDelete() --> handleGeneralDelete()
283
284         * khtml/editing/htmlediting.cpp:
285         (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
286         (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
287         (khtml::DeleteSelectionCommand::handleGeneralDelete)
288         (khtml::DeleteSelectionCommand::doApply)
289         * khtml/editing/htmlediting.h
290
291 2004-11-11  Ken Kocienda  <kocienda@apple.com>
292
293         Reviewed by John
294         
295         Updated some layout test results that changed as a result of my last checking.
296         Added a new test that has been in my tree for a few days.
297
298         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
299         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
300         * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
301         * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
302
303 2004-11-11  Ken Kocienda  <kocienda@apple.com>
304
305         Reviewed by John
306
307         * khtml/editing/htmlediting.cpp:
308         (khtml::debugNode): New debugging helper.
309         (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
310         startPositionForDelete() and endPositionForDelete() functions. Just use the 
311         m_selectionToDelete object to determine start and end positions for the delete.
312         (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
313         function that creates a special case for deleting all the content in a root
314         editable element.
315         (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
316         function before BR special case and the general case delete functions.
317         * khtml/editing/htmlediting.h: Updated for changed functions.
318
319 2004-11-10  Kevin Decker  <kdecker@apple.com>
320
321         Reviewed by mjs.
322         
323         Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.  
324
325         * khtml/ecma/kjs_dom.cpp:
326         (DOMNodeList::tryGet): Got rid of an unnecessary node traversal. 
327
328 2004-11-10  Ken Kocienda  <kocienda@apple.com>
329
330         Reviewed by Chris
331
332         * khtml/editing/htmlediting.cpp:
333         (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
334         smart delete from the two functions below to here. There was an unnecessary double 
335         calculation of the leading and trailing whitespace positions. Also refined the trailing
336         case so it only acts when the leading position is null (which seems to match TextEdit in
337         my tests). Also removed some unnecessary copying of Position objects.
338         (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
339         from here.
340         (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
341
342 2004-11-10  Ken Kocienda  <kocienda@apple.com>
343
344         Reviewed by Harrison
345
346         (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
347         make things more clear.
348         * khtml/editing/selection.cpp:
349         (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the 
350         resulting positions do not cross block boundaries. This was a bug and caused some
351         delete problems when whole blocks were selected. I will be addressing that issue
352         more fully in upcoming changes.
353
354 2004-11-10  Ken Kocienda  <kocienda@apple.com>
355
356         Reviewed by Harrison
357
358         Some cleanups and fixes in upstream and downstream functions. 
359         
360         Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement(). 
361         Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the 
362         block's enclosing block will be returned. 
363         
364         Remove code from upstream that confined the serach to block boundaries outside of
365         the code which runs in the StayInBlock case. This code was redundant, and caused
366         incorrect results to be returned in the DoNotStayInBlock case.
367         
368         In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
369         node, not the the this pointer's node.
370
371         * khtml/xml/dom_position.cpp:
372         (DOM::Position::upstream)
373         (DOM::Position::downstream)
374
375 2004-11-09  David Hyatt  <hyatt@apple.com>
376
377         Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
378         loading large local files.
379         
380         Reviewed by mjs
381
382         * khtml/html/htmltokenizer.cpp:
383         (khtml::HTMLTokenizer::HTMLTokenizer):
384         (khtml::HTMLTokenizer::reset):
385         (khtml::HTMLTokenizer::write):
386         (khtml::HTMLTokenizer::stopped):
387         (khtml::HTMLTokenizer::processingData):
388         (khtml::HTMLTokenizer::continueProcessing):
389         (khtml::HTMLTokenizer::timerEvent):
390         (khtml::HTMLTokenizer::allDataProcessed):
391         (khtml::HTMLTokenizer::end):
392         (khtml::HTMLTokenizer::finish):
393         (khtml::HTMLTokenizer::notifyFinished):
394         * khtml/html/htmltokenizer.h:
395         * khtml/khtml_part.cpp:
396         (KHTMLPart::slotFinished):
397         (KHTMLPart::end):
398         (KHTMLPart::stop):
399         * khtml/khtml_part.h:
400         (KHTMLPart::tokenizerProcessedData):
401         * khtml/khtmlview.cpp:
402         * khtml/xml/dom_docimpl.cpp:
403         * khtml/xml/xml_tokenizer.h:
404         (khtml::Tokenizer::stopped):
405         (khtml::Tokenizer::processingData):
406         * kwq/KWQDateTime.h:
407         * kwq/KWQDateTime.mm:
408         (QDateTime::secsTo):
409         (KWQUIEventTime::uiEventPending):
410         * kwq/KWQKHTMLPart.h:
411         * kwq/KWQKHTMLPart.mm:
412         (KWQKHTMLPart::tokenizerProcessedData):
413         * kwq/WebCoreBridge.h:
414         * kwq/WebCoreBridge.mm:
415         (-[WebCoreBridge stop]):
416         (-[WebCoreBridge numPendingOrLoadingRequests]):
417         (-[WebCoreBridge doneProcessingData]):
418
419 2004-11-09  David Harrison  <harrison@apple.com>
420
421         Reviewed by Ken Kocienda.
422
423                 <rdar://problem/3865837> Wrong text style after delete to start of document
424                 
425         * khtml/editing/htmlediting.cpp:
426         (khtml::DeleteSelectionCommand::saveTypingStyleState):
427         Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
428
429 2004-11-09  Richard Williamson   <rjw@apple.com>
430
431         Fixed <rdar://problem/3872440> NSTimer prematurely released.
432
433         Reviewed by Darin.
434
435         * kwq/KWQTimer.mm:
436         (QTimer::fire):
437         * kwq/KWQWidget.mm:
438         (QWidget::paint):
439
440 2004-11-09  Chris Blumenberg  <cblu@apple.com>
441
442         Reviewed by vicki.
443
444         * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
445
446 2004-11-08  David Harrison  <harrison@apple.com>
447
448         Reviewed by Ken Kocienda.
449
450                 <rdar://problem/3865854> Deleting first line deletes all lines
451                 
452         * khtml/editing/htmlediting.cpp:
453         (khtml::DeleteSelectionCommand::performGeneralDelete):
454         Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
455         of its ancestors, failed to end the loop that deletes all fully selected nodes.  Also,
456         fixed this code to clear m_trailingWhitespaceValid.  Also removed dead m_endingPosition
457         update because it is handled in calculateEndingPosition now.
458         * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
459         * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
460
461 2004-11-08  Ken Kocienda  <kocienda@apple.com>
462
463         Reviewed by Hyatt
464
465         * khtml/html/html_elementimpl.cpp:
466         (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
467         are added to the DOM.
468         * khtml/html/html_elementimpl.h: Ditto.
469         * khtml/html/htmlparser.cpp:
470         (KHTMLParser::KHTMLParser): Ditto.
471         (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
472         * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
473         * khtml/html/htmltokenizer.cpp:
474         (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
475         (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
476         There were a couple of indexing errors that resulted in the comment text containing part of the 
477         comment markers.
478         (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
479         * khtml/html/htmltokenizer.h:  Add flag to constructor so callers can request comment nodes.
480
481 2004-11-08  Chris Blumenberg  <cblu@apple.com>
482
483         Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
484
485         Reviewed by darin.
486
487         * WebCore.pbproj/project.pbxproj: stop unnecessary linking
488         * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
489         * kwq/KWQKHTMLPart.h: ditto
490
491 2004-11-08  Darin Adler  <darin@apple.com>
492
493         Reviewed by John.
494
495         - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
496
497         * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
498         that possibly deletes the QTimer.
499
500 2004-11-08  Chris Blumenberg  <cblu@apple.com>
501
502         Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
503
504         Reviewed by john.
505
506         * kwq/KWQTextField.mm:
507         (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
508         * kwq/WebCoreBridge.h:
509
510 2004-11-08  David Harrison  <harrison@apple.com>
511
512         Reviewed by Darin.
513         
514         Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
515
516         * khtml/editing/htmlediting.cpp:
517         (khtml::DeleteSelectionCommand::moveNodesAfterNode):
518         * khtml/xml/dom_nodeimpl.cpp:
519         (NodeImpl::enclosingInlineElement):
520         * khtml/xml/dom_nodeimpl.h:
521
522 2004-11-05  Chris Blumenberg  <cblu@apple.com>
523
524         Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
525
526         Reviewed by rjw.
527
528         * khtml/editing/htmlediting.cpp:
529         (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
530         * khtml/editing/visible_position.cpp:
531         (khtml::VisiblePosition::character): new, returns the character for the position
532         * khtml/editing/visible_position.h:
533         * kwq/KWQKHTMLPart.h:
534         * kwq/KWQKHTMLPart.mm:
535         (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
536         * kwq/WebCoreBridge.h:
537
538 === Safari-170 ===
539
540 2004-11-05  Adele Amchan  <adele@apple.com>
541
542         Reviewed by Darin
543
544         Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
545         and a workaround for displaying transparent backgrounds for textareas.
546
547         * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
548         * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
549         * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class, 
550           on the contentView, and on the textView.
551
552 2004-11-04  David Hyatt  <hyatt@apple.com>
553
554         Fix for relpositioned inlines.  This was reviewed a long time ago, but I can't recall who reviewed it (either
555         darin or ken).
556         
557         Reviewed by darin or ken
558
559         * khtml/rendering/bidi.cpp:
560         (khtml::appendRunsForObject):
561         (khtml::RenderBlock::skipWhitespace):
562         (khtml::RenderBlock::findNextLineBreak):
563         * khtml/rendering/render_block.cpp:
564         (khtml::RenderBlock::lowestPosition):
565         (khtml::RenderBlock::rightmostPosition):
566         (khtml::RenderBlock::leftmostPosition):
567         * khtml/rendering/render_box.cpp:
568         (RenderBox::position):
569         * khtml/rendering/render_box.h:
570         (khtml::RenderBox::staticX):
571         (khtml::RenderBox::staticY):
572         * khtml/rendering/render_layer.cpp:
573         (RenderLayer::updateLayerPosition):
574         (RenderLayer::convertToLayerCoords):
575         * khtml/rendering/render_line.cpp:
576         (khtml::InlineFlowBox::placeBoxesHorizontally):
577         * khtml/rendering/render_object.h:
578         (khtml::RenderObject::staticX):
579         (khtml::RenderObject::staticY):
580
581         Finish turning on XSLT.  Make sure child stylesheets can load.
582         
583         * khtml/xsl/xslt_processorimpl.cpp:
584         (DOM::stylesheetLoadFunc):
585         (DOM::XSLTProcessorImpl::transformDocument):
586
587 2004-11-04  David Hyatt  <hyatt@apple.com>
588
589         Implement CSS3 support for multiple backgrounds.  Also fix a bug with background propagation so that it only
590         happens (from the <body> to the root) for HTML documents.  Fixed background-position to handle a mixture of
591         keyword and length values.
592
593         Reviewed by darin
594
595         * khtml/css/cssparser.cpp:
596         (CSSParser::parseValue):
597         (CSSParser::addBackgroundValue):
598         (CSSParser::parseBackgroundShorthand):
599         (CSSParser::parseBackgroundColor):
600         (CSSParser::parseBackgroundImage):
601         (CSSParser::parseBackgroundPositionXY):
602         (CSSParser::parseBackgroundPosition):
603         (CSSParser::parseBackgroundProperty):
604         (CSSParser::parseColorFromValue):
605         * khtml/css/cssparser.h:
606         * khtml/css/cssstyleselector.cpp:
607         (khtml::CSSStyleSelector::adjustRenderStyle):
608         (khtml::CSSStyleSelector::applyProperty):
609         (khtml::CSSStyleSelector::mapBackgroundAttachment):
610         (khtml::CSSStyleSelector::mapBackgroundImage):
611         (khtml::CSSStyleSelector::mapBackgroundRepeat):
612         (khtml::CSSStyleSelector::mapBackgroundXPosition):
613         (khtml::CSSStyleSelector::mapBackgroundYPosition):
614         * khtml/css/cssstyleselector.h:
615         * khtml/rendering/render_box.cpp:
616         (RenderBox::paintRootBoxDecorations):
617         (RenderBox::paintBoxDecorations):
618         (RenderBox::paintBackgrounds):
619         (RenderBox::paintBackground):
620         (RenderBox::paintBackgroundExtended):
621         * khtml/rendering/render_box.h:
622         * khtml/rendering/render_form.cpp:
623         (RenderFieldset::paintBoxDecorations):
624         * khtml/rendering/render_line.cpp:
625         (khtml::InlineFlowBox::paintBackgrounds):
626         (khtml::InlineFlowBox::paintBackground):
627         (khtml::InlineFlowBox::paintBackgroundAndBorder):
628         * khtml/rendering/render_line.h:
629         * khtml/rendering/render_object.cpp:
630         (RenderObject::setStyle):
631         (RenderObject::updateBackgroundImages):
632         (RenderObject::getVerticalPosition):
633         * khtml/rendering/render_object.h:
634         (khtml::RenderObject::paintBackgroundExtended):
635         * khtml/rendering/render_style.cpp:
636         (m_next):
637         (BackgroundLayer::BackgroundLayer):
638         (BackgroundLayer::~BackgroundLayer):
639         (BackgroundLayer::operator=):
640         (BackgroundLayer::operator==):
641         (BackgroundLayer::fillUnsetProperties):
642         (BackgroundLayer::cullEmptyLayers):
643         (StyleBackgroundData::StyleBackgroundData):
644         (StyleBackgroundData::operator==):
645         (RenderStyle::diff):
646         (RenderStyle::adjustBackgroundLayers):
647         * khtml/rendering/render_style.h:
648         (khtml::OutlineValue::operator==):
649         (khtml::OutlineValue::operator!=):
650         (khtml::BackgroundLayer::backgroundImage):
651         (khtml::BackgroundLayer::backgroundXPosition):
652         (khtml::BackgroundLayer::backgroundYPosition):
653         (khtml::BackgroundLayer::backgroundAttachment):
654         (khtml::BackgroundLayer::backgroundRepeat):
655         (khtml::BackgroundLayer::next):
656         (khtml::BackgroundLayer::isBackgroundImageSet):
657         (khtml::BackgroundLayer::isBackgroundXPositionSet):
658         (khtml::BackgroundLayer::isBackgroundYPositionSet):
659         (khtml::BackgroundLayer::isBackgroundAttachmentSet):
660         (khtml::BackgroundLayer::isBackgroundRepeatSet):
661         (khtml::BackgroundLayer::setBackgroundImage):
662         (khtml::BackgroundLayer::setBackgroundXPosition):
663         (khtml::BackgroundLayer::setBackgroundYPosition):
664         (khtml::BackgroundLayer::setBackgroundAttachment):
665         (khtml::BackgroundLayer::setBackgroundRepeat):
666         (khtml::BackgroundLayer::clearBackgroundImage):
667         (khtml::BackgroundLayer::clearBackgroundXPosition):
668         (khtml::BackgroundLayer::clearBackgroundYPosition):
669         (khtml::BackgroundLayer::clearBackgroundAttachment):
670         (khtml::BackgroundLayer::clearBackgroundRepeat):
671         (khtml::BackgroundLayer::setNext):
672         (khtml::BackgroundLayer::operator!=):
673         (khtml::BackgroundLayer::containsImage):
674         (khtml::BackgroundLayer::hasImage):
675         (khtml::BackgroundLayer::hasFixedImage):
676         (khtml::RenderStyle::setBitDefaults):
677         (khtml::RenderStyle::hasBackground):
678         (khtml::RenderStyle::hasFixedBackgroundImage):
679         (khtml::RenderStyle::outlineWidth):
680         (khtml::RenderStyle::outlineStyle):
681         (khtml::RenderStyle::outlineStyleIsAuto):
682         (khtml::RenderStyle::outlineColor):
683         (khtml::RenderStyle::backgroundColor):
684         (khtml::RenderStyle::backgroundImage):
685         (khtml::RenderStyle::backgroundRepeat):
686         (khtml::RenderStyle::backgroundAttachment):
687         (khtml::RenderStyle::backgroundXPosition):
688         (khtml::RenderStyle::backgroundYPosition):
689         (khtml::RenderStyle::accessBackgroundLayers):
690         (khtml::RenderStyle::backgroundLayers):
691         (khtml::RenderStyle::outlineOffset):
692         (khtml::RenderStyle::resetOutline):
693         (khtml::RenderStyle::setBackgroundColor):
694         (khtml::RenderStyle::setOutlineWidth):
695         (khtml::RenderStyle::setOutlineStyle):
696         (khtml::RenderStyle::setOutlineColor):
697         (khtml::RenderStyle::clearBackgroundLayers):
698         (khtml::RenderStyle::inheritBackgroundLayers):
699         (khtml::RenderStyle::setOutlineOffset):
700         * khtml/rendering/render_table.cpp:
701         (RenderTable::paintBoxDecorations):
702         (RenderTableCell::paintBoxDecorations):
703
704 2004-11-04  David Hyatt  <hyatt@apple.com>
705
706         Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
707         Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
708
709         Reviewed by darin
710
711         * kwq/KWQTextCodec.mm:
712         (KWQTextDecoder::convertLatin1):
713         (KWQTextDecoder::convertUTF16):
714         (KWQTextDecoder::convertUsingTEC):
715         (KWQTextDecoder::toUnicode):
716
717 2004-11-04  David Hyatt  <hyatt@apple.com>
718
719         Make sure line-height returns the correct value for normal.
720         
721         Reviewed by darin
722
723         * khtml/css/css_computedstyle.cpp:
724         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
725
726 2004-11-04  David Harrison  <harrison@apple.com>
727
728         Reviewed by Ken Kocienda.
729
730                 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
731                 
732         * khtml/editing/htmlediting.cpp:
733         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
734         to, but not including, the enclosingBlockFlowElement) rather than just the source element.
735         Fixed to insert after the destination subtree, rather than the destination element.  Handles
736         edge case of deleting back to the top of the tree, where there is nothing left to insert after.
737         * khtml/xml/dom_nodeimpl.cpp:
738         (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
739         * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
740         * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
741         * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
742
743 2004-11-03  Ken Kocienda  <kocienda@apple.com>
744
745         Reviewed by me
746         
747         More layout tests.
748
749         * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
750         * layout-tests/editing/deleting/delete-br-008.html: Added.
751         * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
752         * layout-tests/editing/deleting/delete-br-009.html: Added.
753         * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
754         * layout-tests/editing/deleting/delete-br-010.html: Added.
755
756 2004-11-03  Maciej Stachowiak  <mjs@apple.com>
757
758         Fix by Yasuo Kida, reviewed by me.
759
760         <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
761         
762         * kwq/KWQKHTMLPart.mm:
763         (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
764         same as a nil range - setting an empty marked range should clear
765         the marked range entirely.
766
767 2004-11-02  Maciej Stachowiak  <mjs@apple.com>
768
769         Reviewed by Dave Hyatt (when I originally coded it).
770
771         WebCore part of fix for:
772
773         <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
774         
775         * kwq/WebCoreBridge.h:
776         * kwq/WebCoreBridge.mm:
777         (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
778         DOMRange, or if the range is split into multiple lines, the rect for the part on
779         the first line only.
780         
781         * khtml/rendering/render_object.cpp:
782         (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
783         for the overrides below.
784         * khtml/rendering/render_object.h:
785         * khtml/rendering/render_box.cpp:
786         (RenderBox::caretRect):
787         * khtml/rendering/render_box.h:
788         * khtml/rendering/render_br.cpp:
789         (RenderBR::caretRect):
790         * khtml/rendering/render_br.h:
791         * khtml/rendering/render_flow.cpp:
792         (RenderFlow::caretRect):
793         * khtml/rendering/render_flow.h:
794         * khtml/rendering/render_text.cpp:
795         (RenderText::caretRect):
796
797 2004-11-02  Ken Kocienda  <kocienda@apple.com>
798
799         Reviewed by Hyatt
800
801         Implemented command to insert a block in response to typing a return key (even though
802         I am not turning that on by default with this patch....that will come later). 
803         
804         This new command is called InsertParagraphSeparatorCommand.
805         
806         Reworked the command and function names associated with inserting content into a 
807         document. Before this patch, there were inputXXX and insertXXX variants, with the
808         former used for more high-level actions and the latter used for lower-level stuff.
809         However, this was confusing as the AppKit uses insertXXX for everything. This resulted
810         in an insertXXX command going through an inputXXX WebCore step and then finally to an
811         insertXXX WebCore step. To make this less confusing, I have changes all the names to
812         be insertXXX, and modified the lower-level operations so that it is clear what they do.
813         
814         * khtml/editing/htmlediting.cpp:
815         (khtml::EditCommandPtr::isInsertTextCommand): Name change.
816         (khtml::EditCommand::isInsertTextCommand): Ditto.
817         (khtml::CompositeEditCommand::inputText): Ditto.
818         (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
819         (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
820         (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
821         (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
822         (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
823         (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
824         (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
825         (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
826         (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
827         (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
828         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
829         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
830         (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
831         (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
832         (khtml::InsertIntoTextNode::doApply): Ditto.
833         (khtml::InsertIntoTextNode::doUnapply): Ditto.
834         (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
835         (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
836         (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
837         (khtml::InsertLineBreakCommand::doApply):
838         (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
839         (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
840         (khtml::InsertNodeBeforeCommand::doApply): Ditto.
841         (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
842         (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
843         (khtml::InsertParagraphSeparatorCommand::doApply):
844         (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
845         Class name change, was InsertNewlineCommandInQuotedContentCommand.
846         (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
847         (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
848         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
849         (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
850         (khtml::InsertTextCommand::doApply): Ditto.
851         (khtml::InsertTextCommand::deleteCharacter): Ditto.
852         (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
853         (khtml::InsertTextCommand::input): Ditto.
854         (khtml::InsertTextCommand::insertSpace): Ditto.
855         (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
856         (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
857         (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
858         (khtml::TypingCommand::insertParagraphSeparator): New function.
859         (khtml::TypingCommand::doApply): Name changes, as above.
860         (khtml::TypingCommand::insertText): Ditto.
861         (khtml::TypingCommand::deleteKeyPressed): Ditto.
862         (khtml::TypingCommand::preservesTypingStyle): Ditto.
863         * khtml/editing/htmlediting.h:
864         (khtml::DeleteFromTextNodeCommand::node): Name change.
865         (khtml::DeleteFromTextNodeCommand::offset): Ditto.
866         (khtml::DeleteFromTextNodeCommand::count): Ditto.
867         (khtml::InsertIntoTextNode::text): Ditto.
868         (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
869         (khtml::InsertNodeBeforeCommand::refChild): Ditto.
870         (khtml::TypingCommand::): Ditto.
871         * khtml/editing/jsediting.cpp: Name changes, as above.
872         * kwq/WebCoreBridge.h:
873         * kwq/WebCoreBridge.mm:
874         (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
875         (-[WebCoreBridge insertParagraphSeparator]): New function.
876         (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
877
878 2004-11-01  Kevin Decker  <kdecker@apple.com>
879
880         Reviewed by rjw.
881
882         fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
883         once and for all. 
884
885         * khtml/ecma/kjs_window.cpp:
886         (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
887
888 2004-11-01  Darin Adler  <darin@apple.com>
889
890         Reviewed by Hyatt.
891
892         - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
893
894         * khtml/css/html4.css: Use color: initial for textarea and related ones.
895
896 2004-11-01  Ken Kocienda  <kocienda@apple.com>
897
898         Reviewed by John
899
900         Fix for this bug:
901         
902         <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
903
904         * khtml/css/css_computedstyle.cpp:
905         (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the 
906         implementation here into new copyPropertiesInSet helper. This now calls the
907         generalized copyPropertiesInSet function with the arguments needed to make copying
908         inheritable work.
909         * khtml/css/css_computedstyle.h:
910         * khtml/css/css_valueimpl.cpp:
911         (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
912         In order to do apply block properties, "regular" style declarations need to do style
913         diffs as well.
914         (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
915         except that it uses a different set of properties that apply only to blocks.
916         (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
917         and copies out those properties listed in a pre-defined set.
918         * khtml/css/css_valueimpl.h:
919         * khtml/editing/htmlediting.cpp:
920         (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
921         block, factoring out some of the special case code that should now only run in the inline case.
922         (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
923         (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
924         special handling for "legacy" HTML styles like <B> and <I>.
925         (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
926         style changes into different kinds. CSS specifies certain properties only apply to certain
927         element types. This set of changes now recognizes two such separate cases: styles that apply
928         to blocks, and styles that apply to inlines.
929         (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
930         (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
931         (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
932         with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
933         done so that the function can be passed a portion of the styles being applied so that block styles
934         and inline styles can be handled separately.
935         (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
936         (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
937         (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
938         (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
939         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
940         * khtml/editing/htmlediting.h:
941         (khtml::StyleChange::): Changed as described above.
942         (khtml::StyleChange::usesLegacyStyles):
943         (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
944         it needs to layout, even though it has not changed position in the DOM. For instance, this is needed 
945         when text align changes.
946         * khtml/khtml_part.cpp:
947         (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
948         the passed-in argument.
949         (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
950         is a caret. Formerly, this just set typing style and made no visible changes to the document.
951
952         New tests.
953
954         * layout-tests/editing/editing.js: Added some glue to change text align.
955         * layout-tests/editing/style/block-style-001-expected.txt: Added.
956         * layout-tests/editing/style/block-style-001.html: Added.
957         * layout-tests/editing/style/block-style-002-expected.txt: Added.
958         * layout-tests/editing/style/block-style-002.html: Added.
959         * layout-tests/editing/style/block-style-003-expected.txt: Added.
960         * layout-tests/editing/style/block-style-003.html: Added.
961
962 === Safari-169 ===
963
964 2004-10-29  Darin Adler  <darin@apple.com>
965
966         Reviewed by Kevin.
967
968         - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
969
970         * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
971         before advancing one character; before it did it backwards.
972
973 2004-10-29  Chris Blumenberg  <cblu@apple.com>
974
975         Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
976
977         Reviewed by kocienda, adele.
978
979         * khtml/rendering/render_frames.cpp:
980         (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
981
982 2004-10-29  Darin Adler  <darin@apple.com>
983
984         Reviewed by Chris.
985
986         - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
987
988         * khtml/khtmlview.cpp:
989         (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
990         deleted before this function finishes running.
991         (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
992         (KHTMLView::viewportMouseReleaseEvent): Ditto.
993         (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
994         is guaranteed to do ref/deref as needed.
995
996         * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
997
998 2004-10-28  Chris Blumenberg  <cblu@apple.com>
999
1000         Enabled XSLT on Panther. See intrigue mail for compiling instructions.
1001
1002         Reviewed by darin.
1003
1004         * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
1005         * WebCorePrefix.h: always use XSLT
1006
1007 2004-10-28  Ken Kocienda  <kocienda@apple.com>
1008
1009         Reviewed by Chris
1010
1011         Fix for these bugs:
1012         
1013         <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
1014         <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
1015         
1016         * khtml/editing/htmlediting.cpp:
1017         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members 
1018         to initialization list, zeroing them out.
1019         (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
1020         handle a delete of content in special cases where the only thing selected is a BR. This
1021         code path is much simpler than the newly-named performGeneralDelete, and detects when no
1022         content merging should be done between blocks. This aspect of the change fixes 3854848.
1023         One of the special cases added fixes 3803832.
1024         (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
1025         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
1026         like the other helpers in this class.
1027         (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
1028         (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
1029         * khtml/editing/htmlediting.h: Added new helper and changed an old one.
1030
1031 2004-10-28  Chris Blumenberg  <cblu@apple.com>
1032
1033         Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
1034
1035         Reviewed by darin.
1036
1037         * kwq/KWQKHTMLPart.mm:
1038         (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
1039
1040 2004-10-28  Ken Kocienda  <kocienda@apple.com>
1041
1042         Reviewed by Harrison
1043
1044         Reorganization of delete command functionality so that doApply is not
1045         several hundred lines long. This is not a squeaky-clean cleanup, but
1046         it is a step in the right direction. No functionality changes.
1047
1048         * khtml/editing/htmlediting.cpp:
1049         (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
1050         (khtml::DeleteSelectionCommand::initializePositionData): New helper.
1051         (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
1052         (khtml::DeleteSelectionCommand::performDelete): Ditto.
1053         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
1054         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
1055         (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
1056         (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
1057         (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
1058         (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
1059         * khtml/editing/htmlediting.h:
1060
1061 2004-10-28  Ken Kocienda  <kocienda@apple.com>
1062
1063         Reviewed by me
1064
1065         * khtml/editing/htmlediting.cpp:
1066         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
1067         new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
1068
1069 2004-10-27  Ken Kocienda  <kocienda@apple.com>
1070
1071         Reviewed by Chris
1072
1073         * khtml/editing/htmlediting.cpp:
1074         (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
1075         whether content not in the block containing the start of the selection is moved to that block
1076         after the selection is deleted.
1077         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
1078         (khtml::DeleteSelectionCommand::doApply): Ditto.
1079         (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
1080         to handle the case of inserting a newline when in quoted content in Mail.
1081         (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
1082         (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
1083         (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
1084         (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
1085         (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
1086         (khtml::TypingCommand::doApply): Ditto.
1087         (khtml::TypingCommand::preservesTypingStyle): Ditto.
1088         * khtml/editing/htmlediting.h: Add new delclarations.
1089         (khtml::TypingCommand::): Ditto.
1090         * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
1091         * kwq/WebCoreBridge.mm:
1092         (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
1093
1094 2004-10-26  Chris Blumenberg  <cblu@apple.com>
1095
1096         Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
1097
1098         Reviewed by dave.
1099
1100         * khtml/ecma/kjs_dom.cpp:
1101         (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
1102         * khtml/ecma/kjs_dom.h:
1103         (KJS::DOMElement::):
1104         * khtml/ecma/kjs_dom.lut.h:
1105         (KJS::):
1106
1107 2004-10-26  David Hyatt  <hyatt@apple.com>
1108
1109         Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
1110         the previous line.
1111         
1112         Reviewed by kocienda
1113
1114         * khtml/rendering/bidi.cpp:
1115         (khtml::RenderBlock::layoutInlineChildren):
1116
1117 2004-10-26  David Hyatt  <hyatt@apple.com>
1118
1119         Convert selectionRect() from using a list to a dict and patch it to be like setSelection.  It was still trying
1120         to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
1121         
1122         Reviewed by kocienda
1123
1124         * khtml/rendering/render_canvas.cpp:
1125         (RenderCanvas::selectionRect):
1126         * khtml/rendering/render_object.h:
1127         (khtml::RenderObject::hasSelectedChildren):
1128
1129 2004-10-26  Ken Kocienda  <kocienda@apple.com>
1130
1131         Reviewed by Hyatt
1132         
1133         Fix for this bug::
1134         
1135         <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
1136
1137         * khtml/editing/htmlediting.cpp:
1138         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
1139         let the caller know if a placeholder was removed.
1140         (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
1141         removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
1142         some cases, the selection was still set on the removed BR, and this was the cause of the
1143         crash.
1144         * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
1145
1146 2004-10-26  Darin Adler  <darin@apple.com>
1147
1148         Reviewed by Chris.
1149
1150         - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
1151
1152         * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
1153
1154 2004-10-26  Ken Kocienda  <kocienda@apple.com>
1155
1156         Reviewed by John
1157
1158         * khtml/editing/htmlediting.cpp:
1159         (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
1160         with a zero-length string. That triggers an assert. Call deleteText instead, 
1161         using the same indices that are passed to replaceText.
1162         
1163         Cleaned up the asserts in these three functions below, making them
1164         more consistent. This is not needed for the fix, but I tripped over
1165         these in the course of debugging.
1166         
1167         (khtml::InsertTextCommand::InsertTextCommand):
1168         (khtml::InsertTextCommand::doApply):
1169         (khtml::InsertTextCommand::doUnapply):
1170
1171 2004-10-25  Adele Amchan <adele@apple.com>
1172
1173         Reviewed by Darin.
1174
1175         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
1176         * khtml/xml/dom_docimpl.h:
1177
1178 2004-10-25  Adele Amchan  <adele@apple.com>
1179
1180         Reviewed by me, code change by Darin.
1181
1182         * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
1183
1184 2004-10-25  Ken Kocienda  <kocienda@apple.com>
1185
1186         Oops. These two test results changed with my last checkin, for the better.
1187
1188         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
1189         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
1190
1191 2004-10-25  Ken Kocienda  <kocienda@apple.com>
1192
1193         Reviewed by Chris
1194
1195         Fix for this bug:
1196         
1197         <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
1198
1199         * khtml/editing/htmlediting.cpp:
1200         (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
1201         expand the selection outwards when the selection is on the visible boundary of a root
1202         editable element. This fixes the bug. Note that this function also contains a little code
1203         I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
1204         (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
1205         (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
1206         * khtml/editing/htmlediting.h: Declare new helpers.
1207         * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
1208         * layout-tests/editing/deleting/delete-select-all-001.html: Added.
1209         * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
1210         * layout-tests/editing/deleting/delete-select-all-002.html: Added.
1211         * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
1212         * layout-tests/editing/deleting/delete-select-all-003.html: Added.
1213
1214 2004-10-25  Ken Kocienda  <kocienda@apple.com>
1215
1216         Added some more editing layout tests.
1217
1218         * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
1219         * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
1220         * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
1221         * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
1222         * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
1223         * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
1224         * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
1225         * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
1226         * layout-tests/editing/inserting/typing-003-expected.txt: Added.
1227         * layout-tests/editing/inserting/typing-003.html: Added.
1228
1229 2004-10-25  Ken Kocienda  <kocienda@apple.com>
1230
1231         Reviewed by John
1232
1233         * khtml/rendering/bidi.cpp:
1234         (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
1235             yesterday quite right: words that should have been placed on the next line were instead
1236         appearing on the line before, beyond the right margin. This was a one-word only error
1237         based on moving the line break object when it should have stayed put. Here is the rule:
1238         The line break object only moves to after the whitespace on the end of a line if that 
1239         whitespace caused line overflow when its width is added in.
1240
1241 2004-10-25  Adele Amchan  <adele@apple.com>
1242
1243         Reviewed by Darin.
1244  
1245         Fix for <rdar://problem/3619890> Feature request: designMode        
1246
1247         This change implements the designMode property of a document.  This is an IE property that is also supported by Mozilla.  
1248         This will enable more JS editing compatibility.
1249
1250         * khtml/ecma/kjs_html.cpp:
1251         (KJS::HTMLDocument::tryGet): added case for designMode
1252         (KJS::HTMLDocument::putValue): added case for designMode
1253         * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
1254         * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
1255         * khtml/xml/dom_docimpl.cpp:
1256         (DocumentImpl::DocumentImpl): initialize m_designMode member variable
1257         (DocumentImpl::setDesignMode): added function to assign m_designMode value
1258         (DocumentImpl::getDesignMode): return m_designMode value
1259         (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value. 
1260             Otherwise, it will just return the m_designMode value.
1261         (DocumentImpl::parentDocument):
1262         * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
1263         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
1264
1265 2004-10-22  Ken Kocienda  <kocienda@apple.com>
1266
1267         Reviewed by Hyatt
1268
1269         Fix for this bug:
1270         
1271         <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
1272
1273         * khtml/editing/htmlediting.cpp:
1274         (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
1275         everything that could be affected.
1276         (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
1277         braces, making it act as a comma operator, with a zero value as the right value!!! This made
1278         an important check always fail!!! It turns out that we do not want the constant at all, since
1279         that constant is only needed when checking a computed style, not an inline style as is being
1280         done here.
1281         (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
1282         (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
1283         RangeImpl::compareBoundaryPoints to perform the required check.
1284         * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
1285
1286 2004-10-22  Ken Kocienda  <kocienda@apple.com>
1287
1288         Reviewed by Hyatt
1289         
1290         Fix for this bugs:
1291         
1292         <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
1293         <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
1294     
1295         * khtml/rendering/bidi.cpp:
1296         (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
1297         it is when we are editing, add in the space of the current character when calculating the width
1298         of committed plus uncommitted characters. If this value exceeds the width of the line, move up
1299         the line break object and call skipWhitespace to move past the end of the whitespace.
1300
1301 === Safari-168 ===
1302
1303 2004-10-22  Ken Kocienda  <kocienda@apple.com>
1304
1305         * WebCore.pbproj/project.pbxproj:
1306          Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
1307
1308 2004-10-21  David Hyatt  <hyatt@apple.com>
1309
1310         Reviewed by darin
1311         
1312         Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
1313         
1314         <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
1315         <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
1316         
1317         * khtml/rendering/render_block.cpp:
1318         (khtml::getInlineRun):
1319         (khtml::RenderBlock::makeChildrenNonInline):
1320
1321 2004-10-21  David Hyatt  <hyatt@apple.com>
1322
1323         Fix for 3810389, crash because of continuation() craziness.  Revert back to the old behavior of
1324         making sure that all line boxes get deleted and recreated when inlines are split because of a block.
1325         
1326         Reviewed darin
1327
1328         * khtml/rendering/render_inline.cpp:
1329         (RenderInline::splitFlow):
1330
1331 2004-10-21  Ken Kocienda  <kocienda@apple.com>
1332
1333         Reviewed by Darin
1334         
1335         Significant improvement to the way that whitespace is handled during editing.
1336
1337         * khtml/editing/htmlediting.cpp:
1338         (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
1339         two being added with this name) that delete "insignificant" unrendered text.
1340         (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
1341         calculates the downstream position to use as the endpoint for the deletion, and
1342         then calls deleteInsignificantText with this start and end.
1343         (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
1344         (khtml::InputNewlineCommand::doApply): Ditto.
1345         (khtml::InputTextCommand::input): Ditto.
1346         * khtml/editing/htmlediting.h: Add new declarations.
1347         
1348         Modified layout test results:
1349         * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
1350         * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
1351         * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
1352         * layout-tests/editing/deleting/delete-selection-001-expected.txt:
1353         * layout-tests/editing/deleting/delete-tab-001-expected.txt:
1354         * layout-tests/editing/deleting/delete-tab-004-expected.txt:
1355         * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
1356         * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
1357         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
1358         * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
1359         * layout-tests/editing/inserting/insert-br-001-expected.txt:
1360         * layout-tests/editing/inserting/insert-br-004-expected.txt:
1361         * layout-tests/editing/inserting/insert-br-005-expected.txt:
1362         * layout-tests/editing/inserting/insert-br-006-expected.txt:
1363         * layout-tests/editing/inserting/insert-tab-001-expected.txt:
1364         * layout-tests/editing/inserting/insert-tab-002-expected.txt:
1365         * layout-tests/editing/inserting/insert-tab-004-expected.txt:
1366         * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
1367         * layout-tests/editing/inserting/typing-001-expected.txt:
1368         * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
1369         * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
1370         * layout-tests/editing/style/typing-style-003-expected.txt:
1371         * layout-tests/editing/undo/redo-typing-001-expected.txt:
1372         * layout-tests/editing/undo/undo-typing-001-expected.txt:
1373
1374 2004-10-21  David Hyatt  <hyatt@apple.com>
1375
1376         Fix for 3847054, assertion failure in RenderText::layout() on news.com page.  Fix getInlineRun so that
1377         it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
1378         
1379         Reviewed by darin
1380
1381         * khtml/rendering/render_block.cpp:
1382         (khtml::getInlineRun):
1383
1384 2004-10-20  David Hyatt  <hyatt@apple.com>
1385
1386         Add better dumping of overflow information for scrolling regions.
1387
1388         Fix for 3726524, crash in updateLayerPosition.  Make sure anonymous elements properly remove themselves
1389         from the render tree so that layers and so forth are cleaned up.
1390         
1391         Reviewed by darin
1392
1393         * khtml/rendering/render_container.cpp:
1394         (RenderContainer::detach):
1395         * khtml/rendering/render_layer.h:
1396         (khtml::RenderLayer::scrollXOffset):
1397         (khtml::RenderLayer::scrollYOffset):
1398         * kwq/KWQRenderTreeDebug.cpp:
1399         (write):
1400
1401 2004-10-20  David Hyatt  <hyatt@apple.com>
1402
1403         Fix for 3791146, make sure all lines are checked when computing overflow.
1404         
1405         Reviewed by kocienda
1406
1407         * khtml/rendering/bidi.cpp:
1408         (khtml::RenderBlock::computeHorizontalPositionsForLine):
1409         (khtml::RenderBlock::layoutInlineChildren):
1410         (khtml::RenderBlock::findNextLineBreak):
1411         (khtml::RenderBlock::checkLinesForOverflow):
1412         * khtml/rendering/render_block.h:
1413
1414 2004-10-20  David Hyatt  <hyatt@apple.com>
1415
1416         Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
1417         
1418         Reviewed by kocienda
1419
1420         * khtml/rendering/break_lines.cpp:
1421         (khtml::isBreakable):
1422
1423 2004-10-20  Darin Adler  <darin@apple.com>
1424
1425         Reviewed by John.
1426
1427         - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
1428
1429         * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
1430         Create a palette with the background and foreground colors in it and set it on the widget.
1431
1432         * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
1433         with APPLE_CHANGES. Removed palette and palette-related function members.
1434         * khtml/rendering/render_style.cpp:
1435         (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
1436         (RenderStyle::diff): No palette to compare.
1437
1438         * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
1439         * kwq/KWQLineEdit.mm:
1440         (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
1441         (QLineEdit::text): Made const.
1442
1443         * kwq/KWQTextEdit.h: Added setPalette override.
1444         * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
1445         based on palette.
1446
1447         * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
1448         per color group, and only a single color group per palette.
1449         * kwq/KWQColorGroup.mm: Removed.
1450         * kwq/KWQPalette.mm: Removed.
1451         * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
1452
1453         * kwq/KWQApplication.h: Removed unused palette function.
1454         * kwq/KWQApplication.mm: Ditto.
1455
1456         * kwq/KWQWidget.h: Removed unsetPalette.
1457         * kwq/KWQWidget.mm: Ditto.
1458
1459         - fixed storage leak
1460
1461         * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
1462         Roll in storage leak fix from KDE guys.
1463
1464 2004-10-19  David Hyatt  <hyatt@apple.com>
1465
1466         Reviewed by kocienda
1467
1468         More cleanup of block layout.  Eliminates the separate step for tables that dont fit on a line with a float
1469         and consolidates it with clearing.
1470
1471         Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
1472         
1473         * khtml/rendering/render_block.cpp:
1474         (khtml::getInlineRun):
1475         (khtml::RenderBlock::layoutBlock):
1476         (khtml::RenderBlock::adjustFloatingBlock):
1477         (khtml::RenderBlock::collapseMargins):
1478         (khtml::RenderBlock::clearFloatsIfNeeded):
1479         (khtml::RenderBlock::estimateVerticalPosition):
1480         (khtml::RenderBlock::layoutBlockChildren):
1481         (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
1482         (khtml::RenderBlock::getClearDelta):
1483         (khtml::RenderBlock::calcBlockMinMaxWidth):
1484         * khtml/rendering/render_block.h:
1485         * khtml/rendering/render_frames.cpp:
1486         (RenderFrameSet::layout):
1487         * khtml/xml/dom_textimpl.cpp:
1488         (TextImpl::rendererIsNeeded):
1489
1490         Fix for 3841060, regression with * in frames.  Reviewed by kocienda.
1491         
1492         * layout-tests/fast/frames/002-expected.txt: Added.
1493         * layout-tests/fast/frames/002.html: Added.
1494
1495  2004-10-19  Darin Adler  <darin@apple.com>
1496
1497         Reviewed by Maciej.
1498
1499         - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
1500
1501         * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
1502         scripts being loaded here. If the current code being run is the external script itself, then we don't want
1503         to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
1504         assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
1505         wrong since there can be a script loading in that case too. Layout tests check for both problems.
1506
1507         * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
1508         * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
1509         * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
1510
1511         * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
1512
1513 2004-10-18  Darin Adler  <darin@apple.com>
1514
1515         Reviewed by Dave Hyatt.
1516
1517         - fixed <rdar://problem/3807234> REGRESSION (152-153): can't get element by ID that was just written with document.write in separate JS file (lacoccinelle.net)
1518
1519         * khtml/html/htmltokenizer.cpp:
1520         (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
1521         (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
1522         we only want to look at loadingExtScript if m_executingScript is 0.
1523
1524 2004-10-18  Ken Kocienda  <kocienda@apple.com>
1525
1526         Reviewed by Hyatt
1527
1528         Fix for this bug:
1529         
1530         <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
1531
1532         * khtml/css/css_valueimpl.cpp:
1533         (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
1534         Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the 
1535         lifecycle issues associated with creating a string to be returned in the ident case.
1536         * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
1537         * khtml/css/cssstyleselector.cpp:
1538         (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
1539
1540 2004-10-18  Chris Blumenberg  <cblu@apple.com>
1541
1542         Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
1543
1544         Reviewed by kocienda.
1545
1546         * khtml/rendering/render_frames.cpp:
1547         (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
1548
1549 2004-10-15  Chris Blumenberg  <cblu@apple.com>
1550
1551         Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
1552
1553         Reviewed by john.
1554
1555         * kwq/DOM-CSS.mm:
1556         (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
1557         * kwq/DOMPrivate.h:
1558
1559 2004-10-15  Ken Kocienda  <kocienda@apple.com>
1560
1561         Reviewed by Hyatt
1562
1563         * khtml/rendering/bidi.cpp:
1564         (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
1565         skipping after a clean line break, in addition to the cases already 
1566         checked for.
1567         * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
1568         * layout-tests/editing/inserting/insert-br-007.html: Added.
1569         * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
1570         * layout-tests/editing/inserting/insert-br-008.html: Added.
1571
1572 === Safari-167 ===
1573
1574 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1575
1576         Reviewed by John
1577
1578         Fix for this bug:
1579         
1580         <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
1581
1582         * khtml/editing/visible_position.cpp:
1583         (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
1584         position code to new-style VisiblePosition code. In retrospect, this code was misguided.
1585         Since we do a good job of insulating external code from the internal workings of 
1586         VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
1587         in the case of this bug, was doing harm. Simply removing this code makes the bug
1588         go away and does not cause any editing layout test regresssions.
1589
1590 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1591
1592         Reviewed by Hyatt
1593
1594         * khtml/rendering/bidi.cpp:
1595         (khtml::skipNonBreakingSpace): New helper.
1596         (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
1597         at the start of a block. This was preventing users from typing spaces in empty
1598         documents.
1599         * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
1600         * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
1601
1602 2004-10-14  Adele Amchan  <adele@apple.com>
1603
1604         Reviewed by Darin and Ken.
1605
1606         fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
1607
1608         This change shifts some code around so that the code that determines what typing style
1609         is in effect is called before deleteUnrenderedText is called.  Two asserts are also added
1610         to ensure that start and end nodes of the selection are in the document.
1611
1612         * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
1613
1614 2004-10-14  Adele Amchan  <adele@apple.com>
1615
1616         Reviewed by Ken
1617         
1618         This change makes these three functions virtual so that the work is being done in KWQHTMLPart 
1619         instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
1620
1621         * khtml/khtml_part.cpp:
1622         (KHTMLPart::shouldBeginEditing):
1623         (KHTMLPart::shouldEndEditing):
1624         (KHTMLPart::isContentEditable):
1625         * khtml/khtml_part.h:
1626         * kwq/KWQKHTMLPart.h:
1627
1628 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1629
1630         Reviewed by John
1631
1632         Final fix for these bugs:
1633         
1634         <rdar://problem/3806306> HTML editing puts spaces at start of line
1635         <rdar://problem/3814252> HTML editing groups space with word causing wrapping
1636
1637         This change sets some new CSS properties that have been added to WebCore to 
1638         enable whitespace-handling and line-breaking features that make WebView work
1639         more like a text editor.
1640
1641         * khtml/css/cssstyleselector.cpp:
1642         (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties 
1643         based on property value.
1644         * khtml/html/html_elementimpl.cpp:
1645         (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties 
1646         based on attribute value.
1647         * khtml/khtml_part.cpp:
1648         (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
1649         body element.
1650         (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
1651         body element.
1652         (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
1653         (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
1654         * khtml/khtml_part.h: Add new declarations.
1655         * kwq/WebCoreBridge.h: Ditto.
1656         * kwq/WebCoreBridge.mm:
1657         (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
1658         (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
1659         (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
1660         (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
1661
1662 2004-10-14  John Sullivan  <sullivan@apple.com>
1663
1664         Reviewed by Ken.
1665         
1666         - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
1667
1668         * khtml/editing/htmlediting.cpp:
1669         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
1670         needed a nil check to handle empty document case
1671
1672 2004-10-13  Maciej Stachowiak  <mjs@apple.com>
1673
1674         Reviewed by Ken.
1675
1676         <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
1677         
1678         - I fixed this by turning off all colormatching for WebKit
1679         content. We might turn it back on later. For now, it's possible to
1680         turn it on temporarily by defining COLORMATCH_EVERYTHING.
1681         
1682         * WebCorePrefix.h:
1683         * khtml/ecma/kjs_html.cpp:
1684         (KJS::Context2DFunction::tryCall):
1685         (Context2D::colorRefFromValue):
1686         (Gradient::getShading):
1687         * khtml/rendering/render_canvasimage.cpp:
1688         (RenderCanvasImage::createDrawingContext):
1689         * kwq/KWQColor.mm:
1690         (QColor::getNSColor):
1691         * kwq/KWQPainter.h:
1692         * kwq/KWQPainter.mm:
1693         (CGColorFromNSColor):
1694         (QPainter::selectedTextBackgroundColor):
1695         (QPainter::rgbColorSpace):
1696         (QPainter::grayColorSpace):
1697         (QPainter::cmykColorSpace):
1698         * kwq/WebCoreGraphicsBridge.h:
1699         * kwq/WebCoreGraphicsBridge.m:
1700         (-[WebCoreGraphicsBridge createRGBColorSpace]):
1701         (-[WebCoreGraphicsBridge createGrayColorSpace]):
1702         (-[WebCoreGraphicsBridge createCMYKColorSpace]):
1703
1704 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1705
1706         Reviewed by Hyatt
1707
1708         * khtml/css/css_valueimpl.cpp:
1709         (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
1710         is non-null before appending.
1711
1712 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1713
1714         Update expected results for improved behavior as a result of fix to 3816768.
1715     
1716         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
1717         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
1718         * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
1719
1720 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1721
1722         Reviewed by Richard
1723
1724         * khtml/css/css_computedstyle.cpp:
1725         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
1726         for getting -khtml-line-break and -khml-nbsp-mode.
1727
1728 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1729
1730         Reviewed by John
1731
1732         Fix for this bug:
1733         
1734         <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly 
1735         moves caret out of block.
1736
1737         The issue here is that an empty block with no explicit height set by style collapses
1738         to zero height, and does so immediately after the last bit of content is removed from
1739         it (as a result of deleting text with the delete key for instance). Since zero-height
1740         blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
1741         
1742         The fix is to detect when a block has not been removed itself, but has had all its 
1743         contents removed. In this case, a BR element is placed in the block, one that is
1744         specially marked as a placeholder. Later, if the block ever receives content, this
1745         placeholder is removed.
1746
1747         * khtml/editing/htmlediting.cpp:
1748         (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
1749         (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
1750         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
1751         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
1752         Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong 
1753         (it's very clear that we needs to be able to move more than just text nodes). This may expose
1754         bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
1755         made the test case in the bug work.
1756         (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
1757         removeBlockPlaceholderIfNeeded.
1758         (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
1759         (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
1760         * khtml/editing/htmlediting.h: Declare new functions.
1761
1762 2004-10-13  Richard Williamson   <rjw@apple.com>
1763
1764         Added support for -apple-dashboard-region:none.  And fixed
1765         a few computed style problems.
1766
1767         Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
1768         Reviewed by Hyatt.
1769
1770         * khtml/css/css_computedstyle.cpp:
1771         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1772         * khtml/css/css_valueimpl.cpp:
1773         (CSSPrimitiveValueImpl::cssText):
1774         * khtml/css/cssparser.cpp:
1775         (CSSParser::parseValue):
1776         (CSSParser::parseDashboardRegions):
1777         * khtml/css/cssstyleselector.cpp:
1778         (khtml::CSSStyleSelector::applyProperty):
1779         * khtml/rendering/render_style.cpp:
1780         (RenderStyle::noneDashboardRegions):
1781         * khtml/rendering/render_style.h:
1782         * kwq/KWQKHTMLPart.mm:
1783         (KWQKHTMLPart::dashboardRegionsDictionary):
1784
1785 2004-10-13  David Hyatt  <hyatt@apple.com>
1786
1787         Rework block layout to clean it up and simplify it (r=kocienda).  
1788
1789         Also fixing the style sharing bug (r=mjs).
1790         
1791         * khtml/rendering/render_block.cpp:
1792         (khtml::RenderBlock::MarginInfo::MarginInfo):
1793         (khtml::RenderBlock::layoutBlock):
1794         (khtml::RenderBlock::adjustPositionedBlock):
1795         (khtml::RenderBlock::adjustFloatingBlock):
1796         (khtml::RenderBlock::handleSpecialChild):
1797         (khtml::RenderBlock::handleFloatingOrPositionedChild):
1798         (khtml::RenderBlock::handleCompactChild):
1799         (khtml::RenderBlock::insertCompactIfNeeded):
1800         (khtml::RenderBlock::handleRunInChild):
1801         (khtml::RenderBlock::collapseMargins):
1802         (khtml::RenderBlock::clearFloatsIfNeeded):
1803         (khtml::RenderBlock::estimateVerticalPosition):
1804         (khtml::RenderBlock::determineHorizontalPosition):
1805         (khtml::RenderBlock::setCollapsedBottomMargin):
1806         (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
1807         (khtml::RenderBlock::handleBottomOfBlock):
1808         (khtml::RenderBlock::layoutBlockChildren):
1809         (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
1810         (khtml::RenderBlock::addOverHangingFloats):
1811         * khtml/rendering/render_block.h:
1812         (khtml::RenderBlock::maxTopMargin):
1813         (khtml::RenderBlock::maxBottomMargin):
1814         (khtml::RenderBlock::CompactInfo::compact):
1815         (khtml::RenderBlock::CompactInfo::block):
1816         (khtml::RenderBlock::CompactInfo::matches):
1817         (khtml::RenderBlock::CompactInfo::clear):
1818         (khtml::RenderBlock::CompactInfo::set):
1819         (khtml::RenderBlock::CompactInfo::CompactInfo):
1820         (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
1821         (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
1822         (khtml::RenderBlock::MarginInfo::clearMargin):
1823         (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
1824         (khtml::RenderBlock::MarginInfo::setTopQuirk):
1825         (khtml::RenderBlock::MarginInfo::setBottomQuirk):
1826         (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
1827         (khtml::RenderBlock::MarginInfo::setPosMargin):
1828         (khtml::RenderBlock::MarginInfo::setNegMargin):
1829         (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
1830         (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
1831         (khtml::RenderBlock::MarginInfo::setMargin):
1832         (khtml::RenderBlock::MarginInfo::atTopOfBlock):
1833         (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
1834         (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
1835         (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
1836         (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
1837         (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
1838         (khtml::RenderBlock::MarginInfo::quirkContainer):
1839         (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
1840         (khtml::RenderBlock::MarginInfo::topQuirk):
1841         (khtml::RenderBlock::MarginInfo::bottomQuirk):
1842         (khtml::RenderBlock::MarginInfo::posMargin):
1843         (khtml::RenderBlock::MarginInfo::negMargin):
1844         (khtml::RenderBlock::MarginInfo::margin):
1845         * khtml/rendering/render_box.cpp:
1846         (RenderBox::calcAbsoluteVertical):
1847         * khtml/rendering/render_box.h:
1848         (khtml::RenderBox::marginTop):
1849         (khtml::RenderBox::marginBottom):
1850         (khtml::RenderBox::marginLeft):
1851         (khtml::RenderBox::marginRight):
1852         * khtml/rendering/render_image.cpp:
1853         (RenderImage::setImage):
1854         * khtml/rendering/render_object.cpp:
1855         (RenderObject::sizesToMaxWidth):
1856         * khtml/rendering/render_object.h:
1857         (khtml::RenderObject::collapsedMarginTop):
1858         (khtml::RenderObject::collapsedMarginBottom):
1859         (khtml::RenderObject::maxTopMargin):
1860         (khtml::RenderObject::maxBottomMargin):
1861         (khtml::RenderObject::marginTop):
1862         (khtml::RenderObject::marginBottom):
1863         (khtml::RenderObject::marginLeft):
1864         (khtml::RenderObject::marginRight):
1865         * khtml/rendering/render_text.h:
1866         (khtml::RenderText::marginLeft):
1867         (khtml::RenderText::marginRight):
1868         * khtml/xml/dom_elementimpl.cpp:
1869         (ElementImpl::recalcStyle):
1870
1871 2004-10-12  Ken Kocienda  <kocienda@apple.com>
1872
1873         Reviewed by John
1874
1875         Fix for this bug:
1876         
1877         <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line
1878
1879         * khtml/editing/selection.cpp:
1880         (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
1881         This will make it seem like the run ends on the next line.
1882
1883 2004-10-12  Ken Kocienda  <kocienda@apple.com>
1884
1885         Reviewed by Hyatt
1886
1887         Fix for this bug:
1888         
1889         <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages
1890
1891         * khtml/editing/htmlediting.cpp:
1892         (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
1893         row, section, or column.
1894         (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
1895         of table structure when doing deletes, rather than deleting the structure elements themselves.
1896         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
1897         of table structure. We may want to revisit this some day, but this seems like the best behavior
1898         to me now.
1899         (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
1900         where needed.
1901         * khtml/editing/htmlediting.h: Add declarations for new functions.
1902
1903 2004-10-12  Richard Williamson   <rjw@apple.com>
1904
1905         Fixed access to DOM object via WebScriptObject API.
1906         The execution context for DOM objects wasn't being found.       
1907         <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
1908         Reviewed by Chris
1909
1910         Fixed <rdar://problem/3831063> regions use left offset instead of top offset
1911         Reviewed by John
1912
1913         * khtml/khtml_part.h:
1914         * khtml/rendering/render_object.cpp:
1915         (RenderObject::addDashboardRegions):
1916         * kwq/DOM.mm:
1917         (-[DOMNode isContentEditable]):
1918         (-[DOMNode KJS::Bindings::]):
1919         * kwq/KWQKHTMLPart.h:
1920         * kwq/KWQKHTMLPart.mm:
1921         (KWQKHTMLPart::executionContextForDOM):
1922
1923 2004-10-12  Ken Kocienda  <kocienda@apple.com>
1924
1925         Reviewed by Hyatt
1926
1927         Fix for this bug:
1928
1929         <rdar://problem/3834779> Mail crashes when editing HTML message - khtml::Selection::layout()
1930     
1931         * kwq/KWQKHTMLPart.mm:
1932         (KWQKHTMLPart::styleForSelectionStart): Table code seems to be more robust when the call to
1933         insert our style-checking node is done with an appendChild rather than an insertBefore. Note 
1934         that this table-related problem was exposed by fixing Selection::layout(), which I did
1935         yesterday. This change simply improves things even more so that we do not crash in the
1936         scenario described in the bug.
1937
1938 2004-10-11  Ken Kocienda  <kocienda@apple.com>
1939
1940         Reviewed by John
1941
1942         This is a partial fix to this bug:
1943         
1944         <rdar://problem/3832886> increase quote level on new mail document leads to immediate 
1945         crash in caret painting code
1946         
1947         To eliminate the bad behavior for good, I have done some investigations in Mail code,
1948         and I have sent a suggested code change on to Grant. Basically, Mail can't add empty
1949         blocks (like blockquote elements used for quoting) to documents without giving those 
1950         blocks some content (so they have a height).
1951
1952         I added some other crash protections below.
1953
1954         * khtml/editing/selection.cpp:
1955         (khtml::Selection::layout): Check for non-null position after calls to VisiblePosition, since
1956         the VisiblePosition constructors may fail to find a visible spot in the document. Also, add
1957         a couple position-has-renderer assertion checks.
1958         * kwq/KWQKHTMLPart.mm:
1959         (KWQKHTMLPart::styleForSelectionStart): Take out pos.isNotNull() assertion since VisiblePosition
1960         may not yield a position. This assertion is a holdover from before we had VisiblePosition.
1961         (KWQKHTMLPart::fontForSelection): Rearrange the code a little to deal with possible null results from
1962         calls to helpers.
1963
1964 2004-10-11  Darin Adler  <darin@apple.com>
1965
1966         Reviewed by John.
1967
1968         - fixed <rdar://problem/3834230> empty table can result in division by 0
1969
1970         * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows):
1971         Added 0 check; rolled in from KDE.
1972
1973 2004-10-11  Darin Adler  <darin@apple.com>
1974
1975         Reviewed by John.
1976
1977         - fixed <rdar://problem/3818712> form checkbox value property is read only
1978
1979         The underlying problem was that we were storing two separate values for all
1980         form elements; one for the value property (JavaScript) and the other for the
1981         value attribute (DOM). This is a good idea for text input, but not for other types.
1982
1983         * khtml/html/html_formimpl.h: Changed setValue to take a const DOMString reference.
1984         Added private storesValueSeparateFromAttribute function.
1985         * khtml/html/html_formimpl.cpp:
1986         (DOM::HTMLInputElementImpl::setType): Handle type changes, including detaching and re-attaching
1987         if type changed, and moving value from m_value to ATTR_VALUE and vice versa.
1988         (DOM::HTMLInputElementImpl::type): Added a case for ISINDEX and moved the default out of the
1989         switch so that we will get a warning if a type is left out.
1990         (DOM::HTMLInputElementImpl::parseHTMLAttribute): Tweaked comment format.
1991         (DOM::HTMLInputElementImpl::reset): Changed to only nuke the value if the value property is stored
1992         separately from the attribute. Otherwise, we just want to lave it alone
1993         (DOM::HTMLInputElementImpl::value): Changed to always use m_value if it's not null, then fall back
1994         on the attribute, and finally fall back to the "on" for the checkbox only if both are null.
1995         (DOM::HTMLInputElementImpl::setValue): Changed to set the attribute unless the value property is
1996         supposed to be stored separate from the attribute.
1997         (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute): Added. Returns true for text-type
1998         input elements, and false for the others.
1999
2000 2004-10-11  Darin Adler  <darin@apple.com>
2001
2002         Reviewed by John.
2003
2004         - fixed <rdar://problem/3296652> checkbox input type does not respond to onchange
2005
2006         * khtml/rendering/render_form.cpp:
2007         (RenderFormElement::updateFromElement): Some new code, commented out, for form element colors.
2008         (RenderCheckBox::slotStateChanged): Added call to onChange.
2009
2010 2004-10-11  Ken Kocienda  <kocienda@apple.com>
2011
2012         Reviewed by Darin
2013
2014         Finish selection affinity implementation. This includes code to set the
2015         affinity correctly when clicking with the mouse, and clearing the
2016         affinity when altering the selection using any of the Selection object
2017         mutation functions.
2018
2019         Each instance of the positionForCoordinates, inlineBox and caretRect 
2020         functions have been changed to include an EAffinity argument to give results
2021         which take this bit into account.
2022
2023         * khtml/editing/selection.cpp:
2024         (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
2025         (khtml::Selection::modifyAffinity): New function to compute affinity based on
2026         modification constants.
2027         (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
2028         (khtml::Selection::modifyExtendingRightForward): Ditto.
2029         (khtml::Selection::modifyMovingRightForward): Ditto.
2030         (khtml::Selection::modifyExtendingLeftBackward): Ditto.
2031         (khtml::Selection::modifyMovingLeftBackward): Ditto.
2032         (khtml::Selection::modify): Support saving, restoring, and then calculating new
2033         affinity value as needed. 
2034         (khtml::Selection::xPosForVerticalArrowNavigation):
2035         (khtml::Selection::clear): Reset affinity to UPSTREAM.
2036         (khtml::Selection::setBase): Ditto.
2037         (khtml::Selection::setExtent): Ditto.
2038         (khtml::Selection::setBaseAndExtent): Ditto.
2039         (khtml::Selection::layout): Pass affinity to caretRect().
2040         (khtml::Selection::validate): Pass along affinity parameter to new functions that
2041         require it.
2042         (khtml::startOfFirstRunAt): Changed the way that the y-coordinate search is done, to
2043         keep this code working with changes made in selectionForLine().
2044         (khtml::endOfLastRunAt): Ditto.
2045         (khtml::selectionForLine): Make this function work for all renderers, not just text
2046         renderers.
2047         * khtml/editing/selection.h:
2048         (khtml::operator==): Consider affinity in equality check.
2049         * khtml/editing/visible_units.cpp:
2050         (khtml::previousLinePosition): Pass affinity argument to function so it can take this 
2051         information into account while processing.
2052         (khtml::nextLinePosition): Ditto.
2053         (khtml::previousParagraphPosition): Ditto.
2054         (khtml::nextParagraphPosition): Ditto.
2055         * khtml/editing/visible_units.h: Ditto, for each of the functions listed.
2056         * khtml/khtml_events.cpp:
2057         (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
2058         as this function is being removed.
2059         * khtml/khtml_part.cpp:
2060         (KHTMLPart::isPointInsideSelection): Ditto.
2061         (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
2062         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2063         (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
2064         call to positionForCoordinates, and set resulting affinity on the selection.
2065         (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on 
2066         NodeImpl::positionForCoordinates, as this function is being removed.
2067         (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
2068         * khtml/rendering/render_block.cpp:
2069         (khtml::RenderBlock::positionForCoordinates): Now takes an affinity argument.
2070         * khtml/rendering/render_block.h:
2071         * khtml/rendering/render_box.cpp:
2072         (RenderBox::caretRect): Ditto.
2073         * khtml/rendering/render_box.h:
2074         * khtml/rendering/render_br.cpp:
2075         (RenderBR::positionForCoordinates): Ditto.
2076         (RenderBR::caretRect): Ditto.
2077         (RenderBR::inlineBox): Ditto.
2078         * khtml/rendering/render_br.h:
2079         * khtml/rendering/render_container.cpp:
2080         (RenderContainer::positionForCoordinates): Ditto.
2081         * khtml/rendering/render_container.h:
2082         * khtml/rendering/render_flow.cpp:
2083         (RenderFlow::caretRect): Ditto.
2084         * khtml/rendering/render_flow.h:
2085         * khtml/rendering/render_inline.cpp:
2086         (RenderInline::positionForCoordinates): Ditto.
2087         * khtml/rendering/render_inline.h:
2088         * khtml/rendering/render_object.cpp:
2089         (RenderObject::caretRect): Ditto.
2090         (RenderObject::positionForCoordinates): Ditto.
2091         (RenderObject::inlineBox): Ditto.
2092         * khtml/rendering/render_object.h:
2093         * khtml/rendering/render_replaced.cpp:
2094         (RenderReplaced::positionForCoordinates): Ditto.
2095         * khtml/rendering/render_replaced.h:
2096         * khtml/rendering/render_text.cpp:
2097         (RenderText::positionForCoordinates): Ditto.
2098         (firstRendererOnNextLine): New helper used by caretRect().
2099         (RenderText::caretRect): Now takes an affinity argument.
2100         (RenderText::inlineBox): Ditto.
2101         * khtml/rendering/render_text.h:
2102         * khtml/xml/dom_nodeimpl.cpp: Remove positionForCoordinates helper.
2103         * khtml/xml/dom_nodeimpl.h: Ditto.
2104         * khtml/xml/dom_position.cpp:
2105         (DOM::Position::previousLinePosition): Now takes an affinity argument.
2106         (DOM::Position::nextLinePosition): Ditto.
2107         * khtml/xml/dom_position.h:
2108         * kwq/WebCoreBridge.h:
2109         * kwq/WebCoreBridge.mm:
2110         (-[WebCoreBridge caretRectAtNode:offset:affinity:]): Ditto.
2111         (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
2112         (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on 
2113         NodeImpl::positionForCoordinates, as this function is being removed.
2114
2115 2004-10-11  Darin Adler  <darin@apple.com>
2116
2117         Reviewed by Ken.
2118
2119         - fixed <rdar://problem/3670280> scroll position on overflowed textareas resets when leaving the tab
2120
2121         * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView becomeFirstResponder]):
2122         Scroll to reveal the text area, don't scroll to reveal the text view itself.
2123         Scrolling the text view ended up putting it at the top left, regardless of
2124         where the insertion point is.
2125
2126 2004-10-11  Darin Adler  <darin@apple.com>
2127
2128         Reviewed by Ken.
2129
2130         - fixed <rdar://problem/3831546> More text is copied than is visually selected
2131
2132         The bug here is that upstream was moving a position too far.
2133
2134         * khtml/xml/dom_position.cpp:
2135         (DOM::Position::upstream): Use the "deep equivalent" node rather than the original node passed
2136         in for various checks. Also use local variables a bit more for slightly more efficiency.
2137         (DOM::Position::downstream): Ditto.
2138
2139 2004-10-11  Darin Adler  <darin@apple.com>
2140
2141         Reviewed by Ken.
2142
2143         - fixed <rdar://problem/3833841> adding an event listener for keypress events does not work
2144
2145         * khtml/xml/dom2_eventsimpl.h: Added numEventIds and made typeToId take a const DOMString &.
2146         * khtml/xml/dom2_eventsimpl.cpp:
2147         (EventImpl::typeToId): Changed to use table. Added "keypress", otherwise, the same as before.
2148         (EventImpl::idToType): Changed to use table.
2149
2150 2004-10-10  John Sullivan  <sullivan@apple.com>
2151
2152         - fixed <rdar://problem/3664375> repro crash in -[KWQAccObject accessibilityAttributeNames]
2153
2154         (-[KWQAccObject accessibilityActionNames]):
2155         check for nil m_renderer
2156
2157 2004-10-09  Darin Adler  <darin@apple.com>
2158
2159         Reviewed by Kevin.
2160
2161         - fixed <rdar://problem/3828147> REGRESSION: textareas with wrap="off" show their contents in a thin vertical line of text
2162
2163         * kwq/KWQTextArea.h: Added setTextColor and setBackgroundColor methods. This is really for another fix
2164         I'm landing later, but it does no harm to add these now.
2165         * kwq/KWQTextArea.mm:
2166         (-[KWQTextArea _configureTextViewForWordWrapMode]): Set the container size after changing the flag that
2167         determines if the width tracks the text view. Otherwise, we won't successfully set the width in the case
2168         where we don't want it to track the text view. This caused the bug. 
2169         (-[KWQTextArea _createTextView]): Remove unneeded call to setMaxSize. The above method already does that.
2170         (-[KWQTextArea setTextColor:]): Added.
2171         (-[KWQTextArea setBackgroundColor:]): Added.
2172
2173 2004-10-09  Darin Adler  <darin@apple.com>
2174
2175         Reviewed by Adele.
2176
2177         - fixed <rdar://problem/3829452> REGRESSION (156-157): onload handler doesn't run on page with meta refresh of 0 duration (new Apple start page)
2178
2179         The fix for <rdar://problem/3773150> made it so <meta> redirects prevent tokenizing the rest of the page.
2180         This is incorrect; the reason the JavaScript-triggered loads prevent tokenizing is that they take place
2181         "right away" in other browsers, but that is not true of <meta> redirect. We fixed this by using a separate
2182         call for <meta> redirect and not preventing tokenizing when that's in effect.
2183
2184         * khtml/khtml_part.h: Removed userGesture parameter from scheduleRedirection. Renamed
2185         isImmediateRedirectPending to isScheduledLocationChangePending. Added scheduleLocationChange.
2186         * khtml/khtml_part.cpp:
2187         (KHTMLPart::openURL): Updated for new constant name.
2188         (KHTMLPart::scheduleRedirection): Removed now-unneeded userGesture parameter, and removed code that
2189         does the special case for redirection during load; a <meta> refresh can never be one of those special
2190         redirects during a load because it redirects the frame itself, not another frame. Also tightened up
2191         the logic by always stopping the redirect timer even if we aren't restarting it.
2192         (KHTMLPart::scheduleLocationChange): Added. Like scheduleRedirection, but with a different constant
2193         so we can tell it apart and always a delay of 0. The "redirection during load" case was moved in here
2194         and renamed to locationChangeScheduledDuringLoad.
2195         (KHTMLPart::isScheduledLocationChangePending): Renamed from isImmediateRedirectPending. This now
2196         returns true only for location changes and history navigation, not <meta> redirects.
2197         (KHTMLPart::scheduleHistoryNavigation): Tightened up logic to do the stop() outside the if as above,
2198         and got rid of a silly timer delay computation that always resulted in 0.
2199
2200         * khtml/khtmlpart_p.h: Added a new value to the RedirectionScheduled enum for scheduleLocationChange
2201         and also renamed one of the existing values.
2202
2203         * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::write): Changed to use isScheduledLocationChangePending instead
2204         of isImmediateRedirectPending, because we do want to continue tokenizing if it's actually a redirect.
2205
2206         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Changed to call the new scheduleLocationChange
2207         instead of calling scheduleRedirection with delay of 0.
2208         * khtml/ecma/kjs_window.cpp:
2209         (Window::put): Ditto.
2210         (WindowFunc::tryCall): Ditto.
2211         (Location::put): Ditto.
2212         (LocationFunc::tryCall): Ditto.
2213
2214 2004-10-09  Darin Adler  <darin@apple.com>
2215
2216         Reviewed by Kevin.
2217
2218         - fixed <rdar://problem/3658277> REGRESSION (1.1-1.2): form submission should either not simulate a click at all or use (0,0) the way Mozilla does
2219
2220         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::click): Use 0,0 for the coordinates.
2221
2222 2004-10-09  Darin Adler  <darin@apple.com>
2223
2224         Reviewed by Kevin.
2225
2226         - fixed <rdar://problem/3804665> REGRESSION: WebCore framework now has many init routines
2227
2228         * khtml/xml/dom_nodeimpl.h: Changed anyQName declaration to not use the inline function
2229         makeId. Surprisingly, the inline function was not "constant-folded" and we ended up with
2230         a copy of the function in each file as an init routine for the framework.
2231
2232         * khtml/ecma/kjs_html.cpp: (Gradient::colorStops): Get rid of initialized ColorStop
2233         globals; their constructors were showing up as init routines for the framework.
2234
2235         * khtml/rendering/render_style.h: Got rid of inline initialDashboardRegions function.
2236         * khtml/rendering/render_style.cpp: (RenderStyle::initialDashboardRegions): Made this
2237         a normal function. When it was an inline function, the constructors for the per-file
2238         copies of the globals were showing up as init routines for the framework.
2239
2240 2004-10-09  Chris Blumenberg  <cblu@apple.com>
2241
2242         Fixed: 
2243         <rdar://problem/3625352> up and down arrow and page up/down keys don't work to scroll overflow:auto/scroll/overlay areas
2244         <rdar://problem/3397658> scroll wheel does not work to scroll overflow:auto/scroll/overlay areas (RSS)
2245         <rdar://problem/3822027> REGRESSION (Mail): When selection moves out of visible area, should center as NSText does
2246
2247         Reviewed by hyatt, kocienda.
2248
2249         * khtml/rendering/render_layer.cpp:
2250         (RenderLayer::scroll): new
2251         * khtml/rendering/render_layer.h:
2252         * khtml/rendering/render_object.cpp:
2253         (RenderObject::scroll): new
2254         * khtml/rendering/render_object.h:
2255         * kwq/KWQKHTMLPart.h:
2256         * kwq/KWQKHTMLPart.mm:
2257         (KWQKHTMLPart::scrollOverflow): new
2258         (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent): new
2259         (KWQKHTMLPart::khtmlMousePressEvent): store pressed node so we know where the focus is
2260         * kwq/KWQScrollBar.h:
2261         * kwq/KWQScrollBar.mm:
2262         (QScrollBar::setValue): return a bool
2263         (QScrollBar::scrollbarHit): ditto
2264         (QScrollBar::scroll): new
2265         * kwq/WebCoreBridge.h:
2266         * kwq/WebCoreBridge.mm:
2267         (-[WebCoreBridge scrollOverflowInDirection:granularity:]): new
2268         (-[WebCoreBridge scrollOverflowWithScrollWheelEvent:]): new
2269         (-[WebCoreBridge ensureSelectionVisible]): visually center the extent of the selection
2270
2271 2004-10-06  David Hyatt  <hyatt@apple.com>
2272
2273         Back out style sharing perf fix.
2274         
2275         * khtml/css/cssstyleselector.cpp:
2276         (khtml::CSSStyleSelector::locateCousinList):
2277         (khtml::CSSStyleSelector::canShareStyleWithElement):
2278         (khtml::CSSStyleSelector::locateSharedStyle):
2279         * khtml/css/cssstyleselector.h:
2280         * khtml/html/html_elementimpl.h:
2281         (DOM::HTMLElementImpl::inlineStyleDecl):
2282         * khtml/xml/dom_elementimpl.cpp:
2283         (ElementImpl::recalcStyle):
2284         * khtml/xml/dom_elementimpl.h:
2285
2286 === Safari-166 ===
2287
2288 2004-10-05  David Hyatt  <hyatt@apple.com>
2289
2290         Fix a bug in the iteration of locateCousinList and clean up the style sharing stats code.
2291
2292         * khtml/css/cssstyleselector.cpp:
2293         (khtml::CSSStyleSelector::locateCousinList):
2294         (khtml::CSSStyleSelector::elementsCanShareStyle):
2295         (khtml::CSSStyleSelector::locateSharedStyle):
2296         (khtml::CSSStyleSelector::styleForElement):
2297
2298 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2299
2300         Reviewed by Hyatt
2301
2302         * khtml/rendering/bidi.cpp:
2303         (khtml::RenderBlock::computeHorizontalPositionsForLine): Fix coding mistake that
2304         broke layout tests involving compacts.
2305
2306 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2307
2308         Reviewed by Darin
2309
2310         Finish selection affinity implementation. This includes code to set the
2311         affinity correctly when clicking with the mouse, and clearing the
2312         affinity when altering the selection using any of the Selection object
2313         mutation functions.
2314
2315         Each instance of the positionForCoordinates function in the render tree
2316         has been changed to include an EAffinity argument. It is now the job of this
2317         function to set the selection affinity.
2318
2319         * khtml/editing/selection.cpp:
2320         (khtml::Selection::moveTo): Set affinity to DOWNSTREAM.
2321         (khtml::Selection::modify): Ditto.
2322         (khtml::Selection::clear): Ditto.
2323         (khtml::Selection::setBase): Ditto.
2324         (khtml::Selection::setExtent): Ditto.
2325         (khtml::Selection::setBaseAndExtent): Ditto.
2326         * khtml/editing/selection.h:
2327         (khtml::operator==): Consider affinity in equality check.
2328         * khtml/khtml_events.cpp:
2329         (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
2330         as this function is being removed.
2331         * khtml/khtml_part.cpp: 
2332         (KHTMLPart::isPointInsideSelection): Ditto.
2333         (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
2334         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2335         (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
2336         call to positionForCoordinates, and set resulting affinity on the selection.
2337         (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on 
2338         NodeImpl::positionForCoordinates, as this function is being removed.
2339         (KHTMLPart::khtmlMouseReleaseEvent):
2340         * khtml/rendering/render_block.cpp:
2341         (khtml::RenderBlock::positionForCoordinates): Changed, as described above.
2342         * khtml/rendering/render_block.h:
2343         * khtml/rendering/render_br.cpp:
2344         (RenderBR::positionForCoordinates): Ditto.
2345         * khtml/rendering/render_br.h:
2346         * khtml/rendering/render_container.cpp:
2347         (RenderContainer::positionForCoordinates): Ditto.
2348         * khtml/rendering/render_container.h:
2349         * khtml/rendering/render_inline.cpp:
2350         (RenderInline::positionForCoordinates): Ditto.
2351         * khtml/rendering/render_inline.h:
2352         * khtml/rendering/render_object.cpp:
2353         (RenderObject::positionForCoordinates): Ditto.
2354         * khtml/rendering/render_object.h:
2355         * khtml/rendering/render_replaced.cpp:
2356         (RenderReplaced::positionForCoordinates): Ditto.
2357         * khtml/rendering/render_replaced.h:
2358         * khtml/rendering/render_text.cpp:
2359         (RenderText::positionForCoordinates): Ditto.
2360         * khtml/rendering/render_text.h:
2361         * khtml/xml/dom_nodeimpl.cpp: Removed positionForCoordinates convenience.
2362         * khtml/xml/dom_nodeimpl.h: Ditto.
2363         * kwq/WebCoreBridge.mm:
2364         (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on 
2365         NodeImpl::positionForCoordinates, as this function is being removed.
2366
2367 2004-10-05  David Hyatt  <hyatt@apple.com>
2368
2369         Fix style sharing optimization to be fast again.  Go back to using pointer comparisons when looking for
2370         cousins to share.
2371         
2372         Reviewed by darin
2373
2374         * khtml/css/cssstyleselector.cpp:
2375         (khtml::CSSStyleSelector::locateCousinList):
2376         * khtml/rendering/render_object.cpp:
2377         (RenderObject::setStyleInternal):
2378         * khtml/rendering/render_object.h:
2379         * khtml/xml/dom_elementimpl.cpp:
2380         (ElementImpl::recalcStyle):
2381
2382 2004-10-05  David Hyatt  <hyatt@apple.com>
2383
2384         Fix lists so that they properly participate in line layout as though they are text (when text bullets are
2385         used) and as images (when image bullets are used).
2386         
2387         Reviewed by kocienda
2388
2389         * khtml/rendering/render_list.cpp:
2390         (RenderListMarker::createInlineBox):
2391         * khtml/rendering/render_list.h:
2392         (khtml::ListMarkerBox:::InlineBox):
2393         (khtml::ListMarkerBox::isText):
2394
2395 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2396
2397         Reviewed by Darin
2398
2399         Recent checkin adding upstreamDeepEquivalent had it backwards. The helper
2400         we want is downstreamDeepEquivalent, as the deepEquivalent function returns
2401         an upstream position.
2402
2403         * khtml/editing/selection.cpp:
2404         (khtml::Selection::layout): DOWNSTREAM case now uses downstreamDeepEquivalent.
2405         UPSTREAM uses deepEquivalent.
2406         * khtml/editing/visible_position.cpp:
2407         (khtml::VisiblePosition::downstreamDeepEquivalent): New helper, replacing 
2408         upstreamDeepEquivalent.
2409         * khtml/editing/visible_position.h
2410
2411 2004-10-05  David Hyatt  <hyatt@apple.com>
2412
2413         New selection gap-filling architecture.  Makes the gap-filling much more like NSTextView and puts the responsibility
2414         for gap-filling in the block.  Fixes numerous bugs with selection drawing including bidi issues, incorrect old
2415         horizontal gap filling, and selection performance issues.
2416         
2417         Reviewed by kocienda
2418
2419         * khtml/html/html_imageimpl.cpp:
2420         (HTMLImageLoader::notifyFinished):
2421         * khtml/misc/khtmllayout.h:
2422         (khtml::GapRects::left):
2423         (khtml::GapRects::center):
2424         (khtml::GapRects::right):
2425         (khtml::GapRects::uniteLeft):
2426         (khtml::GapRects::uniteCenter):
2427         (khtml::GapRects::uniteRight):
2428         (khtml::GapRects::unite):
2429         (khtml::GapRects::operator QRect):
2430         (khtml::GapRects::operator==):
2431         (khtml::GapRects::operator!=):
2432         * khtml/rendering/font.cpp:
2433         (Font::drawHighlightForText):
2434         * khtml/rendering/font.h:
2435         * khtml/rendering/render_block.cpp:
2436         (khtml:::RenderFlow):
2437         (khtml::RenderBlock::removeChild):
2438         (khtml::RenderBlock::paintObject):
2439         (khtml::RenderBlock::paintEllipsisBoxes):
2440         (khtml::RenderBlock::setSelectionState):
2441         (khtml::RenderBlock::shouldPaintSelectionGaps):
2442         (khtml::RenderBlock::isSelectionRoot):
2443         (khtml::RenderBlock::selectionGapRects):
2444         (khtml::RenderBlock::paintSelection):
2445         (khtml::RenderBlock::fillSelectionGaps):
2446         (khtml::RenderBlock::fillInlineSelectionGaps):
2447         (khtml::RenderBlock::fillBlockSelectionGaps):
2448         (khtml::RenderBlock::fillHorizontalSelectionGap):
2449         (khtml::RenderBlock::fillVerticalSelectionGap):
2450         (khtml::RenderBlock::fillLeftSelectionGap):
2451         (khtml::RenderBlock::fillRightSelectionGap):
2452         (khtml::RenderBlock::getHorizontalSelectionGapInfo):
2453         (khtml::RenderBlock::leftSelectionOffset):
2454         (khtml::RenderBlock::rightSelectionOffset):
2455         * khtml/rendering/render_block.h:
2456         (khtml::RenderBlock::hasSelectedChildren):
2457         (khtml::RenderBlock::selectionState):
2458         (khtml::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
2459         (khtml::RenderBlock::BlockSelectionInfo::rects):
2460         (khtml::RenderBlock::BlockSelectionInfo::state):
2461         (khtml::RenderBlock::BlockSelectionInfo::block):
2462         (khtml::RenderBlock::selectionRect):
2463         * khtml/rendering/render_box.cpp:
2464         (RenderBox::position):
2465         * khtml/rendering/render_br.cpp:
2466         (RenderBR::inlineBox):
2467         * khtml/rendering/render_br.h:
2468         (khtml::RenderBR::selectionRect):
2469         (khtml::RenderBR::paint):
2470         * khtml/rendering/render_canvas.cpp:
2471         (RenderCanvas::selectionRect):
2472         (RenderCanvas::setSelection):
2473         * khtml/rendering/render_canvasimage.cpp:
2474         (RenderCanvasImage::paint):
2475         * khtml/rendering/render_image.cpp:
2476         (RenderImage::paint):
2477         * khtml/rendering/render_image.h:
2478         * khtml/rendering/render_line.cpp:
2479         (khtml::InlineBox::nextLeafChild):
2480         (khtml::InlineBox::prevLeafChild):
2481         (khtml::InlineBox::selectionState):
2482         (khtml::InlineFlowBox::addToLine):
2483         (khtml::InlineFlowBox::firstLeafChild):
2484         (khtml::InlineFlowBox::lastLeafChild):
2485         (khtml::InlineFlowBox::firstLeafChildAfterBox):
2486         (khtml::InlineFlowBox::lastLeafChildBeforeBox):
2487         (khtml::InlineFlowBox::selectionState):
2488         (khtml::RootInlineBox::fillLineSelectionGap):
2489         (khtml::RootInlineBox::setHasSelectedChildren):
2490         (khtml::RootInlineBox::selectionState):
2491         (khtml::RootInlineBox::firstSelectedBox):
2492         (khtml::RootInlineBox::lastSelectedBox):
2493         (khtml::RootInlineBox::selectionTop):
2494         (khtml::RootInlineBox::block):
2495         * khtml/rendering/render_line.h:
2496         (khtml::RootInlineBox::RootInlineBox):
2497         (khtml::RootInlineBox::hasSelectedChildren):
2498         (khtml::RootInlineBox::selectionHeight):
2499         * khtml/rendering/render_object.cpp:
2500         (RenderObject::selectionColor):
2501         * khtml/rendering/render_object.h:
2502         (khtml::RenderObject::):
2503         (khtml::RenderObject::selectionState):
2504         (khtml::RenderObject::setSelectionState):
2505         (khtml::RenderObject::selectionRect):
2506         (khtml::RenderObject::canBeSelectionLeaf):
2507         (khtml::RenderObject::hasSelectedChildren):
2508         (khtml::RenderObject::hasDirtySelectionState):
2509         (khtml::RenderObject::setHasDirtySelectionState):
2510         (khtml::RenderObject::shouldPaintSelectionGaps):
2511         (khtml::RenderObject::SelectionInfo::SelectionInfo):
2512         * khtml/rendering/render_replaced.cpp:
2513         (RenderReplaced::RenderReplaced):
2514         (RenderReplaced::shouldPaint):
2515         (RenderReplaced::selectionRect):
2516         (RenderReplaced::setSelectionState):
2517         (RenderReplaced::selectionColor):
2518         (RenderWidget::paint):
2519         (RenderWidget::setSelectionState):
2520         * khtml/rendering/render_replaced.h:
2521         (khtml::RenderReplaced::canBeSelectionLeaf):
2522         (khtml::RenderReplaced::selectionState):
2523         * khtml/rendering/render_text.cpp:
2524         (InlineTextBox::checkVerticalPoint):
2525         (InlineTextBox::isSelected):
2526         (InlineTextBox::selectionState):
2527         (InlineTextBox::selectionRect):
2528         (InlineTextBox::paintSelection):
2529         (InlineTextBox::paintMarkedTextBackground):
2530         (RenderText::paint):
2531         (RenderText::setSelectionState):
2532         (RenderText::selectionRect):
2533         * khtml/rendering/render_text.h:
2534         (khtml::RenderText::canBeSelectionLeaf):
2535         * kwq/KWQPainter.h:
2536         * kwq/KWQPainter.mm:
2537         (QPainter::drawHighlightForText):
2538         * kwq/KWQPtrDict.h:
2539         (QPtrDictIterator::toFirst):
2540         * kwq/KWQRect.mm:
2541         (QRect::unite):
2542         * kwq/WebCoreTextRenderer.h:
2543         * kwq/WebCoreTextRendererFactory.mm:
2544         (WebCoreInitializeEmptyTextGeometry):
2545
2546 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2547
2548         Reviewed by Darin
2549         
2550         Use the new CSS properties I added with my previous check-in. Also makes
2551         some changes to caret positioning and drawing to make the proper editing
2552         end-of-line behavior work correctly.
2553
2554         * khtml/editing/selection.cpp:
2555         (khtml::Selection::layout): Caret drawing now takes affinity into account
2556         when deciding where to paint the caret (finally!).
2557         * khtml/editing/visible_position.cpp:
2558         (khtml::VisiblePosition::previousVisiblePosition): Move off Position::rendersInDifferentPosition
2559         to determine the result. Use a simpler test involving comparisons between
2560         downstream positions while iterating. This is cheaper to do and easier to understand.
2561         (khtml::VisiblePosition::nextVisiblePosition): Ditto.
2562         * khtml/rendering/bidi.cpp:
2563         (khtml::BidiIterator::current): Do not return non-breaking spaces for empty
2564         text renderers and for non-text renderers. Return a null Qchar instead. Returning
2565         non-breaking spaces was causing errors when the new -khtml-nbsp-mode was set to "space".
2566         (khtml::RenderBlock::computeHorizontalPositionsForLine): Shrink line boxes that 
2567         contain with more spaces than can fit on the end of a line.
2568         (khtml::RenderBlock::skipWhitespace): Factor this out from findNextLineBreak.
2569         (khtml::RenderBlock::findNextLineBreak): Use new skipWhitespace function. Add
2570         in code to check and use new CSS properties.
2571         * khtml/rendering/break_lines.cpp:
2572         (khtml::isBreakable): Consider a non-breaking space a breakable character based
2573         on setting of new -khtml-nbsp-mode property.
2574         * khtml/rendering/break_lines.h: Ditto.
2575         * khtml/rendering/render_block.h: Declare skipWhitespace function.
2576         * khtml/rendering/render_text.cpp: 
2577         (RenderText::caretRect): Do not draw the caret beyond the right edge of the
2578         window when in white-space normal mode.
2579
2580 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2581
2582         Reviewed by Darin
2583
2584         Fix for these bugs:
2585         
2586         In this patch, I add two new CSS properties and their associated behavior.
2587         This is to support end-of-line and word-wrapping features that match the 
2588         conventions of text editors.
2589
2590         There are also some other small changes here which begin to lay the groundwork
2591         for using these new properties to bring about the desired editing behavior.
2592
2593         * khtml/css/cssparser.cpp:
2594         (CSSParser::parseValue): Add support for new CSS properties.
2595         * khtml/css/cssproperties.c: Generated file.
2596         * khtml/css/cssproperties.h: Ditto.
2597         * khtml/css/cssproperties.in: Add new properties.
2598         * khtml/css/cssstyleselector.cpp:
2599         (khtml::CSSStyleSelector::applyProperty): Add support for new CSS properties.
2600         * khtml/css/cssvalues.c: Generated file.
2601         * khtml/css/cssvalues.h: Ditto.
2602         * khtml/css/cssvalues.in:  Add support for new CSS properties.
2603         * khtml/editing/visible_position.cpp:
2604         (khtml::VisiblePosition::upstreamDeepEquivalent): Added new helper.
2605         * khtml/editing/visible_position.h:
2606         * khtml/rendering/render_box.cpp:
2607         (RenderBox::deleteLineBoxWrapper): Zero out inlineBoxWrapper.
2608         * khtml/rendering/render_replaced.cpp:
2609         (RenderWidget::detach): Zero out inlineBoxWrapper.
2610         * khtml/rendering/render_style.cpp:
2611         (StyleCSS3InheritedData):
2612         (StyleCSS3InheritedData::operator==): Add support for new CSS properties.
2613         (RenderStyle::diff): Ditto.
2614         * khtml/rendering/render_style.h:
2615         (khtml::RenderStyle::nbspMode): Ditto.
2616         (khtml::RenderStyle::khtmlLineBreak): Ditto.
2617         (khtml::RenderStyle::setNBSPMode): Ditto.
2618         (khtml::RenderStyle::setKHTMLLineBreak): Ditto.
2619         (khtml::RenderStyle::initialNBSPMode): Ditto.
2620         (khtml::RenderStyle::initialKHTMLLineBreak): Ditto.
2621
2622 2004-10-05  Darin Adler  <darin@apple.com>
2623
2624         Reviewed by John.
2625
2626         - fixed <rdar://problem/3673150> Pasting string from clipboard that is longer than input box will accept fails rather than truncating
2627
2628         * kwq/KWQTextField.mm:
2629         (-[KWQTextFieldFormatter isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:]):
2630         Wrote a new version of this method that truncates incoming strings rather than rejecting them
2631         out of hand.
2632
2633 2004-10-04  Darin Adler  <darin@apple.com>
2634
2635         Reviewed by Maciej.
2636
2637         - fixed <rdar://problem/3826343> crash in KHTMLParser::setCurrent parsing document fragment (happens in Calendar widget)
2638
2639         * khtml/html/htmlparser.cpp:
2640         (KHTMLParser::KHTMLParser): Initialized currentIsReferenced to false (fixes bug).
2641         (KHTMLParser::reset): Use doc() to make code easier to read.
2642         (KHTMLParser::setCurrent): Ditto.
2643         (KHTMLParser::parseToken): Ditto.
2644         (KHTMLParser::insertNode): Ditto.
2645         (KHTMLParser::getElement): Ditto.
2646         (KHTMLParser::popOneBlock): Ditto.
2647
2648         - fixed <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window
2649
2650         * kwq/KWQKHTMLPart.h: Added fontAttributesForSelectionStart.
2651         * kwq/KWQKHTMLPart.mm:
2652         (KWQKHTMLPart::styleForSelectionStart): Factored out most of fontForSelection.
2653         (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
2654         (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
2655         (KWQKHTMLPart::registerCommandForUndo): Updated for name change (see below).
2656         (KWQKHTMLPart::registerCommandForRedo): Ditto.
2657
2658         * kwq/WebCoreBridge.h: Added fontAttributesForSelectionStart.
2659         * kwq/WebCoreBridge.mm:
2660         (-[WebCoreBridge undoEditing:]): Updated for name change (see below).
2661         (-[WebCoreBridge redoEditing:]): Ditto.
2662         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Got rid of named temporary
2663         EditCommandPtr variable to make things slightly more terse.
2664         (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): Ditto.
2665         (-[WebCoreBridge deleteSelectionWithSmartDelete:]): Ditto.
2666         (-[WebCoreBridge fontAttributesForSelectionStart]): Added.
2667
2668         - fix compile on Panther and other cleanup
2669
2670         * khtml/khtml_part.cpp: Removed unneeded include.
2671         * kwq/KWQEditCommand.h: Got rid of use of "impl" when referring to EditCommand pointers.
2672         * kwq/KWQEditCommand.mm: Added include so we compile on Panther.
2673         (-[KWQEditCommand initWithEditCommand:]): Changed name.
2674         (-[KWQEditCommand dealloc]): Updated for m_impl change to m_command.
2675         (-[KWQEditCommand finalize]): Ditto.
2676         (+[KWQEditCommand commandWithEditCommand:]): Changed name.
2677         (-[KWQEditCommand command]): Changed name.
2678
2679 2004-10-04  Darin Adler  <darin@apple.com>
2680
2681         Reviewed by John.
2682
2683         - did a more-robust version of the fix I just landed
2684
2685         * khtml/html/htmlparser.h: Added currentIsReferenced boolean.
2686         * khtml/html/htmlparser.cpp:
2687         (KHTMLParser::KHTMLParser): Initializes currentIsReferenced.
2688         (KHTMLParser::setCurrent): Changed to respect and set currentIsReferenced.
2689
2690 2004-10-04  Darin Adler  <darin@apple.com>
2691
2692         Reviewed by John.
2693
2694         - fixed <rdar://problem/3824393> REGRESSION (165-TOT): Crash in KHTMLParser::popOneBlock closing window (bose.com)
2695
2696         * khtml/html/htmlparser.cpp:
2697         (KHTMLParser::~KHTMLParser): Move call to setCurrent(0) after the call to freeBlock, since freeBlock doesn't
2698         work well when current is 0, and there's no reason we need to reset the current block first.
2699         (KHTMLParser::setCurrent): Don't ever hold a reference to the document. This prevents a situation where there
2700         would be a reference cycle. In the test case from the bug above, this cycle actually happened and resulted
2701         in a double-delete of the document, tokenizer, and parser.
2702
2703 2004-10-04  Darin Adler  <darin@apple.com>
2704
2705         Reviewed by Maciej.
2706
2707         - fixed <rdar://problem/3825429> onclick handler called when mouse down on another element (affects Dashboard Movies widget, test case enclosed)
2708
2709         * khtml/khtmlview.cpp:
2710         (KHTMLViewPrivate::KHTMLViewPrivate): Initialize the click node to 0.
2711         (KHTMLViewPrivate::~KHTMLViewPrivate): Deref the click node.
2712         (KHTMLViewPrivate::reset): Clear the click node.
2713         (KHTMLView::viewportMousePressEvent): Call invalidateClick when we pass the event to a subframe to
2714         reduce the chance that we'll hold on to an old click node for a long time. Set the click node to
2715         the node we we are clicking on.
2716         (KHTMLView::viewportMouseDoubleClickEvent): Only send a click even if the node is the same one from
2717         the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
2718         old click node for a long time.
2719         (KHTMLView::invalidateClick): Clear the click node.
2720         (KHTMLView::viewportMouseReleaseEvent): Only send a click even if the node is the same one from
2721         the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
2722         old click node for a long time.
2723         (KHTMLView::keyPressEvent): Remove code that sets the originalNode field, which is never used.
2724
2725 2004-10-04  Ken Kocienda  <kocienda@apple.com>
2726
2727         Reviewed by Hyatt
2728
2729         Fix for this bug:
2730         
2731         <rdar://problem/3825289> REGRESSION (Mail): Crash in fontForSelection in empty window
2732
2733         * khtml/editing/visible_position.cpp:
2734         (khtml::VisiblePosition::previousPosition): Switch to node iteration instead "leaf"
2735         iteration. I have been wanting to make this change for a long time, but couldn't
2736         since other code relied on the leaf behavior. That is no longer true. Plus, the
2737         bug fix requires the new behavior.
2738         (khtml::VisiblePosition::nextPosition): Ditto.
2739         (khtml::VisiblePosition::isCandidate): Empty blocks needed a height to be a candidate,
2740         but we make a special case for the body element. This fixes the bug.
2741
2742 2004-10-04  Darin Adler  <darin@apple.com>
2743
2744         Reviewed by Ken.
2745
2746         - fixed <rdar://problem/3800667> REGRESSION (Mail): double-clicking multiple spaces only selects two spaces
2747
2748         * kwq/KWQTextUtilities.mm: (KWQFindWordBoundary): Moved here from the .cpp file. Changed to use the
2749         doubleClickAtIndex: method from NSAttributedString rather than using Unicode Utilities.
2750         * kwq/KWQTextUtilities.cpp: Removed.
2751         * WebCore.pbproj/project.pbxproj: Removed KWQTextUtilities.cpp.
2752
2753         - fixed a problem that would show up using HTML editing under garbage collection
2754
2755         * kwq/KWQEditCommand.mm: (-[KWQEditCommand finalize]): Fixed a [super dealloc] that should have been a
2756         [super finalize].
2757
2758         - another small change
2759
2760         * khtml/editing/visible_units.cpp: (khtml::nextWordBoundary): Tweaked a comment.
2761
2762 2004-10-01  Darin Adler  <darin@apple.com>
2763
2764         Reviewed by Ken (or arguably done by Ken, reviewed by Darin).
2765
2766         - fixed <rdar://problem/3823828> REGRESSION (Mail): Clicking past end of any line puts insertion point at beginning of next line
2767
2768         * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::VisiblePosition):
2769         Check for an offset of 0 and a <br> and use UPSTREAM affinity in that case.
2770         This is a short term fix for something that needs a better longer-term fix.
2771
2772         - fixed <rdar://problem/3823816> REGRESSION (Mail): double-clicking first word on line also selects previous empty line
2773
2774         * khtml/editing/visible_units.cpp: (khtml::previousWordBoundary): Added a special
2775         case for <br>. While I'm not sure why this regressed, I'm sure this fix is good.
2776
2777 2004-10-01  Darin Adler  <darin@apple.com>
2778
2779         Reviewed by John.
2780
2781         - fixed <rdar://problem/3782117> CrashTracer: ..722 crashes at com.apple.WebCore: DOM::HTMLBodyElementImpl::insertedIntoDocument + 0x2c (AOL website)
2782
2783         * khtml/html/html_baseimpl.cpp:
2784         (HTMLBodyElementImpl::insertedIntoDocument): Check for nil document case.
2785         (HTMLFrameElementImpl::isURLAllowed): Ditto.
2786         (HTMLFrameElementImpl::openURL): Ditto.
2787
2788 2004-10-01  Darin Adler  <darin@apple.com>
2789
2790         Reviewed by Maciej.
2791
2792         - fixed <rdar://problem/3822218> REGRESSION (164-165): images don't update on rollover on directv.com page
2793
2794         I introduced a major regression where various JavaScript window properties would not be found when I
2795         fixed bug 3809600.
2796
2797         * khtml/ecma/kjs_window.h: Added hasProperty.
2798         * khtml/ecma/kjs_window.cpp: (Window::hasProperty): Return true in all the cases where get returns something.
2799
2800 2004-09-30  Darin Adler  <darin@apple.com>
2801
2802         Reviewed by Maciej.
2803
2804         - fixed <rdar://problem/3461499> JavaScript function document.open() is buggy with 2nd argument "replace"
2805
2806         Experiments with Firefox indicate that document.open() should not be treated as window.open() unless there
2807         are more than two parameters. Also, Firefox does not implement the "replace" behavior, so we don't have
2808         to worry about it either.
2809
2810         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): Only forward to window if there are more than
2811         two parameters, rather than if there are more than one.
2812
2813         - fixed <rdar://problem/3672933> oninput is firing at page load time for <input type=range>
2814
2815         * kwq/KWQSlider.mm: (QSlider::setValue): Don't emit a signal here. This follows the usual pattern, where
2816         a signal is only emitted for changes that are not explicitly requested by the caller.
2817
2818         - fixed <rdar://problem/3821167> leaks of something allocated by recalcStyle after loading altavista page from cvs-base
2819
2820         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Ref and deref the style we allocate so it's
2821         not left floating if setStyle decides not to ref it.
2822
2823         - fixed <rdar://problem/3821172> leak of HTML attribute string after loading the ESPN page from cvs-base
2824
2825         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Use the DOMString version of
2826         the lower() operation so we don't end up leaving a DOMStringImpl * floating if AtomicString decides not
2827         to ref it.
2828
2829 2004-09-30  Richard Williamson   <rjw@apple.com>
2830
2831         Fixed <rdar://problem/3822330> REGRESSION: crash on launch when homepage is set to about:blank
2832         
2833         Added nil check.
2834         
2835         * kwq/KWQKHTMLPart.mm:
2836         (KWQKHTMLPart::setDisplaysWithFocusAttributes):
2837
2838 2004-09-30  Chris Blumenberg  <cblu@apple.com>
2839         
2840         Fixed: <rdar://problem/3792822> Safari is calling the Cocoa QuickTime plugin twice for the OBJECT and EMBED tags
2841
2842         Reviewed by hyatt.
2843
2844         * khtml/html/html_objectimpl.cpp:
2845         (HTMLObjectElementImpl::attach): call dispatchHTMLEvent after updateWidget instead of every time this method is called
2846         (HTMLObjectElementImpl::recalcStyle): ditto
2847
2848 2004-09-30  Darin Adler  <darin@apple.com>
2849
2850         - rolled out bad image change that caused performance regression
2851
2852         * khtml/rendering/render_image.cpp: (RenderImage::setPixmap):
2853         Don't reference the new image before doing the assignment.
2854         This forced an unwanted.
2855
2856 2004-09-30  Ken Kocienda  <kocienda@apple.com>
2857
2858         Reviewed by me, coded by Darin
2859
2860         - fixed <rdar://problem/3818305> REGRESSION (Mail): Shift + page up has no effect; should modify selection
2861
2862         * khtml/editing/selection.cpp: (khtml::Selection::modify): Fix problem where vertical distance
2863         was used as a distance threshold, but was a negative number. Now make it positive at the start
2864         of the function (and make a couple related changes).
2865
2866 2004-09-29  Richard Williamson   <rjw@apple.com>
2867
2868         Fixed <rdar://problem/3779998> bringing window to front or sending to back does not send focus/blur events to JavaScript window object
2869
2870         The fix has two parts, 1) make onblur and onfocus work for windows, 
2871         and 2), allow the dashboard to override WebKit's special key/non-key
2872         behaviors.
2873
2874         Reviewed by Chris.
2875
2876         * kwq/KWQKHTMLPart.mm:
2877         (KWQKHTMLPart::setDisplaysWithFocusAttributes):
2878
2879 2004-09-29  Ken Kocienda  <kocienda@apple.com>
2880
2881         Reviewed by Hyatt
2882         
2883         Fix for this bug:
2884         
2885         <rdar://problem/3705894> REGRESSION (Mail): if a single word is wider than the window, 
2886         it doesn't break and just runs off the right side
2887
2888         * khtml/css/css_computedstyle.cpp:
2889         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support for CSS_PROP_WORD_WRAP.
2890         * khtml/css/cssparser.cpp:
2891         (CSSParser::parseValue): Ditto.
2892         * khtml/css/cssproperties.c: Generated file.
2893         * khtml/css/cssproperties.h: Ditto.
2894         * khtml/css/cssproperties.in: Add word-wrap property.
2895         * khtml/css/cssstyleselector.cpp:
2896         (khtml::CSSStyleSelector::applyProperty): Add support for CSS_PROP_WORD_WRAP.
2897         * khtml/css/cssvalues.c: Generated file.
2898         * khtml/css/cssvalues.h: Ditto.
2899         * khtml/css/cssvalues.in: Add break-word value.
2900         * khtml/rendering/bidi.cpp:
2901         (khtml::RenderBlock::findNextLineBreak): Add code to implement new word wrapping feature.
2902         * khtml/rendering/render_style.cpp:
2903         (StyleCSS3InheritedData): Add support for new wordWrap property.
2904         (StyleCSS3InheritedData::operator==): Ditto.
2905         (RenderStyle::diff): Ditto.
2906         * khtml/rendering/render_style.h:
2907         (khtml::RenderStyle::wordWrap): Ditto.
2908         (khtml::RenderStyle::setWordWrap): Ditto.
2909         (khtml::RenderStyle::initialWordWrap): Ditto.
2910
2911 2004-09-29  Maciej Stachowiak  <mjs@apple.com>
2912
2913         Reviewed by John.
2914
2915         - consolidated OS version checks into prefix header
2916
2917         * WebCorePrefix.h:
2918         * khtml/rendering/render_canvasimage.cpp:
2919         * kwq/KWQAccObject.mm:
2920         (-[KWQAccObject roleDescription]):
2921         (-[KWQAccObject accessibilityActionDescription:]):
2922         * kwq/KWQComboBox.mm:
2923         (QComboBox::QComboBox):
2924         * kwq/KWQFoundationExtras.h:
2925
2926 2004-09-29  David Hyatt  <hyatt@apple.com>
2927
2928         Make sure <br>s always get line boxes.  Also prevent the creation of RenderTexts for whitespace normal/nowrap nodes
2929         that follow <br>s.
2930         
2931         Reviewed by kocienda
2932
2933         * khtml/editing/visible_position.cpp:
2934         (khtml::VisiblePosition::isCandidate):
2935         * khtml/rendering/render_br.cpp:
2936         (RenderBR::RenderBR):
2937         (RenderBR::createInlineBox):
2938         (RenderBR::baselinePosition):
2939         (RenderBR::lineHeight):
2940         * khtml/rendering/render_br.h:
2941         * khtml/rendering/render_line.cpp:
2942         (khtml::InlineFlowBox::placeBoxesVertically):
2943         * khtml/rendering/render_line.h:
2944         (khtml::InlineBox::isText):
2945         (khtml::InlineFlowBox::addToLine):
2946         * khtml/rendering/render_text.cpp:
2947         (RenderText::detach):
2948         * khtml/rendering/render_text.h:
2949         (khtml::InlineTextBox:::InlineRunBox):
2950         (khtml::InlineTextBox::isInlineTextBox):
2951         (khtml::InlineTextBox::isText):
2952         (khtml::InlineTextBox::setIsText):
2953         * khtml/xml/dom_textimpl.cpp:
2954         (TextImpl::rendererIsNeeded):
2955         * kwq/KWQRenderTreeDebug.cpp:
2956         (operator<<):
2957
2958 2004-09-29  Ken Kocienda  <kocienda@apple.com>
2959
2960         Reviewed by John
2961
2962         Fix for this bug:
2963         
2964         <rdar://problem/3815895> exception inside fontForSelection causes Mail to abort when selection hits bottom
2965
2966         * khtml/editing/selection.cpp:
2967         (khtml::Selection::toRange): Use RangeImpl calls to detect exceptions when creating a Range
2968         from a Selection. Return an empty Range when there is an exception.
2969
2970         Fix for this bug:
2971         
2972         <rdar://problem/3817268> REGRESSION (Mail): Window does not scroll when selecting out of 
2973         visible area of view with arrow keys
2974
2975         * khtml/editing/selection.cpp: Did some name changing. m_needsCaretLayout -> m_needsLayout.
2976         Added m_expectedVisibleRect which supplies the right rectangle to update when scrolling.
2977         (khtml::Selection::Selection): m_needsCaretLayout -> m_needsLayout name change.
2978         (khtml::Selection::init): Handle m_expectedVisibleRect in initialization.
2979         (khtml::Selection::operator=): Handle m_expectedVisibleRect in assignment.
2980         (khtml::Selection::setNeedsLayout): m_needsCaretLayout -> m_needsLayout name change.
2981         (khtml::Selection::layout): Changed name from layoutCaret, since m_expectedVisibleRect
2982         is also calculated here.
2983         (khtml::Selection::caretRect): m_needsCaretLayout -> m_needsLayout name change.
2984         (khtml::Selection::expectedVisibleRect): New. Returns m_expectedVisibleRect, doing a 
2985         layout if needed.
2986         (khtml::Selection::needsCaretRepaint): m_needsCaretLayout -> m_needsLayout name change.
2987         (khtml::Selection::paintCaret): Ditto.
2988         (khtml::Selection::validate): Ditto.
2989         * khtml/editing/selection.h: Add m_expectedVisibleRect member variable and 
2990         expectedVisibleRect accessor.
2991         * kwq/WebCoreBridge.h: Change name of ensureCaretVisible to ensureSelectionVisible, since
2992         this is not only about making the caret visible anymore. Now it can reveal the varying
2993         end of the selection when scrolling with arrow keys.
2994         * kwq/WebCoreBridge.mm:
2995         (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): ensureCaretVisible to 
2996         ensureSelectionVisible name change.
2997         (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto
2998         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Ditto
2999         (-[WebCoreBridge insertNewline]): Ditto
3000         (-[WebCoreBridge insertText:selectInsertedText:]): Ditto
3001         (-[WebCoreBridge deleteKeyPressed]): Ditto
3002         (-[WebCoreBridge ensureSelectionVisible]): Ditto
3003
3004 2004-09-29  Ken Kocienda  <kocienda@apple.com>
3005
3006         Reviewed by Hyatt
3007         
3008         Fix for this bug:
3009         
3010         <rdar://problem/3818296> REGRESSION (Mail): centerSelectionInVisibleArea does not work correctly
3011         
3012         * kwq/KWQKHTMLPart.h:
3013         * kwq/KWQKHTMLPart.mm:
3014         (KWQKHTMLPart::centerSelectionInVisibleArea): New function. Handles both caret
3015         and range selections correctly.
3016         * kwq/KWQNSViewExtras.h: Add forceCentering boolean to some methods in this file.
3017         * kwq/KWQNSViewExtras.m: Ditto. This addition has been done since the AppKit 
3018         method we use to do the centering, -[NSView scrollRectToVisible:],  does not alter 
3019         the view if the rectangle passed to it is already in view. When forceCentering is
3020         true, extra math is done to make scrollRectToVisible center the rectangle we want.
3021         (-[NSView _KWQ_scrollFrameToVisible]): Pass NO for forceCentering in call through to 
3022         _KWQ_scrollRectToVisible:forceCentering:
3023         (-[NSView _KWQ_scrollRectToVisible:forceCentering:]): Add forceCentering argument.
3024         (-[NSView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto.
3025         (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto. Do extra
3026         math to implement the forceCentering effect.
3027         * kwq/KWQScrollView.h: Add forceCentering default argument to ensureRectVisibleCentered.
3028         * kwq/KWQScrollView.mm:
3029         (QScrollView::ensureRectVisibleCentered): Ditto.
3030         * kwq/WebCoreBridge.h:
3031         * kwq/WebCoreBridge.mm:
3032         (-[WebCoreBridge centerSelectionInVisibleArea]): New function. Call through to KWQKHTMLPart. 
3033
3034 2004-09-28  Chris Blumenberg  <cblu@apple.com>
3035
3036         Fixed: WebArchives begin with "<#document/>"
3037
3038         Reviewed by hyatt.
3039
3040         * khtml/xml/dom_nodeimpl.cpp:
3041         (NodeImpl::startMarkup): don't return markup if this is a document node, forgot this when factoring this method out from toHTML
3042
3043 2004-09-28  Chris Blumenberg  <cblu@apple.com>
3044
3045         Removed range parameter from recursive_toHTML and friends since that code path is no longer used.
3046         
3047         Reviewed by mjs.
3048
3049         * khtml/xml/dom2_rangeimpl.cpp:
3050         (DOM::RangeImpl::toHTML):
3051         * khtml/xml/dom_nodeimpl.cpp:
3052         (NodeImpl::recursive_toString):
3053         (NodeImpl::recursive_toHTML):
3054         * khtml/xml/dom_nodeimpl.h:
3055         * kwq/WebCoreBridge.mm:
3056         (-[WebCoreBridge markupStringFromNode:nodes:]):
3057
3058 2004-09-28  Darin Adler  <darin@apple.com>
3059
3060         Reviewed by Ken.
3061
3062         - improve spell checking so it doesn't unmark and remark as you move the cursor with the arrow
3063
3064         * khtml/editing/htmlediting.h: Remove obsolete markMisspellingsInSelection private function.
3065         * khtml/editing/htmlediting.cpp:
3066         (khtml::EditCommand::EditCommand): Blow away the selection when starting an edit command.
3067         (khtml::EditCommand::apply): Remove code to mark misspellings because that's now done as part
3068         of blowing away the selection.
3069         (khtml::EditCommand::unapply): Blow away the selection instead of marking mispellings.
3070         (khtml::EditCommand::reapply): Ditto.
3071         (khtml::ReplaceSelectionCommand::doApply): Removed incorrect code that does spell checking
3072         on inserted text; this doesn't match NSText behavior.
3073         (khtml::TypingCommand::markMisspellingsAfterTyping): Use markMisspellingsInAdjacentWords
3074         function for greater clarity on what this actually does.
3075
3076         * khtml/khtml_part.h: Replaced setSelection's "unmarkOldSelection" boolean parameter with a
3077         "keepTypingStyle" boolean parameter. Removed notifySelectionChanged.
3078         * khtml/khtml_part.cpp:
3079         (KHTMLPart::setSelection): Replaced the "unmarkOldSelection" boolean with a new "keepTypingStyle"
3080         boolean. This is a step on the way to simplifying how this works. Moved the code from the
3081         notifySelectionChanged function here, since there was no clear line between the two functions.
3082         (KHTMLPart::clearSelection): Call setSelection rather that having special case code here for
3083         the case of an empty selection.
3084         (KHTMLPart::appliedEditing): Remove the explicit "false" for "unmarkOldSelection".
3085         (KHTMLPart::unappliedEditing): Ditto.
3086         (KHTMLPart::reappliedEditing): Ditto.
3087
3088         * kwq/KWQKHTMLPart.h: Replaced markMisspellingsInSelection and updateSpellChecking with
3089         markMisspellings and markMisspellingsInAdjacentWords. Added parameters to respondToChangedSelection.
3090         * kwq/KWQKHTMLPart.mm:
3091         (KWQKHTMLPart::markMisspellingsInAdjacentWords): Added.
3092         (KWQKHTMLPart::markMisspellings): New name for markMisspellingsInSelection. Simplified logic a
3093         bit and made it the caller's responsibility to expand the selection passed in to word boundaries.
3094         (KWQKHTMLPart::respondToChangedSelection): Added parameter that identifies the old selection,
3095         and changed logic so it won't mark mispellings in a word if the selection still starts in that word.
3096
3097         - implemented empty-cells property in computed style
3098
3099         * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3100         Added code for CSS_PROP_EMPTY_CELLS. I think the HTML converter in AppKit uses this.
3101
3102 2004-09-28  Chris Blumenberg  <cblu@apple.com>
3103
3104         Fixed n-squared issues with appending to KWQValueListImpl. This fixes the hang in 3794799.
3105
3106         Fixed by Darin, reviewed by me.
3107
3108         * khtml/xml/dom2_rangeimpl.cpp:
3109         (DOM::RangeImpl::toHTML): tweaks
3110         * kwq/KWQValueListImpl.mm:
3111         (KWQValueListImpl::KWQValueListPrivate::KWQValueListPrivate):
3112         (KWQValueListImpl::KWQValueListPrivate::copyList):
3113         (KWQValueListImpl::clear):
3114         (KWQValueListImpl::appendNode):
3115         (KWQValueListImpl::prependNode):
3116         (KWQValueListImpl::removeEqualNodes):
3117         (KWQValueListImpl::containsEqualNodes):
3118         (KWQValueListImpl::removeIterator):
3119         (KWQValueListImpl::lastNode):
3120         * kwq/WebCoreBridge.mm:
3121         (-[WebCoreBridge nodesFromList:]): use iterator, not at()
3122
3123 2004-09-28  Richard Williamson   <rjw@apple.com>
3124
3125         More dashboard region changes for John.
3126
3127         <rdar://problem/3817421> add getter for dashboard regions (debugging)
3128         
3129         <rdar://problem/3817417> NSScrollView need autoregions for dashboard
3130         
3131         <rdar://problem/3817388> should have short form form control regions
3132         
3133         <rdar://problem/3817477> visibility does not work with dashboard control regions
3134
3135         Reviewed by Hyatt.
3136
3137         * WebCore-combined.exp:
3138         * WebCore.exp:
3139         * khtml/css/cssparser.cpp:
3140         (skipCommaInDashboardRegion):
3141         (CSSParser::parseDashboardRegions):
3142         * khtml/khtmlview.cpp:
3143         (KHTMLView::updateDashboardRegions):
3144         * khtml/rendering/render_object.cpp:
3145         (RenderObject::setStyle):
3146         (RenderObject::addDashboardRegions):
3147         * khtml/xml/dom_docimpl.cpp:
3148         (DocumentImpl::DocumentImpl):
3149         (DocumentImpl::setDashboardRegions):
3150         * khtml/xml/dom_docimpl.h:
3151         (DOM::DocumentImpl::setDashboardRegionsDirty):
3152         (DOM::DocumentImpl::dashboardRegionsDirty):
3153         * kwq/KWQKHTMLPart.h:
3154         * kwq/KWQKHTMLPart.mm:
3155         (KWQKHTMLPart::paint):
3156         (KWQKHTMLPart::dashboardRegionsDictionary):
3157         (KWQKHTMLPart::dashboardRegionsChanged):
3158         * kwq/WebCoreBridge.h:
3159         * kwq/WebCoreBridge.mm:
3160         (-[WebCoreBridge dashboardRegions]):
3161         * kwq/WebDashboardRegion.h:
3162         * kwq/WebDashboardRegion.m:
3163         (-[WebDashboardRegion description]):
3164
3165 2004-09-28  John Sullivan  <sullivan@apple.com>
3166
3167         Reviewed by Chris.
3168
3169         - fixed <rdar://problem/3818558> REGRESSION: "Installed Plug-ins" is blank 
3170         because of <script type="application/x-javascript">
3171
3172         * khtml/html/htmltokenizer.cpp:
3173         (khtml::HTMLTokenizer::parseTag):
3174         add "application/x-javascript" to the list of legal scripting types. Mozilla
3175         accepts this, but WinIE doesn't.
3176         
3177         * layout-tests/fast/tokenizer/004.html:
3178         updated layout test to test some application/xxxx types
3179
3180 2004-09-27  David Hyatt  <hyatt@apple.com>
3181
3182         Reworked lists to work well with RTL text.  Specifically the following bugs have been fixed:
3183
3184         (1) All bullets use the same offset constant now (a padding of 7 pixels).  Before, images used 5 and others used 7.
3185         (2) Line height now works properly, so that list items with no content aren't squished (and missing the line descent).
3186         (3) Punctuation now works correctly with inside and outside style ordered lists in RTL.
3187         (4) RTL lists now properly apply padding and margin to the right side rather than the left.  This was done by adding
3188         -khtml-margin-start and -khtml-padding-start properties that are just mapped to left/right based off the direction.
3189         
3190         Reviewed by darin
3191
3192         * khtml/css/cssparser.cpp:
3193         (CSSParser::parseValue):
3194         * khtml/css/cssproperties.c:
3195         (hash_prop):
3196         (findProp):
3197         * khtml/css/cssproperties.h:
3198         * khtml/css/cssproperties.in:
3199         * khtml/css/cssstyleselector.cpp:
3200         (khtml::CSSStyleSelector::applyDeclarations):
3201         (khtml::CSSStyleSelector::applyProperty):
3202         * khtml/css/html4.css:
3203         * khtml/rendering/bidi.cpp:
3204         (khtml::BidiIterator::direction):
3205         * khtml/rendering/render_list.cpp:
3206         (RenderListItem::getAbsoluteRepaintRect):
3207         (RenderListMarker::paint):
3208         (RenderListMarker::calcMinMaxWidth):
3209         (RenderListMarker::lineHeight):
3210         (RenderListMarker::baselinePosition):
3211
3212 2004-09-28  Ken Kocienda  <kocienda@apple.com>
3213
3214         Reviewed by Darin
3215         
3216         Mark the VisiblePosition taking (Position &, EAffinity=DOWNSTREAM) explicit. Recently, when I added
3217         the EAffinity argument, I left this constructor implicit. Darin pointed out to me that this is
3218         undesirable since implicit use of the the constructor involved making the affinity choice, something
3219         which should be done explicitly.
3220
3221         * khtml/editing/selection.cpp:
3222         (khtml::Selection::modifyExtendingRightForward): Make explicit use of constructor mentioned above.
3223         (khtml::Selection::modifyMovingRightForward): Ditto.
3224         (khtml::Selection::modifyExtendingLeftBackward): Ditto.
3225         (khtml::Selection::modifyMovingLeftBackward): Ditto.
3226         (khtml::Selection::modify): Ditto.
3227         (khtml::Selection::validate): Ditto.
3228         * khtml/editing/visible_position.h: Make constructor taking (Position &, EAffinity) explicit.
3229         * khtml/editing/visible_units.cpp: Ditto.
3230         (khtml::previousWordBoundary): Make explicit use of constructor mentioned above.
3231         (khtml::nextWordBoundary): Ditto.
3232         (khtml::previousLinePosition): Ditto.
3233         (khtml::nextLinePosition): Ditto.
3234         * kwq/KWQKHTMLPart.mm: Ditto.
3235         (KWQKHTMLPart::findString): Ditto.
3236         (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
3237         (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
3238         (KWQKHTMLPart::updateSpellChecking): Ditto.
3239
3240 2004-09-28  Darin Adler  <darin@apple.com>
3241
3242         Reviewed by John.
3243
3244         - fixed a storage leak discovered by code inspection
3245
3246         * khtml/html/htmlparser.cpp: (KHTMLParser::~KHTMLParser): Call setCurrent(0) to deref
3247         the parser's current node in the rare case where it still has one.
3248
3249 2004-09-27  David Hyatt  <hyatt@apple.com>
3250
3251         Don't allow nested headers when only inlines are in between them.  Fixes a hang related to pathological nesting
3252         on magicmethodsonline.com.
3253         
3254         Reviewed by darin
3255
3256         * khtml/html/htmlparser.cpp:
3257         (KHTMLParser::parseToken):
3258         (KHTMLParser::processCloseTag):
3259         (KHTMLParser::isHeaderTag):
3260         (KHTMLParser::popNestedHeaderTag):
3261         * khtml/html/htmlparser.h:
3262
3263 2004-09-27  Kevin Decker  <kdecker@apple.com>
3264
3265         Reviewed by John.
3266
3267         * khtml/css/css_base.cpp:
3268         (CSSSelector::selectorText): changed another ATTR_CLASS case to properly return class selector names. 
3269
3270 2004-09-27  David Hyatt  <hyatt@apple.com>
3271
3272         Fix style sharing so that it doesn't share when it shouldn't.  Partially fixes 3671516, table cells don't update
3273         their color on macosx.apple.com.
3274
3275         Fix 3521639, iframe mispositioned on bidi page.  Make sure that when the width of a line exceeds the available line
3276         width that the spillage out of the block is determined by the direction of the block and not by the text-align value.
3277
3278         Partial fix for 3762962, make sure the image cells with specified widths but percentage heights don't just get a minwidth
3279         of 0.
3280
3281         Fix for 3533878, framesets that use percentages that add up to a value > 100% should normalize those percentages.
3282         
3283         Reviewed by john
3284
3285         * khtml/css/cssstyleselector.cpp:
3286         (khtml::CSSStyleSelector::locateCousinList):
3287         (khtml::CSSStyleSelector::elementsCanShareStyle):
3288         (khtml::CSSStyleSelector::locateSharedStyle):
3289         * khtml/css/cssstyleselector.h:
3290         * khtml/html/html_elementimpl.h:
3291         (DOM::HTMLNamedAttrMapImpl::hasMappedAttributes):
3292         (DOM::HTMLElementImpl::inlineStyleDecl):
3293         * khtml/rendering/bidi.cpp:
3294         (khtml::RenderBlock::computeHorizontalPositionsForLine):
3295         * khtml/rendering/render_frames.cpp:
3296         (RenderFrameSet::layout):
3297         * khtml/rendering/render_replaced.cpp:
3298         (RenderReplaced::calcMinMaxWidth):
3299         * khtml/xml/dom_elementimpl.h:
3300         (DOM::ElementImpl::inlineStyleDecl):
3301         (DOM::ElementImpl::hasMappedAttributes):
3302
3303 2004-09-27  Ken Kocienda  <kocienda@apple.com>
3304
3305         Reviewed by John
3306
3307         Removed closestRenderedPosition function from Position class and gave this work
3308         to VisiblePosition instead. However, in order to make the transfer possible,
3309         VisiblePosition needed upstream and downstream affinities added to its
3310         constructors. Also moved the EAffinity enum into its own file. Also moved it
3311         to the khtml namespace.
3312
3313         Updated several functions which used closestRenderedPosition to use VisiblePosition
3314         instead.
3315         
3316         Also deleted Position::equivalentShallowPosition. This was unused.
3317
3318         * ForwardingHeaders/editing/text_affinity.h: Added.
3319         * ForwardingHeaders/editing/visible_position.h: Added.
3320         * WebCore.pbproj/project.pbxproj: Added new files.
3321         * khtml/editing/selection.cpp:
3322         (khtml::Selection::validate): Use VisiblePosition instead of closestRenderedPosition.
3323         * khtml/editing/selection.h:
3324         * khtml/editing/text_affinity.h: Added.