1 2004-11-12 Maciej Stachowiak <mjs@apple.com>
3 Reviewed by NOBODY (OOPS!).
5 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
6 sometimes using a huge bogus length value.
8 * khtml/xml/dom_nodeimpl.cpp:
9 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
11 2004-11-12 Darin Adler <darin@apple.com>
15 - fixed an infinite loop in that last check-in
17 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
18 Added a ++i to the loop so it won't get stuck on the first element in the list.
20 2004-11-12 Maciej Stachowiak <mjs@apple.com>
24 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
26 I fixed this by changing NodeLists to cache their length, but
27 invalidate it whenever there is a change in the DOM subtree at
28 which they are rooted. This makes NodeListImpl::recursiveLength()
29 drop completely off the profile, since we were repeatedly getting
30 a length for the same NodeList over and over.
32 * khtml/xml/dom_nodeimpl.cpp:
34 (NodeImpl::~NodeImpl):
35 (NodeImpl::registerNodeList):
36 (NodeImpl::unregisterNodeList):
37 (NodeImpl::notifyLocalNodeListsSubtreeModified):
38 (NodeImpl::notifyNodeListsSubtreeModified):
39 (NodeImpl::dispatchSubtreeModifiedEvent):
40 (NodeListImpl::NodeListImpl):
41 (NodeListImpl::~NodeListImpl):
42 (NodeListImpl::recursiveLength):
43 (NodeListImpl::recursiveItem):
44 (NodeListImpl::rootNodeSubtreeModified):
45 (ChildNodeListImpl::ChildNodeListImpl):
46 (ChildNodeListImpl::length):
47 (ChildNodeListImpl::item):
48 (TagNodeListImpl::TagNodeListImpl):
49 (TagNodeListImpl::length):
50 (TagNodeListImpl::item):
51 (NameNodeListImpl::NameNodeListImpl):
52 (NameNodeListImpl::length):
53 (NameNodeListImpl::item):
54 * khtml/xml/dom_nodeimpl.h:
56 2004-11-12 Darin Adler <darin@apple.com>
60 - various small cleanups
62 * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
63 * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
65 * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
66 * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
67 * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
68 * khtml/html/htmltokenizer.cpp:
69 (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
70 (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
72 * khtml/khtml_part.h: Removed docImpl function.
73 * khtml/khtml_part.cpp: Ditto.
75 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
76 the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
78 * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
79 * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
80 part of the change last time, which is why the build broke).
81 (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
82 (KWQKHTMLPart::setPolicyBaseURL): Ditto.
83 (KWQKHTMLPart::keyEvent): Ditto.
84 (KWQKHTMLPart::dispatchCPPEvent): Ditto.
85 (KWQKHTMLPart::bodyBackgroundColor): Ditto.
87 2004-11-12 Chris Blumenberg <cblu@apple.com>
89 <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
93 * kwq/KWQKHTMLPart.mm:
94 (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
98 2004-11-12 Darin Adler <darin@apple.com>
102 - fixed a couple places that would not work for XML documents
104 * khtml/ecma/kjs_window.cpp:
105 (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
106 is present on the base class.
107 (WindowFunc::tryCall): More of the same.
109 2004-11-12 Darin Adler <darin@apple.com>
111 - land versions of these files generated by the newer gperf
113 People building on Panther will continue to see these files modified.
114 A workaround would be to install the newer gperf on our Tiger build machines.
116 * khtml/css/cssproperties.c: Regenerated.
117 * khtml/css/cssvalues.c: Regenerated.
118 * khtml/html/doctypes.cpp: Regenerated.
119 * khtml/html/kentities.c: Regenerated.
120 * khtml/misc/htmlattrs.c: Regenerated.
121 * khtml/misc/htmltags.c: Regenerated.
122 * kwq/KWQColorData.c: Regenerated.
124 2004-11-11 Richard Williamson <rjw@apple.com>
126 Fix build horkage from previous checkin.
128 * kwq/KWQKHTMLPart.h:
130 2004-11-11 Darin Adler <darin@apple.com>
134 - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
136 * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
138 * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
139 * kwq/KWQKHTMLPart.mm:
140 (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
141 method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
142 we started with the NSTextField as first responder, and then took focus away and gave it back, which
143 makes dragging text work again.
144 (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
146 2004-11-11 David Hyatt <hyatt@apple.com>
148 Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
152 * khtml/html/htmltokenizer.cpp:
153 (khtml::HTMLTokenizer::continueProcessing):
155 2004-11-11 Ken Kocienda <kocienda@apple.com>
159 * khtml/editing/htmlediting.cpp:
160 (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
161 of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
162 with the prevailing style for the VisiblePosition class.
163 * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files.
164 * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
165 (khtml::visiblePositionsInDifferentBlocks): New helper method.
166 (khtml::isLastVisiblePositionInBlock): Ditto.
167 (khtml::isLastVisiblePositionInNode): Ditto.
168 * khtml/editing/visible_position.h: Add declarations for new functions.
170 2004-11-11 Ken Kocienda <kocienda@apple.com>
174 * khtml/editing/htmlediting.cpp:
175 (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
176 (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
177 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
178 (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
179 (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
180 * khtml/xml/dom2_rangeimpl.cpp:
181 (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
182 * khtml/xml/dom2_rangeimpl.h: Ditto.
184 2004-11-11 Ken Kocienda <kocienda@apple.com>
188 Some improvements to deleting when complete lines are selected.
190 * khtml/editing/htmlediting.cpp:
191 (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
192 the end of a selection is fully selected. Turn off block merging in this case.
193 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
194 whether a BR immediately followed a block. The old code could erroneously skip nodes.
195 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
196 start block is selected. This new code will now delete this block in one call, rather
197 than iterating over each child.
198 * khtml/editing/visible_position.cpp:
199 (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
200 to do the work mentioned above in the comment for that function.
201 (khtml::isFirstVisiblePositionOnLine): Ditto.
202 (khtml::isLastVisiblePositionOnLine): Ditto.
203 * khtml/editing/visible_position.h: Add new functions.
204 * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
205 * layout-tests/editing/deleting/delete-line-001.html: Added.
206 * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
207 * layout-tests/editing/deleting/delete-line-002.html: Added.
208 * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
209 * layout-tests/editing/deleting/delete-line-003.html: Added.
210 * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
211 * layout-tests/editing/deleting/delete-line-004.html: Added.
212 * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
213 * layout-tests/editing/deleting/delete-line-005.html: Added.
214 * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
215 * layout-tests/editing/deleting/delete-line-006.html: Added.
216 * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
217 * layout-tests/editing/deleting/delete-line-007.html: Added.
218 * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
219 * layout-tests/editing/deleting/delete-line-008.html: Added.
220 * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
221 * layout-tests/editing/deleting/delete-line-009.html: Added.
222 * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
223 * layout-tests/editing/deleting/delete-line-010.html: Added.
224 * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
225 * layout-tests/editing/deleting/delete-line-011.html: Added.
226 * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
227 * layout-tests/editing/deleting/delete-line-012.html: Added.
229 2004-11-11 Ken Kocienda <kocienda@apple.com>
233 * khtml/editing/htmlediting.cpp:
234 (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
236 2004-11-11 Ken Kocienda <kocienda@apple.com>
242 <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
243 <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
245 * khtml/editing/selection.cpp:
246 (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
247 the next line position when necessary.
248 * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
249 * layout-tests/editing/selection/move-3875618-fix.html: Added.
250 * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
251 * layout-tests/editing/selection/move-3875641-fix.html: Added.
253 2004-11-11 Ken Kocienda <kocienda@apple.com>
257 Improved some function names, at John's urging. No changes to the
258 functions themselves.
260 canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
261 canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
262 performGeneralDelete() --> handleGeneralDelete()
264 * khtml/editing/htmlediting.cpp:
265 (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
266 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
267 (khtml::DeleteSelectionCommand::handleGeneralDelete)
268 (khtml::DeleteSelectionCommand::doApply)
269 * khtml/editing/htmlediting.h
271 2004-11-11 Ken Kocienda <kocienda@apple.com>
275 Updated some layout test results that changed as a result of my last checking.
276 Added a new test that has been in my tree for a few days.
278 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
279 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
280 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
281 * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
283 2004-11-11 Ken Kocienda <kocienda@apple.com>
287 * khtml/editing/htmlediting.cpp:
288 (khtml::debugNode): New debugging helper.
289 (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
290 startPositionForDelete() and endPositionForDelete() functions. Just use the
291 m_selectionToDelete object to determine start and end positions for the delete.
292 (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
293 function that creates a special case for deleting all the content in a root
295 (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
296 function before BR special case and the general case delete functions.
297 * khtml/editing/htmlediting.h: Updated for changed functions.
299 2004-11-10 Kevin Decker <kdecker@apple.com>
303 Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.
305 * khtml/ecma/kjs_dom.cpp:
306 (DOMNodeList::tryGet): Got rid of an unnecessary node traversal.
308 2004-11-10 Ken Kocienda <kocienda@apple.com>
312 * khtml/editing/htmlediting.cpp:
313 (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
314 smart delete from the two functions below to here. There was an unnecessary double
315 calculation of the leading and trailing whitespace positions. Also refined the trailing
316 case so it only acts when the leading position is null (which seems to match TextEdit in
317 my tests). Also removed some unnecessary copying of Position objects.
318 (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
320 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
322 2004-11-10 Ken Kocienda <kocienda@apple.com>
326 (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
327 make things more clear.
328 * khtml/editing/selection.cpp:
329 (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the
330 resulting positions do not cross block boundaries. This was a bug and caused some
331 delete problems when whole blocks were selected. I will be addressing that issue
332 more fully in upcoming changes.
334 2004-11-10 Ken Kocienda <kocienda@apple.com>
338 Some cleanups and fixes in upstream and downstream functions.
340 Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement().
341 Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the
342 block's enclosing block will be returned.
344 Remove code from upstream that confined the serach to block boundaries outside of
345 the code which runs in the StayInBlock case. This code was redundant, and caused
346 incorrect results to be returned in the DoNotStayInBlock case.
348 In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
349 node, not the the this pointer's node.
351 * khtml/xml/dom_position.cpp:
352 (DOM::Position::upstream)
353 (DOM::Position::downstream)
355 2004-11-09 David Hyatt <hyatt@apple.com>
357 Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
358 loading large local files.
362 * khtml/html/htmltokenizer.cpp:
363 (khtml::HTMLTokenizer::HTMLTokenizer):
364 (khtml::HTMLTokenizer::reset):
365 (khtml::HTMLTokenizer::write):
366 (khtml::HTMLTokenizer::stopped):
367 (khtml::HTMLTokenizer::processingData):
368 (khtml::HTMLTokenizer::continueProcessing):
369 (khtml::HTMLTokenizer::timerEvent):
370 (khtml::HTMLTokenizer::allDataProcessed):
371 (khtml::HTMLTokenizer::end):
372 (khtml::HTMLTokenizer::finish):
373 (khtml::HTMLTokenizer::notifyFinished):
374 * khtml/html/htmltokenizer.h:
375 * khtml/khtml_part.cpp:
376 (KHTMLPart::slotFinished):
379 * khtml/khtml_part.h:
380 (KHTMLPart::tokenizerProcessedData):
381 * khtml/khtmlview.cpp:
382 * khtml/xml/dom_docimpl.cpp:
383 * khtml/xml/xml_tokenizer.h:
384 (khtml::Tokenizer::stopped):
385 (khtml::Tokenizer::processingData):
387 * kwq/KWQDateTime.mm:
389 (KWQUIEventTime::uiEventPending):
390 * kwq/KWQKHTMLPart.h:
391 * kwq/KWQKHTMLPart.mm:
392 (KWQKHTMLPart::tokenizerProcessedData):
393 * kwq/WebCoreBridge.h:
394 * kwq/WebCoreBridge.mm:
395 (-[WebCoreBridge stop]):
396 (-[WebCoreBridge numPendingOrLoadingRequests]):
397 (-[WebCoreBridge doneProcessingData]):
399 2004-11-09 David Harrison <harrison@apple.com>
401 Reviewed by Ken Kocienda.
403 <rdar://problem/3865837> Wrong text style after delete to start of document
405 * khtml/editing/htmlediting.cpp:
406 (khtml::DeleteSelectionCommand::saveTypingStyleState):
407 Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
409 2004-11-09 Richard Williamson <rjw@apple.com>
411 Fixed <rdar://problem/3872440> NSTimer prematurely released.
420 2004-11-09 Chris Blumenberg <cblu@apple.com>
424 * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
426 2004-11-08 David Harrison <harrison@apple.com>
428 Reviewed by Ken Kocienda.
430 <rdar://problem/3865854> Deleting first line deletes all lines
432 * khtml/editing/htmlediting.cpp:
433 (khtml::DeleteSelectionCommand::performGeneralDelete):
434 Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
435 of its ancestors, failed to end the loop that deletes all fully selected nodes. Also,
436 fixed this code to clear m_trailingWhitespaceValid. Also removed dead m_endingPosition
437 update because it is handled in calculateEndingPosition now.
438 * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
439 * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
441 2004-11-08 Ken Kocienda <kocienda@apple.com>
445 * khtml/html/html_elementimpl.cpp:
446 (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
447 are added to the DOM.
448 * khtml/html/html_elementimpl.h: Ditto.
449 * khtml/html/htmlparser.cpp:
450 (KHTMLParser::KHTMLParser): Ditto.
451 (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
452 * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
453 * khtml/html/htmltokenizer.cpp:
454 (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
455 (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
456 There were a couple of indexing errors that resulted in the comment text containing part of the
458 (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
459 * khtml/html/htmltokenizer.h: Add flag to constructor so callers can request comment nodes.
461 2004-11-08 Chris Blumenberg <cblu@apple.com>
463 Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
467 * WebCore.pbproj/project.pbxproj: stop unnecessary linking
468 * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
469 * kwq/KWQKHTMLPart.h: ditto
471 2004-11-08 Darin Adler <darin@apple.com>
475 - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
477 * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
478 that possibly deletes the QTimer.
480 2004-11-08 Chris Blumenberg <cblu@apple.com>
482 Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
486 * kwq/KWQTextField.mm:
487 (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
488 * kwq/WebCoreBridge.h:
490 2004-11-08 David Harrison <harrison@apple.com>
494 Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
496 * khtml/editing/htmlediting.cpp:
497 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
498 * khtml/xml/dom_nodeimpl.cpp:
499 (NodeImpl::enclosingInlineElement):
500 * khtml/xml/dom_nodeimpl.h:
502 2004-11-05 Chris Blumenberg <cblu@apple.com>
504 Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
508 * khtml/editing/htmlediting.cpp:
509 (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
510 * khtml/editing/visible_position.cpp:
511 (khtml::VisiblePosition::character): new, returns the character for the position
512 * khtml/editing/visible_position.h:
513 * kwq/KWQKHTMLPart.h:
514 * kwq/KWQKHTMLPart.mm:
515 (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
516 * kwq/WebCoreBridge.h:
520 2004-11-05 Adele Amchan <adele@apple.com>
524 Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
525 and a workaround for displaying transparent backgrounds for textareas.
527 * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
528 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
529 * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class,
530 on the contentView, and on the textView.
532 2004-11-04 David Hyatt <hyatt@apple.com>
534 Fix for relpositioned inlines. This was reviewed a long time ago, but I can't recall who reviewed it (either
537 Reviewed by darin or ken
539 * khtml/rendering/bidi.cpp:
540 (khtml::appendRunsForObject):
541 (khtml::RenderBlock::skipWhitespace):
542 (khtml::RenderBlock::findNextLineBreak):
543 * khtml/rendering/render_block.cpp:
544 (khtml::RenderBlock::lowestPosition):
545 (khtml::RenderBlock::rightmostPosition):
546 (khtml::RenderBlock::leftmostPosition):
547 * khtml/rendering/render_box.cpp:
548 (RenderBox::position):
549 * khtml/rendering/render_box.h:
550 (khtml::RenderBox::staticX):
551 (khtml::RenderBox::staticY):
552 * khtml/rendering/render_layer.cpp:
553 (RenderLayer::updateLayerPosition):
554 (RenderLayer::convertToLayerCoords):
555 * khtml/rendering/render_line.cpp:
556 (khtml::InlineFlowBox::placeBoxesHorizontally):
557 * khtml/rendering/render_object.h:
558 (khtml::RenderObject::staticX):
559 (khtml::RenderObject::staticY):
561 Finish turning on XSLT. Make sure child stylesheets can load.
563 * khtml/xsl/xslt_processorimpl.cpp:
564 (DOM::stylesheetLoadFunc):
565 (DOM::XSLTProcessorImpl::transformDocument):
567 2004-11-04 David Hyatt <hyatt@apple.com>
569 Implement CSS3 support for multiple backgrounds. Also fix a bug with background propagation so that it only
570 happens (from the <body> to the root) for HTML documents. Fixed background-position to handle a mixture of
571 keyword and length values.
575 * khtml/css/cssparser.cpp:
576 (CSSParser::parseValue):
577 (CSSParser::addBackgroundValue):
578 (CSSParser::parseBackgroundShorthand):
579 (CSSParser::parseBackgroundColor):
580 (CSSParser::parseBackgroundImage):
581 (CSSParser::parseBackgroundPositionXY):
582 (CSSParser::parseBackgroundPosition):
583 (CSSParser::parseBackgroundProperty):
584 (CSSParser::parseColorFromValue):
585 * khtml/css/cssparser.h:
586 * khtml/css/cssstyleselector.cpp:
587 (khtml::CSSStyleSelector::adjustRenderStyle):
588 (khtml::CSSStyleSelector::applyProperty):
589 (khtml::CSSStyleSelector::mapBackgroundAttachment):
590 (khtml::CSSStyleSelector::mapBackgroundImage):
591 (khtml::CSSStyleSelector::mapBackgroundRepeat):
592 (khtml::CSSStyleSelector::mapBackgroundXPosition):
593 (khtml::CSSStyleSelector::mapBackgroundYPosition):
594 * khtml/css/cssstyleselector.h:
595 * khtml/rendering/render_box.cpp:
596 (RenderBox::paintRootBoxDecorations):
597 (RenderBox::paintBoxDecorations):
598 (RenderBox::paintBackgrounds):
599 (RenderBox::paintBackground):
600 (RenderBox::paintBackgroundExtended):
601 * khtml/rendering/render_box.h:
602 * khtml/rendering/render_form.cpp:
603 (RenderFieldset::paintBoxDecorations):
604 * khtml/rendering/render_line.cpp:
605 (khtml::InlineFlowBox::paintBackgrounds):
606 (khtml::InlineFlowBox::paintBackground):
607 (khtml::InlineFlowBox::paintBackgroundAndBorder):
608 * khtml/rendering/render_line.h:
609 * khtml/rendering/render_object.cpp:
610 (RenderObject::setStyle):
611 (RenderObject::updateBackgroundImages):
612 (RenderObject::getVerticalPosition):
613 * khtml/rendering/render_object.h:
614 (khtml::RenderObject::paintBackgroundExtended):
615 * khtml/rendering/render_style.cpp:
617 (BackgroundLayer::BackgroundLayer):
618 (BackgroundLayer::~BackgroundLayer):
619 (BackgroundLayer::operator=):
620 (BackgroundLayer::operator==):
621 (BackgroundLayer::fillUnsetProperties):
622 (BackgroundLayer::cullEmptyLayers):
623 (StyleBackgroundData::StyleBackgroundData):
624 (StyleBackgroundData::operator==):
626 (RenderStyle::adjustBackgroundLayers):
627 * khtml/rendering/render_style.h:
628 (khtml::OutlineValue::operator==):
629 (khtml::OutlineValue::operator!=):
630 (khtml::BackgroundLayer::backgroundImage):
631 (khtml::BackgroundLayer::backgroundXPosition):
632 (khtml::BackgroundLayer::backgroundYPosition):
633 (khtml::BackgroundLayer::backgroundAttachment):
634 (khtml::BackgroundLayer::backgroundRepeat):
635 (khtml::BackgroundLayer::next):
636 (khtml::BackgroundLayer::isBackgroundImageSet):
637 (khtml::BackgroundLayer::isBackgroundXPositionSet):
638 (khtml::BackgroundLayer::isBackgroundYPositionSet):
639 (khtml::BackgroundLayer::isBackgroundAttachmentSet):
640 (khtml::BackgroundLayer::isBackgroundRepeatSet):
641 (khtml::BackgroundLayer::setBackgroundImage):
642 (khtml::BackgroundLayer::setBackgroundXPosition):
643 (khtml::BackgroundLayer::setBackgroundYPosition):
644 (khtml::BackgroundLayer::setBackgroundAttachment):
645 (khtml::BackgroundLayer::setBackgroundRepeat):
646 (khtml::BackgroundLayer::clearBackgroundImage):
647 (khtml::BackgroundLayer::clearBackgroundXPosition):
648 (khtml::BackgroundLayer::clearBackgroundYPosition):
649 (khtml::BackgroundLayer::clearBackgroundAttachment):
650 (khtml::BackgroundLayer::clearBackgroundRepeat):
651 (khtml::BackgroundLayer::setNext):
652 (khtml::BackgroundLayer::operator!=):
653 (khtml::BackgroundLayer::containsImage):
654 (khtml::BackgroundLayer::hasImage):
655 (khtml::BackgroundLayer::hasFixedImage):
656 (khtml::RenderStyle::setBitDefaults):
657 (khtml::RenderStyle::hasBackground):
658 (khtml::RenderStyle::hasFixedBackgroundImage):
659 (khtml::RenderStyle::outlineWidth):
660 (khtml::RenderStyle::outlineStyle):
661 (khtml::RenderStyle::outlineStyleIsAuto):
662 (khtml::RenderStyle::outlineColor):
663 (khtml::RenderStyle::backgroundColor):
664 (khtml::RenderStyle::backgroundImage):
665 (khtml::RenderStyle::backgroundRepeat):
666 (khtml::RenderStyle::backgroundAttachment):
667 (khtml::RenderStyle::backgroundXPosition):
668 (khtml::RenderStyle::backgroundYPosition):
669 (khtml::RenderStyle::accessBackgroundLayers):
670 (khtml::RenderStyle::backgroundLayers):
671 (khtml::RenderStyle::outlineOffset):
672 (khtml::RenderStyle::resetOutline):
673 (khtml::RenderStyle::setBackgroundColor):
674 (khtml::RenderStyle::setOutlineWidth):
675 (khtml::RenderStyle::setOutlineStyle):
676 (khtml::RenderStyle::setOutlineColor):
677 (khtml::RenderStyle::clearBackgroundLayers):
678 (khtml::RenderStyle::inheritBackgroundLayers):
679 (khtml::RenderStyle::setOutlineOffset):
680 * khtml/rendering/render_table.cpp:
681 (RenderTable::paintBoxDecorations):
682 (RenderTableCell::paintBoxDecorations):
684 2004-11-04 David Hyatt <hyatt@apple.com>
686 Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
687 Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
691 * kwq/KWQTextCodec.mm:
692 (KWQTextDecoder::convertLatin1):
693 (KWQTextDecoder::convertUTF16):
694 (KWQTextDecoder::convertUsingTEC):
695 (KWQTextDecoder::toUnicode):
697 2004-11-04 David Hyatt <hyatt@apple.com>
699 Make sure line-height returns the correct value for normal.
703 * khtml/css/css_computedstyle.cpp:
704 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
706 2004-11-04 David Harrison <harrison@apple.com>
708 Reviewed by Ken Kocienda.
710 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
712 * khtml/editing/htmlediting.cpp:
713 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
714 to, but not including, the enclosingBlockFlowElement) rather than just the source element.
715 Fixed to insert after the destination subtree, rather than the destination element. Handles
716 edge case of deleting back to the top of the tree, where there is nothing left to insert after.
717 * khtml/xml/dom_nodeimpl.cpp:
718 (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
719 * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
720 * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
721 * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
723 2004-11-03 Ken Kocienda <kocienda@apple.com>
729 * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
730 * layout-tests/editing/deleting/delete-br-008.html: Added.
731 * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
732 * layout-tests/editing/deleting/delete-br-009.html: Added.
733 * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
734 * layout-tests/editing/deleting/delete-br-010.html: Added.
736 2004-11-03 Maciej Stachowiak <mjs@apple.com>
738 Fix by Yasuo Kida, reviewed by me.
740 <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
742 * kwq/KWQKHTMLPart.mm:
743 (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
744 same as a nil range - setting an empty marked range should clear
745 the marked range entirely.
747 2004-11-02 Maciej Stachowiak <mjs@apple.com>
749 Reviewed by Dave Hyatt (when I originally coded it).
751 WebCore part of fix for:
753 <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
755 * kwq/WebCoreBridge.h:
756 * kwq/WebCoreBridge.mm:
757 (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
758 DOMRange, or if the range is split into multiple lines, the rect for the part on
761 * khtml/rendering/render_object.cpp:
762 (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
763 for the overrides below.
764 * khtml/rendering/render_object.h:
765 * khtml/rendering/render_box.cpp:
766 (RenderBox::caretRect):
767 * khtml/rendering/render_box.h:
768 * khtml/rendering/render_br.cpp:
769 (RenderBR::caretRect):
770 * khtml/rendering/render_br.h:
771 * khtml/rendering/render_flow.cpp:
772 (RenderFlow::caretRect):
773 * khtml/rendering/render_flow.h:
774 * khtml/rendering/render_text.cpp:
775 (RenderText::caretRect):
777 2004-11-02 Ken Kocienda <kocienda@apple.com>
781 Implemented command to insert a block in response to typing a return key (even though
782 I am not turning that on by default with this patch....that will come later).
784 This new command is called InsertParagraphSeparatorCommand.
786 Reworked the command and function names associated with inserting content into a
787 document. Before this patch, there were inputXXX and insertXXX variants, with the
788 former used for more high-level actions and the latter used for lower-level stuff.
789 However, this was confusing as the AppKit uses insertXXX for everything. This resulted
790 in an insertXXX command going through an inputXXX WebCore step and then finally to an
791 insertXXX WebCore step. To make this less confusing, I have changes all the names to
792 be insertXXX, and modified the lower-level operations so that it is clear what they do.
794 * khtml/editing/htmlediting.cpp:
795 (khtml::EditCommandPtr::isInsertTextCommand): Name change.
796 (khtml::EditCommand::isInsertTextCommand): Ditto.
797 (khtml::CompositeEditCommand::inputText): Ditto.
798 (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
799 (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
800 (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
801 (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
802 (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
803 (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
804 (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
805 (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
806 (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
807 (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
808 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
809 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
810 (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
811 (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
812 (khtml::InsertIntoTextNode::doApply): Ditto.
813 (khtml::InsertIntoTextNode::doUnapply): Ditto.
814 (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
815 (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
816 (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
817 (khtml::InsertLineBreakCommand::doApply):
818 (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
819 (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
820 (khtml::InsertNodeBeforeCommand::doApply): Ditto.
821 (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
822 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
823 (khtml::InsertParagraphSeparatorCommand::doApply):
824 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
825 Class name change, was InsertNewlineCommandInQuotedContentCommand.
826 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
827 (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
828 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
829 (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
830 (khtml::InsertTextCommand::doApply): Ditto.
831 (khtml::InsertTextCommand::deleteCharacter): Ditto.
832 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
833 (khtml::InsertTextCommand::input): Ditto.
834 (khtml::InsertTextCommand::insertSpace): Ditto.
835 (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
836 (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
837 (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
838 (khtml::TypingCommand::insertParagraphSeparator): New function.
839 (khtml::TypingCommand::doApply): Name changes, as above.
840 (khtml::TypingCommand::insertText): Ditto.
841 (khtml::TypingCommand::deleteKeyPressed): Ditto.
842 (khtml::TypingCommand::preservesTypingStyle): Ditto.
843 * khtml/editing/htmlediting.h:
844 (khtml::DeleteFromTextNodeCommand::node): Name change.
845 (khtml::DeleteFromTextNodeCommand::offset): Ditto.
846 (khtml::DeleteFromTextNodeCommand::count): Ditto.
847 (khtml::InsertIntoTextNode::text): Ditto.
848 (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
849 (khtml::InsertNodeBeforeCommand::refChild): Ditto.
850 (khtml::TypingCommand::): Ditto.
851 * khtml/editing/jsediting.cpp: Name changes, as above.
852 * kwq/WebCoreBridge.h:
853 * kwq/WebCoreBridge.mm:
854 (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
855 (-[WebCoreBridge insertParagraphSeparator]): New function.
856 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
858 2004-11-01 Kevin Decker <kdecker@apple.com>
862 fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
865 * khtml/ecma/kjs_window.cpp:
866 (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
868 2004-11-01 Darin Adler <darin@apple.com>
872 - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
874 * khtml/css/html4.css: Use color: initial for textarea and related ones.
876 2004-11-01 Ken Kocienda <kocienda@apple.com>
882 <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
884 * khtml/css/css_computedstyle.cpp:
885 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the
886 implementation here into new copyPropertiesInSet helper. This now calls the
887 generalized copyPropertiesInSet function with the arguments needed to make copying
889 * khtml/css/css_computedstyle.h:
890 * khtml/css/css_valueimpl.cpp:
891 (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
892 In order to do apply block properties, "regular" style declarations need to do style
894 (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
895 except that it uses a different set of properties that apply only to blocks.
896 (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
897 and copies out those properties listed in a pre-defined set.
898 * khtml/css/css_valueimpl.h:
899 * khtml/editing/htmlediting.cpp:
900 (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
901 block, factoring out some of the special case code that should now only run in the inline case.
902 (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
903 (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
904 special handling for "legacy" HTML styles like <B> and <I>.
905 (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
906 style changes into different kinds. CSS specifies certain properties only apply to certain
907 element types. This set of changes now recognizes two such separate cases: styles that apply
908 to blocks, and styles that apply to inlines.
909 (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
910 (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
911 (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
912 with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
913 done so that the function can be passed a portion of the styles being applied so that block styles
914 and inline styles can be handled separately.
915 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
916 (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
917 (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
918 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
919 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
920 * khtml/editing/htmlediting.h:
921 (khtml::StyleChange::): Changed as described above.
922 (khtml::StyleChange::usesLegacyStyles):
923 (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
924 it needs to layout, even though it has not changed position in the DOM. For instance, this is needed
925 when text align changes.
926 * khtml/khtml_part.cpp:
927 (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
928 the passed-in argument.
929 (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
930 is a caret. Formerly, this just set typing style and made no visible changes to the document.
934 * layout-tests/editing/editing.js: Added some glue to change text align.
935 * layout-tests/editing/style/block-style-001-expected.txt: Added.
936 * layout-tests/editing/style/block-style-001.html: Added.
937 * layout-tests/editing/style/block-style-002-expected.txt: Added.
938 * layout-tests/editing/style/block-style-002.html: Added.
939 * layout-tests/editing/style/block-style-003-expected.txt: Added.
940 * layout-tests/editing/style/block-style-003.html: Added.
944 2004-10-29 Darin Adler <darin@apple.com>
948 - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
950 * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
951 before advancing one character; before it did it backwards.
953 2004-10-29 Chris Blumenberg <cblu@apple.com>
955 Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
957 Reviewed by kocienda, adele.
959 * khtml/rendering/render_frames.cpp:
960 (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
962 2004-10-29 Darin Adler <darin@apple.com>
966 - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
968 * khtml/khtmlview.cpp:
969 (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
970 deleted before this function finishes running.
971 (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
972 (KHTMLView::viewportMouseReleaseEvent): Ditto.
973 (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
974 is guaranteed to do ref/deref as needed.
976 * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
978 2004-10-28 Chris Blumenberg <cblu@apple.com>
980 Enabled XSLT on Panther. See intrigue mail for compiling instructions.
984 * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
985 * WebCorePrefix.h: always use XSLT
987 2004-10-28 Ken Kocienda <kocienda@apple.com>
993 <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
994 <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
996 * khtml/editing/htmlediting.cpp:
997 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members
998 to initialization list, zeroing them out.
999 (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
1000 handle a delete of content in special cases where the only thing selected is a BR. This
1001 code path is much simpler than the newly-named performGeneralDelete, and detects when no
1002 content merging should be done between blocks. This aspect of the change fixes 3854848.
1003 One of the special cases added fixes 3803832.
1004 (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
1005 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
1006 like the other helpers in this class.
1007 (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
1008 (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
1009 * khtml/editing/htmlediting.h: Added new helper and changed an old one.
1011 2004-10-28 Chris Blumenberg <cblu@apple.com>
1013 Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
1017 * kwq/KWQKHTMLPart.mm:
1018 (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
1020 2004-10-28 Ken Kocienda <kocienda@apple.com>
1022 Reviewed by Harrison
1024 Reorganization of delete command functionality so that doApply is not
1025 several hundred lines long. This is not a squeaky-clean cleanup, but
1026 it is a step in the right direction. No functionality changes.
1028 * khtml/editing/htmlediting.cpp:
1029 (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
1030 (khtml::DeleteSelectionCommand::initializePositionData): New helper.
1031 (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
1032 (khtml::DeleteSelectionCommand::performDelete): Ditto.
1033 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
1034 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
1035 (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
1036 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
1037 (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
1038 (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
1039 * khtml/editing/htmlediting.h:
1041 2004-10-28 Ken Kocienda <kocienda@apple.com>
1045 * khtml/editing/htmlediting.cpp:
1046 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
1047 new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
1049 2004-10-27 Ken Kocienda <kocienda@apple.com>
1053 * khtml/editing/htmlediting.cpp:
1054 (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
1055 whether content not in the block containing the start of the selection is moved to that block
1056 after the selection is deleted.
1057 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
1058 (khtml::DeleteSelectionCommand::doApply): Ditto.
1059 (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
1060 to handle the case of inserting a newline when in quoted content in Mail.
1061 (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
1062 (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
1063 (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
1064 (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
1065 (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
1066 (khtml::TypingCommand::doApply): Ditto.
1067 (khtml::TypingCommand::preservesTypingStyle): Ditto.
1068 * khtml/editing/htmlediting.h: Add new delclarations.
1069 (khtml::TypingCommand::): Ditto.
1070 * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
1071 * kwq/WebCoreBridge.mm:
1072 (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
1074 2004-10-26 Chris Blumenberg <cblu@apple.com>
1076 Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
1080 * khtml/ecma/kjs_dom.cpp:
1081 (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
1082 * khtml/ecma/kjs_dom.h:
1083 (KJS::DOMElement::):
1084 * khtml/ecma/kjs_dom.lut.h:
1087 2004-10-26 David Hyatt <hyatt@apple.com>
1089 Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
1092 Reviewed by kocienda
1094 * khtml/rendering/bidi.cpp:
1095 (khtml::RenderBlock::layoutInlineChildren):
1097 2004-10-26 David Hyatt <hyatt@apple.com>
1099 Convert selectionRect() from using a list to a dict and patch it to be like setSelection. It was still trying
1100 to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
1102 Reviewed by kocienda
1104 * khtml/rendering/render_canvas.cpp:
1105 (RenderCanvas::selectionRect):
1106 * khtml/rendering/render_object.h:
1107 (khtml::RenderObject::hasSelectedChildren):
1109 2004-10-26 Ken Kocienda <kocienda@apple.com>
1115 <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
1117 * khtml/editing/htmlediting.cpp:
1118 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
1119 let the caller know if a placeholder was removed.
1120 (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
1121 removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
1122 some cases, the selection was still set on the removed BR, and this was the cause of the
1124 * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
1126 2004-10-26 Darin Adler <darin@apple.com>
1130 - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
1132 * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
1134 2004-10-26 Ken Kocienda <kocienda@apple.com>
1138 * khtml/editing/htmlediting.cpp:
1139 (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
1140 with a zero-length string. That triggers an assert. Call deleteText instead,
1141 using the same indices that are passed to replaceText.
1143 Cleaned up the asserts in these three functions below, making them
1144 more consistent. This is not needed for the fix, but I tripped over
1145 these in the course of debugging.
1147 (khtml::InsertTextCommand::InsertTextCommand):
1148 (khtml::InsertTextCommand::doApply):
1149 (khtml::InsertTextCommand::doUnapply):
1151 2004-10-25 Adele Amchan <adele@apple.com>
1155 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
1156 * khtml/xml/dom_docimpl.h:
1158 2004-10-25 Adele Amchan <adele@apple.com>
1160 Reviewed by me, code change by Darin.
1162 * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
1164 2004-10-25 Ken Kocienda <kocienda@apple.com>
1166 Oops. These two test results changed with my last checkin, for the better.
1168 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
1169 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
1171 2004-10-25 Ken Kocienda <kocienda@apple.com>
1177 <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
1179 * khtml/editing/htmlediting.cpp:
1180 (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
1181 expand the selection outwards when the selection is on the visible boundary of a root
1182 editable element. This fixes the bug. Note that this function also contains a little code
1183 I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
1184 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
1185 (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
1186 * khtml/editing/htmlediting.h: Declare new helpers.
1187 * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
1188 * layout-tests/editing/deleting/delete-select-all-001.html: Added.
1189 * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
1190 * layout-tests/editing/deleting/delete-select-all-002.html: Added.
1191 * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
1192 * layout-tests/editing/deleting/delete-select-all-003.html: Added.
1194 2004-10-25 Ken Kocienda <kocienda@apple.com>
1196 Added some more editing layout tests.
1198 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
1199 * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
1200 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
1201 * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
1202 * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
1203 * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
1204 * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
1205 * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
1206 * layout-tests/editing/inserting/typing-003-expected.txt: Added.
1207 * layout-tests/editing/inserting/typing-003.html: Added.
1209 2004-10-25 Ken Kocienda <kocienda@apple.com>
1213 * khtml/rendering/bidi.cpp:
1214 (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
1215 yesterday quite right: words that should have been placed on the next line were instead
1216 appearing on the line before, beyond the right margin. This was a one-word only error
1217 based on moving the line break object when it should have stayed put. Here is the rule:
1218 The line break object only moves to after the whitespace on the end of a line if that
1219 whitespace caused line overflow when its width is added in.
1221 2004-10-25 Adele Amchan <adele@apple.com>
1225 Fix for <rdar://problem/3619890> Feature request: designMode
1227 This change implements the designMode property of a document. This is an IE property that is also supported by Mozilla.
1228 This will enable more JS editing compatibility.
1230 * khtml/ecma/kjs_html.cpp:
1231 (KJS::HTMLDocument::tryGet): added case for designMode
1232 (KJS::HTMLDocument::putValue): added case for designMode
1233 * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
1234 * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
1235 * khtml/xml/dom_docimpl.cpp:
1236 (DocumentImpl::DocumentImpl): initialize m_designMode member variable
1237 (DocumentImpl::setDesignMode): added function to assign m_designMode value
1238 (DocumentImpl::getDesignMode): return m_designMode value
1239 (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value.
1240 Otherwise, it will just return the m_designMode value.
1241 (DocumentImpl::parentDocument):
1242 * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
1243 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
1245 2004-10-22 Ken Kocienda <kocienda@apple.com>
1251 <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
1253 * khtml/editing/htmlediting.cpp:
1254 (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
1255 everything that could be affected.
1256 (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
1257 braces, making it act as a comma operator, with a zero value as the right value!!! This made
1258 an important check always fail!!! It turns out that we do not want the constant at all, since
1259 that constant is only needed when checking a computed style, not an inline style as is being
1261 (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
1262 (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
1263 RangeImpl::compareBoundaryPoints to perform the required check.
1264 * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
1266 2004-10-22 Ken Kocienda <kocienda@apple.com>
1272 <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
1273 <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
1275 * khtml/rendering/bidi.cpp:
1276 (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
1277 it is when we are editing, add in the space of the current character when calculating the width
1278 of committed plus uncommitted characters. If this value exceeds the width of the line, move up
1279 the line break object and call skipWhitespace to move past the end of the whitespace.
1283 2004-10-22 Ken Kocienda <kocienda@apple.com>
1285 * WebCore.pbproj/project.pbxproj:
1286 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
1288 2004-10-21 David Hyatt <hyatt@apple.com>
1292 Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
1294 <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
1295 <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
1297 * khtml/rendering/render_block.cpp:
1298 (khtml::getInlineRun):
1299 (khtml::RenderBlock::makeChildrenNonInline):
1301 2004-10-21 David Hyatt <hyatt@apple.com>
1303 Fix for 3810389, crash because of continuation() craziness. Revert back to the old behavior of
1304 making sure that all line boxes get deleted and recreated when inlines are split because of a block.
1308 * khtml/rendering/render_inline.cpp:
1309 (RenderInline::splitFlow):
1311 2004-10-21 Ken Kocienda <kocienda@apple.com>
1315 Significant improvement to the way that whitespace is handled during editing.
1317 * khtml/editing/htmlediting.cpp:
1318 (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
1319 two being added with this name) that delete "insignificant" unrendered text.
1320 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
1321 calculates the downstream position to use as the endpoint for the deletion, and
1322 then calls deleteInsignificantText with this start and end.
1323 (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
1324 (khtml::InputNewlineCommand::doApply): Ditto.
1325 (khtml::InputTextCommand::input): Ditto.
1326 * khtml/editing/htmlediting.h: Add new declarations.
1328 Modified layout test results:
1329 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
1330 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
1331 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
1332 * layout-tests/editing/deleting/delete-selection-001-expected.txt:
1333 * layout-tests/editing/deleting/delete-tab-001-expected.txt:
1334 * layout-tests/editing/deleting/delete-tab-004-expected.txt:
1335 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
1336 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
1337 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
1338 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
1339 * layout-tests/editing/inserting/insert-br-001-expected.txt:
1340 * layout-tests/editing/inserting/insert-br-004-expected.txt:
1341 * layout-tests/editing/inserting/insert-br-005-expected.txt:
1342 * layout-tests/editing/inserting/insert-br-006-expected.txt:
1343 * layout-tests/editing/inserting/insert-tab-001-expected.txt:
1344 * layout-tests/editing/inserting/insert-tab-002-expected.txt:
1345 * layout-tests/editing/inserting/insert-tab-004-expected.txt:
1346 * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
1347 * layout-tests/editing/inserting/typing-001-expected.txt:
1348 * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
1349 * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
1350 * layout-tests/editing/style/typing-style-003-expected.txt:
1351 * layout-tests/editing/undo/redo-typing-001-expected.txt:
1352 * layout-tests/editing/undo/undo-typing-001-expected.txt:
1354 2004-10-21 David Hyatt <hyatt@apple.com>
1356 Fix for 3847054, assertion failure in RenderText::layout() on news.com page. Fix getInlineRun so that
1357 it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
1361 * khtml/rendering/render_block.cpp:
1362 (khtml::getInlineRun):
1364 2004-10-20 David Hyatt <hyatt@apple.com>
1366 Add better dumping of overflow information for scrolling regions.
1368 Fix for 3726524, crash in updateLayerPosition. Make sure anonymous elements properly remove themselves
1369 from the render tree so that layers and so forth are cleaned up.
1373 * khtml/rendering/render_container.cpp:
1374 (RenderContainer::detach):
1375 * khtml/rendering/render_layer.h:
1376 (khtml::RenderLayer::scrollXOffset):
1377 (khtml::RenderLayer::scrollYOffset):
1378 * kwq/KWQRenderTreeDebug.cpp:
1381 2004-10-20 David Hyatt <hyatt@apple.com>
1383 Fix for 3791146, make sure all lines are checked when computing overflow.
1385 Reviewed by kocienda
1387 * khtml/rendering/bidi.cpp:
1388 (khtml::RenderBlock::computeHorizontalPositionsForLine):
1389 (khtml::RenderBlock::layoutInlineChildren):
1390 (khtml::RenderBlock::findNextLineBreak):
1391 (khtml::RenderBlock::checkLinesForOverflow):
1392 * khtml/rendering/render_block.h:
1394 2004-10-20 David Hyatt <hyatt@apple.com>
1396 Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
1398 Reviewed by kocienda
1400 * khtml/rendering/break_lines.cpp:
1401 (khtml::isBreakable):
1403 2004-10-20 Darin Adler <darin@apple.com>
1407 - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
1409 * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
1410 Create a palette with the background and foreground colors in it and set it on the widget.
1412 * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
1413 with APPLE_CHANGES. Removed palette and palette-related function members.
1414 * khtml/rendering/render_style.cpp:
1415 (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
1416 (RenderStyle::diff): No palette to compare.
1418 * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
1419 * kwq/KWQLineEdit.mm:
1420 (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
1421 (QLineEdit::text): Made const.
1423 * kwq/KWQTextEdit.h: Added setPalette override.
1424 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
1427 * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
1428 per color group, and only a single color group per palette.
1429 * kwq/KWQColorGroup.mm: Removed.
1430 * kwq/KWQPalette.mm: Removed.
1431 * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
1433 * kwq/KWQApplication.h: Removed unused palette function.
1434 * kwq/KWQApplication.mm: Ditto.
1436 * kwq/KWQWidget.h: Removed unsetPalette.
1437 * kwq/KWQWidget.mm: Ditto.
1439 - fixed storage leak
1441 * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
1442 Roll in storage leak fix from KDE guys.
1444 2004-10-19 David Hyatt <hyatt@apple.com>
1446 Reviewed by kocienda
1448 More cleanup of block layout. Eliminates the separate step for tables that dont fit on a line with a float
1449 and consolidates it with clearing.
1451 Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
1453 * khtml/rendering/render_block.cpp:
1454 (khtml::getInlineRun):
1455 (khtml::RenderBlock::layoutBlock):
1456 (khtml::RenderBlock::adjustFloatingBlock):
1457 (khtml::RenderBlock::collapseMargins):
1458 (khtml::RenderBlock::clearFloatsIfNeeded):
1459 (khtml::RenderBlock::estimateVerticalPosition):
1460 (khtml::RenderBlock::layoutBlockChildren):
1461 (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
1462 (khtml::RenderBlock::getClearDelta):
1463 (khtml::RenderBlock::calcBlockMinMaxWidth):
1464 * khtml/rendering/render_block.h:
1465 * khtml/rendering/render_frames.cpp:
1466 (RenderFrameSet::layout):
1467 * khtml/xml/dom_textimpl.cpp:
1468 (TextImpl::rendererIsNeeded):
1470 Fix for 3841060, regression with * in frames. Reviewed by kocienda.
1472 * layout-tests/fast/frames/002-expected.txt: Added.
1473 * layout-tests/fast/frames/002.html: Added.
1475 2004-10-19 Darin Adler <darin@apple.com>
1479 - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
1481 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
1482 scripts being loaded here. If the current code being run is the external script itself, then we don't want
1483 to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
1484 assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
1485 wrong since there can be a script loading in that case too. Layout tests check for both problems.
1487 * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
1488 * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
1489 * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
1491 * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
1493 2004-10-18 Darin Adler <darin@apple.com>
1495 Reviewed by Dave Hyatt.
1497 - 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)
1499 * khtml/html/htmltokenizer.cpp:
1500 (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
1501 (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
1502 we only want to look at loadingExtScript if m_executingScript is 0.
1504 2004-10-18 Ken Kocienda <kocienda@apple.com>
1510 <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
1512 * khtml/css/css_valueimpl.cpp:
1513 (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
1514 Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the
1515 lifecycle issues associated with creating a string to be returned in the ident case.
1516 * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
1517 * khtml/css/cssstyleselector.cpp:
1518 (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
1520 2004-10-18 Chris Blumenberg <cblu@apple.com>
1522 Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
1524 Reviewed by kocienda.
1526 * khtml/rendering/render_frames.cpp:
1527 (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
1529 2004-10-15 Chris Blumenberg <cblu@apple.com>
1531 Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
1536 (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
1539 2004-10-15 Ken Kocienda <kocienda@apple.com>
1543 * khtml/rendering/bidi.cpp:
1544 (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
1545 skipping after a clean line break, in addition to the cases already
1547 * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
1548 * layout-tests/editing/inserting/insert-br-007.html: Added.
1549 * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
1550 * layout-tests/editing/inserting/insert-br-008.html: Added.
1554 2004-10-14 Ken Kocienda <kocienda@apple.com>
1560 <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
1562 * khtml/editing/visible_position.cpp:
1563 (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
1564 position code to new-style VisiblePosition code. In retrospect, this code was misguided.
1565 Since we do a good job of insulating external code from the internal workings of
1566 VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
1567 in the case of this bug, was doing harm. Simply removing this code makes the bug
1568 go away and does not cause any editing layout test regresssions.
1570 2004-10-14 Ken Kocienda <kocienda@apple.com>
1574 * khtml/rendering/bidi.cpp:
1575 (khtml::skipNonBreakingSpace): New helper.
1576 (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
1577 at the start of a block. This was preventing users from typing spaces in empty
1579 * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
1580 * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
1582 2004-10-14 Adele Amchan <adele@apple.com>
1584 Reviewed by Darin and Ken.
1586 fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
1588 This change shifts some code around so that the code that determines what typing style
1589 is in effect is called before deleteUnrenderedText is called. Two asserts are also added
1590 to ensure that start and end nodes of the selection are in the document.
1592 * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
1594 2004-10-14 Adele Amchan <adele@apple.com>
1598 This change makes these three functions virtual so that the work is being done in KWQHTMLPart
1599 instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
1601 * khtml/khtml_part.cpp:
1602 (KHTMLPart::shouldBeginEditing):
1603 (KHTMLPart::shouldEndEditing):
1604 (KHTMLPart::isContentEditable):
1605 * khtml/khtml_part.h:
1606 * kwq/KWQKHTMLPart.h:
1608 2004-10-14 Ken Kocienda <kocienda@apple.com>
1612 Final fix for these bugs:
1614 <rdar://problem/3806306> HTML editing puts spaces at start of line
1615 <rdar://problem/3814252> HTML editing groups space with word causing wrapping
1617 This change sets some new CSS properties that have been added to WebCore to
1618 enable whitespace-handling and line-breaking features that make WebView work
1619 more like a text editor.
1621 * khtml/css/cssstyleselector.cpp:
1622 (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties
1623 based on property value.
1624 * khtml/html/html_elementimpl.cpp:
1625 (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties
1626 based on attribute value.
1627 * khtml/khtml_part.cpp:
1628 (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
1630 (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
1632 (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
1633 (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
1634 * khtml/khtml_part.h: Add new declarations.
1635 * kwq/WebCoreBridge.h: Ditto.
1636 * kwq/WebCoreBridge.mm:
1637 (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
1638 (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
1639 (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
1640 (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
1642 2004-10-14 John Sullivan <sullivan@apple.com>
1646 - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
1648 * khtml/editing/htmlediting.cpp:
1649 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
1650 needed a nil check to handle empty document case
1652 2004-10-13 Maciej Stachowiak <mjs@apple.com>
1656 <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
1658 - I fixed this by turning off all colormatching for WebKit
1659 content. We might turn it back on later. For now, it's possible to
1660 turn it on temporarily by defining COLORMATCH_EVERYTHING.
1663 * khtml/ecma/kjs_html.cpp:
1664 (KJS::Context2DFunction::tryCall):
1665 (Context2D::colorRefFromValue):
1666 (Gradient::getShading):
1667 * khtml/rendering/render_canvasimage.cpp:
1668 (RenderCanvasImage::createDrawingContext):
1670 (QColor::getNSColor):
1672 * kwq/KWQPainter.mm:
1673 (CGColorFromNSColor):
1674 (QPainter::selectedTextBackgroundColor):
1675 (QPainter::rgbColorSpace):
1676 (QPainter::grayColorSpace):
1677 (QPainter::cmykColorSpace):
1678 * kwq/WebCoreGraphicsBridge.h:
1679 * kwq/WebCoreGraphicsBridge.m:
1680 (-[WebCoreGraphicsBridge createRGBColorSpace]):
1681 (-[WebCoreGraphicsBridge createGrayColorSpace]):
1682 (-[WebCoreGraphicsBridge createCMYKColorSpace]):
1684 2004-10-13 Ken Kocienda <kocienda@apple.com>
1688 * khtml/css/css_valueimpl.cpp:
1689 (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
1690 is non-null before appending.
1692 2004-10-13 Ken Kocienda <kocienda@apple.com>
1694 Update expected results for improved behavior as a result of fix to 3816768.
1696 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
1697 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
1698 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
1700 2004-10-13 Ken Kocienda <kocienda@apple.com>
1704 * khtml/css/css_computedstyle.cpp:
1705 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
1706 for getting -khtml-line-break and -khml-nbsp-mode.
1708 2004-10-13 Ken Kocienda <kocienda@apple.com>
1714 <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly
1715 moves caret out of block.
1717 The issue here is that an empty block with no explicit height set by style collapses
1718 to zero height, and does so immediately after the last bit of content is removed from
1719 it (as a result of deleting text with the delete key for instance). Since zero-height
1720 blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
1722 The fix is to detect when a block has not been removed itself, but has had all its
1723 contents removed. In this case, a BR element is placed in the block, one that is
1724 specially marked as a placeholder. Later, if the block ever receives content, this
1725 placeholder is removed.
1727 * khtml/editing/htmlediting.cpp:
1728 (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
1729 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
1730 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
1731 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
1732 Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong
1733 (it's very clear that we needs to be able to move more than just text nodes). This may expose
1734 bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
1735 made the test case in the bug work.
1736 (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
1737 removeBlockPlaceholderIfNeeded.
1738 (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
1739 (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
1740 * khtml/editing/htmlediting.h: Declare new functions.
1742 2004-10-13 Richard Williamson <rjw@apple.com>
1744 Added support for -apple-dashboard-region:none. And fixed
1745 a few computed style problems.
1747 Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
1750 * khtml/css/css_computedstyle.cpp:
1751 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1752 * khtml/css/css_valueimpl.cpp:
1753 (CSSPrimitiveValueImpl::cssText):
1754 * khtml/css/cssparser.cpp:
1755 (CSSParser::parseValue):
1756 (CSSParser::parseDashboardRegions):
1757 * khtml/css/cssstyleselector.cpp:
1758 (khtml::CSSStyleSelector::applyProperty):
1759 * khtml/rendering/render_style.cpp:
1760 (RenderStyle::noneDashboardRegions):
1761 * khtml/rendering/render_style.h:
1762 * kwq/KWQKHTMLPart.mm:
1763 (KWQKHTMLPart::dashboardRegionsDictionary):
1765 2004-10-13 David Hyatt <hyatt@apple.com>
1767 Rework block layout to clean it up and simplify it (r=kocienda).
1769 Also fixing the style sharing bug (r=mjs).
1771 * khtml/rendering/render_block.cpp:
1772 (khtml::RenderBlock::MarginInfo::MarginInfo):
1773 (khtml::RenderBlock::layoutBlock):
1774 (khtml::RenderBlock::adjustPositionedBlock):
1775 (khtml::RenderBlock::adjustFloatingBlock):
1776 (khtml::RenderBlock::handleSpecialChild):
1777 (khtml::RenderBlock::handleFloatingOrPositionedChild):
1778 (khtml::RenderBlock::handleCompactChild):
1779 (khtml::RenderBlock::insertCompactIfNeeded):
1780 (khtml::RenderBlock::handleRunInChild):
1781 (khtml::RenderBlock::collapseMargins):
1782 (khtml::RenderBlock::clearFloatsIfNeeded):
1783 (khtml::RenderBlock::estimateVerticalPosition):
1784 (khtml::RenderBlock::determineHorizontalPosition):
1785 (khtml::RenderBlock::setCollapsedBottomMargin):
1786 (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
1787 (khtml::RenderBlock::handleBottomOfBlock):
1788 (khtml::RenderBlock::layoutBlockChildren):
1789 (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
1790 (khtml::RenderBlock::addOverHangingFloats):
1791 * khtml/rendering/render_block.h:
1792 (khtml::RenderBlock::maxTopMargin):
1793 (khtml::RenderBlock::maxBottomMargin):
1794 (khtml::RenderBlock::CompactInfo::compact):
1795 (khtml::RenderBlock::CompactInfo::block):
1796 (khtml::RenderBlock::CompactInfo::matches):
1797 (khtml::RenderBlock::CompactInfo::clear):
1798 (khtml::RenderBlock::CompactInfo::set):
1799 (khtml::RenderBlock::CompactInfo::CompactInfo):
1800 (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
1801 (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
1802 (khtml::RenderBlock::MarginInfo::clearMargin):
1803 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
1804 (khtml::RenderBlock::MarginInfo::setTopQuirk):
1805 (khtml::RenderBlock::MarginInfo::setBottomQuirk):
1806 (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
1807 (khtml::RenderBlock::MarginInfo::setPosMargin):
1808 (khtml::RenderBlock::MarginInfo::setNegMargin):
1809 (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
1810 (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
1811 (khtml::RenderBlock::MarginInfo::setMargin):
1812 (khtml::RenderBlock::MarginInfo::atTopOfBlock):
1813 (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
1814 (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
1815 (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
1816 (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
1817 (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
1818 (khtml::RenderBlock::MarginInfo::quirkContainer):
1819 (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
1820 (khtml::RenderBlock::MarginInfo::topQuirk):
1821 (khtml::RenderBlock::MarginInfo::bottomQuirk):
1822 (khtml::RenderBlock::MarginInfo::posMargin):
1823 (khtml::RenderBlock::MarginInfo::negMargin):
1824 (khtml::RenderBlock::MarginInfo::margin):
1825 * khtml/rendering/render_box.cpp:
1826 (RenderBox::calcAbsoluteVertical):
1827 * khtml/rendering/render_box.h:
1828 (khtml::RenderBox::marginTop):
1829 (khtml::RenderBox::marginBottom):
1830 (khtml::RenderBox::marginLeft):
1831 (khtml::RenderBox::marginRight):
1832 * khtml/rendering/render_image.cpp:
1833 (RenderImage::setImage):
1834 * khtml/rendering/render_object.cpp:
1835 (RenderObject::sizesToMaxWidth):
1836 * khtml/rendering/render_object.h:
1837 (khtml::RenderObject::collapsedMarginTop):
1838 (khtml::RenderObject::collapsedMarginBottom):
1839 (khtml::RenderObject::maxTopMargin):
1840 (khtml::RenderObject::maxBottomMargin):
1841 (khtml::RenderObject::marginTop):
1842 (khtml::RenderObject::marginBottom):
1843 (khtml::RenderObject::marginLeft):
1844 (khtml::RenderObject::marginRight):
1845 * khtml/rendering/render_text.h:
1846 (khtml::RenderText::marginLeft):
1847 (khtml::RenderText::marginRight):
1848 * khtml/xml/dom_elementimpl.cpp:
1849 (ElementImpl::recalcStyle):
1851 2004-10-12 Ken Kocienda <kocienda@apple.com>
1857 <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line
1859 * khtml/editing/selection.cpp:
1860 (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
1861 This will make it seem like the run ends on the next line.
1863 2004-10-12 Ken Kocienda <kocienda@apple.com>
1869 <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages
1871 * khtml/editing/htmlediting.cpp:
1872 (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
1873 row, section, or column.
1874 (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
1875 of table structure when doing deletes, rather than deleting the structure elements themselves.
1876 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
1877 of table structure. We may want to revisit this some day, but this seems like the best behavior
1879 (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
1881 * khtml/editing/htmlediting.h: Add declarations for new functions.
1883 2004-10-12 Richard Williamson <rjw@apple.com>
1885 Fixed access to DOM object via WebScriptObject API.
1886 The execution context for DOM objects wasn't being found.
1887 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
1890 Fixed <rdar://problem/3831063> regions use left offset instead of top offset
1893 * khtml/khtml_part.h:
1894 * khtml/rendering/render_object.cpp:
1895 (RenderObject::addDashboardRegions):
1897 (-[DOMNode isContentEditable]):
1898 (-[DOMNode KJS::Bindings::]):
1899 * kwq/KWQKHTMLPart.h:
1900 * kwq/KWQKHTMLPart.mm:
1901 (KWQKHTMLPart::executionContextForDOM):
1903 2004-10-12 Ken Kocienda <kocienda@apple.com>
1909 <rdar://problem/3834779> Mail crashes when editing HTML message - khtml::Selection::layout()
1911 * kwq/KWQKHTMLPart.mm:
1912 (KWQKHTMLPart::styleForSelectionStart): Table code seems to be more robust when the call to
1913 insert our style-checking node is done with an appendChild rather than an insertBefore. Note
1914 that this table-related problem was exposed by fixing Selection::layout(), which I did
1915 yesterday. This change simply improves things even more so that we do not crash in the
1916 scenario described in the bug.
1918 2004-10-11 Ken Kocienda <kocienda@apple.com>
1922 This is a partial fix to this bug:
1924 <rdar://problem/3832886> increase quote level on new mail document leads to immediate
1925 crash in caret painting code
1927 To eliminate the bad behavior for good, I have done some investigations in Mail code,
1928 and I have sent a suggested code change on to Grant. Basically, Mail can't add empty
1929 blocks (like blockquote elements used for quoting) to documents without giving those
1930 blocks some content (so they have a height).
1932 I added some other crash protections below.
1934 * khtml/editing/selection.cpp:
1935 (khtml::Selection::layout): Check for non-null position after calls to VisiblePosition, since
1936 the VisiblePosition constructors may fail to find a visible spot in the document. Also, add
1937 a couple position-has-renderer assertion checks.
1938 * kwq/KWQKHTMLPart.mm:
1939 (KWQKHTMLPart::styleForSelectionStart): Take out pos.isNotNull() assertion since VisiblePosition
1940 may not yield a position. This assertion is a holdover from before we had VisiblePosition.
1941 (KWQKHTMLPart::fontForSelection): Rearrange the code a little to deal with possible null results from
1944 2004-10-11 Darin Adler <darin@apple.com>
1948 - fixed <rdar://problem/3834230> empty table can result in division by 0
1950 * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows):
1951 Added 0 check; rolled in from KDE.
1953 2004-10-11 Darin Adler <darin@apple.com>
1957 - fixed <rdar://problem/3818712> form checkbox value property is read only
1959 The underlying problem was that we were storing two separate values for all
1960 form elements; one for the value property (JavaScript) and the other for the
1961 value attribute (DOM). This is a good idea for text input, but not for other types.
1963 * khtml/html/html_formimpl.h: Changed setValue to take a const DOMString reference.
1964 Added private storesValueSeparateFromAttribute function.
1965 * khtml/html/html_formimpl.cpp:
1966 (DOM::HTMLInputElementImpl::setType): Handle type changes, including detaching and re-attaching
1967 if type changed, and moving value from m_value to ATTR_VALUE and vice versa.
1968 (DOM::HTMLInputElementImpl::type): Added a case for ISINDEX and moved the default out of the
1969 switch so that we will get a warning if a type is left out.
1970 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Tweaked comment format.
1971 (DOM::HTMLInputElementImpl::reset): Changed to only nuke the value if the value property is stored
1972 separately from the attribute. Otherwise, we just want to lave it alone
1973 (DOM::HTMLInputElementImpl::value): Changed to always use m_value if it's not null, then fall back
1974 on the attribute, and finally fall back to the "on" for the checkbox only if both are null.
1975 (DOM::HTMLInputElementImpl::setValue): Changed to set the attribute unless the value property is
1976 supposed to be stored separate from the attribute.
1977 (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute): Added. Returns true for text-type
1978 input elements, and false for the others.
1980 2004-10-11 Darin Adler <darin@apple.com>
1984 - fixed <rdar://problem/3296652> checkbox input type does not respond to onchange
1986 * khtml/rendering/render_form.cpp:
1987 (RenderFormElement::updateFromElement): Some new code, commented out, for form element colors.
1988 (RenderCheckBox::slotStateChanged): Added call to onChange.
1990 2004-10-11 Ken Kocienda <kocienda@apple.com>
1994 Finish selection affinity implementation. This includes code to set the
1995 affinity correctly when clicking with the mouse, and clearing the
1996 affinity when altering the selection using any of the Selection object
1999 Each instance of the positionForCoordinates, inlineBox and caretRect
2000 functions have been changed to include an EAffinity argument to give results
2001 which take this bit into account.
2003 * khtml/editing/selection.cpp:
2004 (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
2005 (khtml::Selection::modifyAffinity): New function to compute affinity based on
2006 modification constants.
2007 (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
2008 (khtml::Selection::modifyExtendingRightForward): Ditto.
2009 (khtml::Selection::modifyMovingRightForward): Ditto.
2010 (khtml::Selection::modifyExtendingLeftBackward): Ditto.
2011 (khtml::Selection::modifyMovingLeftBackward): Ditto.
2012 (khtml::Selection::modify): Support saving, restoring, and then calculating new
2013 affinity value as needed.
2014 (khtml::Selection::xPosForVerticalArrowNavigation):
2015 (khtml::Selection::clear): Reset affinity to UPSTREAM.
2016 (khtml::Selection::setBase): Ditto.
2017 (khtml::Selection::setExtent): Ditto.
2018 (khtml::Selection::setBaseAndExtent): Ditto.
2019 (khtml::Selection::layout): Pass affinity to caretRect().
2020 (khtml::Selection::validate): Pass along affinity parameter to new functions that
2022 (khtml::startOfFirstRunAt): Changed the way that the y-coordinate search is done, to
2023 keep this code working with changes made in selectionForLine().
2024 (khtml::endOfLastRunAt): Ditto.
2025 (khtml::selectionForLine): Make this function work for all renderers, not just text
2027 * khtml/editing/selection.h:
2028 (khtml::operator==): Consider affinity in equality check.
2029 * khtml/editing/visible_units.cpp:
2030 (khtml::previousLinePosition): Pass affinity argument to function so it can take this
2031 information into account while processing.
2032 (khtml::nextLinePosition): Ditto.
2033 (khtml::previousParagraphPosition): Ditto.
2034 (khtml::nextParagraphPosition): Ditto.
2035 * khtml/editing/visible_units.h: Ditto, for each of the functions listed.
2036 * khtml/khtml_events.cpp:
2037 (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
2038 as this function is being removed.
2039 * khtml/khtml_part.cpp:
2040 (KHTMLPart::isPointInsideSelection): Ditto.
2041 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
2042 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2043 (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
2044 call to positionForCoordinates, and set resulting affinity on the selection.
2045 (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on
2046 NodeImpl::positionForCoordinates, as this function is being removed.
2047 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
2048 * khtml/rendering/render_block.cpp:
2049 (khtml::RenderBlock::positionForCoordinates): Now takes an affinity argument.
2050 * khtml/rendering/render_block.h:
2051 * khtml/rendering/render_box.cpp:
2052 (RenderBox::caretRect): Ditto.
2053 * khtml/rendering/render_box.h:
2054 * khtml/rendering/render_br.cpp:
2055 (RenderBR::positionForCoordinates): Ditto.
2056 (RenderBR::caretRect): Ditto.
2057 (RenderBR::inlineBox): Ditto.
2058 * khtml/rendering/render_br.h:
2059 * khtml/rendering/render_container.cpp:
2060 (RenderContainer::positionForCoordinates): Ditto.
2061 * khtml/rendering/render_container.h:
2062 * khtml/rendering/render_flow.cpp:
2063 (RenderFlow::caretRect): Ditto.
2064 * khtml/rendering/render_flow.h:
2065 * khtml/rendering/render_inline.cpp:
2066 (RenderInline::positionForCoordinates): Ditto.
2067 * khtml/rendering/render_inline.h:
2068 * khtml/rendering/render_object.cpp:
2069 (RenderObject::caretRect): Ditto.
2070 (RenderObject::positionForCoordinates): Ditto.
2071 (RenderObject::inlineBox): Ditto.
2072 * khtml/rendering/render_object.h:
2073 * khtml/rendering/render_replaced.cpp:
2074 (RenderReplaced::positionForCoordinates): Ditto.
2075 * khtml/rendering/render_replaced.h:
2076 * khtml/rendering/render_text.cpp:
2077 (RenderText::positionForCoordinates): Ditto.
2078 (firstRendererOnNextLine): New helper used by caretRect().
2079 (RenderText::caretRect): Now takes an affinity argument.
2080 (RenderText::inlineBox): Ditto.
2081 * khtml/rendering/render_text.h:
2082 * khtml/xml/dom_nodeimpl.cpp: Remove positionForCoordinates helper.
2083 * khtml/xml/dom_nodeimpl.h: Ditto.
2084 * khtml/xml/dom_position.cpp:
2085 (DOM::Position::previousLinePosition): Now takes an affinity argument.
2086 (DOM::Position::nextLinePosition): Ditto.
2087 * khtml/xml/dom_position.h:
2088 * kwq/WebCoreBridge.h:
2089 * kwq/WebCoreBridge.mm:
2090 (-[WebCoreBridge caretRectAtNode:offset:affinity:]): Ditto.
2091 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
2092 (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on
2093 NodeImpl::positionForCoordinates, as this function is being removed.
2095 2004-10-11 Darin Adler <darin@apple.com>
2099 - fixed <rdar://problem/3670280> scroll position on overflowed textareas resets when leaving the tab
2101 * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView becomeFirstResponder]):
2102 Scroll to reveal the text area, don't scroll to reveal the text view itself.
2103 Scrolling the text view ended up putting it at the top left, regardless of
2104 where the insertion point is.
2106 2004-10-11 Darin Adler <darin@apple.com>
2110 - fixed <rdar://problem/3831546> More text is copied than is visually selected
2112 The bug here is that upstream was moving a position too far.
2114 * khtml/xml/dom_position.cpp:
2115 (DOM::Position::upstream): Use the "deep equivalent" node rather than the original node passed
2116 in for various checks. Also use local variables a bit more for slightly more efficiency.
2117 (DOM::Position::downstream): Ditto.
2119 2004-10-11 Darin Adler <darin@apple.com>
2123 - fixed <rdar://problem/3833841> adding an event listener for keypress events does not work
2125 * khtml/xml/dom2_eventsimpl.h: Added numEventIds and made typeToId take a const DOMString &.
2126 * khtml/xml/dom2_eventsimpl.cpp:
2127 (EventImpl::typeToId): Changed to use table. Added "keypress", otherwise, the same as before.
2128 (EventImpl::idToType): Changed to use table.
2130 2004-10-10 John Sullivan <sullivan@apple.com>
2132 - fixed <rdar://problem/3664375> repro crash in -[KWQAccObject accessibilityAttributeNames]
2134 (-[KWQAccObject accessibilityActionNames]):
2135 check for nil m_renderer
2137 2004-10-09 Darin Adler <darin@apple.com>
2141 - fixed <rdar://problem/3828147> REGRESSION: textareas with wrap="off" show their contents in a thin vertical line of text
2143 * kwq/KWQTextArea.h: Added setTextColor and setBackgroundColor methods. This is really for another fix
2144 I'm landing later, but it does no harm to add these now.
2145 * kwq/KWQTextArea.mm:
2146 (-[KWQTextArea _configureTextViewForWordWrapMode]): Set the container size after changing the flag that
2147 determines if the width tracks the text view. Otherwise, we won't successfully set the width in the case
2148 where we don't want it to track the text view. This caused the bug.
2149 (-[KWQTextArea _createTextView]): Remove unneeded call to setMaxSize. The above method already does that.
2150 (-[KWQTextArea setTextColor:]): Added.
2151 (-[KWQTextArea setBackgroundColor:]): Added.
2153 2004-10-09 Darin Adler <darin@apple.com>
2157 - fixed <rdar://problem/3829452> REGRESSION (156-157): onload handler doesn't run on page with meta refresh of 0 duration (new Apple start page)
2159 The fix for <rdar://problem/3773150> made it so <meta> redirects prevent tokenizing the rest of the page.
2160 This is incorrect; the reason the JavaScript-triggered loads prevent tokenizing is that they take place
2161 "right away" in other browsers, but that is not true of <meta> redirect. We fixed this by using a separate
2162 call for <meta> redirect and not preventing tokenizing when that's in effect.
2164 * khtml/khtml_part.h: Removed userGesture parameter from scheduleRedirection. Renamed
2165 isImmediateRedirectPending to isScheduledLocationChangePending. Added scheduleLocationChange.
2166 * khtml/khtml_part.cpp:
2167 (KHTMLPart::openURL): Updated for new constant name.
2168 (KHTMLPart::scheduleRedirection): Removed now-unneeded userGesture parameter, and removed code that
2169 does the special case for redirection during load; a <meta> refresh can never be one of those special
2170 redirects during a load because it redirects the frame itself, not another frame. Also tightened up
2171 the logic by always stopping the redirect timer even if we aren't restarting it.
2172 (KHTMLPart::scheduleLocationChange): Added. Like scheduleRedirection, but with a different constant
2173 so we can tell it apart and always a delay of 0. The "redirection during load" case was moved in here
2174 and renamed to locationChangeScheduledDuringLoad.
2175 (KHTMLPart::isScheduledLocationChangePending): Renamed from isImmediateRedirectPending. This now
2176 returns true only for location changes and history navigation, not <meta> redirects.
2177 (KHTMLPart::scheduleHistoryNavigation): Tightened up logic to do the stop() outside the if as above,
2178 and got rid of a silly timer delay computation that always resulted in 0.
2180 * khtml/khtmlpart_p.h: Added a new value to the RedirectionScheduled enum for scheduleLocationChange
2181 and also renamed one of the existing values.
2183 * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::write): Changed to use isScheduledLocationChangePending instead
2184 of isImmediateRedirectPending, because we do want to continue tokenizing if it's actually a redirect.
2186 * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Changed to call the new scheduleLocationChange
2187 instead of calling scheduleRedirection with delay of 0.
2188 * khtml/ecma/kjs_window.cpp:
2189 (Window::put): Ditto.
2190 (WindowFunc::tryCall): Ditto.
2191 (Location::put): Ditto.
2192 (LocationFunc::tryCall): Ditto.
2194 2004-10-09 Darin Adler <darin@apple.com>
2198 - 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
2200 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::click): Use 0,0 for the coordinates.
2202 2004-10-09 Darin Adler <darin@apple.com>
2206 - fixed <rdar://problem/3804665> REGRESSION: WebCore framework now has many init routines
2208 * khtml/xml/dom_nodeimpl.h: Changed anyQName declaration to not use the inline function
2209 makeId. Surprisingly, the inline function was not "constant-folded" and we ended up with
2210 a copy of the function in each file as an init routine for the framework.
2212 * khtml/ecma/kjs_html.cpp: (Gradient::colorStops): Get rid of initialized ColorStop
2213 globals; their constructors were showing up as init routines for the framework.
2215 * khtml/rendering/render_style.h: Got rid of inline initialDashboardRegions function.
2216 * khtml/rendering/render_style.cpp: (RenderStyle::initialDashboardRegions): Made this
2217 a normal function. When it was an inline function, the constructors for the per-file
2218 copies of the globals were showing up as init routines for the framework.
2220 2004-10-09 Chris Blumenberg <cblu@apple.com>
2223 <rdar://problem/3625352> up and down arrow and page up/down keys don't work to scroll overflow:auto/scroll/overlay areas
2224 <rdar://problem/3397658> scroll wheel does not work to scroll overflow:auto/scroll/overlay areas (RSS)
2225 <rdar://problem/3822027> REGRESSION (Mail): When selection moves out of visible area, should center as NSText does
2227 Reviewed by hyatt, kocienda.
2229 * khtml/rendering/render_layer.cpp:
2230 (RenderLayer::scroll): new
2231 * khtml/rendering/render_layer.h:
2232 * khtml/rendering/render_object.cpp:
2233 (RenderObject::scroll): new
2234 * khtml/rendering/render_object.h:
2235 * kwq/KWQKHTMLPart.h:
2236 * kwq/KWQKHTMLPart.mm:
2237 (KWQKHTMLPart::scrollOverflow): new
2238 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent): new
2239 (KWQKHTMLPart::khtmlMousePressEvent): store pressed node so we know where the focus is
2240 * kwq/KWQScrollBar.h:
2241 * kwq/KWQScrollBar.mm:
2242 (QScrollBar::setValue): return a bool
2243 (QScrollBar::scrollbarHit): ditto
2244 (QScrollBar::scroll): new
2245 * kwq/WebCoreBridge.h:
2246 * kwq/WebCoreBridge.mm:
2247 (-[WebCoreBridge scrollOverflowInDirection:granularity:]): new
2248 (-[WebCoreBridge scrollOverflowWithScrollWheelEvent:]): new
2249 (-[WebCoreBridge ensureSelectionVisible]): visually center the extent of the selection
2251 2004-10-06 David Hyatt <hyatt@apple.com>
2253 Back out style sharing perf fix.
2255 * khtml/css/cssstyleselector.cpp:
2256 (khtml::CSSStyleSelector::locateCousinList):
2257 (khtml::CSSStyleSelector::canShareStyleWithElement):
2258 (khtml::CSSStyleSelector::locateSharedStyle):
2259 * khtml/css/cssstyleselector.h:
2260 * khtml/html/html_elementimpl.h:
2261 (DOM::HTMLElementImpl::inlineStyleDecl):
2262 * khtml/xml/dom_elementimpl.cpp:
2263 (ElementImpl::recalcStyle):
2264 * khtml/xml/dom_elementimpl.h:
2268 2004-10-05 David Hyatt <hyatt@apple.com>
2270 Fix a bug in the iteration of locateCousinList and clean up the style sharing stats code.
2272 * khtml/css/cssstyleselector.cpp:
2273 (khtml::CSSStyleSelector::locateCousinList):
2274 (khtml::CSSStyleSelector::elementsCanShareStyle):
2275 (khtml::CSSStyleSelector::locateSharedStyle):
2276 (khtml::CSSStyleSelector::styleForElement):
2278 2004-10-05 Ken Kocienda <kocienda@apple.com>
2282 * khtml/rendering/bidi.cpp:
2283 (khtml::RenderBlock::computeHorizontalPositionsForLine): Fix coding mistake that
2284 broke layout tests involving compacts.
2286 2004-10-05 Ken Kocienda <kocienda@apple.com>
2290 Finish selection affinity implementation. This includes code to set the
2291 affinity correctly when clicking with the mouse, and clearing the
2292 affinity when altering the selection using any of the Selection object
2295 Each instance of the positionForCoordinates function in the render tree
2296 has been changed to include an EAffinity argument. It is now the job of this
2297 function to set the selection affinity.
2299 * khtml/editing/selection.cpp:
2300 (khtml::Selection::moveTo): Set affinity to DOWNSTREAM.
2301 (khtml::Selection::modify): Ditto.
2302 (khtml::Selection::clear): Ditto.
2303 (khtml::Selection::setBase): Ditto.
2304 (khtml::Selection::setExtent): Ditto.
2305 (khtml::Selection::setBaseAndExtent): Ditto.
2306 * khtml/editing/selection.h:
2307 (khtml::operator==): Consider affinity in equality check.
2308 * khtml/khtml_events.cpp:
2309 (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
2310 as this function is being removed.
2311 * khtml/khtml_part.cpp:
2312 (KHTMLPart::isPointInsideSelection): Ditto.
2313 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
2314 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2315 (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
2316 call to positionForCoordinates, and set resulting affinity on the selection.
2317 (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on
2318 NodeImpl::positionForCoordinates, as this function is being removed.
2319 (KHTMLPart::khtmlMouseReleaseEvent):
2320 * khtml/rendering/render_block.cpp:
2321 (khtml::RenderBlock::positionForCoordinates): Changed, as described above.
2322 * khtml/rendering/render_block.h:
2323 * khtml/rendering/render_br.cpp:
2324 (RenderBR::positionForCoordinates): Ditto.
2325 * khtml/rendering/render_br.h:
2326 * khtml/rendering/render_container.cpp:
2327 (RenderContainer::positionForCoordinates): Ditto.
2328 * khtml/rendering/render_container.h:
2329 * khtml/rendering/render_inline.cpp:
2330 (RenderInline::positionForCoordinates): Ditto.
2331 * khtml/rendering/render_inline.h:
2332 * khtml/rendering/render_object.cpp:
2333 (RenderObject::positionForCoordinates): Ditto.
2334 * khtml/rendering/render_object.h:
2335 * khtml/rendering/render_replaced.cpp:
2336 (RenderReplaced::positionForCoordinates): Ditto.
2337 * khtml/rendering/render_replaced.h:
2338 * khtml/rendering/render_text.cpp:
2339 (RenderText::positionForCoordinates): Ditto.
2340 * khtml/rendering/render_text.h:
2341 * khtml/xml/dom_nodeimpl.cpp: Removed positionForCoordinates convenience.
2342 * khtml/xml/dom_nodeimpl.h: Ditto.
2343 * kwq/WebCoreBridge.mm:
2344 (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on
2345 NodeImpl::positionForCoordinates, as this function is being removed.
2347 2004-10-05 David Hyatt <hyatt@apple.com>
2349 Fix style sharing optimization to be fast again. Go back to using pointer comparisons when looking for
2354 * khtml/css/cssstyleselector.cpp:
2355 (khtml::CSSStyleSelector::locateCousinList):
2356 * khtml/rendering/render_object.cpp:
2357 (RenderObject::setStyleInternal):
2358 * khtml/rendering/render_object.h:
2359 * khtml/xml/dom_elementimpl.cpp:
2360 (ElementImpl::recalcStyle):
2362 2004-10-05 David Hyatt <hyatt@apple.com>
2364 Fix lists so that they properly participate in line layout as though they are text (when text bullets are
2365 used) and as images (when image bullets are used).
2367 Reviewed by kocienda
2369 * khtml/rendering/render_list.cpp:
2370 (RenderListMarker::createInlineBox):
2371 * khtml/rendering/render_list.h:
2372 (khtml::ListMarkerBox:::InlineBox):
2373 (khtml::ListMarkerBox::isText):
2375 2004-10-05 Ken Kocienda <kocienda@apple.com>
2379 Recent checkin adding upstreamDeepEquivalent had it backwards. The helper
2380 we want is downstreamDeepEquivalent, as the deepEquivalent function returns
2381 an upstream position.
2383 * khtml/editing/selection.cpp:
2384 (khtml::Selection::layout): DOWNSTREAM case now uses downstreamDeepEquivalent.
2385 UPSTREAM uses deepEquivalent.
2386 * khtml/editing/visible_position.cpp:
2387 (khtml::VisiblePosition::downstreamDeepEquivalent): New helper, replacing
2388 upstreamDeepEquivalent.
2389 * khtml/editing/visible_position.h
2391 2004-10-05 David Hyatt <hyatt@apple.com>
2393 New selection gap-filling architecture. Makes the gap-filling much more like NSTextView and puts the responsibility
2394 for gap-filling in the block. Fixes numerous bugs with selection drawing including bidi issues, incorrect old
2395 horizontal gap filling, and selection performance issues.
2397 Reviewed by kocienda
2399 * khtml/html/html_imageimpl.cpp:
2400 (HTMLImageLoader::notifyFinished):
2401 * khtml/misc/khtmllayout.h:
2402 (khtml::GapRects::left):
2403 (khtml::GapRects::center):
2404 (khtml::GapRects::right):
2405 (khtml::GapRects::uniteLeft):
2406 (khtml::GapRects::uniteCenter):
2407 (khtml::GapRects::uniteRight):
2408 (khtml::GapRects::unite):
2409 (khtml::GapRects::operator QRect):
2410 (khtml::GapRects::operator==):
2411 (khtml::GapRects::operator!=):
2412 * khtml/rendering/font.cpp:
2413 (Font::drawHighlightForText):
2414 * khtml/rendering/font.h:
2415 * khtml/rendering/render_block.cpp:
2416 (khtml:::RenderFlow):
2417 (khtml::RenderBlock::removeChild):
2418 (khtml::RenderBlock::paintObject):
2419 (khtml::RenderBlock::paintEllipsisBoxes):
2420 (khtml::RenderBlock::setSelectionState):
2421 (khtml::RenderBlock::shouldPaintSelectionGaps):
2422 (khtml::RenderBlock::isSelectionRoot):
2423 (khtml::RenderBlock::selectionGapRects):
2424 (khtml::RenderBlock::paintSelection):
2425 (khtml::RenderBlock::fillSelectionGaps):
2426 (khtml::RenderBlock::fillInlineSelectionGaps):
2427 (khtml::RenderBlock::fillBlockSelectionGaps):
2428 (khtml::RenderBlock::fillHorizontalSelectionGap):
2429 (khtml::RenderBlock::fillVerticalSelectionGap):
2430 (khtml::RenderBlock::fillLeftSelectionGap):
2431 (khtml::RenderBlock::fillRightSelectionGap):
2432 (khtml::RenderBlock::getHorizontalSelectionGapInfo):
2433 (khtml::RenderBlock::leftSelectionOffset):
2434 (khtml::RenderBlock::rightSelectionOffset):
2435 * khtml/rendering/render_block.h:
2436 (khtml::RenderBlock::hasSelectedChildren):
2437 (khtml::RenderBlock::selectionState):
2438 (khtml::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
2439 (khtml::RenderBlock::BlockSelectionInfo::rects):
2440 (khtml::RenderBlock::BlockSelectionInfo::state):
2441 (khtml::RenderBlock::BlockSelectionInfo::block):
2442 (khtml::RenderBlock::selectionRect):
2443 * khtml/rendering/render_box.cpp:
2444 (RenderBox::position):
2445 * khtml/rendering/render_br.cpp:
2446 (RenderBR::inlineBox):
2447 * khtml/rendering/render_br.h:
2448 (khtml::RenderBR::selectionRect):
2449 (khtml::RenderBR::paint):
2450 * khtml/rendering/render_canvas.cpp:
2451 (RenderCanvas::selectionRect):
2452 (RenderCanvas::setSelection):
2453 * khtml/rendering/render_canvasimage.cpp:
2454 (RenderCanvasImage::paint):
2455 * khtml/rendering/render_image.cpp:
2456 (RenderImage::paint):
2457 * khtml/rendering/render_image.h:
2458 * khtml/rendering/render_line.cpp:
2459 (khtml::InlineBox::nextLeafChild):
2460 (khtml::InlineBox::prevLeafChild):
2461 (khtml::InlineBox::selectionState):
2462 (khtml::InlineFlowBox::addToLine):
2463 (khtml::InlineFlowBox::firstLeafChild):
2464 (khtml::InlineFlowBox::lastLeafChild):
2465 (khtml::InlineFlowBox::firstLeafChildAfterBox):
2466 (khtml::InlineFlowBox::lastLeafChildBeforeBox):
2467 (khtml::InlineFlowBox::selectionState):
2468 (khtml::RootInlineBox::fillLineSelectionGap):
2469 (khtml::RootInlineBox::setHasSelectedChildren):
2470 (khtml::RootInlineBox::selectionState):
2471 (khtml::RootInlineBox::firstSelectedBox):
2472 (khtml::RootInlineBox::lastSelectedBox):
2473 (khtml::RootInlineBox::selectionTop):
2474 (khtml::RootInlineBox::block):
2475 * khtml/rendering/render_line.h:
2476 (khtml::RootInlineBox::RootInlineBox):
2477 (khtml::RootInlineBox::hasSelectedChildren):
2478 (khtml::RootInlineBox::selectionHeight):
2479 * khtml/rendering/render_object.cpp:
2480 (RenderObject::selectionColor):
2481 * khtml/rendering/render_object.h:
2482 (khtml::RenderObject::):
2483 (khtml::RenderObject::selectionState):
2484 (khtml::RenderObject::setSelectionState):
2485 (khtml::RenderObject::selectionRect):
2486 (khtml::RenderObject::canBeSelectionLeaf):
2487 (khtml::RenderObject::hasSelectedChildren):
2488 (khtml::RenderObject::hasDirtySelectionState):
2489 (khtml::RenderObject::setHasDirtySelectionState):
2490 (khtml::RenderObject::shouldPaintSelectionGaps):
2491 (khtml::RenderObject::SelectionInfo::SelectionInfo):
2492 * khtml/rendering/render_replaced.cpp:
2493 (RenderReplaced::RenderReplaced):
2494 (RenderReplaced::shouldPaint):
2495 (RenderReplaced::selectionRect):
2496 (RenderReplaced::setSelectionState):
2497 (RenderReplaced::selectionColor):
2498 (RenderWidget::paint):
2499 (RenderWidget::setSelectionState):
2500 * khtml/rendering/render_replaced.h:
2501 (khtml::RenderReplaced::canBeSelectionLeaf):
2502 (khtml::RenderReplaced::selectionState):
2503 * khtml/rendering/render_text.cpp:
2504 (InlineTextBox::checkVerticalPoint):
2505 (InlineTextBox::isSelected):
2506 (InlineTextBox::selectionState):
2507 (InlineTextBox::selectionRect):
2508 (InlineTextBox::paintSelection):
2509 (InlineTextBox::paintMarkedTextBackground):
2510 (RenderText::paint):
2511 (RenderText::setSelectionState):
2512 (RenderText::selectionRect):
2513 * khtml/rendering/render_text.h:
2514 (khtml::RenderText::canBeSelectionLeaf):
2516 * kwq/KWQPainter.mm:
2517 (QPainter::drawHighlightForText):
2519 (QPtrDictIterator::toFirst):
2522 * kwq/WebCoreTextRenderer.h:
2523 * kwq/WebCoreTextRendererFactory.mm:
2524 (WebCoreInitializeEmptyTextGeometry):
2526 2004-10-05 Ken Kocienda <kocienda@apple.com>
2530 Use the new CSS properties I added with my previous check-in. Also makes
2531 some changes to caret positioning and drawing to make the proper editing
2532 end-of-line behavior work correctly.
2534 * khtml/editing/selection.cpp:
2535 (khtml::Selection::layout): Caret drawing now takes affinity into account
2536 when deciding where to paint the caret (finally!).
2537 * khtml/editing/visible_position.cpp:
2538 (khtml::VisiblePosition::previousVisiblePosition): Move off Position::rendersInDifferentPosition
2539 to determine the result. Use a simpler test involving comparisons between
2540 downstream positions while iterating. This is cheaper to do and easier to understand.
2541 (khtml::VisiblePosition::nextVisiblePosition): Ditto.
2542 * khtml/rendering/bidi.cpp:
2543 (khtml::BidiIterator::current): Do not return non-breaking spaces for empty
2544 text renderers and for non-text renderers. Return a null Qchar instead. Returning
2545 non-breaking spaces was causing errors when the new -khtml-nbsp-mode was set to "space".
2546 (khtml::RenderBlock::computeHorizontalPositionsForLine): Shrink line boxes that
2547 contain with more spaces than can fit on the end of a line.
2548 (khtml::RenderBlock::skipWhitespace): Factor this out from findNextLineBreak.
2549 (khtml::RenderBlock::findNextLineBreak): Use new skipWhitespace function. Add
2550 in code to check and use new CSS properties.
2551 * khtml/rendering/break_lines.cpp:
2552 (khtml::isBreakable): Consider a non-breaking space a breakable character based
2553 on setting of new -khtml-nbsp-mode property.
2554 * khtml/rendering/break_lines.h: Ditto.
2555 * khtml/rendering/render_block.h: Declare skipWhitespace function.
2556 * khtml/rendering/render_text.cpp:
2557 (RenderText::caretRect): Do not draw the caret beyond the right edge of the
2558 window when in white-space normal mode.
2560 2004-10-05 Ken Kocienda <kocienda@apple.com>
2566 In this patch, I add two new CSS properties and their associated behavior.
2567 This is to support end-of-line and word-wrapping features that match the
2568 conventions of text editors.
2570 There are also some other small changes here which begin to lay the groundwork
2571 for using these new properties to bring about the desired editing behavior.
2573 * khtml/css/cssparser.cpp:
2574 (CSSParser::parseValue): Add support for new CSS properties.
2575 * khtml/css/cssproperties.c: Generated file.
2576 * khtml/css/cssproperties.h: Ditto.
2577 * khtml/css/cssproperties.in: Add new properties.
2578 * khtml/css/cssstyleselector.cpp:
2579 (khtml::CSSStyleSelector::applyProperty): Add support for new CSS properties.
2580 * khtml/css/cssvalues.c: Generated file.
2581 * khtml/css/cssvalues.h: Ditto.
2582 * khtml/css/cssvalues.in: Add support for new CSS properties.
2583 * khtml/editing/visible_position.cpp:
2584 (khtml::VisiblePosition::upstreamDeepEquivalent): Added new helper.
2585 * khtml/editing/visible_position.h:
2586 * khtml/rendering/render_box.cpp:
2587 (RenderBox::deleteLineBoxWrapper): Zero out inlineBoxWrapper.
2588 * khtml/rendering/render_replaced.cpp:
2589 (RenderWidget::detach): Zero out inlineBoxWrapper.
2590 * khtml/rendering/render_style.cpp:
2591 (StyleCSS3InheritedData):
2592 (StyleCSS3InheritedData::operator==): Add support for new CSS properties.
2593 (RenderStyle::diff): Ditto.
2594 * khtml/rendering/render_style.h:
2595 (khtml::RenderStyle::nbspMode): Ditto.
2596 (khtml::RenderStyle::khtmlLineBreak): Ditto.
2597 (khtml::RenderStyle::setNBSPMode): Ditto.
2598 (khtml::RenderStyle::setKHTMLLineBreak): Ditto.
2599 (khtml::RenderStyle::initialNBSPMode): Ditto.
2600 (khtml::RenderStyle::initialKHTMLLineBreak): Ditto.
2602 2004-10-05 Darin Adler <darin@apple.com>
2606 - fixed <rdar://problem/3673150> Pasting string from clipboard that is longer than input box will accept fails rather than truncating
2608 * kwq/KWQTextField.mm:
2609 (-[KWQTextFieldFormatter isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:]):
2610 Wrote a new version of this method that truncates incoming strings rather than rejecting them
2613 2004-10-04 Darin Adler <darin@apple.com>
2617 - fixed <rdar://problem/3826343> crash in KHTMLParser::setCurrent parsing document fragment (happens in Calendar widget)
2619 * khtml/html/htmlparser.cpp:
2620 (KHTMLParser::KHTMLParser): Initialized currentIsReferenced to false (fixes bug).
2621 (KHTMLParser::reset): Use doc() to make code easier to read.
2622 (KHTMLParser::setCurrent): Ditto.
2623 (KHTMLParser::parseToken): Ditto.
2624 (KHTMLParser::insertNode): Ditto.
2625 (KHTMLParser::getElement): Ditto.
2626 (KHTMLParser::popOneBlock): Ditto.
2628 - fixed <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window
2630 * kwq/KWQKHTMLPart.h: Added fontAttributesForSelectionStart.
2631 * kwq/KWQKHTMLPart.mm:
2632 (KWQKHTMLPart::styleForSelectionStart): Factored out most of fontForSelection.
2633 (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
2634 (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
2635 (KWQKHTMLPart::registerCommandForUndo): Updated for name change (see below).
2636 (KWQKHTMLPart::registerCommandForRedo): Ditto.
2638 * kwq/WebCoreBridge.h: Added fontAttributesForSelectionStart.
2639 * kwq/WebCoreBridge.mm:
2640 (-[WebCoreBridge undoEditing:]): Updated for name change (see below).
2641 (-[WebCoreBridge redoEditing:]): Ditto.
2642 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Got rid of named temporary
2643 EditCommandPtr variable to make things slightly more terse.
2644 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): Ditto.
2645 (-[WebCoreBridge deleteSelectionWithSmartDelete:]): Ditto.
2646 (-[WebCoreBridge fontAttributesForSelectionStart]): Added.
2648 - fix compile on Panther and other cleanup
2650 * khtml/khtml_part.cpp: Removed unneeded include.
2651 * kwq/KWQEditCommand.h: Got rid of use of "impl" when referring to EditCommand pointers.
2652 * kwq/KWQEditCommand.mm: Added include so we compile on Panther.
2653 (-[KWQEditCommand initWithEditCommand:]): Changed name.
2654 (-[KWQEditCommand dealloc]): Updated for m_impl change to m_command.
2655 (-[KWQEditCommand finalize]): Ditto.
2656 (+[KWQEditCommand commandWithEditCommand:]): Changed name.
2657 (-[KWQEditCommand command]): Changed name.
2659 2004-10-04 Darin Adler <darin@apple.com>
2663 - did a more-robust version of the fix I just landed
2665 * khtml/html/htmlparser.h: Added currentIsReferenced boolean.
2666 * khtml/html/htmlparser.cpp:
2667 (KHTMLParser::KHTMLParser): Initializes currentIsReferenced.
2668 (KHTMLParser::setCurrent): Changed to respect and set currentIsReferenced.
2670 2004-10-04 Darin Adler <darin@apple.com>
2674 - fixed <rdar://problem/3824393> REGRESSION (165-TOT): Crash in KHTMLParser::popOneBlock closing window (bose.com)
2676 * khtml/html/htmlparser.cpp:
2677 (KHTMLParser::~KHTMLParser): Move call to setCurrent(0) after the call to freeBlock, since freeBlock doesn't
2678 work well when current is 0, and there's no reason we need to reset the current block first.
2679 (KHTMLParser::setCurrent): Don't ever hold a reference to the document. This prevents a situation where there
2680 would be a reference cycle. In the test case from the bug above, this cycle actually happened and resulted
2681 in a double-delete of the document, tokenizer, and parser.
2683 2004-10-04 Darin Adler <darin@apple.com>
2687 - fixed <rdar://problem/3825429> onclick handler called when mouse down on another element (affects Dashboard Movies widget, test case enclosed)
2689 * khtml/khtmlview.cpp:
2690 (KHTMLViewPrivate::KHTMLViewPrivate): Initialize the click node to 0.
2691 (KHTMLViewPrivate::~KHTMLViewPrivate): Deref the click node.
2692 (KHTMLViewPrivate::reset): Clear the click node.
2693 (KHTMLView::viewportMousePressEvent): Call invalidateClick when we pass the event to a subframe to
2694 reduce the chance that we'll hold on to an old click node for a long time. Set the click node to
2695 the node we we are clicking on.
2696 (KHTMLView::viewportMouseDoubleClickEvent): Only send a click even if the node is the same one from
2697 the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
2698 old click node for a long time.
2699 (KHTMLView::invalidateClick): Clear the click node.
2700 (KHTMLView::viewportMouseReleaseEvent): Only send a click even if the node is the same one from
2701 the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
2702 old click node for a long time.
2703 (KHTMLView::keyPressEvent): Remove code that sets the originalNode field, which is never used.
2705 2004-10-04 Ken Kocienda <kocienda@apple.com>
2711 <rdar://problem/3825289> REGRESSION (Mail): Crash in fontForSelection in empty window
2713 * khtml/editing/visible_position.cpp:
2714 (khtml::VisiblePosition::previousPosition): Switch to node iteration instead "leaf"
2715 iteration. I have been wanting to make this change for a long time, but couldn't
2716 since other code relied on the leaf behavior. That is no longer true. Plus, the
2717 bug fix requires the new behavior.
2718 (khtml::VisiblePosition::nextPosition): Ditto.
2719 (khtml::VisiblePosition::isCandidate): Empty blocks needed a height to be a candidate,
2720 but we make a special case for the body element. This fixes the bug.
2722 2004-10-04 Darin Adler <darin@apple.com>
2726 - fixed <rdar://problem/3800667> REGRESSION (Mail): double-clicking multiple spaces only selects two spaces
2728 * kwq/KWQTextUtilities.mm: (KWQFindWordBoundary): Moved here from the .cpp file. Changed to use the
2729 doubleClickAtIndex: method from NSAttributedString rather than using Unicode Utilities.
2730 * kwq/KWQTextUtilities.cpp: Removed.
2731 * WebCore.pbproj/project.pbxproj: Removed KWQTextUtilities.cpp.
2733 - fixed a problem that would show up using HTML editing under garbage collection
2735 * kwq/KWQEditCommand.mm: (-[KWQEditCommand finalize]): Fixed a [super dealloc] that should have been a
2738 - another small change
2740 * khtml/editing/visible_units.cpp: (khtml::nextWordBoundary): Tweaked a comment.
2742 2004-10-01 Darin Adler <darin@apple.com>
2744 Reviewed by Ken (or arguably done by Ken, reviewed by Darin).
2746 - fixed <rdar://problem/3823828> REGRESSION (Mail): Clicking past end of any line puts insertion point at beginning of next line
2748 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::VisiblePosition):
2749 Check for an offset of 0 and a <br> and use UPSTREAM affinity in that case.
2750 This is a short term fix for something that needs a better longer-term fix.
2752 - fixed <rdar://problem/3823816> REGRESSION (Mail): double-clicking first word on line also selects previous empty line
2754 * khtml/editing/visible_units.cpp: (khtml::previousWordBoundary): Added a special
2755 case for <br>. While I'm not sure why this regressed, I'm sure this fix is good.
2757 2004-10-01 Darin Adler <darin@apple.com>
2761 - fixed <rdar://problem/3782117> CrashTracer: ..722 crashes at com.apple.WebCore: DOM::HTMLBodyElementImpl::insertedIntoDocument + 0x2c (AOL website)
2763 * khtml/html/html_baseimpl.cpp:
2764 (HTMLBodyElementImpl::insertedIntoDocument): Check for nil document case.
2765 (HTMLFrameElementImpl::isURLAllowed): Ditto.
2766 (HTMLFrameElementImpl::openURL): Ditto.
2768 2004-10-01 Darin Adler <darin@apple.com>
2772 - fixed <rdar://problem/3822218> REGRESSION (164-165): images don't update on rollover on directv.com page
2774 I introduced a major regression where various JavaScript window properties would not be found when I
2777 * khtml/ecma/kjs_window.h: Added hasProperty.
2778 * khtml/ecma/kjs_window.cpp: (Window::hasProperty): Return true in all the cases where get returns something.
2780 2004-09-30 Darin Adler <darin@apple.com>
2784 - fixed <rdar://problem/3461499> JavaScript function document.open() is buggy with 2nd argument "replace"
2786 Experiments with Firefox indicate that document.open() should not be treated as window.open() unless there
2787 are more than two parameters. Also, Firefox does not implement the "replace" behavior, so we don't have
2788 to worry about it either.
2790 * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): Only forward to window if there are more than
2791 two parameters, rather than if there are more than one.
2793 - fixed <rdar://problem/3672933> oninput is firing at page load time for <input type=range>
2795 * kwq/KWQSlider.mm: (QSlider::setValue): Don't emit a signal here. This follows the usual pattern, where
2796 a signal is only emitted for changes that are not explicitly requested by the caller.
2798 - fixed <rdar://problem/3821167> leaks of something allocated by recalcStyle after loading altavista page from cvs-base
2800 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Ref and deref the style we allocate so it's
2801 not left floating if setStyle decides not to ref it.
2803 - fixed <rdar://problem/3821172> leak of HTML attribute string after loading the ESPN page from cvs-base
2805 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Use the DOMString version of
2806 the lower() operation so we don't end up leaving a DOMStringImpl * floating if AtomicString decides not
2809 2004-09-30 Richard Williamson <rjw@apple.com>
2811 Fixed <rdar://problem/3822330> REGRESSION: crash on launch when homepage is set to about:blank
2815 * kwq/KWQKHTMLPart.mm:
2816 (KWQKHTMLPart::setDisplaysWithFocusAttributes):
2818 2004-09-30 Chris Blumenberg <cblu@apple.com>
2820 Fixed: <rdar://problem/3792822> Safari is calling the Cocoa QuickTime plugin twice for the OBJECT and EMBED tags
2824 * khtml/html/html_objectimpl.cpp:
2825 (HTMLObjectElementImpl::attach): call dispatchHTMLEvent after updateWidget instead of every time this method is called
2826 (HTMLObjectElementImpl::recalcStyle): ditto
2828 2004-09-30 Darin Adler <darin@apple.com>
2830 - rolled out bad image change that caused performance regression
2832 * khtml/rendering/render_image.cpp: (RenderImage::setPixmap):
2833 Don't reference the new image before doing the assignment.
2834 This forced an unwanted.
2836 2004-09-30 Ken Kocienda <kocienda@apple.com>
2838 Reviewed by me, coded by Darin
2840 - fixed <rdar://problem/3818305> REGRESSION (Mail): Shift + page up has no effect; should modify selection
2842 * khtml/editing/selection.cpp: (khtml::Selection::modify): Fix problem where vertical distance
2843 was used as a distance threshold, but was a negative number. Now make it positive at the start
2844 of the function (and make a couple related changes).
2846 2004-09-29 Richard Williamson <rjw@apple.com>
2848 Fixed <rdar://problem/3779998> bringing window to front or sending to back does not send focus/blur events to JavaScript window object
2850 The fix has two parts, 1) make onblur and onfocus work for windows,
2851 and 2), allow the dashboard to override WebKit's special key/non-key
2856 * kwq/KWQKHTMLPart.mm:
2857 (KWQKHTMLPart::setDisplaysWithFocusAttributes):
2859 2004-09-29 Ken Kocienda <kocienda@apple.com>
2865 <rdar://problem/3705894> REGRESSION (Mail): if a single word is wider than the window,
2866 it doesn't break and just runs off the right side
2868 * khtml/css/css_computedstyle.cpp:
2869 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support for CSS_PROP_WORD_WRAP.
2870 * khtml/css/cssparser.cpp:
2871 (CSSParser::parseValue): Ditto.
2872 * khtml/css/cssproperties.c: Generated file.
2873 * khtml/css/cssproperties.h: Ditto.
2874 * khtml/css/cssproperties.in: Add word-wrap property.
2875 * khtml/css/cssstyleselector.cpp:
2876 (khtml::CSSStyleSelector::applyProperty): Add support for CSS_PROP_WORD_WRAP.
2877 * khtml/css/cssvalues.c: Generated file.
2878 * khtml/css/cssvalues.h: Ditto.
2879 * khtml/css/cssvalues.in: Add break-word value.
2880 * khtml/rendering/bidi.cpp:
2881 (khtml::RenderBlock::findNextLineBreak): Add code to implement new word wrapping feature.
2882 * khtml/rendering/render_style.cpp:
2883 (StyleCSS3InheritedData): Add support for new wordWrap property.
2884 (StyleCSS3InheritedData::operator==): Ditto.
2885 (RenderStyle::diff): Ditto.
2886 * khtml/rendering/render_style.h:
2887 (khtml::RenderStyle::wordWrap): Ditto.
2888 (khtml::RenderStyle::setWordWrap): Ditto.
2889 (khtml::RenderStyle::initialWordWrap): Ditto.
2891 2004-09-29 Maciej Stachowiak <mjs@apple.com>
2895 - consolidated OS version checks into prefix header
2898 * khtml/rendering/render_canvasimage.cpp:
2899 * kwq/KWQAccObject.mm:
2900 (-[KWQAccObject roleDescription]):
2901 (-[KWQAccObject accessibilityActionDescription:]):
2902 * kwq/KWQComboBox.mm:
2903 (QComboBox::QComboBox):
2904 * kwq/KWQFoundationExtras.h:
2906 2004-09-29 David Hyatt <hyatt@apple.com>
2908 Make sure <br>s always get line boxes. Also prevent the creation of RenderTexts for whitespace normal/nowrap nodes
2911 Reviewed by kocienda
2913 * khtml/editing/visible_position.cpp:
2914 (khtml::VisiblePosition::isCandidate):
2915 * khtml/rendering/render_br.cpp:
2916 (RenderBR::RenderBR):
2917 (RenderBR::createInlineBox):
2918 (RenderBR::baselinePosition):
2919 (RenderBR::lineHeight):
2920 * khtml/rendering/render_br.h:
2921 * khtml/rendering/render_line.cpp:
2922 (khtml::InlineFlowBox::placeBoxesVertically):
2923 * khtml/rendering/render_line.h:
2924 (khtml::InlineBox::isText):
2925 (khtml::InlineFlowBox::addToLine):
2926 * khtml/rendering/render_text.cpp:
2927 (RenderText::detach):
2928 * khtml/rendering/render_text.h:
2929 (khtml::InlineTextBox:::InlineRunBox):
2930 (khtml::InlineTextBox::isInlineTextBox):
2931 (khtml::InlineTextBox::isText):
2932 (khtml::InlineTextBox::setIsText):
2933 * khtml/xml/dom_textimpl.cpp:
2934 (TextImpl::rendererIsNeeded):
2935 * kwq/KWQRenderTreeDebug.cpp:
2938 2004-09-29 Ken Kocienda <kocienda@apple.com>
2944 <rdar://problem/3815895> exception inside fontForSelection causes Mail to abort when selection hits bottom
2946 * khtml/editing/selection.cpp:
2947 (khtml::Selection::toRange): Use RangeImpl calls to detect exceptions when creating a Range
2948 from a Selection. Return an empty Range when there is an exception.
2952 <rdar://problem/3817268> REGRESSION (Mail): Window does not scroll when selecting out of
2953 visible area of view with arrow keys
2955 * khtml/editing/selection.cpp: Did some name changing. m_needsCaretLayout -> m_needsLayout.
2956 Added m_expectedVisibleRect which supplies the right rectangle to update when scrolling.
2957 (khtml::Selection::Selection): m_needsCaretLayout -> m_needsLayout name change.
2958 (khtml::Selection::init): Handle m_expectedVisibleRect in initialization.
2959 (khtml::Selection::operator=): Handle m_expectedVisibleRect in assignment.
2960 (khtml::Selection::setNeedsLayout): m_needsCaretLayout -> m_needsLayout name change.
2961 (khtml::Selection::layout): Changed name from layoutCaret, since m_expectedVisibleRect
2962 is also calculated here.
2963 (khtml::Selection::caretRect): m_needsCaretLayout -> m_needsLayout name change.
2964 (khtml::Selection::expectedVisibleRect): New. Returns m_expectedVisibleRect, doing a
2966 (khtml::Selection::needsCaretRepaint): m_needsCaretLayout -> m_needsLayout name change.
2967 (khtml::Selection::paintCaret): Ditto.
2968 (khtml::Selection::validate): Ditto.
2969 * khtml/editing/selection.h: Add m_expectedVisibleRect member variable and
2970 expectedVisibleRect accessor.
2971 * kwq/WebCoreBridge.h: Change name of ensureCaretVisible to ensureSelectionVisible, since
2972 this is not only about making the caret visible anymore. Now it can reveal the varying
2973 end of the selection when scrolling with arrow keys.
2974 * kwq/WebCoreBridge.mm:
2975 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): ensureCaretVisible to
2976 ensureSelectionVisible name change.
2977 (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto
2978 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Ditto
2979 (-[WebCoreBridge insertNewline]): Ditto
2980 (-[WebCoreBridge insertText:selectInsertedText:]): Ditto
2981 (-[WebCoreBridge deleteKeyPressed]): Ditto
2982 (-[WebCoreBridge ensureSelectionVisible]): Ditto
2984 2004-09-29 Ken Kocienda <kocienda@apple.com>
2990 <rdar://problem/3818296> REGRESSION (Mail): centerSelectionInVisibleArea does not work correctly
2992 * kwq/KWQKHTMLPart.h:
2993 * kwq/KWQKHTMLPart.mm:
2994 (KWQKHTMLPart::centerSelectionInVisibleArea): New function. Handles both caret
2995 and range selections correctly.
2996 * kwq/KWQNSViewExtras.h: Add forceCentering boolean to some methods in this file.
2997 * kwq/KWQNSViewExtras.m: Ditto. This addition has been done since the AppKit
2998 method we use to do the centering, -[NSView scrollRectToVisible:], does not alter
2999 the view if the rectangle passed to it is already in view. When forceCentering is
3000 true, extra math is done to make scrollRectToVisible center the rectangle we want.
3001 (-[NSView _KWQ_scrollFrameToVisible]): Pass NO for forceCentering in call through to
3002 _KWQ_scrollRectToVisible:forceCentering:
3003 (-[NSView _KWQ_scrollRectToVisible:forceCentering:]): Add forceCentering argument.
3004 (-[NSView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto.
3005 (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto. Do extra
3006 math to implement the forceCentering effect.
3007 * kwq/KWQScrollView.h: Add forceCentering default argument to ensureRectVisibleCentered.
3008 * kwq/KWQScrollView.mm:
3009 (QScrollView::ensureRectVisibleCentered): Ditto.
3010 * kwq/WebCoreBridge.h:
3011 * kwq/WebCoreBridge.mm:
3012 (-[WebCoreBridge centerSelectionInVisibleArea]): New function. Call through to KWQKHTMLPart.
3014 2004-09-28 Chris Blumenberg <cblu@apple.com>
3016 Fixed: WebArchives begin with "<#document/>"
3020 * khtml/xml/dom_nodeimpl.cpp:
3021 (NodeImpl::startMarkup): don't return markup if this is a document node, forgot this when factoring this method out from toHTML
3023 2004-09-28 Chris Blumenberg <cblu@apple.com>
3025 Removed range parameter from recursive_toHTML and friends since that code path is no longer used.
3029 * khtml/xml/dom2_rangeimpl.cpp:
3030 (DOM::RangeImpl::toHTML):
3031 * khtml/xml/dom_nodeimpl.cpp:
3032 (NodeImpl::recursive_toString):
3033 (NodeImpl::recursive_toHTML):
3034 * khtml/xml/dom_nodeimpl.h:
3035 * kwq/WebCoreBridge.mm:
3036 (-[WebCoreBridge markupStringFromNode:nodes:]):
3038 2004-09-28 Darin Adler <darin@apple.com>
3042 - improve spell checking so it doesn't unmark and remark as you move the cursor with the arrow
3044 * khtml/editing/htmlediting.h: Remove obsolete markMisspellingsInSelection private function.
3045 * khtml/editing/htmlediting.cpp:
3046 (khtml::EditCommand::EditCommand): Blow away the selection when starting an edit command.
3047 (khtml::EditCommand::apply): Remove code to mark misspellings because that's now done as part
3048 of blowing away the selection.
3049 (khtml::EditCommand::unapply): Blow away the selection instead of marking mispellings.
3050 (khtml::EditCommand::reapply): Ditto.
3051 (khtml::ReplaceSelectionCommand::doApply): Removed incorrect code that does spell checking
3052 on inserted text; this doesn't match NSText behavior.
3053 (khtml::TypingCommand::markMisspellingsAfterTyping): Use markMisspellingsInAdjacentWords
3054 function for greater clarity on what this actually does.
3056 * khtml/khtml_part.h: Replaced setSelection's "unmarkOldSelection" boolean parameter with a
3057 "keepTypingStyle" boolean parameter. Removed notifySelectionChanged.
3058 * khtml/khtml_part.cpp:
3059 (KHTMLPart::setSelection): Replaced the "unmarkOldSelection" boolean with a new "keepTypingStyle"
3060 boolean. This is a step on the way to simplifying how this works. Moved the code from the
3061 notifySelectionChanged function here, since there was no clear line between the two functions.
3062 (KHTMLPart::clearSelection): Call setSelection rather that having special case code here for
3063 the case of an empty selection.
3064 (KHTMLPart::appliedEditing): Remove the explicit "false" for "unmarkOldSelection".
3065 (KHTMLPart::unappliedEditing): Ditto.
3066 (KHTMLPart::reappliedEditing): Ditto.
3068 * kwq/KWQKHTMLPart.h: Replaced markMisspellingsInSelection and updateSpellChecking with
3069 markMisspellings and markMisspellingsInAdjacentWords. Added parameters to respondToChangedSelection.
3070 * kwq/KWQKHTMLPart.mm:
3071 (KWQKHTMLPart::markMisspellingsInAdjacentWords): Added.
3072 (KWQKHTMLPart::markMisspellings): New name for markMisspellingsInSelection. Simplified logic a
3073 bit and made it the caller's responsibility to expand the selection passed in to word boundaries.
3074 (KWQKHTMLPart::respondToChangedSelection): Added parameter that identifies the old selection,
3075 and changed logic so it won't mark mispellings in a word if the selection still starts in that word.
3077 - implemented empty-cells property in computed style
3079 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3080 Added code for CSS_PROP_EMPTY_CELLS. I think the HTML converter in AppKit uses this.
3082 2004-09-28 Chris Blumenberg <cblu@apple.com>
3084 Fixed n-squared issues with appending to KWQValueListImpl. This fixes the hang in 3794799.
3086 Fixed by Darin, reviewed by me.
3088 * khtml/xml/dom2_rangeimpl.cpp:
3089 (DOM::RangeImpl::toHTML): tweaks
3090 * kwq/KWQValueListImpl.mm:
3091 (KWQValueListImpl::KWQValueListPrivate::KWQValueListPrivate):
3092 (KWQValueListImpl::KWQValueListPrivate::copyList):
3093 (KWQValueListImpl::clear):
3094 (KWQValueListImpl::appendNode):
3095 (KWQValueListImpl::prependNode):
3096 (KWQValueListImpl::removeEqualNodes):
3097 (KWQValueListImpl::containsEqualNodes):
3098 (KWQValueListImpl::removeIterator):
3099 (KWQValueListImpl::lastNode):
3100 * kwq/WebCoreBridge.mm:
3101 (-[WebCoreBridge nodesFromList:]): use iterator, not at()
3103 2004-09-28 Richard Williamson <rjw@apple.com>
3105 More dashboard region changes for John.
3107 <rdar://problem/3817421> add getter for dashboard regions (debugging)
3109 <rdar://problem/3817417> NSScrollView need autoregions for dashboard
3111 <rdar://problem/3817388> should have short form form control regions
3113 <rdar://problem/3817477> visibility does not work with dashboard control regions
3117 * WebCore-combined.exp:
3119 * khtml/css/cssparser.cpp:
3120 (skipCommaInDashboardRegion):
3121 (CSSParser::parseDashboardRegions):
3122 * khtml/khtmlview.cpp:
3123 (KHTMLView::updateDashboardRegions):
3124 * khtml/rendering/render_object.cpp:
3125 (RenderObject::setStyle):
3126 (RenderObject::addDashboardRegions):
3127 * khtml/xml/dom_docimpl.cpp:
3128 (DocumentImpl::DocumentImpl):
3129 (DocumentImpl::setDashboardRegions):
3130 * khtml/xml/dom_docimpl.h:
3131 (DOM::DocumentImpl::setDashboardRegionsDirty):
3132 (DOM::DocumentImpl::dashboardRegionsDirty):
3133 * kwq/KWQKHTMLPart.h:
3134 * kwq/KWQKHTMLPart.mm:
3135 (KWQKHTMLPart::paint):
3136 (KWQKHTMLPart::dashboardRegionsDictionary):
3137 (KWQKHTMLPart::dashboardRegionsChanged):
3138 * kwq/WebCoreBridge.h:
3139 * kwq/WebCoreBridge.mm:
3140 (-[WebCoreBridge dashboardRegions]):
3141 * kwq/WebDashboardRegion.h:
3142 * kwq/WebDashboardRegion.m:
3143 (-[WebDashboardRegion description]):
3145 2004-09-28 John Sullivan <sullivan@apple.com>
3149 - fixed <rdar://problem/3818558> REGRESSION: "Installed Plug-ins" is blank
3150 because of <script type="application/x-javascript">
3152 * khtml/html/htmltokenizer.cpp:
3153 (khtml::HTMLTokenizer::parseTag):
3154 add "application/x-javascript" to the list of legal scripting types. Mozilla
3155 accepts this, but WinIE doesn't.
3157 * layout-tests/fast/tokenizer/004.html:
3158 updated layout test to test some application/xxxx types
3160 2004-09-27 David Hyatt <hyatt@apple.com>
3162 Reworked lists to work well with RTL text. Specifically the following bugs have been fixed:
3164 (1) All bullets use the same offset constant now (a padding of 7 pixels). Before, images used 5 and others used 7.
3165 (2) Line height now works properly, so that list items with no content aren't squished (and missing the line descent).
3166 (3) Punctuation now works correctly with inside and outside style ordered lists in RTL.
3167 (4) RTL lists now properly apply padding and margin to the right side rather than the left. This was done by adding
3168 -khtml-margin-start and -khtml-padding-start properties that are just mapped to left/right based off the direction.
3172 * khtml/css/cssparser.cpp:
3173 (CSSParser::parseValue):
3174 * khtml/css/cssproperties.c:
3177 * khtml/css/cssproperties.h:
3178 * khtml/css/cssproperties.in:
3179 * khtml/css/cssstyleselector.cpp:
3180 (khtml::CSSStyleSelector::applyDeclarations):
3181 (khtml::CSSStyleSelector::applyProperty):
3182 * khtml/css/html4.css:
3183 * khtml/rendering/bidi.cpp:
3184 (khtml::BidiIterator::direction):
3185 * khtml/rendering/render_list.cpp:
3186 (RenderListItem::getAbsoluteRepaintRect):
3187 (RenderListMarker::paint):
3188 (RenderListMarker::calcMinMaxWidth):
3189 (RenderListMarker::lineHeight):
3190 (RenderListMarker::baselinePosition):
3192 2004-09-28 Ken Kocienda <kocienda@apple.com>
3196 Mark the VisiblePosition taking (Position &, EAffinity=DOWNSTREAM) explicit. Recently, when I added
3197 the EAffinity argument, I left this constructor implicit. Darin pointed out to me that this is
3198 undesirable since implicit use of the the constructor involved making the affinity choice, something
3199 which should be done explicitly.
3201 * khtml/editing/selection.cpp:
3202 (khtml::Selection::modifyExtendingRightForward): Make explicit use of constructor mentioned above.
3203 (khtml::Selection::modifyMovingRightForward): Ditto.
3204 (khtml::Selection::modifyExtendingLeftBackward): Ditto.
3205 (khtml::Selection::modifyMovingLeftBackward): Ditto.
3206 (khtml::Selection::modify): Ditto.
3207 (khtml::Selection::validate): Ditto.
3208 * khtml/editing/visible_position.h: Make constructor taking (Position &, EAffinity) explicit.
3209 * khtml/editing/visible_units.cpp: Ditto.
3210 (khtml::previousWordBoundary): Make explicit use of constructor mentioned above.
3211 (khtml::nextWordBoundary): Ditto.
3212 (khtml::previousLinePosition): Ditto.
3213 (khtml::nextLinePosition): Ditto.
3214 * kwq/KWQKHTMLPart.mm: Ditto.
3215 (KWQKHTMLPart::findString): Ditto.
3216 (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
3217 (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
3218 (KWQKHTMLPart::updateSpellChecking): Ditto.
3220 2004-09-28 Darin Adler <darin@apple.com>
3224 - fixed a storage leak discovered by code inspection
3226 * khtml/html/htmlparser.cpp: (KHTMLParser::~KHTMLParser): Call setCurrent(0) to deref
3227 the parser's current node in the rare case where it still has one.
3229 2004-09-27 David Hyatt <hyatt@apple.com>
3231 Don't allow nested headers when only inlines are in between them. Fixes a hang related to pathological nesting
3232 on magicmethodsonline.com.
3236 * khtml/html/htmlparser.cpp:
3237 (KHTMLParser::parseToken):
3238 (KHTMLParser::processCloseTag):
3239 (KHTMLParser::isHeaderTag):
3240 (KHTMLParser::popNestedHeaderTag):
3241 * khtml/html/htmlparser.h:
3243 2004-09-27 Kevin Decker <kdecker@apple.com>
3247 * khtml/css/css_base.cpp:
3248 (CSSSelector::selectorText): changed another ATTR_CLASS case to properly return class selector names.
3250 2004-09-27 David Hyatt <hyatt@apple.com>
3252 Fix style sharing so that it doesn't share when it shouldn't. Partially fixes 3671516, table cells don't update
3253 their color on macosx.apple.com.
3255 Fix 3521639, iframe mispositioned on bidi page. Make sure that when the width of a line exceeds the available line
3256 width that the spillage out of the block is determined by the direction of the block and not by the text-align value.
3258 Partial fix for 3762962, make sure the image cells with specified widths but percentage heights don't just get a minwidth
3261 Fix for 3533878, framesets that use percentages that add up to a value > 100% should normalize those percentages.
3265 * khtml/css/cssstyleselector.cpp:
3266 (khtml::CSSStyleSelector::locateCousinList):
3267 (khtml::CSSStyleSelector::elementsCanShareStyle):
3268 (khtml::CSSStyleSelector::locateSharedStyle):
3269 * khtml/css/cssstyleselector.h:
3270 * khtml/html/html_elementimpl.h:
3271 (DOM::HTMLNamedAttrMapImpl::hasMappedAttributes):
3272 (DOM::HTMLElementImpl::inlineStyleDecl):
3273 * khtml/rendering/bidi.cpp:
3274 (khtml::RenderBlock::computeHorizontalPositionsForLine):
3275 * khtml/rendering/render_frames.cpp:
3276 (RenderFrameSet::layout):
3277 * khtml/rendering/render_replaced.cpp:
3278 (RenderReplaced::calcMinMaxWidth):
3279 * khtml/xml/dom_elementimpl.h:
3280 (DOM::ElementImpl::inlineStyleDecl):
3281 (DOM::ElementImpl::hasMappedAttributes):
3283 2004-09-27 Ken Kocienda <kocienda@apple.com>
3287 Removed closestRenderedPosition function from Position class and gave this work
3288 to VisiblePosition instead. However, in order to make the transfer possible,
3289 VisiblePosition needed upstream and downstream affinities added to its
3290 constructors. Also moved the EAffinity enum into its own file. Also moved it
3291 to the khtml namespace.
3293 Updated several functions which used closestRenderedPosition to use VisiblePosition
3296 Also deleted Position::equivalentShallowPosition. This was unused.
3298 * ForwardingHeaders/editing/text_affinity.h: Added.
3299 * ForwardingHeaders/editing/visible_position.h: Added.
3300 * WebCore.pbproj/project.pbxproj: Added new files.
3301 * khtml/editing/selection.cpp:
3302 (khtml::Selection::validate): Use VisiblePosition instead of closestRenderedPosition.
3303 * khtml/editing/selection.h:
3304 * khtml/editing/text_affinity.h: Added.
3305 * khtml/editing/visible_position.cpp:
3306 (khtml::VisiblePosition::VisiblePosition):
3307 (khtml::VisiblePosition::initUpstream): New helper for finding upstream visible position.
3308 (khtml::VisiblePosition::initDownstream): Was old init function that unconditionally did
3309 downstream checks for visible position. Renamed to describe this more clearly.
3310 * khtml/editing/visible_position.h:
3311 * khtml/editing/visible_units.cpp:
3312 (khtml::previousWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
3313 (khtml::nextWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
3314 * khtml/xml/dom_docimpl.cpp:
3315 (DocumentImpl::updateSelection): Use VisiblePosition instead of closestRenderedPosition.
3316 * khtml/xml/dom_position.cpp:
3317 (DOM::Position::closestRenderedPosition): Removed.
3318 * khtml/xml/dom_position.h: Removed two functions mentioned above.
3319 * kwq/KWQKHTMLPart.mm:
3320 (KWQKHTMLPart::fontForSelection) Use VisiblePosition instead of closestRenderedPosition.:
3321 * kwq/WebCoreBridge.mm:
3322 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Use VisiblePosition instead of closestRenderedPosition.
3323 * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Updated expected results.
3324 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Ditto.
3325 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
3326 * layout-tests/editing/selection/move-by-character-004-expected.txt: Ditto.
3328 2004-09-27 Ken Kocienda <kocienda@apple.com>
3330 Reviewed by Darin and Maciej
3332 Removed EditCommand smart pointer wrappers from htmlediting.cpp/.h, save for the one
3333 at the root of the hierarchy, and this one has been renamed EditCommandPtr. Renamed
3334 each of the XXXCommandImpl classes, removing the Impl suffix from each, and rolled
3335 these into the htmlediting.cpp/.h files. The htmlediting_impl.cpp/.h files have
3336 been emptied and are being removed.
3338 For the remainder of files, perform the mechanical changes necessary to make everything
3339 compile and run as before.
3341 * WebCore.pbproj/project.pbxproj
3342 * khtml/editing/htmlediting.cpp
3343 * khtml/editing/htmlediting.h
3344 * khtml/editing/htmlediting_impl.cpp: Removed.
3345 * khtml/editing/htmlediting_impl.h: Removed.
3346 * khtml/editing/jsediting.cpp
3347 * khtml/khtml_part.cpp
3348 (KHTMLPart::openURL)
3349 (KHTMLPart::lastEditCommand)
3350 (KHTMLPart::appliedEditing)
3351 (KHTMLPart::unappliedEditing)
3352 (KHTMLPart::reappliedEditing)
3353 (KHTMLPart::applyStyle):
3354 * khtml/khtml_part.h
3355 * khtml/khtmlpart_p.h
3356 * kwq/KWQEditCommand.h
3357 * kwq/KWQEditCommand.mm
3358 (-[KWQEditCommand initWithEditCommandImpl:])
3359 (+[KWQEditCommand commandWithEditCommandImpl:])
3360 (-[KWQEditCommand impl])
3361 * kwq/KWQKHTMLPart.h
3362 * kwq/KWQKHTMLPart.mm
3363 (KWQKHTMLPart::registerCommandForUndo)
3364 (KWQKHTMLPart::registerCommandForRedo)
3365 * kwq/WebCoreBridge.mm
3366 (-[WebCoreBridge undoEditing:])
3367 (-[WebCoreBridge redoEditing:])
3368 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
3369 (-[WebCoreBridge moveSelectionToDragCaret:smartMove:])
3370 (-[WebCoreBridge deleteSelectionWithSmartDelete:])
3372 2004-09-26 Darin Adler <darin@apple.com>
3376 - fixed <rdar://problem/3816170> image.width/height not available from Image objects (works in Firefox)
3378 * khtml/ecma/kjs_html.h: Added width and height.
3379 * khtml/ecma/kjs_html.cpp: (Image::getValueProperty): Added width and height.
3380 * khtml/ecma/kjs_html.lut.h: Regenerated.
3382 - unrelated change; changed ordering of use count manipulation just in case we decide some day to do
3383 something when the use count hits 0
3385 * khtml/rendering/render_image.cpp: (RenderImage::setPixmap): Increment use count on new object before
3386 decrementing use count on old object.
3388 2004-09-26 Darin Adler <darin@apple.com>
3392 - fixed <rdar://problem/3812771> document.implementation.hasFeature returns false for a lot of features we implement
3394 * khtml/xml/dom_docimpl.cpp: (DOMImplementationImpl::hasFeature): Added all the DOM features that we implemented
3395 as part of the HTML editing work.
3397 * khtml/dom/dom_node.cpp: (Node::isSupported): Changed this to call DOMImplementationImpl::hasFeature to share
3398 code. Later this might need to be different per-node, but at the moment that does not seem to be so.
3400 * khtml/ecma/kjs_dom.cpp:
3401 (DOMNodeProtoFunc::tryCall): Pass a null string if the parameter is omitted, undefined, or null. This is better than
3402 having a special case for the string "null" in the DOM implementation.
3403 (DOMDOMImplementationProtoFunc::tryCall): Ditto.
3405 - fixed <rdar://problem/3814605> REGRESSION: fast/table/039 layout test is failing due to extra trailing whitespace in innerText
3407 * khtml/editing/visible_text.cpp: (khtml::TextIterator::advance): Check for the case where we are at the end of
3408 iteration, and don't call exitNode in that case. This prevents us from getting some unwanted trailing \n characters.
3410 - fixed <rdar://problem/3813253> method cloneNode() does not clone dynamically-set style attributes correctly
3412 * khtml/html/html_elementimpl.h: Added cloneNode override.
3413 * khtml/html/html_elementimpl.cpp:
3414 (HTMLElementImpl::cloneNode): Added. Copies m_inlineStyleDecl.
3415 (HTMLElementImpl::parseHTMLAttribute): Changed to use getInlineStyleDecl().
3416 (HTMLElementImpl::innerText): Changed to do the same thing with fewer lines of code.
3417 (HTMLElementImpl::outerText): Tweaked comment.
3421 * khtml/xml/dom_elementimpl.cpp:
3422 (ElementImpl::cloneNode): Removed an uneeded type cast.
3423 (XMLElementImpl::cloneNode): Ditto.
3425 2004-09-24 Kevin Decker <kdecker@apple.com>
3429 <rdar://problem/3799334> DIG: Safari does not properly return style names [DigCSS.htm]
3431 * khtml/css/css_base.cpp:
3432 (CSSSelector::selectorText): Properly returns Class Selector names.
3433 Before we would get *[CLASS"foo"] instead of .foo
3435 2004-09-24 Ken Kocienda <kocienda@apple.com>
3441 <rdar://problem/3814660> REGRESSION (8A200-8A259): Select All has no effect on livepage.apple.com
3443 * khtml/xml/dom_docimpl.cpp:
3444 (DocumentImpl::updateSelection): Move the selection start and end to rendered positions
3445 before passing off to the RenderCanvas for drawing.
3446 * layout-tests/editing/selection/select-all-004-expected.txt: Added.
3447 * layout-tests/editing/selection/select-all-004.html: Added.
3449 2004-09-24 John Sullivan <sullivan@apple.com>
3453 - fixed <rdar://problem/3528339> Turn on full keyboard access shows
3454 invisible <input> elements
3456 * khtml/html/html_formimpl.cpp:
3457 (DOM::HTMLGenericFormElementImpl::isFocusable):
3458 reject elements that have zero width or height, even if they aren't hidden
3460 2004-09-24 Maciej Stachowiak <mjs@apple.com>
3462 - fixed deployment build
3466 * khtml/dom/dom_string.cpp: put implementation of ascii() in #ifdef !NDEBUG
3469 2004-09-24 David Hyatt <hyatt@apple.com>
3471 Fix for 3800316, test 37 for tables is failing on the layout tests. Make sure we don't incorrectly match
3472 non-HTML elements with HTML tag selectors in CSS.
3476 * khtml/css/cssstyleselector.cpp:
3477 (khtml::CSSStyleSelector::checkOneSelector):
3479 2004-09-23 David Hyatt <hyatt@apple.com>
3481 Fix for 3601920, CSS "tabs" not switching properly on zen garden design. Improve the repainting to account
3482 for layer changes of z-index that necessitate an invalidation.
3484 Reviewed by kocienda
3486 * khtml/rendering/render_object.cpp:
3487 (RenderObject::setStyle):
3488 * khtml/rendering/render_style.cpp:
3489 (RenderStyle::diff):
3490 * khtml/rendering/render_style.h:
3491 (khtml::RenderStyle::):
3493 2004-09-24 Chris Blumenberg <cblu@apple.com>
3495 Made markup copying 5 times faster. Unfortunately, this still doesn't fix:
3496 <rdar://problem/3794799> Tiger8A252: copying a bunch o' text is so slow it seems like a hang
3500 * khtml/dom/dom_string.h:
3501 * khtml/xml/dom2_rangeimpl.cpp:
3502 (DOM::RangeImpl::toHTML): serialize the range by iterating through the range
3503 * khtml/xml/dom_nodeimpl.cpp:
3504 (NodeImpl::startMarkup): new, factored out from recursive_toString
3505 (NodeImpl::endMarkup): ditto
3506 (NodeImpl::recursive_toString): call factored out methods
3507 * khtml/xml/dom_nodeimpl.h:
3511 2004-09-24 Ken Kocienda <kocienda@apple.com>
3513 Hyatt made an improvement in the render tree which caused the results
3514 to get a little thinner.
3516 * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt
3517 * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt
3519 2004-09-24 Ken Kocienda <kocienda@apple.com>
3525 <rdar://problem/3812939> REGRESSION: move-between-blocks-no-001 editing layout test fails in DeleteSelectionCommandImpl
3527 * khtml/rendering/render_block.cpp:
3528 (khtml::RenderBlock::removeChild): Hyatt said this regression was caused by a bad merge.
3529 Found by code inspection.
3531 2004-09-23 John Sullivan <sullivan@apple.com>
3535 - fixed <rdar://problem/3551850> hang caused by interpreting bad javascript
3536 guarded by a deliberately bogus "language" attribute (www.riibe.com)
3538 * khtml/html/htmltokenizer.cpp:
3539 (khtml::HTMLTokenizer::parseTag):
3540 Check for language attribute of <script> tag in a way that matches WinIE.
3541 Previously we were far too permissive.
3543 2004-09-23 David Hyatt <hyatt@apple.com>
3545 Fix for 3685234 and 3548444, the x-offset for frame borders was off by 1 pixel, causing mojibake to occur when
3546 repainting happened.
3548 * khtml/rendering/render_canvas.cpp:
3549 (RenderCanvas::repaintViewRectangle):
3551 2004-09-23 Richard Williamson <rjw@apple.com>
3553 Fixed <rdar://problem/3813271> dashboard-region-circle and dashboard-region-rectangle should be collapsed into dashboard-region
3554 Fixed <rdar://problem/3813289> dashboard regions need to correctly account for overflow/scrolling
3558 * khtml/css/css_valueimpl.cpp:
3559 (CSSPrimitiveValueImpl::cssText):
3560 * khtml/css/css_valueimpl.h:
3561 * khtml/css/cssparser.cpp:
3562 (CSSParser::parseValue):
3563 (skipCommaInDashboardRegion):
3564 (CSSParser::parseDashboardRegions):
3565 * khtml/khtmlview.cpp:
3566 (KHTMLView::layout):
3567 (KHTMLView::updateDashboardRegions):
3568 * khtml/khtmlview.h:
3569 * khtml/rendering/render_layer.cpp:
3570 (RenderLayer::scrollToOffset):
3571 * khtml/rendering/render_object.cpp:
3572 (RenderObject::addDashboardRegions):
3573 * kwq/KWQKHTMLPart.mm:
3574 (KWQKHTMLPart::dashboardRegionsChanged):
3575 * kwq/WebDashboardRegion.h:
3576 * kwq/WebDashboardRegion.m:
3577 (-[WebDashboardRegion initWithRect:clip:type:]):
3578 (-[WebDashboardRegion dashboardRegionClip]):
3579 (-[WebDashboardRegion description]):
3581 2004-09-23 Ken Kocienda <kocienda@apple.com>
3585 * khtml/xml/dom_position.cpp:
3586 (DOM::Position::inRenderedContent): Make the "empty block" check the same as the one
3587 use in visible position. This fixes a recent regression which broke up and down
3588 arrowing between blocks with an empty block in between.
3590 2004-09-23 Maciej Stachowiak <mjs@apple.com>
3594 <rdar://problem/3685235> REGRESSION (Mail): links are not properly editable
3596 * khtml/html/html_inlineimpl.cpp:
3597 (HTMLAnchorElementImpl::isFocusable): If this element is editable, then follow
3598 the normal focus rules so the link does not swallow focus when you arrow key
3599 or drag-select into it.
3601 2004-09-23 Darin Adler <darin@apple.com>
3603 - added test for the DOM::Range bug fixed recently
3605 * layout-tests/fast/dom/clone-contents-0-end-offset-expected.txt: Added.
3606 * layout-tests/fast/dom/clone-contents-0-end-offset.html: Added.
3608 2004-09-23 David Hyatt <hyatt@apple.com>
3610 Fix for hitlist bug, crash when deleting.
3612 Also fix repaint bug when inlines are inside overflow:auto/scroll regions.
3614 Reviewed by kocienda
3616 * khtml/editing/htmlediting_impl.cpp:
3617 (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
3618 (khtml::DeleteSelectionCommandImpl::doApply):
3619 * khtml/rendering/render_block.cpp:
3620 (khtml::RenderBlock::removeChild):
3621 * khtml/rendering/render_flow.cpp:
3622 (RenderFlow::getAbsoluteRepaintRect):
3624 2004-09-23 John Sullivan <sullivan@apple.com>
3628 - fixed <rdar://problem/3527840> reproducible crash at johnbrown.v32.qikker.com
3629 (nil-deref in NodeImpl::dispatchEvent)
3631 * khtml/xml/dom_nodeimpl.cpp:
3632 (NodeImpl::dispatchEvent):
3633 guard against document or document->document() being nil
3635 2004-09-23 Darin Adler <darin@apple.com>
3639 - added new VisibleRange class; not used yet
3641 * WebCore.pbproj/project.pbxproj: Added visible_range.h and visible_range.cpp.
3642 * khtml/editing/visible_range.cpp: Added.
3643 * khtml/editing/visible_range.h: Added.
3647 * kwq/WebCoreBridge.mm: (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
3648 Use switch statement instead of if statement so we get a warning if we ever add a new
3651 * khtml/editing/selection.h: khtml, not DOM, namespace
3652 * khtml/editing/visible_position.h: Ditto.
3654 2004-09-23 Darin Adler <darin@apple.com>
3658 - fixed <rdar://problem/3812758> 8S266: attaching mutation events to an editable div crashes Safari
3660 * khtml/xml/dom_nodeimpl.cpp:
3661 (NodeImpl::dispatchEvent): Added ref/deref so this works if passed a "floating" event object.
3662 (NodeImpl::dispatchGenericEvent): Ditto.
3663 (NodeImpl::dispatchHTMLEvent): Removed unneeded ref/deref now that dispatchEvent takes care of it.
3664 (NodeImpl::dispatchMouseEvent): Ditto.
3665 (NodeImpl::dispatchUIEvent): Ditto.
3667 2004-09-23 Darin Adler <darin@apple.com>
3671 - fixed some minor mistakes discovered by code inspection
3673 * khtml/khtml_part.cpp:
3674 (KHTMLPart::setSelection): Changed to not grab focus if clearing the selection.
3675 Grabbing focus when we get the selection is also probably something that should be
3676 conditional, since you can use a WebView in a mode where it can have selection even
3677 when not first responder, ala NSTextView.
3678 (KHTMLPart::setCaretVisible): Changed to not grab focus if making the caret invisible.
3679 Not sure if it's ever important to grab focus when making the caret visible, but by
3680 code inspection it seemed that was unlikely to do harm.
3682 2004-09-23 Darin Adler <darin@apple.com>
3686 - fixed <rdar://problem/3790595> "ERROR: unimplemented propertyID: 97" logged to console when copying selection (table-layout)
3688 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3689 Added CSS_PROP_TABLE_LAYOUT case.
3691 2004-09-23 Darin Adler <darin@apple.com>
3695 - fixed <rdar://problem/3809600> REGRESSION: text in search field doesn't disappear when clicked at developer.apple.com
3697 Reversing the order of scope caused us to get and set too many properties in the window
3698 object; in the case of this bug setting value ended up setting a window.value property
3699 instead of the value of the <input> element.
3701 * khtml/ecma/kjs_window.h: Removed bogus hasProperty function that always returns true.
3702 Testing shows that MacIE and Gecko match our behavior when we remove this, despite the
3703 "need this to match IE behavior" comment in the file, which I believe is incorrect.
3704 * khtml/ecma/kjs_window.cpp: Ditto.
3706 2004-09-23 Darin Adler <darin@apple.com>
3710 - fixed <rdar://problem/3812471> -[DOMRange cloneContents] clones too much in some cases where endOffset is 0
3712 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Added some nil
3713 checks to prevent this function from crashing if offsets are greater than the
3714 number of child nodes. Added a special case for offset 0 in one case that has a loop
3715 that won't work correctly for that case.
3717 2004-09-23 Darin Adler <darin@apple.com>
3721 - fixed <rdar://problem/3811890> when selecting and moving the caret, some words aren't spell-checked (test case included)
3723 This was mostly fixed by changes I made recently, but using the test case in the bug
3724 I discovered one regression I introduced and another problem that wasn't fixed yet.
3725 This change fixes both.
3727 * kwq/KWQKHTMLPart.mm:
3728 (KWQKHTMLPart::markMisspellingsInSelection): Removed unneeded inRenderedContent() check. It was returning false
3729 in cases involving a <br> at the end of line, and the check isn't all that helpful now that we use VisiblePosition,
3730 which takes care of that sort of thing for you. Changed code to determine the range to check to use the two
3731 different flavors of word boundary to expand to words we touch in both directions.
3732 (KWQKHTMLPart::updateSpellChecking): Changed to use the same logic about word boundaries. By being consistent,
3733 the anomalies reported in the bug report go away.
3735 2004-09-23 Darin Adler <darin@apple.com>
3739 - fixed <rdar://problem/3811584> REGRESSION (85-125): iframe.document undefined in function called from button onclick; works from img onclick
3741 Since we are doing a bit less "defers callbacks" work, when testing I ran into this code path.
3743 * khtml/xml/dom2_eventsimpl.cpp: (MouseEventImpl::computeLayerPos): Check for document without renderer.
3745 2004-09-23 Darin Adler <darin@apple.com>
3747 - checked in a new file I forgot
3749 * khtml/editing/text_granularity.h: Added.
3751 2004-09-22 Darin Adler <darin@apple.com>
3755 DOM::CaretPosition -> khtml::VisibleRange
3756 DOM::Selection -> khtml::Selection
3758 - moved all the functions in visible_units.h from DOM to khtml namespace
3759 - moved the one thing from Selection that KHTMLPart uses into its own header
3761 * WebCore.pbproj/project.pbxproj: Added text_granularity.h.
3763 * ForwardingHeaders/editing/selection.h: Added.
3764 * WebCore-combined.exp: Regenerated.
3765 * WebCore-tests.exp: Updated symbol for DOM::Selection debugging.
3767 * khtml/ecma/kjs_window.cpp: Update names and namespaces.
3768 * khtml/editing/htmlediting.cpp: Ditto.
3769 * khtml/editing/htmlediting.h: Ditto.
3770 * khtml/editing/htmlediting_impl.cpp: Ditto.
3771 * khtml/editing/htmlediting_impl.h: Ditto.
3772 * khtml/editing/jsediting.cpp: Ditto.
3773 * khtml/editing/selection.cpp: Ditto.
3774 * khtml/editing/selection.h: Ditto.
3775 * khtml/editing/visible_position.cpp: Ditto.
3776 * khtml/editing/visible_position.h: Ditto.
3777 * khtml/editing/visible_text.h: Ditto.
3778 * khtml/editing/visible_units.cpp: Ditto.
3779 * khtml/editing/visible_units.h: Ditto.
3780 * khtml/khtml_part.cpp: Ditto.
3781 * khtml/khtml_part.h: Ditto.
3782 * khtml/khtmlpart_p.h: Ditto.
3783 * khtml/rendering/render_block.cpp: Ditto.
3784 * khtml/xml/dom_docimpl.h: Ditto.
3785 * khtml/xml/dom_nodeimpl.cpp: Ditto.
3786 * kwq/KWQKHTMLPart.h: Ditto.
3787 * kwq/KWQKHTMLPart.mm: Ditto.
3788 * kwq/KWQRenderTreeDebug.cpp: Ditto.
3789 * kwq/WebCoreBridge.mm: Ditto.
3791 2004-09-22 Darin Adler <darin@apple.com>
3793 * ForwardingHeaders/*: Use import instead of include.
3795 2004-09-22 Darin Adler <darin@apple.com>
3797 - renamed these files:
3799 misc/khtml_text_operations.h -> editing/visible_text.h
3800 misc/khtml_text_operations.cpp -> editing/visible_text.cpp
3801 xml/dom_caretposition.cpp -> editing/visible_position.cpp
3802 xml/dom_caretposition.h -> editing/visible_position.h
3803 xml/dom_selection.cpp -> editing/selection.cpp
3804 xml/dom_selection.h -> editing/selection.h
3806 - broke out the word/line/paragraph part of visible_position.h into visible_units.h
3807 - removed some unnecessary includes from some header files to reduce the number of
3808 files that trigger "building the world"
3810 * WebCore.pbproj/project.pbxproj: Added the files under new names, removed the old ones.
3812 * ForwardingHeaders/editing/jsediting.h: Added.
3813 * ForwardingHeaders/editing/visible_text.h: Added.
3814 * ForwardingHeaders/misc/khtml_text_operations.h: Removed.
3815 * ForwardingHeaders/xml/dom_caretposition.h: Removed.
3816 * ForwardingHeaders/xml/dom_selection.h: Removed.
3818 * khtml/ecma/kjs_window.cpp: Updated or removed #include lines.
3819 * khtml/editing/htmlediting.cpp: Ditto.
3820 * khtml/editing/htmlediting.h: Ditto.
3821 * khtml/editing/htmlediting_impl.cpp: Ditto.
3822 * khtml/editing/htmlediting_impl.h: Ditto.
3823 * khtml/editing/jsediting.cpp: Ditto.
3824 * khtml/editing/selection.cpp: Ditto.
3825 * khtml/editing/selection.h: Ditto.
3826 * khtml/editing/visible_position.cpp: Ditto.
3827 * khtml/editing/visible_position.h: Ditto.
3828 * khtml/editing/visible_text.cpp: Ditto.
3829 * khtml/editing/visible_text.h: Ditto.
3830 * khtml/editing/visible_units.cpp: Added.
3831 * khtml/editing/visible_units.h: Added.
3832 * khtml/html/html_elementimpl.cpp: Updated or removed #include lines.
3833 * khtml/khtml_part.cpp: Ditto.
3834 * khtml/khtml_part.h: Ditto.
3835 * khtml/khtmlpart_p.h: Ditto.
3836 * khtml/khtmlview.cpp: Ditto.
3837 * khtml/misc/khtml_text_operations.cpp: Removed.
3838 * khtml/misc/khtml_text_operations.h: Removed.
3839 * khtml/rendering/render_block.cpp: Updated or removed #include lines.
3840 * khtml/xml/dom2_rangeimpl.cpp: Ditto.
3841 * khtml/xml/dom_caretposition.cpp: Removed.
3842 * khtml/xml/dom_caretposition.h: Removed.
3843 * khtml/xml/dom_docimpl.cpp: Updated or removed #include lines.
3844 * khtml/xml/dom_docimpl.h: Ditto.
3845 * khtml/xml/dom_elementimpl.cpp: Ditto.
3846 * khtml/xml/dom_nodeimpl.cpp: Ditto.
3847 * khtml/xml/dom_position.cpp: Ditto.
3848 * khtml/xml/dom_selection.cpp: Removed.
3849 * khtml/xml/dom_selection.h: Removed.
3850 * kwq/KWQKHTMLPart.mm: Updated or removed #include lines.
3851 * kwq/KWQKHTMLPart.h: Ditto.
3852 * kwq/KWQRenderTreeDebug.cpp: Ditto.
3853 * kwq/WebCoreBridge.mm: Ditto.
3855 2004-09-22 Richard Williamson <rjw@apple.com>
3857 Pass dashboard regions up to WebKit.
3859 Don't collect regions from RenderTexts.
3861 Made more args and return types references to avoid
3862 copying value lists.
3866 * WebCore.pbproj/project.pbxproj:
3867 * khtml/khtmlview.cpp:
3868 (KHTMLView::layout):
3869 * khtml/rendering/render_object.cpp:
3870 (RenderObject::collectDashboardRegions):
3871 * khtml/xml/dom_docimpl.cpp:
3872 (DocumentImpl::dashboardRegions):
3873 (DocumentImpl::setDashboardRegions):
3874 * khtml/xml/dom_docimpl.h:
3875 * kwq/KWQKHTMLPart.h:
3876 * kwq/KWQKHTMLPart.mm:
3877 (KWQKHTMLPart::didFirstLayout):
3878 (KWQKHTMLPart::dashboardRegionsChanged):
3879 * kwq/WebCoreBridge.h:
3880 * kwq/WebDashboardRegion.h: Added.
3881 * kwq/WebDashboardRegion.m: Added.
3882 (-[WebDashboardRegion initWithRect:type:]):
3883 (-[WebDashboardRegion copyWithZone:]):