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