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