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