1 2004-09-17 Ken Kocienda <kocienda@apple.com>
5 * layout-tests/editing/selection/unrendered-004-expected.txt: Updated expected results.
7 2004-09-17 Ken Kocienda <kocienda@apple.com>
13 <rdar://problem/3780245> REGRESSION (Mail): some lines are skipped when doing arrow navigation
15 * khtml/xml/dom_position.cpp:
16 (DOM::Position::previousLinePosition): One-line fix. Make sure that BRs at the end of blocks
19 2004-09-17 Ken Kocienda <kocienda@apple.com>
25 <rdar://problem/3805594> REGRESSION (Mail): Second return key stroke does not work when first was in blockquote
27 * khtml/xml/dom_selection.cpp:
28 (DOM::Selection::toRange): Code to convert caret positions moved the position upstream
29 before making a range-compliant position, but erroneously would allow the position
30 to cross blocks. Now it will no longer do so.
32 2004-09-16 Richard Williamson <rjw@apple.com>
34 Part 1 of the feature requested in
35 <rdar://problem/3752791> Dashboard: Need a better solution for control regions
37 This patch implements the CSS parsing necessary for dashboard regions.
38 Here's an example of the syntax we support:
42 -apple-dashboard-region:
43 dashboard-region-circle(control 0 0 80 0)
44 dashboard-region-rectangle(control,20,0,20,0)
45 dashboard-region-circle(control 80 0 0 0);
50 Part 2 will determine the appropriate regions.
54 * khtml/css/css_valueimpl.cpp:
55 (CSSPrimitiveValueImpl::CSSPrimitiveValueImpl):
56 * khtml/css/css_valueimpl.h:
57 (DOM::CSSPrimitiveValueImpl::):
58 (DOM::DashboardRegionImpl::DashboardRegionImpl):
59 (DOM::DashboardRegionImpl::~DashboardRegionImpl):
60 (DOM::DashboardRegionImpl::setNext):
61 (DOM::DashboardRegionImpl::setLabel):
62 * khtml/css/cssparser.cpp:
63 (CSSParser::parseValue):
64 (CSSParser::parseContent):
65 (skipCommaInDashboardRegion):
66 (CSSParser::parseDashboardRegions):
67 * khtml/css/cssparser.h:
68 * khtml/css/cssproperties.c:
71 * khtml/css/cssproperties.h:
72 * khtml/css/cssproperties.in:
73 * khtml/dom/css_value.h:
74 (DOM::CSSPrimitiveValue::):
76 2004-09-16 Darin Adler <darin@apple.com>
78 - fixed caret-drawing regression from my last patch
80 * khtml/xml/dom_selection.cpp:
81 (DOM::Selection::xPosForVerticalArrowNavigation): Pass false, meaning "vertical line caret"
82 rather than true meaning "big box for overtyping".
83 (DOM::Selection::layoutCaret): Ditto.
85 2004-09-16 Darin Adler <darin@apple.com>
89 - fixed <rdar://problem/3803280> crash in selectAll on page with no contents
91 * khtml/khtml_part.cpp: (KHTMLPart::selectAll): Handle case of 0 for documentElement().
92 * khtml/xml/dom_position.cpp:
93 (DOM::Position::previousWordPosition): Ditto.
94 (DOM::Position::nextWordPosition): Ditto.
96 - cleaned up caret code
97 - changed DOM::Selection to use CaretPosition more
99 * khtml/rendering/render_box.cpp: (RenderBox::caretRect): Change to use empty rectangles
100 instead of an X value of -1 to mean no rectangle.
101 * khtml/rendering/render_image.cpp: (RenderImage::selectionRect): Take advantage of the
102 fixed QRect constructor.
103 * khtml/rendering/render_object.cpp: (RenderObject::caretRect): Change to use empty
104 rectangle instead of an X value of -1 to mean no rectangle.
105 * khtml/rendering/render_text.cpp: (RenderText::caretRect): Cleaned up, and changed to use
106 an empty rectangle instead of an X value of -1 to mean no rectangle.
108 * khtml/xml/dom_caretposition.h: Made conversion from Position to CaretPosition something you
109 can do implicitly, since it's an unambiguous conversion. Conversion in the other direction
110 needs to be done explicitly. Moved EIncludeLineBreak here, and added startParagraphBoundary
111 and endParagraphBoundary functions.
112 * khtml/xml/dom_caretposition.cpp:
113 (DOM::startParagraphBoundary): Added. Replaces, and made from, member function of DOM::Position.
114 (DOM::endParagraphBoundary): Ditto.
116 * khtml/xml/dom_position.h: Removed EIncludeLineBreak and startParagraphBoundary and
117 endParagraphBoundary.
118 * khtml/xml/dom_position.cpp: Removed startParagraphBoundary and endParagraphBoundary.
120 * khtml/xml/dom_selection.h: Use CaretPosition instead of Position in a few places.
121 Use a QRect for the caret rect. Change nodeIsBeforeNode to be a static member function.
122 * khtml/xml/dom_selection.cpp:
123 (DOM::Selection::Selection): Change caret to store QRect instead of 3 separate fields.
124 (DOM::Selection::init): Ditto.
125 (DOM::Selection::operator=): Ditto.
126 (DOM::Selection::modifyExtendingRightForward): Change to use CaretPosition instead of Position.
128 (DOM::Selection::modifyMovingRightForward): Ditto. Check for 0.
129 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
130 (DOM::Selection::modifyMovingLeftBackward): Ditto.
131 (DOM::Selection::modify): Ditto.
132 (DOM::Selection::layoutCaret): Change to use a QRect for the caret rect, and use an empty
133 one to mean no rectangle.
134 (DOM::Selection::getRepaintRect): Ditto.
135 (DOM::Selection::paintCaret): Ditto.
136 (DOM::Selection::validate): Change to use CaretPosition instead of Position. Also fixed
137 PARAGRAPH_BOUNDARY, which was broken and doing the same thing as PARAGRAPH before, but
138 it's not really used so that didn't matter. Check for 0.
139 (DOM::Selection::nodeIsBeforeNode): Tightened up a bit and added some FIXMEs. This function
140 has a number of problems and should probably be discarded in favor of the DOMStringImpl
141 method that does the same thing.
143 2004-09-16 Ken Kocienda <kocienda@apple.com>
149 <rdar://problem/3787168> REGRESSION (Mail): Deleting text from the beginning of a quoted range removes the quoting from the rest
151 * khtml/editing/htmlediting_impl.cpp:
152 (khtml::DeleteSelectionCommandImpl::moveNodesAfterNode): Only move the text nodes (and their siblings) when
153 doing this move between blocks. This serves to mimic NSText behavior very well.
155 2004-09-15 Darin Adler <darin@apple.com>
157 - fixed Panther build
159 * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityActionDescription:]): Fixed backwards
160 check in #if that was compiling the code on Panther only rather than Tiger only.
162 2004-09-15 Darin Adler <darin@apple.com>
166 - fixed lockFocus exception I observed; perhaps not a real issue in the field due to exception blocking
168 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::imageFromRect): Put most of the function inside a
169 big if statement to avoid the exception we get from lockFocus otherwise.
171 2004-09-15 Darin Adler <darin@apple.com>
175 - fixed <rdar://problem/3786467> REGRESSION (Mail): Reproducible crash replying to an HTML message when your preference is for plain text composing.
177 * khtml/rendering/render_block.h: Remove removeChildrenFromLineBoxes.
178 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::removeChild): Remove calls
179 to removeChildrenFromLineBoxes which was the old way of working around this.
180 * khtml/rendering/render_flow.cpp: (RenderFlow::detach): Add comments and code to handle
181 removing children from line boxes we are about to delete.
183 2004-09-15 Richard Williamson <rjw@apple.com>
185 Fixed <rdar://problem/3781561> REGRESSION (Mail): typing in Mail became suddenly really sluggish (substitute font code)
187 A DocumentMarker may begin before the InLineBox that includes
188 it. Ensure that we correctly handle that case. The paintMarker()
189 method and code that calls it could do with some cleanup to
190 make it clearer how all the cases are handled, i.e. marker
191 within box, or intersecting beginning or end of box.
195 * khtml/rendering/render_text.cpp:
196 (InlineTextBox::paintMarker): Minimal change to ensure that we
197 handle the case of marker starting before box.
199 2004-09-15 Darin Adler <darin@apple.com>
203 - get rid of some of the localizable strings in here; we still have to figure out
204 how we're going to localize the last few role descriptions
206 * kwq/KWQAccObject.mm:
207 (-[KWQAccObject roleDescription]): Use NSAccessibilityRoleDescription for most
208 descriptions instead of a hard-coded string (inside the UI_STRING placeholder).
209 (-[KWQAccObject accessibilityActionDescription:]): Same thing, with NSAccessibilityActionDescription.
211 2004-09-15 Darin Adler <darin@apple.com>
215 - did some QRect-related changes to facilitate later bug fixing
217 * kwq/KWQPainter.h: Added fillRect overload that takes QRect to match the real Qt one.
218 * kwq/KWQPainter.mm: (QPainter::fillRect): Added overload that takes QRect.
220 * kwq/KWQRect.mm: (QRect::QRect): Change default constructed QRect to have a width and
221 height of 0 rather than 1. Contrary to what we believed earlier, this is what Qt does.
223 2004-09-15 Darin Adler <darin@apple.com>
227 - fixed <rdar://problem/3799512> REGRESSION (Mail): caret flashes 1 pixel too far to the left
229 * khtml/rendering/render_text.cpp: (RenderText::caretRect): Added one to the horizontal position
232 2004-09-15 Ken Kocienda <kocienda@apple.com>
236 * khtml/editing/htmlediting_impl.cpp:
237 (khtml::DeleteSelectionCommandImpl::doApply): The whitespace fixup code
238 that makes sure proper whitespace renders after deletion was getting confused
239 in cases where the deletion merged blocks. Basically, I needed to move some
240 whitespace fixup code so it runs before deleting in the case where blocks
241 need to be merged. It used to run after, and was getting confused by
242 whitespace left over at the ends of the block after the deletion.
243 * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Added.
244 * layout-tests/editing/deleting/delete-block-merge-contents-012.html: Added.
245 * layout-tests/editing/deleting/delete-block-merge-contents-013-expected.txt: Added.
246 * layout-tests/editing/deleting/delete-block-merge-contents-013.html: Added.
247 * layout-tests/editing/deleting/delete-block-merge-contents-014-expected.txt: Added.
248 * layout-tests/editing/deleting/delete-block-merge-contents-014.html: Added.
249 * layout-tests/editing/deleting/delete-block-merge-contents-015-expected.txt: Added.
250 * layout-tests/editing/deleting/delete-block-merge-contents-015.html: Added.
251 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt: Added.
252 * layout-tests/editing/deleting/delete-block-merge-contents-016.html: Added.
253 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Added.
254 * layout-tests/editing/deleting/delete-block-merge-contents-017.html: Added.
256 2004-09-15 Ken Kocienda <kocienda@apple.com>
260 * khtml/editing/htmlediting_impl.cpp:
261 (khtml::DeleteSelectionCommandImpl::moveNodesAfterNode): Renamed from moveNodesToBlock.
262 Just some simplification and cleanup in this function.
263 (khtml::DeleteSelectionCommandImpl::doApply): Remove a hunk of start-of-block code I thought
264 I was going to get around to improving and refining. However, I no longer need this case.
265 * khtml/editing/htmlediting_impl.h: Function name change.
267 2004-09-14 Darin Adler <darin@apple.com>
271 - added method for fix to <rdar://problem/3788894> REGRESSION (Mail): ctrl-t emacs key binding does not work (transpose)
273 * kwq/WebCoreBridge.h: Added rangeOfCharactersAroundCaret.
274 * kwq/WebCoreBridge.mm: (-[WebCoreBridge rangeOfCharactersAroundCaret]): Added.
276 * khtml/xml/dom_caretposition.h: Added range function to make a Range from two CaretPosition objects.
277 * khtml/xml/dom_caretposition.cpp:
278 (DOM::CaretPosition::rangeCompliantEquivalent): Fixed a bug in this that caused it to screw up
279 ranges in text nodes. Also changed it to use offset 0 as Ken and I discussed.
282 * kwq/DOM.mm: (-[DOMRange description]): Added.
284 2004-09-14 Darin Adler <darin@apple.com>
288 - fixed <rdar://problem/3786986> REGRESSION: TEXTAREAs have extra wide right margins where the scrollbars used to be
290 * kwq/KWQTextArea.mm:
291 (-[KWQTextArea _updateTextViewWidth]): Renamed from _frameSizeChanged. Now uses the width of
292 the size from the contentSize method rather than trying to compute a size.
293 (-[KWQTextArea initWithFrame:]): Call method by new name.
294 (-[KWQTextArea tile]): Override this instead of setFrame: to adjust the size as the size of
295 the text area changes.
297 2004-09-14 Chris Blumenberg <cblu@apple.com>
299 Backed out my changes to these files. They were not meant to be checked. (I'm having a bad CVS day)
301 * kwq/WebCoreBridge.h:
302 * kwq/WebCoreBridge.mm:
303 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]):
304 (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:]):
305 (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:]):
306 (-[WebCoreBridge replaceSelectionWithText:selectReplacement:]):
308 2004-09-14 David Hyatt <hyatt@apple.com>
310 Fix the crash in the layout tests caused by my recent selection changes. Simply eliminate the buggy
311 selection border setting code and let isSelectionBorder be implemented in terms of the SelectionState.
315 * khtml/rendering/render_canvas.cpp:
316 (RenderCanvas::setSelection):
317 * khtml/rendering/render_object.cpp:
318 (RenderObject::RenderObject):
319 (RenderObject::container):
320 (RenderObject::isSelectionBorder):
321 * khtml/rendering/render_object.h:
322 (khtml::RenderObject::minMaxKnown):
323 (khtml::RenderObject::setReplaced):
325 2004-09-14 Chris Blumenberg <cblu@apple.com>
327 Fixed: <rdar://problem/3778680> REGRESSION: plug-in content sometimes doesn't show up
331 * khtml/html/html_objectimpl.cpp:
332 (HTMLObjectElementImpl::parseHTMLAttribute): set needWidgetUpdate to true only if there is a renderer
333 (HTMLObjectElementImpl::attach): if needWidgetUpdate is true, call updateWidget
335 2004-09-14 Maciej Stachowiak <mjs@apple.com>
339 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
340 - updated escape/encodeURI layout test to match our new, more
343 * layout-tests/fast/js/global/encode-URI-test.html:
345 2004-09-14 Ken Kocienda <kocienda@apple.com>
351 <rdar://problem/3800834> REGRESSION (Mail): Can't delete backwards past quoted text using HTML editing
353 * khtml/editing/htmlediting_impl.cpp:
354 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Use CaretPosition class to get superior
355 smarts about the selection to delete in the "start of block" case. This fixes the bug.
356 While I was in the neighborhood, I cleaned up this function a bit.
357 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Added.
358 * layout-tests/editing/deleting/delete-3800834-fix.html: Added.
360 2004-09-14 Ken Kocienda <kocienda@apple.com>
364 * khtml/css/parser.cpp: Did not regenerate this file from parser.y before last checkin.
366 2004-09-14 Chris Blumenberg <cblu@apple.com>
368 Fixed typos in last check-in.
370 * khtml/khtml_part.cpp:
371 (KHTMLPart::selectClosestWordFromMouseEvent):
372 (KHTMLPart::handleMousePressEventDoubleClick):
373 * khtml/khtml_part.h:
374 * kwq/KWQKHTMLPart.mm:
375 (KWQKHTMLPart::sendContextMenuEvent):
377 2004-09-09 David Hyatt <hyatt@apple.com>
379 Fix for 3667862, regression where dragging of selection became really slow. This patch completely rewrites
380 selection painting and drawing so that the enclosing rect is much more snug. The containing block rect is no
385 * khtml/rendering/render_canvas.cpp:
386 (RenderCanvas::selectionRect):
388 (RenderCanvas::setSelection):
389 (RenderCanvas::clearSelection):
390 * khtml/rendering/render_canvas.h:
391 * khtml/rendering/render_container.cpp:
392 (RenderContainer::removeChildNode):
393 * khtml/rendering/render_image.cpp:
394 (RenderImage::selectionRect):
395 (RenderImage::selectionTintColor):
396 (RenderImage::paint):
397 * khtml/rendering/render_image.h:
398 * khtml/rendering/render_object.cpp:
399 (RenderObject::selectionStartEnd):
400 * khtml/rendering/render_object.h:
401 (khtml::RenderObject::selectionRect):
402 (khtml::RenderObject::SelectionInfo::object):
403 (khtml::RenderObject::SelectionInfo::rect):
404 (khtml::RenderObject::SelectionInfo::state):
405 (khtml::RenderObject::SelectionInfo::SelectionInfo):
406 (khtml::RenderObject::SelectionInfo::m_state):
407 * khtml/rendering/render_text.cpp:
408 (InlineTextBox::textObject):
409 (InlineTextBox::selectionRect):
410 (InlineTextBox::paintSelection):
411 (RenderText::getAbsoluteRepaintRect):
412 (RenderText::selectionRect):
413 * khtml/rendering/render_text.h:
415 (getBlendedColorComponent):
416 (QPainter::selectedTextBackgroundColor):
418 2004-09-14 Ken Kocienda <kocienda@apple.com>
424 <rdar://problem/3794376> vertical formatting lines that show quote level are missing
426 Rolling out change Dave made to fix 3787686. It turns out that we do not want this
427 change, as it does not appear to have any effect on the bug. In addition, it caused
428 the regression in quote bar behavior.
430 * khtml/css/parser.cp
433 2004-09-14 Chris Blumenberg <cblu@apple.com>
435 Fixed: Control-click shouldn't cause deselect when clicking selection.
439 * kwq/KWQKHTMLPart.mm:
440 (KWQKHTMLPart::sendContextMenuEvent): don't attempt to select the closest word when the selection is clicked
442 2004-09-14 Chris Blumenberg <cblu@apple.com>
444 Fixed badness that my last patch caused. Because there was a conflict, my last patch added stuff that darin had just removed.
448 * kwq/KWQKHTMLPart.mm:
449 (KWQKHTMLPart::sendContextMenuEvent): don't call deref on the view
451 2004-09-14 Chris Blumenberg <cblu@apple.com>
453 Fixed: <rdar://problem/3783595> REGRESSION (Mail): control-click does not select closest word
455 Reviewed by kocienda.
457 * khtml/khtml_part.cpp:
458 (KHTMLPart::selectionGranularity): new getter, need this for an upcoming patch
459 (KHTMLPart::selectClosetWordFromMouseEvent): new, factored from handleMousePressEventDoubleClick
460 (KHTMLPart::handleMousePressEventDoubleClick): call selectClosetWordFromMouseEvent
461 * khtml/khtml_part.h:
462 * kwq/KWQKHTMLPart.mm:
463 (KWQKHTMLPart::sendContextMenuEvent): call selectClosetWordFromMouseEvent if nothing swallows the event
465 2004-09-14 Ken Kocienda <kocienda@apple.com>
471 <rdar://problem/3800346> Inserting newline in BR after block not working
473 * khtml/editing/htmlediting_impl.cpp:
474 (khtml::InputNewlineCommandImpl::doApply): The code to insert the "extra" BR at the end
475 of blocks (hack done to make BRs show up when they appear at the ends of blocks) did not
476 cover this one quirky case where the insertion point can be placed in a BR at the end of
477 a block that does actually render. Now the input newline code can handle this addtional
479 * layout-tests/editing/selection/insert-3800346-fix-expected.txt: Added.
480 * layout-tests/editing/selection/insert-3800346-fix.html: Added.
482 2004-09-14 Darin Adler <darin@apple.com>
486 - fixed <rdar://problem/3479392> REGRESSION (Mail): select all does not select all at some pages
488 * khtml/xml/dom_caretposition.cpp: (DOM::CaretPosition::deepEquivalent):
489 Use caretMaxOffset instead of maxOffset when descending to the last node.
490 Also change around the function a bit.
492 2004-09-13 Darin Adler <darin@apple.com>
496 - fixed <rdar://problem/3710123> Loading iframe that replaces content in the parent document crashes Safari (Oracle Portal)
498 This is a more complete fix, but it requires the previous attempt at a fix for this same
499 bug below, because this is only the "don't destroy the KHTMLPart" portion; other fixes are
500 still needed to survive shutdown of the part.
502 * khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::interpreter): Call the new keepAlive method.
503 This is called whenever we're about to use an interpreter to run some JavaScript, and
504 it's JavaScript that might destroy the part, hence the interpreter.
506 * khtml/khtml_part.h: Added keepAlive() and slotEndLifeSupport() member functions.
507 * khtml/khtmlpart_p.h: Added m_lifeSupportTimer.
508 * khtml/khtml_part.cpp:
509 (KHTMLPart::init): Connects m_lifeSupportTimer to slotEndLifeSupport.
510 (KHTMLPart::write): Removed old attempt to work around this issue.
511 (KHTMLPart::end): Ditto.
512 (KHTMLPart::keepAlive): Added. References the part, then sets up a one-shot timer.
513 (KHTMLPart::slotEndLifeSupport): Added. Stops the timer and then removes the reference
514 from the part, possibly destroying it.
517 (KWQSlot::KWQSlot): Added the new slot to the list of slots.
518 (KWQSlot::call): Ditto.
520 * kwq/KWQKHTMLPart.mm:
521 (KWQKHTMLPart::sendResizeEvent): Removed an old attempt to work around this same issue.
522 (KWQKHTMLPart::mouseDown): Ditto.
523 (KWQKHTMLPart::mouseDragged): Ditto.
524 (KWQKHTMLPart::mouseUp): Ditto.
525 (KWQKHTMLPart::mouseMoved): Ditto.
526 (KWQKHTMLPart::sendContextMenuEvent): Ditto.
528 2004-09-13 Darin Adler <darin@apple.com>
532 - fixed regression caused by change earlier today
534 * khtml/xml/dom_selection.cpp: (DOM::Selection::modifyExtendingRightForward):
535 Use CaretPosition for CHARACTER, not WORD.
537 2004-09-13 Darin Adler <darin@apple.com>
541 - fixed <rdar://problem/3798453> DIG failure: getting variable with same name as DOM element attribute gets attribute value instead
543 * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): When adding current target and
544 other event handler scope, put it below the existing scope chain. This ensures that things
545 found in the function's scope will come before the event handler, as in other browsers.
547 2004-09-13 Ken Kocienda <kocienda@apple.com>
553 <rdar://problem/3798346> REGRESSION (125-162): crash pushing down arrow key on KLM.com site
555 * khtml/xml/dom_position.cpp:
556 (DOM::Position::nextLinePosition): This function was being called in a case where it was not expected
557 until we traced the code. It has to do with some deeper issues associated with handling arrow keys,
558 resulting in the editing arrow-down code running in a case where we are not editing. I discussed this
559 with Darin, and we decided to handle the broader issues at a later date. The fix I am checking in
560 here to fix the bug is merely avoiding a null-deref.
562 2004-09-13 Ken Kocienda <kocienda@apple.com>
568 <rdar://problem/3784840> REGRESSION (Mail): Text is inserted in the wrong place after changing typing style
570 * khtml/editing/htmlediting_impl.cpp:
571 (khtml::InputTextCommandImpl::prepareForTextInsertion): Code to handle typing style did not
572 check to see if the reference node used for the DOM node insertion operation was a block.
573 If it is, then the new node containing the new editing style now is inserted at the start of the block,
576 2004-09-13 Ken Kocienda <kocienda@apple.com>
580 Added a couple new layout tests to cover recent changes.
582 * layout-tests/editing/editing.js: Added some new functions to do by-word selection movement.
583 * layout-tests/editing/selection/move-backwords-by-word-001-expected.txt: Added.
584 * layout-tests/editing/selection/move-backwords-by-word-001.html: Added.
585 * layout-tests/editing/selection/selection-3748164-fix-expected.txt: Added.
586 * layout-tests/editing/selection/selection-3748164-fix.html: Added.
588 2004-09-13 Ken Kocienda <kocienda@apple.com>
594 <rdar://problem/3765519> REGRESSION (Mail): word movement goes too far upstream at start of line
596 * khtml/xml/dom_position.cpp:
597 (DOM::Position::previousWordPosition): Use downstream position here when making final placement of caret.
599 2004-09-13 Ken Kocienda <kocienda@apple.com>
603 Various editing improvements, many focused on the improvements made possible by the
604 new CaretPosition class.
606 Includes fixes for these bugs:
608 <rdar://problem/3748164> REGRESSION (Mail): Arrow navigation in typical mail message can result in stuck caret
609 <rdar://problem/3782062> REGRESSION (Mail): option-delete can delete almost all of a message when it has trouble finding a word
610 <rdar://problem/3790456> triple click does not select entire paragraph (folklore.org)
612 * WebCore.pbproj/project.pbxproj: Added CaretPosition class files.
613 * khtml/dom/dom2_range.h:
614 (DOM::offsetInCharacters): Moved this helper here from khtml_text_operations.cpp. This
615 function helps to determine how to interpret the offsets used in DOM Ranges.
616 * khtml/editing/htmlediting_impl.cpp:
617 (khtml::InputNewlineCommandImpl::doApply): Use CaretPosition class to make "end-of-block" determination.
618 Also, fix a caret placement glitch in "case 1" in the code: Place the caret in the node after the inserted
619 BR. This makes it show up in the right place.
620 * khtml/khtml_part.cpp:
621 (KHTMLPart::handleMousePressEventDoubleClick): Don't limit double-click and triple-click handling only to text nodes.
622 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
623 (KHTMLPart::selectAll): Use CaretPosition class to implement improved selectAll.
624 * khtml/misc/khtml_text_operations.cpp:
625 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): Make a fix to the initial state setting of
626 m_handledChildren. This is true if the offset into the end node is 0, meaning that we do not want to descend
627 into its children at all.
628 * khtml/xml/dom_caretposition.cpp: Added.
629 * khtml/xml/dom_caretposition.h: Added.
630 * khtml/xml/dom_nodeimpl.cpp:
631 (NodeImpl::traverseNextNode): Fix bugs with the stayWithin implementation. We could miss nodes we want to test
632 due to an erroneous check of stayWithin when no such check is needed.
633 (NodeImpl::traverseNextSibling): Ditto.
634 (NodeImpl::traversePreviousNodePostOrder): Ditto.
635 * khtml/xml/dom_position.cpp:
636 (DOM::Position::Position): Remove spurious semi-colon.
637 (DOM::Position::upstream): Move incoming Position to its equivalentDeepPosition. This is part of the transition
638 that will make this code work better with increased use of CaretPosition.
639 (DOM::Position::downstream): Ditto.
640 (DOM::Position::atStartOfContainingEditableBlock): Removed. Dead code; was not being called.
641 (DOM::Position::atStartOfRootEditableElement): Removed. Dead code; was not being called.
642 (DOM::Position::isLastRenderedPositionInEditableBlock): Removed. Replaced with calls to CaretPosition class.
643 (DOM::Position::inLastEditableInRootEditableElement): Removed. Dead code; was not being called.
644 (DOM::Position::inFirstEditableInRootEditableElement): Removed. Was only being called by other code that has been removed.
645 * khtml/xml/dom_position.h:
646 * khtml/xml/dom_selection.cpp:
647 (DOM::Selection::modifyExtendingRightForward): Moved implementation of CHARACTER case to use CaretPosition class instead
648 of Position class helpers.
649 (DOM::Selection::modifyMovingRightForward): Ditto.
650 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
651 (DOM::Selection::modifyMovingLeftBackward): Ditto.
652 (DOM::Selection::validate): Made simplifications in code that used to call a concoction of Position class helpers to
653 do the right thing. Now calls CaretPosition equivalents.
655 2004-09-13 Ken Kocienda <kocienda@apple.com>
659 This test was broken. The result is that it was not testing what it was supposed to
660 be testing. I fixed the test and updated the expected results.
662 * layout-tests/editing/selection/move-between-blocks-no-001-expected.txt
663 * layout-tests/editing/selection/move-between-blocks-no-001.html
665 2004-09-13 Ken Kocienda <kocienda@apple.com>
671 <rdar://problem/3784835> REGRESSION (Mail): crash in DOM::ElementImpl::tagName inside delete text command code while editing a Mail message
672 <rdar://problem/3788015> REGRESSION (Mail): Crash deleting before a blockquote
673 <rdar://problem/3796366> REGRESSION (Mail): Crash Mail by deleting the right line from pasted HTML
675 * khtml/editing/htmlediting_impl.cpp:
676 (khtml::DeleteSelectionCommandImpl::doApply): All of these bugs are due to the same problem. When I
677 made the delete command run even when the text is a caret (to make block merges work right when the
678 caret is at the start of a block), I failed to handle one case when there might be no text to
679 delete. This resulted in a call to the DeleteTextCommand with a zero-length deletion request.
680 This is not supported. Now, I have added an additional test in this one place in the code that
681 was causing all these failures.
683 2004-09-12 Darin Adler <darin@apple.com>
687 - fixed <rdar://problem/3797758> REGRESSION (155-156): Cannot tab between input fields at switchboard.com
689 * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Use setFocus() instead of calling makeFirstResponder
690 directly since it handles the case where the field editor has focus.
692 2004-09-12 Darin Adler <darin@apple.com>
696 - fixed <rdar://problem/3792082> zero character codes in UTF-16 input cause crash
698 * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertUTF16): Fixed code that was using the wrong variable
699 to decrement the input length, causing buffer overrun.
701 2004-09-12 Darin Adler <darin@apple.com>
705 - fixed <rdar://problem/3798240> computed style error log messages seen with numbers in the range 74-77
707 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
708 Added implementations for CSS_PROP__KHTML_MARQUEE_INCREMENT, CSS_PROP_MAX_HEIGHT, CSS_PROP_MAX_WIDTH,
709 CSS_PROP_MIN_HEIGHT, CSS_PROP_MIN_WIDTH, and CSS_PROP_VISIBILITY.
711 2004-09-12 Darin Adler <darin@apple.com>
713 * layout-tests/css1/text_properties/text-transform-expected.txt: Removed unused test result.
715 2004-09-11 Maciej Stachowiak <mjs@apple.com>
719 <rdar://problem/3787208> can't log in to SAP SDN site (JS parse error)
722 (KURL::decode_string): Check for find result >= 0 instead of >0,
723 to handle case of first character in a string being encoded.
725 2004-09-09 Chris Blumenberg <cblu@apple.com>
727 Support for: <rdar://problem/3795485> debug menu item to enable RSS animation on first layout
731 * khtml/khtml_part.h:
732 (KHTMLPart::didFirstLayout): new
733 * khtml/khtmlview.cpp:
734 (KHTMLView::layout): call didFirstLayout
735 * kwq/KWQKHTMLPart.h:
736 * kwq/KWQKHTMLPart.mm:
737 (KWQKHTMLPart::didFirstLayout): new
738 * kwq/WebCoreBridge.h:
742 2004-09-09 Maciej Stachowiak <mjs@apple.com>
744 - roll out the last change, it appears to cause a performance regression
746 * khtml/rendering/render_box.cpp:
747 (RenderBox::caretRect):
748 * khtml/rendering/render_box.h:
749 * khtml/rendering/render_br.cpp:
750 (RenderBR::caretRect):
751 * khtml/rendering/render_br.h:
752 * khtml/rendering/render_flow.cpp:
753 (RenderFlow::caretRect):
754 * khtml/rendering/render_flow.h:
755 * khtml/rendering/render_object.cpp:
756 (RenderObject::caretRect):
757 * khtml/rendering/render_object.h:
758 * khtml/rendering/render_text.cpp:
759 (RenderText::caretRect):
760 * khtml/rendering/render_text.h:
761 * kwq/WebCoreBridge.h:
762 * kwq/WebCoreBridge.mm:
764 2004-09-08 Maciej Stachowiak <mjs@apple.com>
768 WebCore part of fix for:
770 <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
772 * kwq/WebCoreBridge.h:
773 * kwq/WebCoreBridge.mm:
774 (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
775 DOMRange, or if the range is split into multiple lines, the rect for the part on
778 * khtml/rendering/render_object.cpp:
779 (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
780 for the overrides below.
781 * khtml/rendering/render_object.h:
782 * khtml/rendering/render_box.cpp:
783 (RenderBox::caretRect):
784 * khtml/rendering/render_box.h:
785 * khtml/rendering/render_br.cpp:
786 (RenderBR::caretRect):
787 * khtml/rendering/render_br.h:
788 * khtml/rendering/render_flow.cpp:
789 (RenderFlow::caretRect):
790 * khtml/rendering/render_flow.h:
791 * khtml/rendering/render_text.cpp:
792 (RenderText::caretRect):
794 2004-09-06 Darin Adler <darin@apple.com>
798 - fixed <rdar://problem/3790526> mark-related methods not implemented (needed for people with them in their key bindings files)
800 * khtml/khtml_part.h: Added mark and setMark.
801 * khtml/khtmlpart_p.h: Added m_mark.
802 * khtml/khtml_part.cpp:
803 (KHTMLPart::mark): Added.
804 (KHTMLPart::setMark): Added.
806 * kwq/KWQKHTMLPart.h: Change name of markedRange to markedTextRange to decrease
807 the change it will be confused with the mark.
808 * kwq/KWQKHTMLPart.mm:
809 (KWQKHTMLPart::clear): Update for name change.
810 (KWQKHTMLPart::markedTextRange): Ditto.
811 (KWQKHTMLPart::setMarkedTextRange): Ditto.
813 * khtml/rendering/render_text.cpp: (RenderText::paint): Update for name change.
815 * kwq/WebCoreBridge.h: Remove setSelectionFrom, selectionStart, selectionStartOffset,
816 selectionEnd, selectionEndOffset, and clearMarkedDOMRange. Renamed setMarkedDOMRange
817 to setMarkedTextDOMRange and markedDOMRange to markedTextDOMRange. Added setMarkDOMRange
818 and markDOMRange for the Emacs "mark".
819 * kwq/WebCoreBridge.mm:
820 (-[WebCoreBridge setMarkDOMRange:]): Added.
821 (-[WebCoreBridge markDOMRange]): Added.
822 (-[WebCoreBridge setMarkedTextDOMRange:]): Renamed.
823 (-[WebCoreBridge markedTextDOMRange]): Renamed.
825 * khtml/xml/dom_selection.cpp: (DOM::Selection::validate): Make paragraph positions
826 canonical by using deep rendered positions. Maybe someday this won't be an ad hoc
829 * khtml/xml/dom_nodeimpl.cpp: (NodeBaseImpl::removeChildren): Use ref and deref
830 rather than the unconventional check for 0 refCount. This makes us a bit more
831 robust against a node going away partway through the removal process.
833 * WebCore.pbproj/project.pbxproj: Update MACOSX_DEPLOYMENT_TARGET to 10.3.
835 2004-09-08 Maciej Stachowiak <mjs@apple.com>
837 - fixed deployment build problems noticed by Grant
839 * khtml/rendering/render_flow.cpp:
840 (RenderFlow::caretRect):
841 * khtml/rendering/render_text.cpp:
842 (RenderText::caretRect):
844 2004-09-08 David Hyatt <hyatt@apple.com>
846 Fix XML so that elements with no namespace never make HTML elements (when their names coincidentally match).
850 * khtml/xml/dom_docimpl.cpp:
851 (DocumentImpl::createElementNS):
853 2004-09-07 Maciej Stachowiak <mjs@apple.com>
857 - renamed caretPos to caretRect and made it return a QRect instead
858 of taking four out parameters by reference.
860 * khtml/rendering/render_box.cpp:
861 (RenderBox::caretRect):
862 * khtml/rendering/render_box.h:
863 * khtml/rendering/render_br.cpp:
864 (RenderBR::caretRect):
865 * khtml/rendering/render_br.h:
866 * khtml/rendering/render_flow.cpp:
867 (RenderFlow::caretRect):
868 * khtml/rendering/render_flow.h:
869 * khtml/rendering/render_object.cpp:
870 (RenderObject::caretRect):
871 * khtml/rendering/render_object.h:
872 * khtml/rendering/render_text.cpp:
873 (RenderText::caretRect):
874 * khtml/rendering/render_text.h:
875 * khtml/xml/dom_selection.cpp:
876 (DOM::Selection::xPosForVerticalArrowNavigation):
877 (DOM::Selection::layoutCaret):
878 * kwq/WebCoreBridge.mm:
879 (-[WebCoreBridge caretRectAtNode:offset:]):
881 2004-09-07 Maciej Stachowiak <mjs@apple.com>
885 <rdar://problem/3759209> REGRESSION (Mail): assertion failure when all of marked text deleted at start of document
887 * kwq/KWQKHTMLPart.mm:
888 (KWQKHTMLPart::setMarkedRange): Allow any empty range, even if
889 it's not in a text node, since in this case it won't matter and
890 weird things can happen when all marked text is removed, there
891 might not be any text nodes.
893 2004-09-07 David Hyatt <hyatt@apple.com>
895 Initial text-decoration CSS3 work for editing. Just gets the properties and values parsed.
899 * khtml/css/css_computedstyle.cpp:
900 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
901 * khtml/css/cssparser.cpp:
902 (CSSParser::parseValue):
903 * khtml/css/cssproperties.c:
906 * khtml/css/cssproperties.h:
907 * khtml/css/cssproperties.in:
908 * khtml/css/cssstyleselector.cpp:
909 (khtml::CSSStyleSelector::adjustRenderStyle):
910 * khtml/css/cssvalues.c:
913 * khtml/css/cssvalues.h:
914 * khtml/css/cssvalues.in:
916 2004-09-06 Maciej Stachowiak <mjs@apple.com>
918 Reviewed by Darin and Ken.
920 <rdar://problem/3655568> window.open fails when URL contains trailing space
923 (KURL::KURL): Strip trailing and leading space when resolving relative URLs in all
924 cases, instead of just leading in the non-absolute case as before.
926 - refactored KURL constructor to put more work in separate
927 functions and also to change static methods to static functions,
928 to avoid having to change the header when only changing helper
929 functions that do not affect the KURL API (since KURL.h is widely
934 (findHostnamesInMailToURL):
935 (findHostnameInHierarchicalURL):
937 (encodeRelativeString):
938 (substituteBackslashes):
941 - add missing include of qvaluelist.h
943 * khtml/ecma/kjs_dom.h:
945 2004-09-06 Darin Adler <darin@apple.com>
949 - fixed <rdar://problem/3512066> REGRESSION (Mail): Select All highlights only part of the content, though all is copied
950 - fixed <rdar://problem/3157025> REGRESSION (Mail): Should select paragraph instead of line on triple-click
951 - fixed <rdar://problem/3735048> REGRESSION (Mail): HTML editing must select newline on triple click
952 - fixed <rdar://problem/3788872> REGRESSION (Mail): ctrl-a emacs key binding does not work (move to start of paragraph)
953 - fixed <rdar://problem/3788881> REGRESSION (Mail): ctrl-e emacs key binding does not work (move to end of paragraph)
954 - fixed <rdar://problem/3789931> REGRESSION (Mail): typing style lost when you backspace
955 - added code to select inserted text to help WebKit implement yankAndSelect:
956 - did some clean-up on editing commands code
958 * khtml/khtml_part.cpp:
959 (KHTMLPart::handleMousePressEventTripleClick): Expand to a paragraph, not a line.
960 (KHTMLPart::selectAll): Remove a lot of unneeded code and just expand to document using Selection.
961 (KHTMLPart::selectionHasStyle): Remove check that limited us to only HTML elements, and add
962 a check for nil. Together, these two changes fix a few cases I ran into during testing.
964 * khtml/rendering/render_canvas.cpp: (RenderCanvas::setSelection): Fix test that was checking if
965 the old selection spanned multiple objects when it really should have checked whether the new
966 new selection spans multiple objects. This caused the select all redraw bug.
968 * khtml/editing/htmlediting.h: Fixed indenting. Remove command IDs, replacing them with a couple
969 of specific type checking methods, and SharedCommandImpl, using EditCommandImpl directly instead.
970 Got rid of virtual functions, since the command objects have no data members other than the ones
971 inherited from SharedPtr. Removed explicit copy constructors and destructors. Removed unneeded
972 empty constructors. Removed inline directives that were having no effect. Added some boolean
973 selectInsertedText parameter to some commands. Made almost all member functions const, because
974 the const here applies to the command object which is a smart pointer, not the pointed-to
975 command implementation object.
976 * khtml/editing/htmlediting.cpp:
977 (khtml::EditCommand::EditCommand): Changed since SharedPtr is now a pointer to EditCommandImpl.
978 (khtml::EditCommand::operator=): Added. By defining this explicitly, we don't need the class
979 that we are pointing to defined in the header, which lets us get rid of SharedCommandImpl.
980 (khtml::EditCommand::isInputTextCommand): Added.
981 (khtml::EditCommand::isTypingCommand): Added.
982 (khtml::EditCommand::setParent): Updated since EditCommandImpl.setParent takes an impl pointer now.
983 (khtml::EditCommand::handle): Removed, since it's identical to get().
984 (khtml::InputTextCommand::input): Added selectInsertedText parameter.
985 (khtml::TypingCommand::TypingCommand): Ditto.
986 (khtml::TypingCommand::insertText): Ditto.
987 (khtml::TypingCommand::isOpenForMoreTypingCommand): Use isTypingCommand instead of commandID.
988 (khtml::TypingCommand::closeTyping): Change parameter type to const reference.
990 * khtml/editing/htmlediting_impl.h: Made StyleChange functions be const member functions.
991 Changed parent() and setParent() to take and return EditCommandImpl pointers and be inlined.
992 Added virtual isInputTextCommand, isTypingCommand, and preservesTypingStyle functions.
993 Removed commandID functions and unneeded explicit destructors. Removed unneeded doApply
994 function declaration in CompositeEditCommandImpl. Changed type of applyTypingStyle to return
995 a node, not necessarily an element. Removed private execute function from InputTextCommandImpl.
996 Added selectInsertedText to InputTextCommandImpl's input function and TypingCommandImpl's constructor
997 and insertText function.
998 * khtml/editing/htmlediting_impl.cpp:
999 (khtml::StyleChange::StyleChange): Don't bother initializing the booleans since init handles that.
1000 (khtml::StyleChange::init): Added code to strip whitespace, and tweaked how the function does its job.
1001 (khtml::StyleChange::currentlyHasStyle): Added a check for null value, which can happen for properties
1002 where we don't have computed style implemented yet.
1003 (khtml::EditCommandImpl::EditCommandImpl): Updated since there is no SharedCommandImpl any more.
1004 (khtml::EditCommandImpl::apply): Call new preservesTypingStyle function rather than checking
1005 the command ID. This preserves typing style when deleting with the keyboard.
1006 (khtml::EditCommandImpl::setStartingSelection): Changed since parent is now a EditCommandImpl.
1007 Also rewrote to use for loop so it's simpler-looking.
1008 (khtml::EditCommandImpl::setEndingSelection): Ditto.
1009 (khtml::EditCommandImpl::setTypingStyle): Ditto.
1010 (khtml::EditCommandImpl::preservesTypingStyle): Added. Returns false.
1011 (khtml::EditCommandImpl::isInputTextCommand): Added. Returns false.
1012 (khtml::EditCommandImpl::isTypingCommand): Added. Returns false.
1013 (khtml::CompositeEditCommandImpl::applyTypingStyle): Changed this function to return a node rather
1014 than an element. Also change it so it returns the child as-is if the style change has nothing in it.
1015 (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl): Removed unneeded null checks.
1016 (khtml::DeleteSelectionCommandImpl::preservesTypingStyle): Added. Returns true.
1017 (khtml::DeleteTextCommandImpl::~DeleteTextCommandImpl): Removed unneeded null checks.
1018 (khtml::InputTextCommandImpl::input): Renamed execute function to input and got rid of the additional
1019 level of indirection, since it was the only caller. Added selectInsertedText parameter and changed
1020 the code so it will respect it.
1021 (khtml::InputTextCommandImpl::isInputTextCommand): Added. Returns true.
1022 (khtml::InsertNodeBeforeCommandImpl::~InsertNodeBeforeCommandImpl): Removed unneeded null checks.
1023 (khtml::JoinTextNodesCommandImpl::~JoinTextNodesCommandImpl): Ditto.
1024 (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): Hold a reference to the fragment
1025 while the command exists.
1026 (khtml::MoveSelectionCommandImpl::~MoveSelectionCommandImpl): Release the fragment.
1027 (khtml::RemoveNodeCommandImpl::~RemoveNodeCommandImpl): Remove unneeded null checks.
1028 (khtml::RemoveNodeCommandImpl::doUnapply): Take advantage of defined behavior of insertBefore when
1029 the node to insert before is 0 (means the same thing as appendChild).
1030 (khtml::RemoveNodePreservingChildrenCommandImpl::~RemoveNodePreservingChildrenCommandImpl):
1031 Remove unneeded null check.
1032 (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl): Hold a reference to the fragment
1033 while the command exists.
1034 (khtml::ReplaceSelectionCommandImpl::~ReplaceSelectionCommandImpl): Release the fragment.
1035 (khtml::SetNodeAttributeCommandImpl::~SetNodeAttributeCommandImpl): Remove unneeded null check.
1036 (khtml::SplitTextNodeCommandImpl::~SplitTextNodeCommandImpl): Remove unneeded null check.
1037 (khtml::TypingCommandImpl::TypingCommandImpl): Added selectInsertedText parameter.
1038 (khtml::TypingCommandImpl::doApply): Pass along selectInsertedText parameter.
1039 (khtml::TypingCommandImpl::insertText): Ditto.
1040 (khtml::TypingCommandImpl::preservesTypingStyle): Added. Returns true for DeleteKey.
1041 (khtml::TypingCommandImpl::isTypingCommand): Added. Returns true.
1043 * khtml/editing/jsediting.cpp: Add a cut at implementing the underline command. May not work
1044 perfectly yet because text-decoration is not inherited the way, say, font-weight is.
1046 * khtml/xml/dom_selection.h: Removed some unneeded friend declarations for comparison operators
1047 that use only public members. Added PARAGRAPH_BOUNDARY.
1048 * khtml/xml/dom_selection.cpp:
1049 (DOM::Selection::modifyExtendingRightForward): Implemented paragraph boundary case, simplified line
1050 boundary case (by changing parameter types and function names, not the algorithm), and made
1051 paragraph case fall into line case for now.
1052 (DOM::Selection::modifyMovingRightForward): Ditto.
1053 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
1054 (DOM::Selection::modifyMovingLeftBackward): Ditto.
1055 (DOM::Selection::validate): Implemented paragraph case and paragraph boundary case, simplified the
1056 line case as above and also fixed the document case.
1057 (DOM::startOfFirstRunAt): Changed to use DOM::Position instead of node
1058 offset pairs. Also renamed and got rid of separate bool to indicate "not found".
1059 (DOM::endOfLastRunAt): Ditto.
1060 (DOM::selectionForLine): Ditto.
1062 * khtml/xml/dom_position.h: Added startParagraphBoundary and endParagraphBoundary.
1063 Also used enums instead of bools in a couple of places. Removed some unneeded friend
1064 declarations for comparison operators that use only public members.
1065 * khtml/xml/dom_position.cpp:
1066 (DOM::Position::Position): Coding style tweak.
1067 (DOM::Position::startParagraphBoundary): Added.
1068 (DOM::Position::endParagraphBoundary): Added.
1069 (DOM::Position::upstream): Use enum parameter instead of bool.
1070 (DOM::Position::downstream): Ditto.
1071 (DOM::Position::rendersOnSameLine): Removed unused function. Noticed some backwards logic
1072 here, and removed it rather than fixing it.
1074 * khtml/xml/dom_nodeimpl.h: Added traversePreviousNodePostOrder.
1075 * khtml/xml/dom_nodeimpl.cpp:
1076 (NodeImpl::traversePreviousNodePostOrder): Added. For some uses, this function is more analogous
1077 to traverseNextNode in reverse than traversePreviousNode, which does a backwards pre-order traversal.
1079 * kwq/WebCoreBridge.h: Replaced fontForCurrentPosition method with fontForSelection:, added
1080 selectInsertedText parameter to insertText method, and added selectionStartHasStyle: method.
1081 Add WebSelectToParagraphBoundary.
1082 * kwq/WebCoreBridge.mm:
1083 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Added workaround for bug where isRenderedContent
1084 returns false for <br> elements at the ends of lines.
1085 (-[WebCoreBridge insertText:selectInsertedText:]): Added selectInsertedText parameter, passing it
1086 along to TypingCommand::insertText.
1087 (-[WebCoreBridge selectionStartHasStyle:]): Added. Calls code in the part that does the real work.
1088 (-[WebCoreBridge fontForSelection:]): Ditto.
1090 * kwq/KWQKHTMLPart.h: Renamed fontForCurrentPosition to fontForSelection, and added a feature
1091 where it tells us whether there are multiple fonts in the selection or not.
1092 * kwq/KWQKHTMLPart.mm:
1093 (KWQKHTMLPart::fontForSelection): Rewrote this to be a bit simpler, and added code to detect
1094 whether there are multiple fonts in the selection.
1095 (KWQKHTMLPart::didTellBridgeAboutLoad): Use a global character rather than a bad pointer here.
1096 Better not to rely on undefined behavior.
1097 (KWQKHTMLPart::documentFragmentWithText): Use lowercase HTML. I believe this works better when
1098 the document is XML, and we should probably visit all callers and change them.
1099 (KWQKHTMLPart::registerCommandForUndo): Call get() instead of handle().
1100 (KWQKHTMLPart::registerCommandForRedo): Call get() instead of handle().
1102 * khtml/misc/shared.h: Added a private, non-implemented copy constructor and assignment
1103 operator to Shared<> and TreeShared<> to prevent copying reference counts by accident.
1104 * khtml/rendering/render_style.h: Get rid of Shared<BorderData>, since it's not used that way.
1105 This makes BorderData smaller, and allows it to compile with the change to Shared<>.
1106 * khtml/xml/dom_docimpl.h: Remove unneeded copy constructor on DocumentFragmentImpl,
1107 which ran afoul of the change to Shared<> and was unused.
1108 * khtml/xml/dom_docimpl.cpp: Ditto.
1109 * khtml/xml/dom_stringimpl.cpp:
1110 (DOM::DOMStringImpl::empty): Changed code around so it doesn't run afoul of the change to
1111 Shared<>. The old code was copying a DOMStringImpl.
1112 (DOM::DOMStringImpl::ascii): Added code to null-terminate the string buffer.
1114 2004-09-06 Darin Adler <darin@apple.com>
1118 - improved computed style code and implemented text-decoration and text-shadow (needed for, e.g., underline)
1120 * khtml/css/css_computedstyle.cpp:
1121 Added CSS_PROP_TEXT_DECORATION to the InheritableProperties array for now even though it's
1122 not inheritable. This makes underline work in some cases for typing style. We may decide to
1123 take it back out again after further consideration.
1124 (DOM::valueForLength): Use IDs in primitive values rather than strings.
1125 (DOM::valueForBorderStyle): Ditto, also renamed this.
1126 (DOM::valueForTextAlign): More of the same.
1127 (DOM::valueForShadow): Added this function.
1128 (DOM::CSSComputedStyleDeclarationImpl::getPositionOffsetValue): More IDs in primitive values.
1129 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Changed all the cases to use
1130 IDs instead of strings in primitive values. Also put the style in a local variable for
1131 better code size and smaller source code too. Added implementation for CSS_PROP_TEXT_DECORATION
1132 and CSS_PROP_TEXT_SHADOW.
1134 * khtml/css/css_valueimpl.cpp:
1135 (CSSValueListImpl::cssText): Put commas between list elements.
1136 (CSSPrimitiveValueImpl::cssText): Fixed some messed up indenting and removed an unneeded
1137 default case that would just prevent a warning if we ever have an unhandled enum value.
1139 2004-09-06 Darin Adler <darin@apple.com>
1143 - did some clean-up on form data code
1145 * khtml/misc/formdata.h: Added more public functions as suggested by Chris when he reviewed
1147 * khtml/misc/formdata.cpp: (khtml::FormData::appendFile): Added. Will be needed soon.
1148 * kwq/KWQFormData.mm: (arrayFromFormData): Use new cleaned-up FormData API.
1150 2004-09-06 Darin Adler <darin@apple.com>
1154 * kwq/DOM-CSS.mm: (-[DOMCSSStyleDeclaration description]): Use cssText in the description
1155 so it's easier to see in the debugger.
1157 2004-09-06 Darin Adler <darin@apple.com>
1161 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::send): Remove uneeded QCString copy.
1163 2004-09-04 Richard Williamson <rjw@apple.com>
1165 Fix build problem on panther.
1167 * khtml/ecma/kjs_html.cpp:
1168 * khtml/rendering/render_canvasimage.h:
1170 2004-09-03 David Hyatt <hyatt@apple.com>
1172 Simple tweak to background-attachment. Don't apply the slow repaint flag until after the whole style has been
1173 resolved, since while cascading someone may set the attachment to fixed but later override with scroll.
1175 * khtml/css/cssstyleselector.cpp:
1176 (khtml::CSSStyleSelector::adjustRenderStyle):
1177 (khtml::CSSStyleSelector::applyProperty):
1179 2004-09-03 Richard Williamson <rjw@apple.com>
1181 Fixed <rdar://problem/3781001>: redirection of URL via resource load delegate does not correctly set base URL for subsequent loads
1183 Ensure that stylesheets have the correct URL when request
1188 * khtml/misc/loader.cpp:
1189 (CachedCSSStyleSheet::checkNotify):
1192 (KWQIsResponseURLEqualToURL):
1195 * khtml/ecma/kjs_html.cpp:
1196 (KJS::Context2DFunction::tryCall):
1197 Compare parameter count with == instead of <=.
1199 2004-09-03 David Hyatt <hyatt@apple.com>
1201 Fix for 3779083, deleting large amount of text is really slow. Don't use NodeLists in editing remove commands.
1205 * khtml/editing/htmlediting_impl.cpp:
1206 (khtml::RemoveNodeCommandImpl::RemoveNodeCommandImpl):
1207 (khtml::RemoveNodePreservingChildrenCommandImpl::doApply):
1209 2004-09-03 Darin Adler <darin@apple.com>
1213 - fixed <rdar://problem/3714501> REGRESSION (125.8-8A162): Chinese words display as garbage in search results (www.sz.net.cn)
1215 * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Resolve URL using the document method
1216 that passes the codec rather than calling the KURL constructor directly.
1218 2004-09-03 Chris Blumenberg <cblu@apple.com>
1220 Fixed: <rdar://problem/3788409> can't create or clone an embed element
1224 * khtml/html/htmlparser.cpp: added fixme about sharing code
1225 * khtml/xml/dom_docimpl.cpp: ditto
1226 (DocumentImpl::createHTMLElement): create and return a HTMLEmbedElementImpl
1228 2004-09-03 Darin Adler <darin@apple.com>
1232 - fixed <rdar://problem/3410112> filename with non-ASCII name for <input type=file> should be sent in the page's encoding
1234 * khtml/html/html_formimpl.cpp: (DOM::HTMLFormElementImpl::formData):
1235 Encode filename using the codec rather than doing the &# dance. It turns out that Mozilla
1236 only does the &# thing under certain circumstances that are not important. Always encoding
1237 the filename is almost certainly better behavior, and will fix many serious problems for
1238 Japanese and Korean users and websites.
1240 2004-09-03 Richard Williamson <rjw@apple.com>
1242 Made drawImage() in <canvas> compliant with whatwg spec.
1246 * khtml/ecma/kjs_html.cpp:
1247 (KJS::Context2DFunction::tryCall):
1248 * khtml/html/html_imageimpl.h:
1249 (DOM::HTMLImageElementImpl::pixmap):
1251 2004-09-03 David Hyatt <hyatt@apple.com>
1253 Fix for 3787686, CSS parser should do case-sensitive matching of ids and attributes only in strict mode
1254 (and not whenever you have an HTML document).
1258 * khtml/css/parser.cpp:
1259 * khtml/css/parser.y:
1263 2004-09-03 Darin Adler <darin@apple.com>
1267 - <rdar://problem/3788040> REGRESSION: text that i type into a textarea disappears when i tab out of the textarea
1269 * kwq/KWQTextArea.mm: (-[KWQTextArea textDidChange:]): Bring back an unconditional version of
1270 this method. Earlier, we deleted this method, but we should have instead removed the check.
1272 2004-09-02 David Hyatt <hyatt@apple.com>
1274 Swap RenderBox and RenderContainer. Make leaf RenderObjects actually derive off of RenderBox instead.
1276 Reviewed by kocienda
1278 * khtml/rendering/render_block.cpp:
1279 (khtml::RenderBlock::addChildToFlow):
1280 * khtml/rendering/render_box.cpp:
1281 (RenderBox::RenderBox):
1282 (RenderBox::detach):
1283 * khtml/rendering/render_box.h:
1284 * khtml/rendering/render_container.cpp:
1285 (RenderContainer::RenderContainer):
1286 (RenderContainer::detach):
1287 * khtml/rendering/render_container.h:
1288 * khtml/rendering/render_flow.cpp:
1289 (RenderFlow::detach):
1290 (RenderFlow::dirtyLineBoxes):
1291 (RenderFlow::createInlineBox):
1292 (RenderFlow::getAbsoluteRepaintRect):
1293 (RenderFlow::lowestPosition):
1294 (RenderFlow::rightmostPosition):
1295 (RenderFlow::leftmostPosition):
1296 (RenderFlow::caretPos):
1297 * khtml/rendering/render_flow.h:
1298 (khtml::RenderFlow::RenderFlow):
1299 * khtml/rendering/render_frames.cpp:
1300 (RenderFrameSet::RenderFrameSet):
1301 (RenderFrameSet::nodeAtPoint):
1302 (RenderFrameSet::dump):
1303 * khtml/rendering/render_frames.h:
1304 * khtml/rendering/render_inline.cpp:
1305 (RenderInline::addChildToFlow):
1306 * khtml/rendering/render_replaced.cpp:
1307 * khtml/rendering/render_replaced.h:
1308 (khtml::RenderReplaced::setIntrinsicHeight):
1309 * khtml/rendering/render_table.cpp:
1310 (RenderTableSection::RenderTableSection):
1311 (RenderTableSection::detach):
1312 (RenderTableSection::setStyle):
1313 * khtml/rendering/render_table.h:
1315 2004-09-02 Ken Kocienda <kocienda@apple.com>
1319 * khtml/editing/htmlediting_impl.h: Fix some inconsistent use of whitespace. No code change.
1321 2004-09-02 Ken Kocienda <kocienda@apple.com>
1327 <rdar://problem/3786848> REGRESSION (Mail): Typing styles and font panel updates broken
1329 * khtml/xml/dom_position.cpp:
1330 (DOM::Position::inRenderedContent): Check for inlines that can have kids is wrong.
1331 I busted this the other day when making the PositionIterator class iterate over
1332 all nodes and not just leaves of the DOM tree.
1334 Update all the following functions. These use the PositionIterator class, but still
1335 only want to consider leaf nodes.
1337 (DOM::Position::isFirstRenderedPositionOnLine)
1338 (DOM::Position::isLastRenderedPositionOnLine)
1339 (DOM::Position::isLastRenderedPositionInEditableBlock)
1340 (DOM::Position::inFirstEditableInRootEditableElement)
1341 (DOM::Position::inLastEditableInRootEditableElement)
1342 (DOM::Position::inFirstEditableInContainingEditableBlock)
1343 (DOM::Position::inLastEditableInContainingEditableBlock)
1345 2004-09-02 Richard Williamson <rjw@apple.com>
1347 Support for patterns in <canvas>
1351 * khtml/ecma/kjs_html.cpp:
1352 (KJS::Context2DFunction::tryCall):
1353 (Context2D::putValue):
1355 (ImagePattern::ImagePattern):
1356 (ImagePattern::~ImagePattern):
1357 * khtml/ecma/kjs_html.h:
1358 (KJS::ImagePattern::getPattern):
1359 (KJS::ImagePattern::pixmap):
1362 (QPixmap::imageRef):
1363 * kwq/WebCoreImageRenderer.h:
1365 2004-09-01 David Hyatt <hyatt@apple.com>
1367 Fix for 3769409, a regression from 10.3.4 to 10.3.5 involving <colgroup>s in malformed HTML.
1371 * khtml/html/htmlparser.cpp:
1372 (KHTMLParser::insertNode):
1374 2004-09-01 David Hyatt <hyatt@apple.com>
1376 Fix for the <colgroup> crasher. Make sure adding to an anonymous box just returns immediately. Also eliminate
1377 all the redundant setPos -500000 calls, since we don't need those at all.
1381 * khtml/rendering/render_block.cpp:
1382 (khtml::RenderBlock::addChildToFlow):
1383 (khtml::RenderBlock::makeChildrenNonInline):
1384 * khtml/rendering/render_inline.cpp:
1385 (RenderInline::splitFlow):
1387 2004-09-02 Ken Kocienda <kocienda@apple.com>
1393 <rdar://problem/3729219> REGRESSION (Mail): Caret placement and navigation not working correctly at yahoo.com
1394 <rdar://problem/3758606> REGRESSION (Mail): Deletions across DIV elements is broken
1395 <rdar://problem/3784810> REGRESSION (Mail): delete at beginning of line instead deletes to the end of the document (simple reduced test)
1397 I made some very big improvements to the code which handles deletions of selections
1398 which span more than one block.
1400 * khtml/editing/htmlediting_impl.cpp:
1401 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): An new, overloaded version of this
1402 function which works on a NodeImpl. The code in this function fell out of some refactoring
1403 I did in the function with the same name which takes a Position as an argument.
1404 (khtml::DeleteSelectionCommandImpl::moveNodesToBlock): New function. This new logic provides
1405 the smarts to fix the bugs listed above and greatly improves the code to perform deleting
1406 selections which span more than one block.
1407 (khtml::DeleteSelectionCommandImpl::doApply): Several changes. Constrain downstream positions
1408 so that they stay in the current block. This was a mistake before I think. Add code to detect
1409 when the insertion point is a caret at the start of a block. This is a special-case of a
1410 cross-block selection. Change the end-of-deletion-fixup case to operate on the downstreamEnd
1411 position of the selection rather than the upstream. This is more logical. Refine the block
1412 merge logic to handle more cases, like dealing with whitespace.
1413 * khtml/editing/htmlediting_impl.h: Associated header file changes.
1414 * khtml/xml/dom_nodeimpl.cpp:
1415 (NodeImpl::rootEditableElement): Add code to clamp the return value to the body element.
1416 * khtml/xml/dom_selection.cpp:
1417 (DOM::Selection::validate): Make selection canonicalizations stay in the current block.
1418 * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt:
1419 * layout-tests/editing/deleting/delete-block-merge-contents-001.html:
1420 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: Added.
1421 * layout-tests/editing/deleting/delete-block-merge-contents-002.html: Added.
1422 * layout-tests/editing/deleting/delete-block-merge-contents-003-expected.txt: Added.
1423 * layout-tests/editing/deleting/delete-block-merge-contents-003.html: Added.
1424 * layout-tests/editing/deleting/delete-block-merge-contents-004-expected.txt: Added.
1425 * layout-tests/editing/deleting/delete-block-merge-contents-004.html: Added.
1426 * layout-tests/editing/deleting/delete-block-merge-contents-005-expected.txt: Added.
1427 * layout-tests/editing/deleting/delete-block-merge-contents-005.html: Added.
1428 * layout-tests/editing/deleting/delete-block-merge-contents-006-expected.txt: Added.
1429 * layout-tests/editing/deleting/delete-block-merge-contents-006.html: Added.
1430 * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Added.
1431 * layout-tests/editing/deleting/delete-block-merge-contents-007.html: Added.
1432 * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt: Added.
1433 * layout-tests/editing/deleting/delete-block-merge-contents-008.html: Added.
1434 * layout-tests/editing/deleting/delete-block-merge-contents-009-expected.txt: Added.
1435 * layout-tests/editing/deleting/delete-block-merge-contents-009.html: Added.
1436 * layout-tests/editing/deleting/delete-block-merge-contents-010-expected.txt: Added.
1437 * layout-tests/editing/deleting/delete-block-merge-contents-010.html: Added.
1438 * layout-tests/editing/deleting/delete-block-merge-contents-011-expected.txt: Added.
1439 * layout-tests/editing/deleting/delete-block-merge-contents-011.html: Added.
1440 * layout-tests/editing/inserting/insert-3654864-fix-expected.txt: Updated with new results.
1441 * layout-tests/editing/inserting/insert-3654864-fix.html: Updated test to deal better with
1442 improved select all behavior.
1443 * layout-tests/editing/selection/select-all-003-expected.txt: Updated with new results.
1445 2004-09-01 Richard Williamson <rjw@apple.com>
1447 Fixed panther build glitch.
1451 * khtml/ecma/kjs_html.cpp:
1453 2004-09-01 Richard Williamson <rjw@apple.com>
1455 Finished implementation of gradient support in <canvas>.
1459 * khtml/ecma/kjs_html.cpp:
1460 (KJS::HTMLElementFunction::tryCall):
1463 (KJS::Context2DFunction::tryCall):
1464 (Context2D::putValue):
1465 (Context2D::Context2D):
1466 (KJS::GradientFunction::tryCall):
1468 (Gradient::commonInit):
1469 (Gradient::Gradient):
1470 (Gradient::~Gradient):
1471 (Gradient::getShading):
1472 (Gradient::addColorStop):
1474 (Gradient::colorStops):
1475 * khtml/ecma/kjs_html.h:
1476 (KJS::ColorStop::ColorStop):
1477 * khtml/ecma/kjs_html.lut.h:
1480 2004-09-01 David Hyatt <hyatt@apple.com>
1482 Fix for 3784686, hidden links still active. Make sure text nodes exclude themselves from nodeAtPoint checks
1485 * khtml/rendering/render_text.cpp:
1486 (RenderText::nodeAtPoint):
1488 2004-08-31 David Hyatt <hyatt@apple.com>
1490 Fixes for 3761411 and 3782201. This patch makes two changes to percentage heights. First it makes sure that
1491 replaced elements always flex inside a cell (unlike blocks and tables, which do so only sometimes under bizarre
1492 conditions that are still being guessed at by me). The second fix is a recognition that empty tables do not
1493 actually honor their heights, and so it is a mistake to try to flex them.
1497 * khtml/rendering/render_table.cpp:
1498 (RenderTableSection::layoutRows):
1499 * khtml/rendering/render_table.h:
1500 (khtml::RenderTable::hasSections):
1502 2004-08-31 Ken Kocienda <kocienda@apple.com>
1508 <rdar://problem/3781572> can't paste text in replied message view
1510 * khtml/xml/dom2_rangeimpl.cpp:
1511 (DOM::RangeImpl::toHTML): Copying text placed in an anonymous block was failing
1512 since the code in here depending on the text node's containing block having an
1513 element, which it won't. In fact, using containing block is wrong anyway, since
1514 positioned elements can have containing blocks far from where they live in the
1515 tree. This "move up to block check" should use the more DOM-wise enclosingBlockFlowElement()
1518 2004-08-30 David Hyatt <hyatt@apple.com>
1520 Fix for 3742585, sony dhtml menus wrong size. The percentage table height algorithm was wrong. This patch
1521 unifies the table percentage height algorithm with the block percentage height algorithm and fixes bugs in
1526 * khtml/rendering/render_box.cpp:
1527 (RenderBox::calcPercentageHeight):
1528 * khtml/rendering/render_table.cpp:
1529 (RenderTable::layout):
1531 2004-08-31 Ken Kocienda <kocienda@apple.com>
1535 Added more editing layout tests.
1537 * layout-tests/editing/deleting/delete-tab-001-expected.txt: Added.
1538 * layout-tests/editing/deleting/delete-tab-001.html: Added.
1539 * layout-tests/editing/deleting/delete-tab-002-expected.txt: Added.
1540 * layout-tests/editing/deleting/delete-tab-002.html: Added.
1541 * layout-tests/editing/deleting/delete-tab-003-expected.txt: Added.
1542 * layout-tests/editing/deleting/delete-tab-003.html: Added.
1543 * layout-tests/editing/deleting/delete-tab-004-expected.txt: Added.
1544 * layout-tests/editing/deleting/delete-tab-004.html: Added.
1545 * layout-tests/editing/editing.js: Fixed a little bug in one of the "delayed" commands.
1546 * layout-tests/editing/inserting/insert-tab-001-expected.txt: Added.
1547 * layout-tests/editing/inserting/insert-tab-001.html: Added.
1548 * layout-tests/editing/inserting/insert-tab-002-expected.txt: Added.
1549 * layout-tests/editing/inserting/insert-tab-002.html: Added.
1550 * layout-tests/editing/inserting/insert-tab-003-expected.txt: Added.
1551 * layout-tests/editing/inserting/insert-tab-003.html: Added.
1552 * layout-tests/editing/inserting/insert-tab-004-expected.txt: Added.
1553 * layout-tests/editing/inserting/insert-tab-004.html: Added.
1555 2004-08-31 Ken Kocienda <kocienda@apple.com>
1561 <rdar://problem/3782521> Typing newline at start of block does not work
1563 * khtml/editing/htmlediting_impl.cpp:
1564 (khtml::InputNewlineCommandImpl::doApply): Change handling of case to insert
1565 newline at the start of a block.
1566 * layout-tests/editing/inserting/insert-br-006-expected.txt: Updated layout test with
1569 2004-08-31 Ken Kocienda <kocienda@apple.com>
1573 Checked in incorrect results for these tests. There are the right ones.
1575 * layout-tests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt
1576 * layout-tests/editing/selection/move-by-line-001-expected.txt
1578 2004-08-31 Ken Kocienda <kocienda@apple.com>
1582 Added more editing layout tests.
1584 * layout-tests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt: Added.
1585 * layout-tests/editing/deleting/collapse-whitespace-3587601-fix.html: Added.
1586 * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt: Added.
1587 * layout-tests/editing/deleting/delete-block-merge-contents-001.html: Added.
1588 * layout-tests/editing/editing.js: Added some more navigation commands.
1589 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt: Added.
1590 * layout-tests/editing/inserting/insert-3778059-fix.html: Added.
1591 * layout-tests/editing/selection/move-by-line-001-expected.txt: Added.
1592 * layout-tests/editing/selection/move-by-line-001.html: Added.
1593 * layout-tests/editing/style/typing-style-003-expected.txt: Added.
1594 * layout-tests/editing/style/typing-style-003.html: Added.
1596 2004-08-31 Ken Kocienda <kocienda@apple.com>
1600 Added more editing layout tests. Renamed some others.
1602 * layout-tests/editing/inserting/insert-br-001-expected.txt: Added.
1603 * layout-tests/editing/inserting/insert-br-001.html: Added.
1604 * layout-tests/editing/inserting/insert-br-002-expected.txt: Added.
1605 * layout-tests/editing/inserting/insert-br-002.html: Added.
1606 * layout-tests/editing/inserting/insert-br-003-expected.txt: Added.
1607 * layout-tests/editing/inserting/insert-br-003.html: Added.
1608 * layout-tests/editing/inserting/insert-br-004-expected.txt: Added.
1609 * layout-tests/editing/inserting/insert-br-004.html: Added.
1610 * layout-tests/editing/inserting/insert-br-005-expected.txt: Added.
1611 * layout-tests/editing/inserting/insert-br-005.html: Added.
1612 * layout-tests/editing/inserting/insert-br-006-expected.txt: Added.
1613 * layout-tests/editing/inserting/insert-br-006.html: Added.
1614 * layout-tests/editing/inserting/insert-br-case1-expected.txt: Removed.
1615 * layout-tests/editing/inserting/insert-br-case1.html: Removed.
1616 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Removed.
1617 * layout-tests/editing/inserting/insert-br-case2.html: Removed.
1618 * layout-tests/editing/inserting/insert-br-case3-expected.txt: Removed.
1619 * layout-tests/editing/inserting/insert-br-case3.html: Removed.
1620 * layout-tests/editing/inserting/insert-br-case6-expected.txt: Removed.
1621 * layout-tests/editing/inserting/insert-br-case6.html: Removed.
1622 * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt: Added.
1623 * layout-tests/editing/inserting/insert-text-with-newlines.html: Added.
1625 2004-08-31 Ken Kocienda <kocienda@apple.com>
1629 * layout-tests/editing/editing.js: Modified typeCharacterCommand so it can accept a character
1632 2004-08-31 Ken Kocienda <kocienda@apple.com>
1638 <rdar://problem/3777629> REGRESSION (Mail): can't delete blank lines in quoted text in HTML mail replies
1639 <rdar://problem/3780309> REGRESSION (Mail): can't delete past an empty span in a particular test case
1640 <rdar://problem/3780315> REGRESSION (Mail): right arrow works incorrectly in a particular test case with an empty span
1641 <rdar://problem/3780320> REGRESSION (Mail): left arrow works incorrectly in a particular test case with an empty span
1642 <rdar://problem/3780336> REGRESSION (Mail): down arrow fails in a reduction of a Mail reply test case (seems to be inside a span)
1644 * khtml/xml/dom_position.cpp:
1645 (DOM::Position::upstream): If this position's node is a block, use it for the StayInBlock case, not the block's
1647 (DOM::Position::downstream): Ditto.
1648 (DOM::Position::inRenderedContent): Refine the case for non-text nodes. This was erroneously returning true
1649 for any empty element (like <span></span>).
1650 * khtml/xml/dom_positioniterator.cpp: Change the following four functions to consider all nodes, not just
1651 leaves of the DOM tree. This is a step towards making this iteration less cranky and unpredictable, and
1652 was necessary to do now to keep the inRenderedContent() change above from breaking editign layout tests.
1653 (DOM::PositionIterator::peekPrevious)
1654 (DOM::PositionIterator::peekNext)
1655 (DOM::PositionIterator::atStart)
1656 (DOM::PositionIterator::atEnd)
1657 * kwq/KWQKHTMLPart.mm:
1658 (KWQKHTMLPart::fontForCurrentPosition): Check that the position being checked is an element and that the
1659 element is in rendered content. I ran across some null-check failures while I was coding this fix, and
1660 the additions seem prudent.
1662 Updated these layout tests with new results.
1664 * layout-tests/editing/deleting/delete-3608430-fix-expected.txt:
1665 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
1666 * layout-tests/editing/deleting/delete-block-contents-001-expected.txt:
1667 * layout-tests/editing/deleting/delete-block-contents-002-expected.txt:
1668 * layout-tests/editing/deleting/delete-block-contents-003-expected.txt:
1669 * layout-tests/editing/deleting/delete-image-004-expected.txt:
1670 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
1671 * layout-tests/editing/editing.js:
1672 * layout-tests/editing/execCommand/boldSelection-expected.txt:
1673 * layout-tests/editing/execCommand/italicizeByCharacter-expected.txt:
1674 * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt:
1675 * layout-tests/editing/execCommand/print-expected.txt:
1676 * layout-tests/editing/execCommand/selectAll-expected.txt:
1677 * layout-tests/editing/selection/extend-by-character-002-expected.txt:
1678 * layout-tests/editing/selection/extend-by-character-004-expected.txt:
1679 * layout-tests/editing/selection/extend-by-character-005-expected.txt:
1680 * layout-tests/editing/selection/extend-by-character-006-expected.txt:
1681 * layout-tests/editing/selection/select-all-001-expected.txt:
1682 * layout-tests/editing/selection/select-all-002-expected.txt:
1683 * layout-tests/editing/selection/select-all-003-expected.txt:
1685 2004-08-30 Darin Adler <darin@apple.com>
1689 - fixed <rdar://problem/3637519> REGRESSION (125-128): unrepro crash in QListBox::sizeForNumberOfLines at istweb.apple.com
1691 * kwq/KWQListBox.h: Added a clearCachedTextRenderers function.
1692 * kwq/KWQListBox.mm:
1693 (itemTextRenderer): Change to use globals that are outside the function, and added retain calls.
1694 (groupLabelTextRenderer): Ditto.
1695 (QListBox::clearCachedTextRenderers): Release global text renderers and nil out the globals.
1697 * kwq/WebCoreBridge.h: Removed updateAllViews; not needed any more.
1698 * kwq/WebCoreBridge.mm: Ditto.
1700 * kwq/WebCoreTextRendererFactory.h: Added a clearCaches method.
1701 * kwq/WebCoreTextRendererFactory.mm:
1702 (-[WebCoreTextRendererFactory clearCaches]): Added. Tells all the views to repaint after clearing the cached
1703 text renderers from KWQListBox. To be more elegant, we could generalize the KWQListBox trick, but for now why bother?
1705 * kwq/WebCoreTextRendererFactory.m: Removed. I needed to put some C++ code in here, so changed the extension to .mm.
1706 * WebCore.pbproj/project.pbxproj: Removed WebCoreTextRendererFactory.m, and added WebCoreTextRendererFactory.mm.
1708 2004-08-30 Darin Adler <darin@apple.com>
1712 - fixed <rdar://problem/3528538> can paste a Return character into the Search field at amazon.com, other browsers won't
1714 * kwq/KWQTextField.mm: (-[KWQTextFieldController controlTextDidChange:]):
1715 Truncate text before the first line break.
1717 2004-08-30 Darin Adler <darin@apple.com>
1719 * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertOneChunkUsingTEC):
1720 Added some more assertions I used to track down what looks like a TEC bug.
1722 2004-08-30 Darin Adler <darin@apple.com>
1726 - fixed <rdar://problem/3779122> No accesskey support on LABEL element
1728 * khtml/html/html_formimpl.h: Change type of m_currValue to DOMString. Should have been done
1729 as part of my form data check-in, but harmless to do now. Add accessKeyAction function for
1730 HTMLLabelElementImpl.
1731 * khtml/html/html_formimpl.cpp:
1732 (DOM::HTMLButtonElementImpl::parseHTMLAttribute): Remove conversion of DOMString to QString
1734 (DOM::HTMLLabelElementImpl::formElement): If there's no "for" attribute, search children for
1736 (DOM::HTMLLabelElementImpl::accessKeyAction): Forward the accesskey action to the formElement.
1738 2004-08-30 Darin Adler <darin@apple.com>
1742 - fixed <rdar://problem/3303968> final newline character omitted from <textarea> when parsing a new page
1744 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::processListing): Handle newline pending
1745 cases as well as space and tab pending spaces at the end of this function. This seems right for
1746 both scripts and text areas; it's not clear why omittiing the LF is ever needed. Tested by running
1747 all the layout tests; no regressions.
1749 - fixed <rdar://problem/3552736> word wrapped text fields that blur/focus when you type move the insertion point strangely (vtext.com)
1751 * khtml/rendering/render_form.cpp: (RenderTextArea::updateFromElement): Call text() instead of
1752 calling widget->text() directly. This prevents this function from running in cases where the
1753 text didn't really change for text areas in wrap mode.
1755 2004-08-30 Darin Adler <darin@apple.com>
1759 - got rid of ERROR message when running layout tests by implementing text-transform in computed style
1761 * khtml/css/css_computedstyle.cpp:
1762 (DOM::numberAsString): Added. Helper that returns "1" rather then "1.0" for integer values.
1763 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Fixed use of tabs instead of
1764 spaces. Fixed switch statements so they don't use default so we get errors if we leave
1765 a case out. Changed callers to use numberAsString instead of QString::number. Added implementation
1766 of CSS_PROP_TEXT_TRANSFORM. Added code to prevent falling through to next property when no item
1767 in a switch statement matches.
1769 2004-08-30 Darin Adler <darin@apple.com>
1773 - did work to prepare for uploading files incrementally when submitting forms
1775 * khtml/misc/formdata.h: Added. Class for holding form data inside WebCore.
1776 * khtml/misc/formdata.cpp: Added.
1778 * khtml/html/html_formimpl.h: Added the FormDataList type, changed the formData function parameters
1779 and made it private, renamed the encoding method to appendFormData and changed the parameters around.
1780 * khtml/html/html_formimpl.cpp:
1781 (DOM::FormDataList): Added. Class that replaces the old use of QValueList<QCString> for form data.
1782 Later we'll change it to accomodate filenames too.
1783 (DOM::HTMLFormElementImpl::formData): Changed code to use FormDataList intsead of the old encodingList.
1784 Also changed to return the "OK" result as the function result and put the form data into something
1785 passed as an "out" parameter; the old way was the other way around.
1786 (DOM::HTMLFormElementImpl::submit): Change to use FormData rather than a QByteArray when getting the
1787 form data to submit.
1788 (DOM::HTMLButtonElementImpl::appendFormData): Rename from encoding, and use the new appendData function
1789 instead of the old way of doing += to put data on the list.
1790 (DOM::HTMLInputElementImpl::appendFormData): Ditto.
1791 (DOM::HTMLSelectElementImpl::appendFormData): Ditto.
1792 (DOM::HTMLKeygenElementImpl::appendFormData): Ditto.
1793 (DOM::HTMLTextAreaElementImpl::appendFormData): Ditto.
1794 (DOM::FormDataList::FormDataList): Added.
1795 (DOM::FormDataList::appendString): Added.
1796 (DOM::FormDataList::begin): Added.
1797 (DOM::FormDataList::end): Added.
1799 * khtml/khtml_part.h: Changed the type of the submitForm parameter to FormData instead of QByteArray.
1800 * khtml/khtmlpart_p.h: Changed the type of the submitFormData data member to FormData instead of QByteArray.
1801 * khtml/khtml_part.cpp: (KHTMLPart::submitForm): Called the new flattenToString function in all the
1802 code that handles mailto forms. Called the new flatten function in the non-Apple code path.
1804 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::submitForm): Pass NSArray for form data instead of NSData.
1806 * kwq/KWQKJob.h: Use FormData instead of QByteArray. A couple other small cleanups.
1807 * kwq/KWQKJobClasses.h: Ditto.
1808 * kwq/KWQKJobClasses.mm:
1809 (KIO::TransferJobPrivate::TransferJobPrivate): Ditto.
1810 (KIO::TransferJob::TransferJob): Ditto.
1811 (KIO::TransferJob::postData): Ditto.
1812 * kwq/KWQKPartsBrowserExtension.h: Ditto.
1814 (KWQServeRequest): Ditto.
1815 (KWQServeSynchronousRequest): Ditto.
1817 * kwq/KWQFormData.h: Added. A function to convert KHTML form data into an NSArray for communication
1818 with the WebKit side.
1819 * kwq/KWQFormData.mm: Added.
1821 * kwq/WebCoreBridge.h: Pass NSArray instead of NSData for form data.
1823 * kwq/KWQArrayImpl.h: Added a detach member function. The old version would do unnecessary work when
1824 detach was called on an array that had exactly one reference.
1825 * kwq/KWQArrayImpl.mm: (KWQArrayImpl::detach): Added.
1826 * kwq/KWQMemArray.h: (QMemArray::detach): Call through to KWQArrayImpl.
1828 * kwq/KWQValueList.h:
1829 (QValueList::first): Added overload for non-const.
1830 (QValueList::last): Ditto.
1832 * ForwardingHeaders/misc/formdata.h: Added.
1833 * WebCore.pbproj/project.pbxproj: Added formdata.h, formdata.cpp, KWQFormData.h, and KWQFormData.cpp.
1835 * WebCore-tests.exp: Updated for changes to QValueList, and re-sorted.
1836 * WebCore-combined.exp: Regenerated.
1838 2004-08-30 Darin Adler <darin@apple.com>
1842 - improved multiple submit logic in preparation for making command-click on a form
1843 button load a form in another frame
1845 * kwq/KWQKHTMLPart.h: Added const to a bunch of member functions for cleanup.
1846 Added prepareForUserAction member function.
1847 * kwq/KWQKHTMLPart.mm:
1848 (KWQKHTMLPart::submitForm): Simplified logic and removed special case for "http" and "https".
1849 (KWQKHTMLPart::renderer): Added const.
1850 (KWQKHTMLPart::keyEvent): Added call to prepareForUserAction.
1851 (KWQKHTMLPart::lastEventIsMouseUp): Added const.
1852 (KWQKHTMLPart::eventMayStartDrag): Added const.
1853 (KWQKHTMLPart::mouseDown): Added call to prepareForUserAction.
1854 (KWQKHTMLPart::overrideMediaType): Added const.
1855 (KWQKHTMLPart::canGoBackOrForward): Added const.
1856 (KWQKHTMLPart::prepareForUserAction): Added. Clears _submittedFormURL.
1857 * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityPerformAction:]): Added call to prepareForUserAction.
1859 2004-08-30 Ken Kocienda <kocienda@apple.com>
1865 <rdar://problem/3762231> REGRESSION (Mail): tab key inserts a single space
1867 * khtml/editing/htmlediting_impl.cpp:
1868 (khtml::isTab): New helper. Checks a DOMString to see if it is one character and
1869 that character is a tab.
1870 (khtml::InputTextCommandImpl::execute): Trap tabs before handling insertion of
1871 other kinds of whitespace. Treat a tab like four spaces. Rearrange the code to
1872 update the ending position after the text insertion to cover the new tab case
1873 where the amount of advance is not the same as the number of character in the
1874 passed-in DOMString (i.e. tabs expand to four characters).
1876 2004-08-27 Ken Kocienda <kocienda@apple.com>
1882 <rdar://problem/3779706> plain text on pasteboard loses indentation when pasted into Blot
1884 * kwq/KWQKHTMLPart.h:
1885 * kwq/KWQKHTMLPart.mm:
1886 (KWQKHTMLPart::documentFragmentWithText): New function that takes over the code from
1887 KWQKHTMLPart and improves it to handle converting tabs and spaces for suitable
1889 * kwq/WebCoreBridge.mm:
1890 (-[WebCoreBridge documentFragmentWithText:]): Move smarts from here to KWQKHTMLPart.
1892 2004-08-27 Maciej Stachowiak <mjs@apple.com>
1896 <rdar://problem/3778314> REGRESSION: Can't proceed to survey questions on Lominger's Apple website
1898 Because we will stop parsing when there is a pending redirection,
1899 avoid setting one if no navigation would actually take place
1900 because the number of steps is out of range.
1902 * khtml/khtml_part.cpp:
1903 (KHTMLPart::scheduleHistoryNavigation):
1904 * kwq/KWQKHTMLPart.h:
1905 * kwq/KWQKHTMLPart.mm:
1906 (KWQKHTMLPart::canGoBackOrForward):
1907 * kwq/KWQKPartsBrowserInterface.h:
1908 * kwq/WebCoreBridge.h:
1910 2004-08-27 Maciej Stachowiak <mjs@apple.com>
1914 - fixed <rdar://problem/3778043> REGRESSION: innerHTML is broken, breaks automated iBench testing
1915 - also fixed outerHTML, which would spill over past the node for whch it was supposed to get HTML
1917 * khtml/html/html_elementimpl.cpp:
1918 (HTMLElementImpl::outerHTML):
1919 * khtml/xml/dom2_rangeimpl.cpp:
1920 (DOM::RangeImpl::toHTML):
1921 * khtml/xml/dom_nodeimpl.cpp:
1923 (NodeImpl::recursive_toString):
1924 (NodeImpl::recursive_toHTML):
1925 * khtml/xml/dom_nodeimpl.h:
1926 * kwq/WebCoreBridge.mm:
1927 (-[WebCoreBridge markupStringFromNode:nodes:]):
1929 - added new layout tests to cover the problems I fixed
1931 * layout-tests/fast/innerHTML/001-expected.txt: Added.
1932 * layout-tests/fast/innerHTML/001.html: Added.
1933 * layout-tests/fast/innerHTML/002-expected.txt: Added.
1934 * layout-tests/fast/innerHTML/002.html: Added.
1935 * layout-tests/fast/innerHTML/003-expected.txt: Added.
1936 * layout-tests/fast/innerHTML/003.html: Added.
1938 2004-08-27 David Hyatt <hyatt@apple.com>
1940 Fix for 3739239, getComputedStyle of top not being implemented broke a site that checked for it.
1942 Reviewed by kocienda
1944 * khtml/css/css_computedstyle.cpp:
1945 (DOM::valueForLength):
1946 (DOM::CSSComputedStyleDeclarationImpl::getPositionOffsetValue):
1947 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1948 * khtml/css/css_computedstyle.h:
1950 2004-08-27 John Sullivan <sullivan@apple.com>
1954 Tweaked option-tab handling to match good suggestion from Tim Omernick of OmniWeb
1956 * kwq/KWQTextArea.mm:
1957 removed override of textDidChange:
1958 (-[KWQTextAreaTextView keyDown:]):
1959 moved option-tab handling that was in textDidChange to here. Rearranged existing code
1960 a little for clarity.
1962 2004-08-27 Adele Amchan <adele@apple.com>
1967 <rdar://problem/3689949> Provide contentWindow access on an iframe
1969 * khtml/ecma/kjs_html.cpp:
1970 (KJS::HTMLElement::getValueProperty): added cases for contentWindow for frames and iframes
1971 * khtml/ecma/kjs_html.h: added contentWindow to the list of properties for frames and iframes
1972 * khtml/ecma/kjs_html.lut.h: regenerated file
1973 * khtml/html/html_baseimpl.cpp:
1974 (HTMLFrameElementImpl::contentPart): factored out old contentDocument code to return KHTMLPart for frame
1975 (HTMLFrameElementImpl::contentDocument): now just gets the contentDocument from contentPart
1976 * khtml/html/html_baseimpl.h: added declaration for contentPart
1980 2004-08-27 Ken Kocienda <kocienda@apple.com>
1986 <rdar://problem/3778059> Odd behaviour when editing between blockquote elements
1988 * khtml/editing/htmlediting_impl.cpp:
1989 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): This function should not move
1990 the selection out of the current block, ever. This is exactly what the bug reported.
1991 What was I thinking? Now, the code looks at the passed-in position and then the equivalent
1992 upstream and downstream positions to see if the selection can be placed there after the
1993 delete, and settles on the block containing the passed-in position as a fallback.
1994 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt: Added.
1995 * layout-tests/editing/inserting/insert-3778059-fix.html: Added.
1997 2004-08-26 Richard Williamson <rjw@apple.com>
1999 Boiler plate for canvas gradients and patterns.
2003 * khtml/ecma/kjs_html.cpp:
2004 (KJS::Context2DFunction::tryCall):
2005 (Context2D::tryPut):
2006 (Context2D::~Context2D):
2007 (KJS::GradientFunction::tryCall):
2008 (Gradient::Gradient):
2010 (Gradient::getValueProperty):
2012 (Gradient::putValue):
2013 (Gradient::~Gradient):
2014 (ImagePattern::ImagePattern):
2015 (ImagePattern::tryGet):
2016 (ImagePattern::getValueProperty):
2017 (ImagePattern::tryPut):
2018 (ImagePattern::putValue):
2019 (ImagePattern::~ImagePattern):
2020 * khtml/ecma/kjs_html.h:
2021 (KJS::Gradient::toBoolean):
2022 (KJS::Gradient::classInfo):
2024 (KJS::ImagePattern::toBoolean):
2025 (KJS::ImagePattern::classInfo):
2026 (KJS::ImagePattern::):
2027 * khtml/ecma/kjs_html.lut.h:
2030 2004-08-26 Ken Kocienda <kocienda@apple.com>
2036 <rdar://problem/3777899> REGRESSION (Mail): only first of several misspelled words separated by
2037 carriage returns is marked
2039 * khtml/editing/htmlediting_impl.cpp:
2040 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Give the spellchecker a slightly larger
2041 selection to work with while typing. This should preclude bugs of this type.
2043 2004-08-26 Ken Kocienda <kocienda@apple.com>
2049 <rdar://problem/3777804> Deleting all content in a document can result in giant tall-as-window insertion point
2051 * khtml/rendering/render_box.cpp:
2052 (RenderBox::caretPos): Always use the font height for calculating the caret height in
2053 non-replaced elements (like blocks), rather than the height of the box.
2055 2004-08-26 Ken Kocienda <kocienda@apple.com>
2057 Silly me. Forgot to add this file before.
2059 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt: Added.
2061 2004-08-26 David Hyatt <hyatt@apple.com>
2063 Fix for 3777172, crash from nested colgroup. Don't allow nested table sections or col groups.
2067 * khtml/html/htmlparser.cpp:
2068 (KHTMLParser::insertNode):
2070 2004-08-26 Ken Kocienda <kocienda@apple.com>
2076 <rdar://problem/3775316> document sprouts an extra newline character at the end
2078 * khtml/editing/htmlediting_impl.cpp:
2079 (khtml::InputNewlineCommandImpl::doApply): There was in insufficient check
2080 in the code which adds extra BR elements at the ends of blocks, which we do
2081 to work around the fact that BR elements, when they are the last element in a
2082 block, do not render. Now the code sees whether there already is one of these
2083 extra BR's in the document and won't add and "extra" extra.
2084 * layout-tests/editing/inserting/insert-3775316-fix.html: Added.
2086 2004-08-26 David Hyatt <hyatt@apple.com>
2088 Fix for 3710721 and 3504114, crashes because of bad ownership model for list markers.
2092 * khtml/rendering/render_container.cpp:
2093 (RenderContainer::detach):
2094 * khtml/rendering/render_list.cpp:
2095 (RenderListItem::setStyle):
2096 (RenderListItem::detach):
2097 (RenderListItem::updateMarkerLocation):
2098 * khtml/rendering/render_list.h:
2100 2004-08-26 Ken Kocienda <kocienda@apple.com>
2104 * khtml/editing/htmlediting_impl.cpp:
2105 (khtml::ApplyStyleCommandImpl::doApply): Remove the StayInBlock modifier from the
2106 call to upstream when passing the start position to removeStyle(). This makes the
2107 start position sufficiently upstream so that all relevant style tags are removed.
2108 (khtml::ApplyStyleCommandImpl::removeStyle): Pass the start position to nodeFullySelected.
2109 (khtml::ApplyStyleCommandImpl::nodeFullySelected): Change interface so start position
2110 for calculation is passed in, rather than recalculating it every time.
2111 * khtml/editing/htmlediting_impl.h: nodeFullySelected interface change.
2112 * khtml/xml/dom_position.h: Add a comment about the working of upstream() and
2115 2004-08-26 Ken Kocienda <kocienda@apple.com>
2117 Fix garbled contenteditable attribute. I must have checked
2118 this in with a typo.
2120 * layout-tests/editing/deleting/delete-3775172-fix.html
2122 2004-08-25 Kevin Decker <kdecker@apple.com>
2124 Reviewed by John and Maciej.
2126 - Fixes SAP bug <rdar://problem/3751295> Personalize link at the
2127 top gives an error in the pop-up window.
2129 * khtml/ecma/kjs_window.cpp:
2130 (WindowFunc::tryCall): Passes a referrer to KHTMLPart::begin()
2132 2004-08-25 Richard Williamson <rjw@apple.com>
2134 Updated to <canvas> API to match the spec. (Still need
2135 to implement gradients and patterns.)
2139 * khtml/ecma/kjs_html.cpp:
2140 (KJS::Context2DFunction::tryCall):
2141 (Context2D::getValueProperty):
2142 (Context2D::drawingContext):
2143 (Context2D::colorRefFromValue):
2144 (Context2D::colorFromValue):
2145 (Context2D::setShadow):
2146 (Context2D::putValue):
2148 (Context2D::restore):
2149 (Context2D::Context2D):
2150 * khtml/ecma/kjs_html.h:
2152 * khtml/ecma/kjs_html.lut.h:
2155 2004-08-25 Ken Kocienda <kocienda@apple.com>
2157 * layout-tests/editing/deleting/delete-3775172-fix.html: Wrong version of test checked in
2160 2004-08-25 Ken Kocienda <kocienda@apple.com>
2162 Added test case for <rdar://problem/3775172> Blot crashes after typing one character then deleting it
2164 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Added.
2165 * layout-tests/editing/deleting/delete-3775172-fix.html: Added.
2167 2004-08-25 Ken Kocienda <kocienda@apple.com>
2169 * layout-tests/editing/style/style-3690704-fix-expected.txt: Fewer styling spans added
2170 on this test as a result of the previously-checked-in fix.
2172 2004-08-25 Ken Kocienda <kocienda@apple.com>
2178 <rdar://problem/3775214> BR elements cause unnecessary spans to be added when applying style
2180 * khtml/editing/htmlediting_impl.cpp:
2181 (khtml::ApplyStyleCommandImpl::doApply): BR elements can be grouped more liberally with other nodes
2182 now in the iteration when attempting to find nodes that can be styled together with one span.
2183 * layout-tests/editing/style/style-3690704-fix-expected.txt: Updated with new results after
2186 2004-08-25 Ken Kocienda <kocienda@apple.com>
2192 <rdar://problem/3775172> Blot crashes after typing one character then deleting it
2194 * khtml/css/css_computedstyle.cpp:
2195 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Bail early if the element
2196 being queried does not have a renderer or that renderer does not have a style. Prevents
2197 a crash in the cases that it does not.
2198 * khtml/editing/htmlediting_impl.cpp:
2199 (khtml::DeleteSelectionCommandImpl::doApply): Add one more case to deleting when the
2200 start and end nodes are different. If the downstream end node is the last node in the
2201 block, then it may need to be deleted completely. Before this patch, the code
2202 erroneously assumed that any deletion in this node had to be trimming of a text node.
2203 This was asserted, and the description in 3775172 shows a simple case where this assertion
2204 does not hold. The additional case and associated checks now make it all better.
2205 * layout-tests/editing/deleting/delete-3775172-fix.html: Added.
2207 2004-08-25 David Hyatt <hyatt@apple.com>
2209 Fix for 3365086, large tables crash Safari. Make sure to use ints rather than shorts for row and column
2210 counts. Also fix a pathological array resize scenario for tables as rows are added.
2214 * khtml/rendering/render_table.cpp:
2215 (RenderTable::splitColumn):
2216 (RenderTable::appendColumn):
2217 (RenderTableSection::RenderTableSection):
2218 (RenderTableSection::ensureRows):
2219 (RenderTableSection::setCellWidths):
2220 (RenderTableSection::calcRowHeight):
2221 (RenderTableSection::layoutRows):
2222 (RenderTableSection::paint):
2223 (RenderTableSection::recalcCells):
2224 (RenderTableSection::clearGrid):
2225 * khtml/rendering/render_table.h:
2226 (khtml::RenderTableSection::numRows):
2228 2004-08-25 David Hyatt <hyatt@apple.com>
2230 To save memory in the common case, move the margin***Collapse variables into the CSS3 struct instead of
2231 bloating the surround struct.
2233 * khtml/rendering/render_style.cpp:
2234 (StyleSurroundData::StyleSurroundData):
2235 (StyleSurroundData::operator==):
2236 (marginBottomCollapse):
2237 (StyleCSS3NonInheritedData::operator==):
2238 (RenderStyle::diff):
2239 * khtml/rendering/render_style.h:
2240 (khtml::RenderStyle::marginTopCollapse):
2241 (khtml::RenderStyle::marginBottomCollapse):
2242 (khtml::RenderStyle::setMarginTopCollapse):
2243 (khtml::RenderStyle::setMarginBottomCollapse):
2245 2004-08-25 David Hyatt <hyatt@apple.com>
2247 Fix the "extra space in TypePad blogs" Emerson problem by adding the ability to collapse away margins.
2248 Also added support for explicitly preventing margin collapsing.
2252 * khtml/css/cssparser.cpp:
2253 (CSSParser::parseValue):
2254 * khtml/css/cssproperties.c:
2257 * khtml/css/cssproperties.h:
2258 * khtml/css/cssproperties.in:
2259 * khtml/css/cssstyleselector.cpp:
2260 (khtml::CSSStyleSelector::applyProperty):
2261 * khtml/css/cssvalues.c:
2264 * khtml/css/cssvalues.h:
2265 * khtml/css/cssvalues.in:
2266 * khtml/rendering/render_block.cpp:
2267 (khtml::RenderBlock::isSelfCollapsingBlock):
2268 (khtml::RenderBlock::layoutBlockChildren):
2269 * khtml/rendering/render_style.cpp:
2270 (StyleSurroundData::StyleSurroundData):
2271 (StyleSurroundData::operator==):
2272 (RenderStyle::diff):
2273 * khtml/rendering/render_style.h:
2275 (khtml::RenderStyle::marginTopCollapse):
2276 (khtml::RenderStyle::marginBottomCollapse):
2277 (khtml::RenderStyle::setMarginTopCollapse):
2278 (khtml::RenderStyle::setMarginBottomCollapse):
2279 (khtml::RenderStyle::initialMarginTopCollapse):
2280 (khtml::RenderStyle::initialMarginBottomCollapse):
2282 2004-08-24 Ken Kocienda <kocienda@apple.com>
2286 Improved the ability of the bridge to report selection state.
2288 * khtml/editing/htmlediting_impl.cpp:
2289 (khtml::TypingCommandImpl::doApply): Bail when there is no selection.
2290 * kwq/WebCoreBridge.h: Added an enum to report selection state. These constants
2291 mirror those used in DOM::Selection.
2292 * kwq/WebCoreBridge.mm:
2293 (-[WebCoreBridge selectionState]): Replacement for haveSelection. Returns a value
2294 from an enum telling whether the selection is in the None, Caret, or Range state,
2295 rather than just true/false for the Range state as it did before.
2297 2004-08-24 David Hyatt <hyatt@apple.com>
2299 Make sure the ifdef XSLT is present for Panther.
2301 * khtml/xml/xml_tokenizer.cpp:
2302 (khtml::XMLTokenizer::insertErrorMessageBlock):
2304 2004-08-24 David Hyatt <hyatt@apple.com>
2306 Polish the XML error message so that it indicates when a document is the result of an XSL transformation
2307 when reporting line/col #s.
2309 * khtml/xml/dom_docimpl.cpp:
2310 (DocumentImpl::applyXSLTransform):
2311 * khtml/xml/xml_tokenizer.cpp:
2312 (khtml::XMLTokenizer::insertErrorMessageBlock):
2313 * khtml/xsl/xslt_processorimpl.cpp:
2314 (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
2316 2004-08-24 David Hyatt <hyatt@apple.com>
2318 Add support for Atom and RSS MIME types to the set of XML types.
2322 * khtml/ecma/xmlhttprequest.cpp:
2323 (KJS::XMLHttpRequest::getValueProperty):
2324 * khtml/khtml_part.cpp:
2326 * khtml/misc/loader.cpp:
2327 (CachedXSLStyleSheet::CachedXSLStyleSheet):
2328 (CachedXBLDocument::CachedXBLDocument):
2329 * khtml/xml/dom_xmlimpl.cpp:
2330 (DOM::ProcessingInstructionImpl::checkStyleSheet):
2332 2004-08-24 Chris Blumenberg <cblu@apple.com>
2334 Fixed: <rdar://problem/3746447> hang loading geocities.com/cinemaorchestra
2338 * khtml/rendering/render_frames.cpp:
2339 (RenderPartObject::updateWidget): do nothing if the src URL is the same as the part's URL
2341 2004-08-24 Ken Kocienda <kocienda@apple.com>
2347 <rdar://problem/3773564> REGRESSION (125-159): Code to remove HTML styles before applying new HTML styles is broken
2349 * khtml/editing/htmlediting_impl.cpp:
2350 (khtml::ApplyStyleCommandImpl::doApply): Unrelated change to constrain downstream position of selection
2351 start to block boundaries. This is a new feature of the downstream function and I missed this usage
2352 when adding the feature.
2353 (khtml::ApplyStyleCommandImpl::removeCSSStyle): There once was code to remove style attributes from spans
2354 which became emptied as a result of removing CSS properties, but I do not see such code in the
2355 tree any more. A quick review of the ChangeLog did not reveal anything. I do not remember making such
2358 In any case, I have restored logic to prune out styling spans we insert if the process of
2359 removing styles caused a span-plus-styles node to become emptied of markup which changes the style
2360 of its contents. This fixes the bug.
2362 2004-08-24 Ken Kocienda <kocienda@apple.com>
2368 <rdar://problem/3765535> paste of text with newlines into text with newlines results in broken doc, crash
2370 This is a "belt and suspenders" fix. The issue is with the paste code path which was creating
2371 zero-length DOM text nodes when a selection being pasted ended with a newline. The normal
2372 code path for parsing HTML does not allow this, but the code to convert newlines to BR's
2373 during paste was creating such nodes. This will no longer happen.
2375 In the case where someone inserts such zero-length nodes using the DOM API, the render tree
2376 will no longer create render objects for these nodes, and it was these empty render text
2377 nodes that was confusing the code doing editing navigation.
2379 * khtml/xml/dom_textimpl.cpp:
2380 (CharacterDataImpl::rendererIsNeeded): Do not create renderers for zero-length DOM text nodes.
2381 * khtml/xml/dom_textimpl.h:
2382 * kwq/WebCoreBridge.mm:
2383 (-[WebCoreBridge documentFragmentWithText:]): Do not insert zero-length DOM text nodes as part
2384 of converting line-end sequences to BR's.
2386 2004-08-23 Maciej Stachowiak <mjs@apple.com>
2388 Reviewed by Richard.
2390 - reduce cost of innerHTML from O(N^2) to O(N*D) where N is the
2391 number of nodes and D is the maximum DOM tree depth.
2393 * khtml/xml/dom_nodeimpl.cpp:
2394 (NodeImpl::recursive_toString): New static helper method for
2395 recursive_toHTML - this is recursive for children but iterative
2397 (NodeImpl::recursive_toHTML): Call the helper with this as the
2399 * khtml/xml/dom_nodeimpl.h:
2401 2004-08-23 David Hyatt <hyatt@apple.com>
2405 Init the encodedURL explicitly for CSSStyleSelectors. Construction time was too early to be passing in the
2406 document m_url, since it doesn't get set during construction.
2408 Fix for 3769643, crash on vancouverblast.org.
2412 * khtml/css/cssstyleselector.cpp:
2413 (khtml::CSSStyleSelector::CSSStyleSelector):
2414 (khtml::CSSStyleSelector::init):
2415 (khtml::CSSStyleSelector::setEncodedURL):
2416 * khtml/css/cssstyleselector.h:
2417 * khtml/xml/dom_docimpl.cpp:
2418 (DocumentImpl::DocumentImpl):
2419 (DocumentImpl::setURL):
2420 (DocumentImpl::recalcStyleSelector):
2421 * khtml/xml/dom_docimpl.h:
2422 (DOM::DocumentImpl::URL):
2424 2004-08-23 Kevin Decker <kdecker@apple.com>
2428 - fixed rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
2429 * khtml/ecma/kjs_window.cpp:
2430 (WindowFunc::tryCall): since this is an xml document, we get the
2431 domain from the xmlDocImpl(), not docImpl().
2433 2004-08-23 Maciej Stachowiak <mjs@apple.com>
2437 <rdar://problem/3771426> assertion failed due to reentering dispatchImageLoadEventsNow
2439 * khtml/xml/dom_docimpl.cpp:
2440 (DocumentImpl::dispatchImageLoadEventsNow): Avoid re-entering this
2441 function, since it uses a data member for the copy of the list of events
2444 2004-08-23 Maciej Stachowiak <mjs@apple.com>
2448 <rdar://problem/3770306> XMLHttpRequest does not honor character set encoding
2450 * khtml/ecma/xmlhttprequest.cpp:
2451 (KJS::XMLHttpRequest::slotData): Get encoding from the transfer job.
2452 * kwq/KWQKJobClasses.h:
2453 * kwq/KWQKJobClasses.mm:
2454 (KIO::TransferJobPrivate::TransferJobPrivate): Added retrievedCharset
2456 (KIO::TransferJob::retrieveCharset): New method, gets the charset
2458 (KIO::TransferJob::queryMetaData): Handle charset.
2459 (KIO::TransferJob::emitReceivedResponse): Clear retreivedCharset flag.
2462 (KWQResponseTextEncodingName): New function, gets the encoding from the response.
2464 2004-08-23 David Hyatt <hyatt@apple.com>
2466 Apply leo's fix to marquees.
2470 * khtml/rendering/render_layer.cpp:
2473 2004-08-20 Darin Adler <darin@apple.com>
2477 - added an ascii() member function to DOMString and DOMStringImpl to help debugging
2479 * khtml/dom/dom_string.h: Add ascii member function for debugging.
2480 * khtml/dom/dom_string.cpp: (DOM::DOMString::ascii): Added. Calls through to DOMStringImpl::ascii.
2481 * khtml/xml/dom_stringimpl.h: Add ascii member function for debugging.
2482 * khtml/xml/dom_stringimpl.cpp: (DOM::DOMStringImpl::ascii): Added. Makes a new buffer and puts
2483 a simple ASCII version in it. Maybe make it better about characters outside the 0x20-0x7E range
2484 some day, but for now this is way better than what we had before.
2486 2004-08-20 David Hyatt <hyatt@apple.com>
2488 Divorce the notion of a marquee being stopped from JS from the notion of being suspended by the back/forward cache.
2490 * khtml/ecma/kjs_html.cpp:
2491 (KJS::HTMLElementFunction::tryCall):
2492 * khtml/rendering/render_layer.cpp:
2496 (Marquee::updateMarqueePosition):
2497 * khtml/rendering/render_layer.h:
2499 2004-08-20 Richard Williamson <rjw@apple.com>
2501 Implemented new JNI abstraction. We no longer invoke Java methods
2502 directly with JNI, rather we call into the plugin. This allows the
2503 plugin to dispatch the call to the appropriate VM thread. This
2504 change should (will?) fix a whole class of threading related problems with
2509 * kwq/KWQKHTMLPart.mm:
2510 (KWQKHTMLPart::getAppletInstanceForView):
2511 * kwq/WebCoreBridge.mm:
2513 (-[WebCoreBridge executionContextForView:]):
2515 2004-08-19 Maciej Stachowiak <mjs@apple.com>
2519 More text paint cleanup. Separated the background and foreground
2520 passes instead of doing a weird for loop thing. Eliminated
2521 redundant if conditions. Added comments.
2523 * khtml/rendering/render_text.cpp:
2524 (RenderText::paint):
2526 2004-08-19 Ken Kocienda <kocienda@apple.com>
2530 * khtml/css/css_computedstyle.cpp:
2531 (DOM::): Changed CopyProperties constant to InheritableProperties. This reflects the
2532 name change of copy() to copyInheritableProperties()
2533 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties: Renamed from copy().
2534 Now just copies those properties which can be inherited.
2535 (DOM::CSSComputedStyleDeclarationImpl::diff): Add a couple null checks.
2536 * khtml/css/css_computedstyle.h: copyInheritableProperties name change. No longer needs to be virtual.
2537 * khtml/css/css_valueimpl.cpp: Removed unneeded copy() function from CSSStyleDeclarationImpl.
2538 * khtml/css/css_valueimpl.h: Ditto.
2539 * khtml/editing/htmlediting.cpp:
2540 (khtml::EditCommand::typingStyle): Added.
2541 (khtml::EditCommand::setTypingStyle): Added.
2542 * khtml/editing/htmlediting.h:
2543 * khtml/editing/htmlediting_impl.cpp:
2544 (khtml::StyleChange::currentlyHasStyle): Fix leak of computed style used in this function.
2545 (khtml::EditCommandImpl::EditCommandImpl): Initialize m_typingStyle.
2546 (khtml::EditCommandImpl::~EditCommandImpl): Deref m_typingStyle.
2547 (khtml::EditCommandImpl::assignTypingStyle): New helper used in setting typing style.
2548 (khtml::EditCommandImpl::setTypingStyle): New setter.
2549 (khtml::DeleteSelectionCommandImpl::doApply): Use new method for managing typing style.
2550 * khtml/editing/htmlediting_impl.h:
2551 (khtml::EditCommandImpl::typingStyle): New accessor.
2552 * khtml/khtml_part.cpp:
2553 (KHTMLPart::appliedEditing): Restores typing style from command after setting selection.
2554 (KHTMLPart::applyStyle): Does a diff between the current style and the style of the caret.
2555 * khtml/khtml_part.h:
2556 * khtml/xml/dom_position.cpp:
2557 (DOM::Position::computedStyle): Now returns a CSSComputedStyleDeclarationImpl instead of a plain
2558 CSSStyleDeclarationImpl.
2559 * khtml/xml/dom_position.h:
2560 * layout-tests/editing/style/style-3681552-fix-002-expected.txt:
2562 2004-08-20 Trey Matteson <trey@apple.com>
2564 3655407 - Editing: -complete: method unimplemented (WebKit editing API)
2566 One new support routine here.
2570 * kwq/WebCoreBridge.h:
2571 * kwq/WebCoreBridge.mm:
2572 (-[WebCoreBridge caretRectAtNode:offset:]): New routine.
2573 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
2574 Fixed former misleading method name.
2576 2004-08-20 Ken Kocienda <kocienda@apple.com>
2582 <rdar://problem/3768378> crash typing newline in Blot
2584 * khtml/editing/htmlediting_impl.cpp:
2585 (khtml::InputNewlineCommandImpl::doApply): Adding an assert in a recent change
2586 showed up that inserting newlines that was not being handled correctly for the
2587 case described in the bug. I added a new case to handle inserting BR's when
2588 at the caret max offset for a node, and this new code runs instead of the
2589 fall-through case that should not have been running and triggered the assert.
2590 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Regenerated results.
2591 * layout-tests/editing/inserting/insert-br-case6-expected.txt: Added.
2592 * layout-tests/editing/inserting/insert-br-case6.html: Added.
2594 2004-08-20 Trey Matteson <trey@apple.com>
2596 Fixing: Spellchecker called once or twice for every char typed.
2600 * khtml/khtml_part.cpp:
2601 (KHTMLPart::setSelection): Don't do any spell checking if we're typing (it's done
2602 elsewhere, in markMisspellingsAfterTyping)
2604 2004-08-19 Maciej Stachowiak <mjs@apple.com>
2608 - fixed <rdar://problem/3549369> Crash at www.e1.ru in HTMLTokenizer::notifyFinished
2610 Probably also fixed the following likely duplicates:
2612 <rdar://problem/3503938> Safari crashed opening many tabs (HTMLTokenizer::notifyFinished(khtml::CachedObject*))
2613 <rdar://problem/3566332> CrashTracer: ..405 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
2614 <rdar://problem/3703964> CrashTracer: ...86 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
2615 <rdar://problem/3703969> CrashTracer: ..234 crashes at com.apple.WebCore: HTMLTokenizer::notifyFinished + 0x1c8
2617 * khtml/xml/dom_docimpl.cpp:
2618 (DocumentImpl::open): call setParsing(true), because we need to know we are once again
2619 parsing when we re-open a document that has previously completed loading.
2621 2004-08-19 Maciej Stachowiak <mjs@apple.com>
2623 Reviewed by Dave and Darin.
2625 * khtml/rendering/render_text.cpp:
2626 (RenderText::paint): Split apple and non-apple code paths to allow further cleanup.
2628 2004-08-19 Darin Adler <darin@apple.com>
2632 - fixed <rdar://problem/3767274> crash in partForWidget inside setFocus (test page attached)
2634 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::nextKeyViewInFrame): Remove code to do position
2635 the widget; no longer needed since we reworked how widgets get their positions.
2636 * kwq/KWQWidget.mm: (QWidget::setFocus): Ditto. This was the one that caused the bug.
2638 2004-08-19 David Hyatt <hyatt@apple.com>
2640 Fix crash when text is contained inside a table-colgroup.
2644 * khtml/xml/dom_textimpl.cpp:
2645 (TextImpl::rendererIsNeeded):
2647 2004-08-19 Trey Matteson <trey@apple.com>
2649 Unexpected errors hit while finding word boundaries, leading to crash.
2653 * kwq/KWQTextUtilities.cpp:
2654 (KWQFindWordBoundary): Don't call UCFindTextBreak with edge cases it thinks
2655 are param errors, and pass correct mask for forward case. Also fix off-by-one
2656 crashers in fallback code.
2658 2004-08-19 David Hyatt <hyatt@apple.com>
2660 Make XSLT imports/includes work. This code has to be turned off until the newer version of libxslt is
2663 Reviewed by kocienda
2665 * khtml/css/css_ruleimpl.cpp:
2666 (CSSImportRuleImpl::init):
2667 * khtml/xml/dom_docimpl.cpp:
2668 (DocumentImpl::DocumentImpl):
2669 (DocumentImpl::~DocumentImpl):
2670 (DocumentImpl::applyXSLTransform):
2671 * khtml/xml/dom_docimpl.h:
2672 (DOM::DocumentImpl::setTransformSource):
2673 (DOM::DocumentImpl::transformSource):
2674 * khtml/xml/dom_xmlimpl.cpp:
2675 (DOM::ProcessingInstructionImpl::checkStyleSheet):
2676 * khtml/xml/xml_tokenizer.cpp:
2681 (khtml::createQStringParser):
2682 (khtml::XMLTokenizer::setTransformSource):
2683 * khtml/xsl/xsl_stylesheetimpl.cpp:
2684 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
2685 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
2686 (DOM::XSLStyleSheetImpl::isLoading):
2687 (DOM::XSLStyleSheetImpl::clearDocuments):
2688 (DOM::XSLStyleSheetImpl::parseString):
2689 (DOM::XSLStyleSheetImpl::loadChildSheets):
2690 (DOM::XSLStyleSheetImpl::loadChildSheet):
2691 (DOM::XSLImportRuleImpl::parentStyleSheet):
2692 (DOM::XSLStyleSheetImpl::compileStyleSheet):
2693 (DOM::XSLStyleSheetImpl::locateStylesheetSubResource):
2694 (DOM::XSLImportRuleImpl::XSLImportRuleImpl):
2695 (DOM::XSLImportRuleImpl::~XSLImportRuleImpl):
2696 (DOM::XSLImportRuleImpl::setStyleSheet):
2697 (DOM::XSLImportRuleImpl::isLoading):
2698 (DOM::XSLImportRuleImpl::loadSheet):
2699 * khtml/xsl/xsl_stylesheetimpl.h:
2700 (DOM::XSLStyleSheetImpl::setOwnerDocument):
2701 (DOM::XSLStyleSheetImpl::setDocument):
2702 (DOM::XSLStyleSheetImpl::markAsProcessed):
2703 (DOM::XSLStyleSheetImpl::processed):
2704 (DOM::XSLImportRuleImpl::href):
2705 (DOM::XSLImportRuleImpl::styleSheet):
2706 (DOM::XSLImportRuleImpl::isImportRule):
2707 * khtml/xsl/xslt_processorimpl.cpp:
2708 (DOM::m_sourceDocument):
2709 (DOM::stylesheetLoadFunc):
2710 (DOM::XSLTProcessorImpl::transformDocument):
2711 * khtml/xsl/xslt_processorimpl.h:
2715 2004-08-18 Trey Matteson <trey@apple.com>
2717 3765958 - downstreamPosition() can hit infinite loop when at end of doc
2719 The problem was that I had a position that was after the maximum position in the text
2720 node, because it was the old caret position before a backspace was processed. Later
2721 I happened to call downstream() on that position, and hit the bug. Fix is to consider
2722 a position past the end point of its node if it is *greater than* or equal to its max offset.
2726 * khtml/xml/dom_positioniterator.cpp:
2727 (DOM::PositionIterator::atEnd):
2729 2004-08-18 David Hyatt <hyatt@apple.com>
2731 - did WebCore part of <rdar://problem/3682969> SLIDER: absolute left position of slider should be headline only
2733 Make the header overlap the footer in the zero-line case. Changes to Emerson's template will ensure the
2734 header draws over the footer.
2738 * khtml/rendering/render_block.cpp:
2739 (khtml::getHeightForLineCount):
2741 2004-08-18 Richard Williamson <rjw@apple.com>
2743 Replace horrible pollForAppletInView: with new
2744 webPlugInGetApplet. The details of how the applet instance
2745 is provided now belong to the Java team. Yeh.
2749 * kwq/KWQKHTMLPart.mm:
2750 (KWQKHTMLPart::getAppletInstanceForView):
2751 * kwq/WebCoreBridge.h:
2753 2004-08-18 Chris Blumenberg <cblu@apple.com>
2755 Fixed: <rdar://problem/3692199> 8A146: Safari crashes in toHTMLWithOptions, selection with no renderer (various sites)
2759 * khtml/xml/dom2_rangeimpl.cpp:
2760 (DOM::RangeImpl::toHTML): renamed, don't assume that nodes of the range had renderers, use the common ancestor of the range as the root
2761 * khtml/xml/dom2_rangeimpl.h:
2762 * khtml/xml/dom_nodeimpl.cpp:
2763 (NodeImpl::recursive_toHTML): renamed, removed code that determines whether to include the root in the HTML, leave this up to the caller
2764 * khtml/xml/dom_nodeimpl.h:
2765 * kwq/WebCoreBridge.mm:
2766 (-[WebCoreBridge markupStringFromNode:nodes:]): call renamed methods
2767 (-[WebCoreBridge markupStringFromRange:nodes:]): ditto
2769 2004-08-18 Ken Kocienda <kocienda@apple.com>
2771 * khtml/css/css_valueimpl.cpp:
2772 (CSSStyleDeclarationImpl::copy): Roll back silly last minute change that broke this code.
2773 Note to self: read code before making changes to it.
2775 2004-08-18 Ken Kocienda <kocienda@apple.com>
2777 Coded by Darin and Ken
2779 * khtml/css/css_computedstyle.cpp: Added CopyProperties static array. This contains
2780 the properties we implement that we also want to copy in the new
2781 CSSComputedStyleDeclarationImpl::copy described below.
2782 (DOM::CSSComputedStyleDeclarationImpl::copy): New function. In this class, copies the
2783 computed values of all the properties listed in CopyProperties. In essence, this makes
2784 a freeze-dired version of a computed style.
2785 (DOM::CSSComputedStyleDeclarationImpl::diff): Removes every property from the passed-in
2786 CSSStyleDeclarationImpl that is also in the computed style.
2787 * khtml/css/css_computedstyle.h:
2788 * khtml/css/css_valueimpl.cpp:
2789 (CSSStyleDeclarationImpl::copy): New function. In this class, the copy operation is
2790 straightforward. Returns a copy that will be unchanged when the original changes.
2791 * khtml/css/css_valueimpl.h:
2792 (DOM::CSSStyleDeclarationImpl::values): Added a accessor suitable for use when the
2793 CSSStyleDeclarationImpl is const.
2795 2004-08-17 Maciej Stachowiak <mjs@apple.com>
2799 <rdar://problem/3703768> CrashTracer: ...50 crashes at com.apple.WebCore: KHTMLPart::xmlDocImpl const + 0
2801 * khtml/khtmlview.cpp:
2802 (KHTMLView::viewportMouseMoveEvent): Add a nil check and an
2803 assertion for m_part being null. It seems impossible for this to
2804 happen, so we want to debug it ourselves, but in the meantime,
2805 let's try to avoid causing crashes for our users.
2807 2004-08-17 David Hyatt <hyatt@apple.com>
2809 Fix the line truncation function for Emerson so that at the far left setting of the slider, only the header
2814 * khtml/rendering/render_block.cpp:
2815 (khtml::getHeightForLineCount):
2816 * khtml/rendering/render_flexbox.cpp:
2817 (khtml::RenderFlexibleBox::layoutVerticalBox):
2819 2004-08-17 Ken Kocienda <kocienda@apple.com>
2823 Rewrite of the command that deletes a selection. I deleted great
2824 big swaths of bug-ridden code to accomplish this and replaced it
2825 with code that is much cleaner and smarter.
2827 Also, renamed equivalentUpstreamPosition and equivalentDownstreamPosition to
2828 upstream to downstream, respectively.
2830 Added a couple of new helper methods.
2832 * khtml/editing/htmlediting.cpp: DeleteCollapsibleWhitespaceCommand and
2833 RemoveNodeAndPruneCommand now obsolete. A huge win.
2834 * khtml/editing/htmlediting.h: Ditto.
2835 * khtml/editing/htmlediting_impl.cpp:
2836 (khtml::debugPosition): Fix printf which had a placeholder, but no argument passed in the varargs.
2837 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): New helper. Much simplified and cleaner
2839 (khtml::ApplyStyleCommandImpl::doApply): upstream/downstream name change
2840 (khtml::ApplyStyleCommandImpl::nodeFullySelected): upstream/downstream name change
2841 (khtml::DeleteSelectionCommandImpl::doApply): upstream/downstream name change
2842 (khtml::DeleteTextCommandImpl::DeleteTextCommandImpl): Add an assert to check that the
2843 passed offset is less than the length of the text node.
2844 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition): upstream/downstream name change
2845 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition): upstream/downstream name change
2846 (khtml::InputNewlineCommandImpl::doApply): upstream/downstream name change
2847 (khtml::InputTextCommandImpl::prepareForTextInsertion): upstream/downstream name change
2848 (khtml::InputTextCommandImpl::execute): upstream/downstream name change
2849 (khtml::InputTextCommandImpl::insertSpace): upstream/downstream name change
2850 (khtml::ReplaceSelectionCommandImpl::doApply): upstream/downstream name change
2851 (khtml::TypingCommandImpl::issueCommandForDeleteKey): upstream/downstream name change
2852 (khtml::TypingCommandImpl::deleteKeyPressed):
2853 * khtml/editing/htmlediting_impl.h:
2854 * khtml/xml/dom_position.cpp:
2855 (DOM::Position::previousWordBoundary):
2856 (DOM::Position::nextWordBoundary):
2857 (DOM::Position::upstream):
2858 (DOM::Position::downstream):
2859 (DOM::Position::inRenderedText): Add null check.
2860 (DOM::Position::isRenderedCharacter): New helper.
2861 (DOM::isWS): New helper in this file.
2862 (DOM::Position::leadingWhitespacePosition): New helper. Factored out from htmlediting_impl.cpp.
2863 (DOM::Position::trailingWhitespacePosition): Ditto.
2864 (DOM::Position::debugPosition): Add null check.
2865 * khtml/xml/dom_position.h:
2866 * khtml/xml/dom_selection.cpp:
2867 (DOM::Selection::toRange): upstream/downstream name change
2868 (DOM::Selection::validate): upstream/downstream name change
2869 (DOM::Selection::debugPosition): upstream/downstream name change
2870 * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Updated tests with new expected results.
2871 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
2872 * layout-tests/editing/deleting/delete-selection-001-expected.txt: Ditto.
2873 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Ditto.
2874 * layout-tests/editing/inserting/insert-br-case1-expected.txt: Ditto.
2875 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Ditto.
2876 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Ditto.
2878 2004-08-17 Trey Matteson <trey@apple.com>
2880 Various spelling fixes.
2884 * khtml/khtml_part.cpp:
2885 (KHTMLPart::setSelection): No misspellings in the spelling code comments
2886 * khtml/xml/dom_docimpl.cpp:
2887 (DocumentImpl::removeMarker): Repaint if doc changes. Sometimes the markers
2888 were not being erased when you clicked in a word.
2889 * khtml/xml/dom_position.cpp:
2890 (DOM::Position::previousWordBoundary): Small optimization. Bail after first
2891 try if the second try will not come out any different.
2892 (DOM::Position::nextWordBoundary): Ditto
2893 * kwq/KWQKHTMLPart.mm:
2894 (KWQKHTMLPart::markMisspellingsInSelection): Comment.
2896 2004-08-17 Darin Adler <darin@apple.com>
2900 - fixed <rdar://problem/3689700> crash loading page; stoxx.com (works in IE and Firefox)
2902 * khtml/khtml_part.h: Make completeURL public.
2903 * kwq/KWQKJavaAppletWidget.mm: (KJavaAppletWidget::KJavaAppletWidget): Complete the base URL
2904 before passing it across the bridge. This sidesteps the crashing bug in CFURL, filed as
2905 '<rdar://problem/3764632> CFURLCreateAbsoluteURLWithBytes crashes if passed the string "../.."'
2906 and also is obviously correct behavior that may fix other sites too.
2908 - fixed <rdar://problem/3547725> Crashes at csuohio.edu, list box vs. mouse event problem (Spoof No Fix)
2910 * kwq/KWQListBox.mm:
2911 (QListBox::~QListBox): Nil out the pointer from the KWQTableView back to the widget by calling
2912 a new detach method.
2913 (-[KWQTableView detach]): Set the pointer to the QListBox to 0. Also set the delegate and data
2914 source to nil, so we don't need nil checks in delegate and data source methods.
2915 (-[KWQTableView mouseDown:]): Add nil check.
2916 (-[KWQTableView keyDown:]): Add nil check.
2917 (-[KWQTableView keyUp:]): Add nil check.
2918 (-[KWQTableView becomeFirstResponder]): Add nil check.
2919 (-[KWQTableView resignFirstResponder]): Add nil check.
2920 (-[KWQTableView canBecomeKeyView]): Add nil check.
2921 (-[KWQTableView tableViewSelectionDidChange:]): Add nil checks, even though this is a delegate
2922 callback, to handle cases where calls to JavaScript result in the QListBox going away partway
2924 (-[KWQTableView drawRow:clipRect:]): Add nil check.
2925 (-[KWQTableView _accessibilityTableCell:tableColumn:]): Add nil check.
2927 2004-08-17 Trey Matteson <trey@apple.com>
2929 Fix ASSERT in spelling marker management.
2933 * khtml/xml/dom_docimpl.cpp:
2934 (DocumentImpl::shiftMarkers): Use assert instead of ASSERT.
2935 Tweak test to allow for a start position of 0.
2937 2004-08-17 Trey Matteson <trey@apple.com>
2939 3764147 - failure of subframe to load leaves links in parent doc broken
2943 * khtml/khtml_part.cpp:
2944 (KHTMLPart::childBegin): New method to mark part as not complete.
2945 (KHTMLPart::processObjectRequest): Mark child part imcomplete, so if we
2946 later get a failure on load it won't think it's already complete and do nothing.
2947 * khtml/khtml_part.h:
2951 2004-08-16 David Hyatt <hyatt@apple.com>
2953 Fix the #define. I had it all backwards.
2957 2004-08-16 David Hyatt <hyatt@apple.com>
2959 Land initial support for XSLT using xml-stylesheet PIs.
2961 * WebCore.pbproj/project.pbxproj:
2962 * khtml/khtml_part.cpp:
2963 (KHTMLPart::replaceDocImpl):
2964 * khtml/khtml_part.h:
2965 * khtml/khtmlview.h:
2966 * khtml/xml/dom_docimpl.cpp:
2967 (DocumentImpl::DocumentImpl):
2968 (DocumentImpl::~DocumentImpl):
2969 (DocumentImpl::recalcStyleSelector):
2970 (DocumentImpl::applyXSLTransform):
2971 (DocumentImpl::setTransformSourceDocument):
2972 * khtml/xml/dom_docimpl.h:
2973 (DOM::DocumentImpl::setTransformSource):
2974 (DOM::DocumentImpl::transformSource):
2975 (DOM::DocumentImpl::transformSourceDocument):
2976 * khtml/xml/dom_xmlimpl.cpp:
2977 (DOM::ProcessingInstructionImpl::checkStyleSheet):
2978 * khtml/xml/dom_xmlimpl.h:
2979 (DOM::ProcessingInstructionImpl::isXSL):
2980 * khtml/xml/xml_tokenizer.cpp:
2983 (khtml::createQStringParser):
2984 (khtml::XMLTokenizer::processingInstruction):
2985 (khtml::XMLTokenizer::finish):
2986 (khtml::XMLTokenizer::setTransformSource):
2987 * khtml/xml/xml_tokenizer.h:
2988 (khtml::Tokenizer::setTransformSource):
2989 * khtml/xml/xsl_stylesheetimpl.cpp: Removed.
2990 * khtml/xml/xsl_stylesheetimpl.h: Removed.
2991 * khtml/xsl/xsl_stylesheetimpl.cpp: Added.
2992 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
2993 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
2994 (DOM::XSLStyleSheetImpl::isLoading):
2995 (DOM::XSLStyleSheetImpl::checkLoaded):
2996 (DOM::XSLStyleSheetImpl::docLoader):
2997 (DOM::XSLStyleSheetImpl::parseString):
2998 * khtml/xsl/xsl_stylesheetimpl.h: Added.
2999 (DOM::XSLStyleSheetImpl::isXSLStyleSheet):
3000 (DOM::XSLStyleSheetImpl::type):
3001 (DOM::XSLStyleSheetImpl::ownerDocument):
3002 (DOM::XSLStyleSheetImpl::document):
3003 (DOM::XSLStyleSheetImpl::clearDocument):
3004 * khtml/xsl/xslt_processorimpl.cpp: Added.
3005 (DOM::m_sourceDocument):
3006 (DOM::XSLTProcessorImpl::~XSLTProcessorImpl):
3007 (DOM::XSLTProcessorImpl::transformDocument):
3009 (DOM::XSLTProcessorImpl::addToResult):
3010 (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
3011 * khtml/xsl/xslt_processorimpl.h: Added.
3013 2004-08-16 Maciej Stachowiak <mjs@apple.com>
3017 * khtml/khtml_part.cpp:
3018 (KHTMLPart::isImmediateRedirectPending):
3020 2004-08-16 Richard Williamson <rjw@apple.com>
3022 Fixed <rdar://problem/3704339> Context2D forces integer positions in drawImage
3024 Use floats instead of ints to draw images.
3028 * khtml/ecma/kjs_html.cpp:
3029 (KJS::Context2DFunction::tryCall):
3031 * kwq/KWQPainter.mm:
3032 (QPainter::drawPixmap):
3033 (QPainter::drawFloatPixmap):
3035 2004-08-13 Maciej Stachowiak <mjs@apple.com>
3039 - fixed <rdar://problem/3752509> Pop up windows not showing up within SAP's BW Module (changing location.href on new window created by window.open)
3041 (actually the previous fix for this bug was mostly correct, but
3042 this additional change is needed to avoid the regression in
3043 <rdar://problem/3751025> REGRESSION: website rejects Safari 125.9
3044 as "need to upgrade to IE 6", but didn't reject 125.8
3046 So if merging for a software update, make sure to include both
3047 this and the previous fix.
3049 * khtml/html/htmltokenizer.cpp:
3050 (khtml::HTMLTokenizer::write): When there is an immediate reidrect pending,
3051 make sure to stop tokenizing, because we need to make sure no further
3052 script tags are processed beyond the one that triggered the redirect.
3053 * khtml/khtml_part.cpp:
3054 (KHTMLPart::isImmediateRedirectPending): New method to allow
3055 checking if a redirect is pending.
3056 * khtml/khtml_part.h:
3058 2004-08-15 David Hyatt <hyatt@apple.com>
3060 - fixed <rdar://problem/3760508> REGRESSION (154-155): No text in textarea
3062 Fix the blank textarea problem by ensuring that any change to a <textarea>'s DOM children causes the form control
3063 to resync with the DOM. This behavior matches WinIE.
3065 Reviewed by kocienda
3067 * khtml/html/html_formimpl.cpp:
3068 (HTMLTextAreaElementImpl::childrenChanged):
3069 * khtml/html/html_formimpl.h:
3071 2004-08-13 Trey Matteson <trey@apple.com>
3073 3761794 Slider doesn't call onmouseup handler
3077 * khtml/rendering/render_form.cpp:
3078 (RenderSlider::RenderSlider): Listen for signal.
3079 (RenderSlider::slotClicked): Pass to superclass.
3080 * khtml/rendering/render_form.h:
3083 (-[KWQSlider mouseDown:]): Generate mouseUp and clicked events,
3084 since AK consumes the mouseUp event in a modal tracking loop.
3085 (QSlider::QSlider): Make signal.
3086 (QSlider::clicked): Send signal.
3088 2004-08-12 Trey Matteson <trey@apple.com>
3090 3761329 - query result links all dead in ingrammicro.com (sometimes)
3091 3761328 - links in some docs dead when doc is loaded from WebArchive
3093 Make sure to get part to completed state when end is called,
3094 even if we have no doc. See WebKit changelog for more info.
3096 Reviewed by Richard and Darin.
3098 * khtml/khtml_part.cpp:
3101 2004-08-13 Trey Matteson <trey@apple.com>
3103 3761098 - red dotted underline for misspelled words shows up in drag image
3107 * khtml/rendering/render_text.cpp:
3108 (RenderText::paint): Don't draw misspelling when creating selection image.
3110 2004-08-12 Richard Williamson <rjw@apple.com>
3112 Bring npruntime.h and friends closer to compliance with
3117 * kwq/KWQKHTMLPart.mm:
3118 (KWQKHTMLPart::windowScriptNPObject):
3120 2004-08-12 Maciej Stachowiak <mjs@apple.com>
3122 Reviewed by Richard.
3124 <rdar://problem/3245706> URLs with backslashes instead of slashes work on WinIE; should work on Safari (SAP)
3125 <rdar://problem/3506429> <BASE> tag containing backslash is breaking images with absolute URLs
3128 (substituteBackslashes): Helper method
3129 (KURL::KURL): If the URL contains any backslashes, substitute all
3130 that appear before the query or fragment.
3132 2004-08-12 Ken Kocienda <kocienda@apple.com>
3138 <rdar://problem/3761014> command-down-arrow takes you to start of document instead of end of document
3140 * khtml/xml/dom_selection.cpp:
3141 (DOM::Selection::modifyExtendingRightForward): Code used to assume, incorrectly, that index 1 of the
3142 document element was beyond the last node in the document. But this is not true, since the document
3143 element is the HTML element (generally). Instead, move to the index equal to the number of children
3144 of the document element. This puts us past everything.
3145 (DOM::Selection::modifyMovingRightForward): Ditto.
3147 2004-08-12 Ken Kocienda <kocienda@apple.com>
3153 <rdar://problem/3695446> shift-down-arrow on last line of editable text should select to end of document
3155 Detect when current position is on first or last line and move to the
3156 start or end of that line, respectively.
3158 * khtml/xml/dom_position.cpp:
3159 (DOM::Position::previousLinePosition)
3160 (DOM::Position::nextLinePosition)
3164 2004-08-12 Ken Kocienda <kocienda@apple.com>
3168 Some consolidation in style application code.
3170 * khtml/editing/htmlediting_impl.cpp:
3171 (khtml::StyleChange::StyleChange): Made this a full-on class and added a couple of
3172 members and a constructors to make a StyleChange from a CSSStyleDeclarationImpl, as
3173 well as from a CSSStyleDeclarationImpl and a Position.
3174 (khtml::StyleChange::init): Common init function for StyleChange constructors.
3175 (khtml::StyleChange::currentlyHasStyle): Moved this here from ApplyStyleCommandImpl.
3176 (khtml::CompositeEditCommandImpl::applyTypingStyle): Tweak to adjust to new StyleChange
3178 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Ditto.
3179 * khtml/editing/htmlediting_impl.h:
3180 (khtml::StyleChange::StyleChange):
3181 (khtml::StyleChange::cssStyle): New accessor.
3182 (khtml::StyleChange::applyBold): Ditto.
3183 (khtml::StyleChange::applyItalic): Ditto.
3184 * khtml/xml/dom_position.cpp:
3185 (DOM::Position::computedStyle): New helper.
3186 * khtml/xml/dom_position.h: Ditto.
3188 2004-08-12 Ken Kocienda <kocienda@apple.com>
3193 <rdar://problem/3751098> HTML email has one set of SPAN tags per character in the message
3195 Progress on this bug:
3196 <rdar://problem/3755562> Typing styles do not use same tag application conventions as font and color panel
3198 * khtml/editing/htmlediting_impl.cpp:
3199 (khtml::CompositeEditCommandImpl::applyTypingStyle): Name changed from createTypingStyleElement.
3200 Also, interface changed to take the node to which the typing style is to be applied.
3201 This makes it easier to apply what may be up to three levels of nested tags to get the
3202 desired style (<B>, <I>, and <SPAN STYLE="">).
3203 Also, Borrow some of the style change smarts from ApplyStyleCommandImpl to use bold and
3204 italic tags for applying styles when that is apprpriate. This creates on opportunity to
3205 factor the code to do this so that this function and the ApplyStyleCommandImpl class can
3206 share the implementation. I will follow up with a change to do that after landing this
3207 change. Some future code factoring could be done here to bring together some similar code
3209 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Add comment about code factoring work.
3210 (khtml::ApplyStyleCommandImpl::computeStyleChange): StyleChange struct no longer a member of the
3211 ApplyStyleCommandImpl class. CompositeEditCommandImpl needs it now in its applyTypingStyle()
3213 (khtml::InputNewlineCommandImpl::doApply): Pass along node to style to applyTypingStyle.
3214 (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
3215 * khtml/editing/htmlediting_impl.h:
3216 (khtml::StyleChange::StyleChange): Pull this struct out of ApplyStyleCommandImpl so
3217 CompositeEditCommandImpl can use it.
3218 * khtml/khtml_part.cpp:
3219 (KHTMLPart::notifySelectionChanged): Always clear typing style when the selection
3220 changes, not only when closing typing. This fixes 3751098.
3222 These three tests actually had results that treated the buggy behavior as correct!
3224 * layout-tests/editing/style/style-3681552-fix-001-expected.txt
3225 * layout-tests/editing/style/style-3681552-fix-002-expected.txt
3226 * layout-tests/editing/style/typing-style-002-expected.txt
3228 2004-08-12 Darin Adler <darin@apple.com>
3232 - fixed <rdar://problem/3740485> Repro crash involving replacing content that includes form field
3234 * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Since this function calls selectText: which has a side
3235 effect of making the text field be first responder, call to bridge first to make it first responder.
3236 The bridge version lets WebHTMLView know we are changing the responder, avoiding some unpleasantness
3237 because it sets the "changing focus programmatically" flag. Without that flag set, we were getting
3238 an additional setFocusNode(0) call, which is unnecessary and incorrect.
3240 2004-08-12 Darin Adler <darin@apple.com>
3244 - fixed <rdar://problem/3758756> copying text selected with down arrow results in all text to end of document
3246 * khtml/xml/dom2_rangeimpl.h: Make startNode and pastEndNode public.
3247 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::pastEndNode): Fix bug where this would return
3248 one node too far in the case where the end container was not a text node.
3250 * khtml/xml/dom_nodeimpl.cpp:
3251 (NodeImpl::recursive_toHTMLWithOptions): Rewrite loop, using startNode and pastEndNode,
3252 to fix bug where it would run past the end node, including too many nodes in the generated
3253 HTML. Nice side benefit: easier to read the code.
3255 2004-08-11 Chris Blumenberg <cblu@apple.com>
3257 Fixed: <rdar://problem/3758216> PARENTAL: buttons on parental controls page only work once
3261 * kwq/KWQKHTMLPart.mm:
3262 (KWQKHTMLPart::submitForm): prevent a form from being submitted more than once only if it uses a scheme of http or https
3264 2004-08-11 Darin Adler <darin@apple.com>
3268 - fixed <rdar://problem/3715878> 8A162: connect.apple.com password field showed in cleartext
3270 * kwq/KWQTextField.mm: (-[KWQSecureTextField textDidEndEditing:]):
3271 Enhanced workaround for shifting focus from one secure text field to another so that it works
3272 even for the case of shifting focus from a secure text field back to itself.
3274 2004-08-11 Ken Kocienda <kocienda@apple.com>
3276 Missed adding this file before.
3278 * kwq/KWQTextUtilities.mm: Added.
3279 (KWQFindNextWordFromIndex):
3281 2004-08-11 Ken Kocienda <kocienda@apple.com>
3285 Efficiency improvements on string manipulations in these two new function
3286 implementations. Use the versions of QString append/prepend that take
3287 (QChar *c, uint length) instead of creating new strings each time.
3289 * khtml/xml/dom_position.cpp:
3290 (DOM::Position::previousWordPosition): Changed, as described above.
3291 (DOM::Position::nextWordPosition): Ditto.
3293 2004-08-11 Ken Kocienda <kocienda@apple.com>
3298 <rdar://problem/3675812> Moving a word at a time does not use the correct conception of "word"
3300 I have implemented versions of previousWordPosition and nextWordPosition that are now
3301 different than previousWordBoundary and nextWordBoundary. The behavior of the new
3302 functions attempts to match what Cocoa does as closely as it can. Let the bug filing begin!
3304 * WebCore.pbproj/project.pbxproj: Added KWQTextUtilities.mm
3305 * khtml/misc/helper.cpp:
3306 (khtml::nextWordFromIndex): Glue to call through to KWQFindNextWordFromIndex.
3307 * khtml/misc/helper.h: Declare the function above.
3308 * khtml/misc/khtml_text_operations.cpp: Added SimplifiedBackwardsTextIterator class.
3309 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): New
3310 (khtml::SimplifiedBackwardsTextIterator::advance): Ditto.
3311 (khtml::SimplifiedBackwardsTextIterator::handleTextNode): Ditto.
3312 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement): Ditto.
3313 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Ditto.
3314 (khtml::SimplifiedBackwardsTextIterator::exitNode): Ditto.
3315 (khtml::SimplifiedBackwardsTextIterator::emitCharacter): Ditto.
3316 (khtml::SimplifiedBackwardsTextIterator::range): Ditto.
3317 * khtml/misc/khtml_text_operations.h:
3318 (khtml::SimplifiedBackwardsTextIterator::atEnd): Ditto.
3319 (khtml::SimplifiedBackwardsTextIterator::length): Ditto.
3320 (khtml::SimplifiedBackwardsTextIterator::characters): Ditto.
3321 * khtml/xml/dom_position.cpp:
3322 (DOM::Position::previousWordBoundary): Updated to gather appropriate text and call through to
3323 AppKit to perform the same calculations NSText uses.
3324 (DOM::Position::nextWordBoundary): Ditto.
3325 (DOM::Position::previousWordPosition): Unrelated change to fix case where the function could get "stuck".
3326 (DOM::Position::nextWordPosition): Ditto
3327 (DOM::Position::equivalentDeepPosition): Changed to look backwards if the position's offset is equal
3328 to the number of child nodes it has. This handles more cases correctly, like when the position is
3329 gives as one beyond the end of a document element's last child.
3330 * kwq/KWQTextUtilities.h: Declared KWQFindNextWordFromIndex.
3331 * kwq/KWQTextUtilities.mm: Added.
3332 (KWQFindNextWordFromIndex): New function.
3334 2004-08-11 Ken Kocienda <kocienda@apple.com>
3340 <rdar://problem/3732702> crash in CSSComputedStyleDeclarationImpl running devtools.com editing sample code