3 2004-09-02 David Hyatt <hyatt@apple.com>
5 Swap RenderBox and RenderContainer. Make leaf RenderObjects actually derive off of RenderBox instead.
9 * khtml/rendering/render_block.cpp:
10 (khtml::RenderBlock::addChildToFlow):
11 * khtml/rendering/render_box.cpp:
12 (RenderBox::RenderBox):
14 * khtml/rendering/render_box.h:
15 * khtml/rendering/render_container.cpp:
16 (RenderContainer::RenderContainer):
17 (RenderContainer::detach):
18 * khtml/rendering/render_container.h:
19 * khtml/rendering/render_flow.cpp:
21 (RenderFlow::dirtyLineBoxes):
22 (RenderFlow::createInlineBox):
23 (RenderFlow::getAbsoluteRepaintRect):
24 (RenderFlow::lowestPosition):
25 (RenderFlow::rightmostPosition):
26 (RenderFlow::leftmostPosition):
27 (RenderFlow::caretPos):
28 * khtml/rendering/render_flow.h:
29 (khtml::RenderFlow::RenderFlow):
30 * khtml/rendering/render_frames.cpp:
31 (RenderFrameSet::RenderFrameSet):
32 (RenderFrameSet::nodeAtPoint):
33 (RenderFrameSet::dump):
34 * khtml/rendering/render_frames.h:
35 * khtml/rendering/render_inline.cpp:
36 (RenderInline::addChildToFlow):
37 * khtml/rendering/render_replaced.cpp:
38 * khtml/rendering/render_replaced.h:
39 (khtml::RenderReplaced::setIntrinsicHeight):
40 * khtml/rendering/render_table.cpp:
41 (RenderTableSection::RenderTableSection):
42 (RenderTableSection::detach):
43 (RenderTableSection::setStyle):
44 * khtml/rendering/render_table.h:
46 2004-09-02 Ken Kocienda <kocienda@apple.com>
50 * khtml/editing/htmlediting_impl.h: Fix some inconsistent use of whitespace. No code change.
52 2004-09-02 Ken Kocienda <kocienda@apple.com>
58 <rdar://problem/3786848> REGRESSION (Mail): Typing styles and font panel updates broken
60 * khtml/xml/dom_position.cpp:
61 (DOM::Position::inRenderedContent): Check for inlines that can have kids is wrong.
62 I busted this the other day when making the PositionIterator class iterate over
63 all nodes and not just leaves of the DOM tree.
65 Update all the following functions. These use the PositionIterator class, but still
66 only want to consider leaf nodes.
68 (DOM::Position::isFirstRenderedPositionOnLine)
69 (DOM::Position::isLastRenderedPositionOnLine)
70 (DOM::Position::isLastRenderedPositionInEditableBlock)
71 (DOM::Position::inFirstEditableInRootEditableElement)
72 (DOM::Position::inLastEditableInRootEditableElement)
73 (DOM::Position::inFirstEditableInContainingEditableBlock)
74 (DOM::Position::inLastEditableInContainingEditableBlock)
76 2004-09-02 Richard Williamson <rjw@apple.com>
78 Support for patterns in <canvas>
82 * khtml/ecma/kjs_html.cpp:
83 (KJS::Context2DFunction::tryCall):
84 (Context2D::putValue):
86 (ImagePattern::ImagePattern):
87 (ImagePattern::~ImagePattern):
88 * khtml/ecma/kjs_html.h:
89 (KJS::ImagePattern::getPattern):
90 (KJS::ImagePattern::pixmap):
94 * kwq/WebCoreImageRenderer.h:
96 2004-09-01 David Hyatt <hyatt@apple.com>
98 Fix for 3769409, a regression from 10.3.4 to 10.3.5 involving <colgroup>s in malformed HTML.
102 * khtml/html/htmlparser.cpp:
103 (KHTMLParser::insertNode):
105 2004-09-01 David Hyatt <hyatt@apple.com>
107 Fix for the <colgroup> crasher. Make sure adding to an anonymous box just returns immediately. Also eliminate
108 all the redundant setPos -500000 calls, since we don't need those at all.
112 * khtml/rendering/render_block.cpp:
113 (khtml::RenderBlock::addChildToFlow):
114 (khtml::RenderBlock::makeChildrenNonInline):
115 * khtml/rendering/render_inline.cpp:
116 (RenderInline::splitFlow):
118 2004-09-02 Ken Kocienda <kocienda@apple.com>
124 <rdar://problem/3729219> REGRESSION (Mail): Caret placement and navigation not working correctly at yahoo.com
125 <rdar://problem/3758606> REGRESSION (Mail): Deletions across DIV elements is broken
126 <rdar://problem/3784810> REGRESSION (Mail): delete at beginning of line instead deletes to the end of the document (simple reduced test)
128 I made some very big improvements to the code which handles deletions of selections
129 which span more than one block.
131 * khtml/editing/htmlediting_impl.cpp:
132 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): An new, overloaded version of this
133 function which works on a NodeImpl. The code in this function fell out of some refactoring
134 I did in the function with the same name which takes a Position as an argument.
135 (khtml::DeleteSelectionCommandImpl::moveNodesToBlock): New function. This new logic provides
136 the smarts to fix the bugs listed above and greatly improves the code to perform deleting
137 selections which span more than one block.
138 (khtml::DeleteSelectionCommandImpl::doApply): Several changes. Constrain downstream positions
139 so that they stay in the current block. This was a mistake before I think. Add code to detect
140 when the insertion point is a caret at the start of a block. This is a special-case of a
141 cross-block selection. Change the end-of-deletion-fixup case to operate on the downstreamEnd
142 position of the selection rather than the upstream. This is more logical. Refine the block
143 merge logic to handle more cases, like dealing with whitespace.
144 * khtml/editing/htmlediting_impl.h: Associated header file changes.
145 * khtml/xml/dom_nodeimpl.cpp:
146 (NodeImpl::rootEditableElement): Add code to clamp the return value to the body element.
147 * khtml/xml/dom_selection.cpp:
148 (DOM::Selection::validate): Make selection canonicalizations stay in the current block.
149 * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt:
150 * layout-tests/editing/deleting/delete-block-merge-contents-001.html:
151 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: Added.
152 * layout-tests/editing/deleting/delete-block-merge-contents-002.html: Added.
153 * layout-tests/editing/deleting/delete-block-merge-contents-003-expected.txt: Added.
154 * layout-tests/editing/deleting/delete-block-merge-contents-003.html: Added.
155 * layout-tests/editing/deleting/delete-block-merge-contents-004-expected.txt: Added.
156 * layout-tests/editing/deleting/delete-block-merge-contents-004.html: Added.
157 * layout-tests/editing/deleting/delete-block-merge-contents-005-expected.txt: Added.
158 * layout-tests/editing/deleting/delete-block-merge-contents-005.html: Added.
159 * layout-tests/editing/deleting/delete-block-merge-contents-006-expected.txt: Added.
160 * layout-tests/editing/deleting/delete-block-merge-contents-006.html: Added.
161 * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Added.
162 * layout-tests/editing/deleting/delete-block-merge-contents-007.html: Added.
163 * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt: Added.
164 * layout-tests/editing/deleting/delete-block-merge-contents-008.html: Added.
165 * layout-tests/editing/deleting/delete-block-merge-contents-009-expected.txt: Added.
166 * layout-tests/editing/deleting/delete-block-merge-contents-009.html: Added.
167 * layout-tests/editing/deleting/delete-block-merge-contents-010-expected.txt: Added.
168 * layout-tests/editing/deleting/delete-block-merge-contents-010.html: Added.
169 * layout-tests/editing/deleting/delete-block-merge-contents-011-expected.txt: Added.
170 * layout-tests/editing/deleting/delete-block-merge-contents-011.html: Added.
171 * layout-tests/editing/inserting/insert-3654864-fix-expected.txt: Updated with new results.
172 * layout-tests/editing/inserting/insert-3654864-fix.html: Updated test to deal better with
173 improved select all behavior.
174 * layout-tests/editing/selection/select-all-003-expected.txt: Updated with new results.
176 2004-09-01 Richard Williamson <rjw@apple.com>
178 Fixed panther build glitch.
182 * khtml/ecma/kjs_html.cpp:
184 2004-09-01 Richard Williamson <rjw@apple.com>
186 Finished implementation of gradient support in <canvas>.
190 * khtml/ecma/kjs_html.cpp:
191 (KJS::HTMLElementFunction::tryCall):
194 (KJS::Context2DFunction::tryCall):
195 (Context2D::putValue):
196 (Context2D::Context2D):
197 (KJS::GradientFunction::tryCall):
199 (Gradient::commonInit):
200 (Gradient::Gradient):
201 (Gradient::~Gradient):
202 (Gradient::getShading):
203 (Gradient::addColorStop):
205 (Gradient::colorStops):
206 * khtml/ecma/kjs_html.h:
207 (KJS::ColorStop::ColorStop):
208 * khtml/ecma/kjs_html.lut.h:
211 2004-09-01 David Hyatt <hyatt@apple.com>
213 Fix for 3784686, hidden links still active. Make sure text nodes exclude themselves from nodeAtPoint checks
216 * khtml/rendering/render_text.cpp:
217 (RenderText::nodeAtPoint):
219 2004-08-31 David Hyatt <hyatt@apple.com>
221 Fixes for 3761411 and 3782201. This patch makes two changes to percentage heights. First it makes sure that
222 replaced elements always flex inside a cell (unlike blocks and tables, which do so only sometimes under bizarre
223 conditions that are still being guessed at by me). The second fix is a recognition that empty tables do not
224 actually honor their heights, and so it is a mistake to try to flex them.
228 * khtml/rendering/render_table.cpp:
229 (RenderTableSection::layoutRows):
230 * khtml/rendering/render_table.h:
231 (khtml::RenderTable::hasSections):
233 2004-08-31 Ken Kocienda <kocienda@apple.com>
239 <rdar://problem/3781572> can't paste text in replied message view
241 * khtml/xml/dom2_rangeimpl.cpp:
242 (DOM::RangeImpl::toHTML): Copying text placed in an anonymous block was failing
243 since the code in here depending on the text node's containing block having an
244 element, which it won't. In fact, using containing block is wrong anyway, since
245 positioned elements can have containing blocks far from where they live in the
246 tree. This "move up to block check" should use the more DOM-wise enclosingBlockFlowElement()
249 2004-08-30 David Hyatt <hyatt@apple.com>
251 Fix for 3742585, sony dhtml menus wrong size. The percentage table height algorithm was wrong. This patch
252 unifies the table percentage height algorithm with the block percentage height algorithm and fixes bugs in
257 * khtml/rendering/render_box.cpp:
258 (RenderBox::calcPercentageHeight):
259 * khtml/rendering/render_table.cpp:
260 (RenderTable::layout):
262 2004-08-31 Ken Kocienda <kocienda@apple.com>
266 Added more editing layout tests.
268 * layout-tests/editing/deleting/delete-tab-001-expected.txt: Added.
269 * layout-tests/editing/deleting/delete-tab-001.html: Added.
270 * layout-tests/editing/deleting/delete-tab-002-expected.txt: Added.
271 * layout-tests/editing/deleting/delete-tab-002.html: Added.
272 * layout-tests/editing/deleting/delete-tab-003-expected.txt: Added.
273 * layout-tests/editing/deleting/delete-tab-003.html: Added.
274 * layout-tests/editing/deleting/delete-tab-004-expected.txt: Added.
275 * layout-tests/editing/deleting/delete-tab-004.html: Added.
276 * layout-tests/editing/editing.js: Fixed a little bug in one of the "delayed" commands.
277 * layout-tests/editing/inserting/insert-tab-001-expected.txt: Added.
278 * layout-tests/editing/inserting/insert-tab-001.html: Added.
279 * layout-tests/editing/inserting/insert-tab-002-expected.txt: Added.
280 * layout-tests/editing/inserting/insert-tab-002.html: Added.
281 * layout-tests/editing/inserting/insert-tab-003-expected.txt: Added.
282 * layout-tests/editing/inserting/insert-tab-003.html: Added.
283 * layout-tests/editing/inserting/insert-tab-004-expected.txt: Added.
284 * layout-tests/editing/inserting/insert-tab-004.html: Added.
286 2004-08-31 Ken Kocienda <kocienda@apple.com>
292 <rdar://problem/3782521> Typing newline at start of block does not work
294 * khtml/editing/htmlediting_impl.cpp:
295 (khtml::InputNewlineCommandImpl::doApply): Change handling of case to insert
296 newline at the start of a block.
297 * layout-tests/editing/inserting/insert-br-006-expected.txt: Updated layout test with
300 2004-08-31 Ken Kocienda <kocienda@apple.com>
304 Checked in incorrect results for these tests. There are the right ones.
306 * layout-tests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt
307 * layout-tests/editing/selection/move-by-line-001-expected.txt
309 2004-08-31 Ken Kocienda <kocienda@apple.com>
313 Added more editing layout tests.
315 * layout-tests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt: Added.
316 * layout-tests/editing/deleting/collapse-whitespace-3587601-fix.html: Added.
317 * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt: Added.
318 * layout-tests/editing/deleting/delete-block-merge-contents-001.html: Added.
319 * layout-tests/editing/editing.js: Added some more navigation commands.
320 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt: Added.
321 * layout-tests/editing/inserting/insert-3778059-fix.html: Added.
322 * layout-tests/editing/selection/move-by-line-001-expected.txt: Added.
323 * layout-tests/editing/selection/move-by-line-001.html: Added.
324 * layout-tests/editing/style/typing-style-003-expected.txt: Added.
325 * layout-tests/editing/style/typing-style-003.html: Added.
327 2004-08-31 Ken Kocienda <kocienda@apple.com>
331 Added more editing layout tests. Renamed some others.
333 * layout-tests/editing/inserting/insert-br-001-expected.txt: Added.
334 * layout-tests/editing/inserting/insert-br-001.html: Added.
335 * layout-tests/editing/inserting/insert-br-002-expected.txt: Added.
336 * layout-tests/editing/inserting/insert-br-002.html: Added.
337 * layout-tests/editing/inserting/insert-br-003-expected.txt: Added.
338 * layout-tests/editing/inserting/insert-br-003.html: Added.
339 * layout-tests/editing/inserting/insert-br-004-expected.txt: Added.
340 * layout-tests/editing/inserting/insert-br-004.html: Added.
341 * layout-tests/editing/inserting/insert-br-005-expected.txt: Added.
342 * layout-tests/editing/inserting/insert-br-005.html: Added.
343 * layout-tests/editing/inserting/insert-br-006-expected.txt: Added.
344 * layout-tests/editing/inserting/insert-br-006.html: Added.
345 * layout-tests/editing/inserting/insert-br-case1-expected.txt: Removed.
346 * layout-tests/editing/inserting/insert-br-case1.html: Removed.
347 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Removed.
348 * layout-tests/editing/inserting/insert-br-case2.html: Removed.
349 * layout-tests/editing/inserting/insert-br-case3-expected.txt: Removed.
350 * layout-tests/editing/inserting/insert-br-case3.html: Removed.
351 * layout-tests/editing/inserting/insert-br-case6-expected.txt: Removed.
352 * layout-tests/editing/inserting/insert-br-case6.html: Removed.
353 * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt: Added.
354 * layout-tests/editing/inserting/insert-text-with-newlines.html: Added.
356 2004-08-31 Ken Kocienda <kocienda@apple.com>
360 * layout-tests/editing/editing.js: Modified typeCharacterCommand so it can accept a character
363 2004-08-31 Ken Kocienda <kocienda@apple.com>
369 <rdar://problem/3777629> REGRESSION (Mail): can't delete blank lines in quoted text in HTML mail replies
370 <rdar://problem/3780309> REGRESSION (Mail): can't delete past an empty span in a particular test case
371 <rdar://problem/3780315> REGRESSION (Mail): right arrow works incorrectly in a particular test case with an empty span
372 <rdar://problem/3780320> REGRESSION (Mail): left arrow works incorrectly in a particular test case with an empty span
373 <rdar://problem/3780336> REGRESSION (Mail): down arrow fails in a reduction of a Mail reply test case (seems to be inside a span)
375 * khtml/xml/dom_position.cpp:
376 (DOM::Position::upstream): If this position's node is a block, use it for the StayInBlock case, not the block's
378 (DOM::Position::downstream): Ditto.
379 (DOM::Position::inRenderedContent): Refine the case for non-text nodes. This was erroneously returning true
380 for any empty element (like <span></span>).
381 * khtml/xml/dom_positioniterator.cpp: Change the following four functions to consider all nodes, not just
382 leaves of the DOM tree. This is a step towards making this iteration less cranky and unpredictable, and
383 was necessary to do now to keep the inRenderedContent() change above from breaking editign layout tests.
384 (DOM::PositionIterator::peekPrevious)
385 (DOM::PositionIterator::peekNext)
386 (DOM::PositionIterator::atStart)
387 (DOM::PositionIterator::atEnd)
388 * kwq/KWQKHTMLPart.mm:
389 (KWQKHTMLPart::fontForCurrentPosition): Check that the position being checked is an element and that the
390 element is in rendered content. I ran across some null-check failures while I was coding this fix, and
391 the additions seem prudent.
393 Updated these layout tests with new results.
395 * layout-tests/editing/deleting/delete-3608430-fix-expected.txt:
396 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
397 * layout-tests/editing/deleting/delete-block-contents-001-expected.txt:
398 * layout-tests/editing/deleting/delete-block-contents-002-expected.txt:
399 * layout-tests/editing/deleting/delete-block-contents-003-expected.txt:
400 * layout-tests/editing/deleting/delete-image-004-expected.txt:
401 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
402 * layout-tests/editing/editing.js:
403 * layout-tests/editing/execCommand/boldSelection-expected.txt:
404 * layout-tests/editing/execCommand/italicizeByCharacter-expected.txt:
405 * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt:
406 * layout-tests/editing/execCommand/print-expected.txt:
407 * layout-tests/editing/execCommand/selectAll-expected.txt:
408 * layout-tests/editing/selection/extend-by-character-002-expected.txt:
409 * layout-tests/editing/selection/extend-by-character-004-expected.txt:
410 * layout-tests/editing/selection/extend-by-character-005-expected.txt:
411 * layout-tests/editing/selection/extend-by-character-006-expected.txt:
412 * layout-tests/editing/selection/select-all-001-expected.txt:
413 * layout-tests/editing/selection/select-all-002-expected.txt:
414 * layout-tests/editing/selection/select-all-003-expected.txt:
416 2004-08-30 Darin Adler <darin@apple.com>
420 - fixed <rdar://problem/3637519> REGRESSION (125-128): unrepro crash in QListBox::sizeForNumberOfLines at istweb.apple.com
422 * kwq/KWQListBox.h: Added a clearCachedTextRenderers function.
424 (itemTextRenderer): Change to use globals that are outside the function, and added retain calls.
425 (groupLabelTextRenderer): Ditto.
426 (QListBox::clearCachedTextRenderers): Release global text renderers and nil out the globals.
428 * kwq/WebCoreBridge.h: Removed updateAllViews; not needed any more.
429 * kwq/WebCoreBridge.mm: Ditto.
431 * kwq/WebCoreTextRendererFactory.h: Added a clearCaches method.
432 * kwq/WebCoreTextRendererFactory.mm:
433 (-[WebCoreTextRendererFactory clearCaches]): Added. Tells all the views to repaint after clearing the cached
434 text renderers from KWQListBox. To be more elegant, we could generalize the KWQListBox trick, but for now why bother?
436 * kwq/WebCoreTextRendererFactory.m: Removed. I needed to put some C++ code in here, so changed the extension to .mm.
437 * WebCore.pbproj/project.pbxproj: Removed WebCoreTextRendererFactory.m, and added WebCoreTextRendererFactory.mm.
439 2004-08-30 Darin Adler <darin@apple.com>
443 - fixed <rdar://problem/3528538> can paste a Return character into the Search field at amazon.com, other browsers won't
445 * kwq/KWQTextField.mm: (-[KWQTextFieldController controlTextDidChange:]):
446 Truncate text before the first line break.
448 2004-08-30 Darin Adler <darin@apple.com>
450 * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertOneChunkUsingTEC):
451 Added some more assertions I used to track down what looks like a TEC bug.
453 2004-08-30 Darin Adler <darin@apple.com>
457 - fixed <rdar://problem/3779122> No accesskey support on LABEL element
459 * khtml/html/html_formimpl.h: Change type of m_currValue to DOMString. Should have been done
460 as part of my form data check-in, but harmless to do now. Add accessKeyAction function for
461 HTMLLabelElementImpl.
462 * khtml/html/html_formimpl.cpp:
463 (DOM::HTMLButtonElementImpl::parseHTMLAttribute): Remove conversion of DOMString to QString
465 (DOM::HTMLLabelElementImpl::formElement): If there's no "for" attribute, search children for
467 (DOM::HTMLLabelElementImpl::accessKeyAction): Forward the accesskey action to the formElement.
469 2004-08-30 Darin Adler <darin@apple.com>
473 - fixed <rdar://problem/3303968> final newline character omitted from <textarea> when parsing a new page
475 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::processListing): Handle newline pending
476 cases as well as space and tab pending spaces at the end of this function. This seems right for
477 both scripts and text areas; it's not clear why omittiing the LF is ever needed. Tested by running
478 all the layout tests; no regressions.
480 - fixed <rdar://problem/3552736> word wrapped text fields that blur/focus when you type move the insertion point strangely (vtext.com)
482 * khtml/rendering/render_form.cpp: (RenderTextArea::updateFromElement): Call text() instead of
483 calling widget->text() directly. This prevents this function from running in cases where the
484 text didn't really change for text areas in wrap mode.
486 2004-08-30 Darin Adler <darin@apple.com>
490 - got rid of ERROR message when running layout tests by implementing text-transform in computed style
492 * khtml/css/css_computedstyle.cpp:
493 (DOM::numberAsString): Added. Helper that returns "1" rather then "1.0" for integer values.
494 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Fixed use of tabs instead of
495 spaces. Fixed switch statements so they don't use default so we get errors if we leave
496 a case out. Changed callers to use numberAsString instead of QString::number. Added implementation
497 of CSS_PROP_TEXT_TRANSFORM. Added code to prevent falling through to next property when no item
498 in a switch statement matches.
500 2004-08-30 Darin Adler <darin@apple.com>
504 - did work to prepare for uploading files incrementally when submitting forms
506 * khtml/misc/formdata.h: Added. Class for holding form data inside WebCore.
507 * khtml/misc/formdata.cpp: Added.
509 * khtml/html/html_formimpl.h: Added the FormDataList type, changed the formData function parameters
510 and made it private, renamed the encoding method to appendFormData and changed the parameters around.
511 * khtml/html/html_formimpl.cpp:
512 (DOM::FormDataList): Added. Class that replaces the old use of QValueList<QCString> for form data.
513 Later we'll change it to accomodate filenames too.
514 (DOM::HTMLFormElementImpl::formData): Changed code to use FormDataList intsead of the old encodingList.
515 Also changed to return the "OK" result as the function result and put the form data into something
516 passed as an "out" parameter; the old way was the other way around.
517 (DOM::HTMLFormElementImpl::submit): Change to use FormData rather than a QByteArray when getting the
519 (DOM::HTMLButtonElementImpl::appendFormData): Rename from encoding, and use the new appendData function
520 instead of the old way of doing += to put data on the list.
521 (DOM::HTMLInputElementImpl::appendFormData): Ditto.
522 (DOM::HTMLSelectElementImpl::appendFormData): Ditto.
523 (DOM::HTMLKeygenElementImpl::appendFormData): Ditto.
524 (DOM::HTMLTextAreaElementImpl::appendFormData): Ditto.
525 (DOM::FormDataList::FormDataList): Added.
526 (DOM::FormDataList::appendString): Added.
527 (DOM::FormDataList::begin): Added.
528 (DOM::FormDataList::end): Added.
530 * khtml/khtml_part.h: Changed the type of the submitForm parameter to FormData instead of QByteArray.
531 * khtml/khtmlpart_p.h: Changed the type of the submitFormData data member to FormData instead of QByteArray.
532 * khtml/khtml_part.cpp: (KHTMLPart::submitForm): Called the new flattenToString function in all the
533 code that handles mailto forms. Called the new flatten function in the non-Apple code path.
535 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::submitForm): Pass NSArray for form data instead of NSData.
537 * kwq/KWQKJob.h: Use FormData instead of QByteArray. A couple other small cleanups.
538 * kwq/KWQKJobClasses.h: Ditto.
539 * kwq/KWQKJobClasses.mm:
540 (KIO::TransferJobPrivate::TransferJobPrivate): Ditto.
541 (KIO::TransferJob::TransferJob): Ditto.
542 (KIO::TransferJob::postData): Ditto.
543 * kwq/KWQKPartsBrowserExtension.h: Ditto.
545 (KWQServeRequest): Ditto.
546 (KWQServeSynchronousRequest): Ditto.
548 * kwq/KWQFormData.h: Added. A function to convert KHTML form data into an NSArray for communication
549 with the WebKit side.
550 * kwq/KWQFormData.mm: Added.
552 * kwq/WebCoreBridge.h: Pass NSArray instead of NSData for form data.
554 * kwq/KWQArrayImpl.h: Added a detach member function. The old version would do unnecessary work when
555 detach was called on an array that had exactly one reference.
556 * kwq/KWQArrayImpl.mm: (KWQArrayImpl::detach): Added.
557 * kwq/KWQMemArray.h: (QMemArray::detach): Call through to KWQArrayImpl.
559 * kwq/KWQValueList.h:
560 (QValueList::first): Added overload for non-const.
561 (QValueList::last): Ditto.
563 * ForwardingHeaders/misc/formdata.h: Added.
564 * WebCore.pbproj/project.pbxproj: Added formdata.h, formdata.cpp, KWQFormData.h, and KWQFormData.cpp.
566 * WebCore-tests.exp: Updated for changes to QValueList, and re-sorted.
567 * WebCore-combined.exp: Regenerated.
569 2004-08-30 Darin Adler <darin@apple.com>
573 - improved multiple submit logic in preparation for making command-click on a form
574 button load a form in another frame
576 * kwq/KWQKHTMLPart.h: Added const to a bunch of member functions for cleanup.
577 Added prepareForUserAction member function.
578 * kwq/KWQKHTMLPart.mm:
579 (KWQKHTMLPart::submitForm): Simplified logic and removed special case for "http" and "https".
580 (KWQKHTMLPart::renderer): Added const.
581 (KWQKHTMLPart::keyEvent): Added call to prepareForUserAction.
582 (KWQKHTMLPart::lastEventIsMouseUp): Added const.
583 (KWQKHTMLPart::eventMayStartDrag): Added const.
584 (KWQKHTMLPart::mouseDown): Added call to prepareForUserAction.
585 (KWQKHTMLPart::overrideMediaType): Added const.
586 (KWQKHTMLPart::canGoBackOrForward): Added const.
587 (KWQKHTMLPart::prepareForUserAction): Added. Clears _submittedFormURL.
588 * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityPerformAction:]): Added call to prepareForUserAction.
590 2004-08-30 Ken Kocienda <kocienda@apple.com>
596 <rdar://problem/3762231> REGRESSION (Mail): tab key inserts a single space
598 * khtml/editing/htmlediting_impl.cpp:
599 (khtml::isTab): New helper. Checks a DOMString to see if it is one character and
600 that character is a tab.
601 (khtml::InputTextCommandImpl::execute): Trap tabs before handling insertion of
602 other kinds of whitespace. Treat a tab like four spaces. Rearrange the code to
603 update the ending position after the text insertion to cover the new tab case
604 where the amount of advance is not the same as the number of character in the
605 passed-in DOMString (i.e. tabs expand to four characters).
607 2004-08-27 Ken Kocienda <kocienda@apple.com>
613 <rdar://problem/3779706> plain text on pasteboard loses indentation when pasted into Blot
615 * kwq/KWQKHTMLPart.h:
616 * kwq/KWQKHTMLPart.mm:
617 (KWQKHTMLPart::documentFragmentWithText): New function that takes over the code from
618 KWQKHTMLPart and improves it to handle converting tabs and spaces for suitable
620 * kwq/WebCoreBridge.mm:
621 (-[WebCoreBridge documentFragmentWithText:]): Move smarts from here to KWQKHTMLPart.
623 2004-08-27 Maciej Stachowiak <mjs@apple.com>
627 <rdar://problem/3778314> REGRESSION: Can't proceed to survey questions on Lominger's Apple website
629 Because we will stop parsing when there is a pending redirection,
630 avoid setting one if no navigation would actually take place
631 because the number of steps is out of range.
633 * khtml/khtml_part.cpp:
634 (KHTMLPart::scheduleHistoryNavigation):
635 * kwq/KWQKHTMLPart.h:
636 * kwq/KWQKHTMLPart.mm:
637 (KWQKHTMLPart::canGoBackOrForward):
638 * kwq/KWQKPartsBrowserInterface.h:
639 * kwq/WebCoreBridge.h:
641 2004-08-27 Maciej Stachowiak <mjs@apple.com>
645 - fixed <rdar://problem/3778043> REGRESSION: innerHTML is broken, breaks automated iBench testing
646 - also fixed outerHTML, which would spill over past the node for whch it was supposed to get HTML
648 * khtml/html/html_elementimpl.cpp:
649 (HTMLElementImpl::outerHTML):
650 * khtml/xml/dom2_rangeimpl.cpp:
651 (DOM::RangeImpl::toHTML):
652 * khtml/xml/dom_nodeimpl.cpp:
654 (NodeImpl::recursive_toString):
655 (NodeImpl::recursive_toHTML):
656 * khtml/xml/dom_nodeimpl.h:
657 * kwq/WebCoreBridge.mm:
658 (-[WebCoreBridge markupStringFromNode:nodes:]):
660 - added new layout tests to cover the problems I fixed
662 * layout-tests/fast/innerHTML/001-expected.txt: Added.
663 * layout-tests/fast/innerHTML/001.html: Added.
664 * layout-tests/fast/innerHTML/002-expected.txt: Added.
665 * layout-tests/fast/innerHTML/002.html: Added.
666 * layout-tests/fast/innerHTML/003-expected.txt: Added.
667 * layout-tests/fast/innerHTML/003.html: Added.
669 2004-08-27 David Hyatt <hyatt@apple.com>
671 Fix for 3739239, getComputedStyle of top not being implemented broke a site that checked for it.
675 * khtml/css/css_computedstyle.cpp:
676 (DOM::valueForLength):
677 (DOM::CSSComputedStyleDeclarationImpl::getPositionOffsetValue):
678 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
679 * khtml/css/css_computedstyle.h:
681 2004-08-27 John Sullivan <sullivan@apple.com>
685 Tweaked option-tab handling to match good suggestion from Tim Omernick of OmniWeb
687 * kwq/KWQTextArea.mm:
688 removed override of textDidChange:
689 (-[KWQTextAreaTextView keyDown:]):
690 moved option-tab handling that was in textDidChange to here. Rearranged existing code
691 a little for clarity.
693 2004-08-27 Adele Amchan <adele@apple.com>
698 <rdar://problem/3689949> Provide contentWindow access on an iframe
700 * khtml/ecma/kjs_html.cpp:
701 (KJS::HTMLElement::getValueProperty): added cases for contentWindow for frames and iframes
702 * khtml/ecma/kjs_html.h: added contentWindow to the list of properties for frames and iframes
703 * khtml/ecma/kjs_html.lut.h: regenerated file
704 * khtml/html/html_baseimpl.cpp:
705 (HTMLFrameElementImpl::contentPart): factored out old contentDocument code to return KHTMLPart for frame
706 (HTMLFrameElementImpl::contentDocument): now just gets the contentDocument from contentPart
707 * khtml/html/html_baseimpl.h: added declaration for contentPart
711 2004-08-27 Ken Kocienda <kocienda@apple.com>
717 <rdar://problem/3778059> Odd behaviour when editing between blockquote elements
719 * khtml/editing/htmlediting_impl.cpp:
720 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): This function should not move
721 the selection out of the current block, ever. This is exactly what the bug reported.
722 What was I thinking? Now, the code looks at the passed-in position and then the equivalent
723 upstream and downstream positions to see if the selection can be placed there after the
724 delete, and settles on the block containing the passed-in position as a fallback.
725 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt: Added.
726 * layout-tests/editing/inserting/insert-3778059-fix.html: Added.
728 2004-08-26 Richard Williamson <rjw@apple.com>
730 Boiler plate for canvas gradients and patterns.
734 * khtml/ecma/kjs_html.cpp:
735 (KJS::Context2DFunction::tryCall):
737 (Context2D::~Context2D):
738 (KJS::GradientFunction::tryCall):
739 (Gradient::Gradient):
741 (Gradient::getValueProperty):
743 (Gradient::putValue):
744 (Gradient::~Gradient):
745 (ImagePattern::ImagePattern):
746 (ImagePattern::tryGet):
747 (ImagePattern::getValueProperty):
748 (ImagePattern::tryPut):
749 (ImagePattern::putValue):
750 (ImagePattern::~ImagePattern):
751 * khtml/ecma/kjs_html.h:
752 (KJS::Gradient::toBoolean):
753 (KJS::Gradient::classInfo):
755 (KJS::ImagePattern::toBoolean):
756 (KJS::ImagePattern::classInfo):
757 (KJS::ImagePattern::):
758 * khtml/ecma/kjs_html.lut.h:
761 2004-08-26 Ken Kocienda <kocienda@apple.com>
767 <rdar://problem/3777899> REGRESSION (Mail): only first of several misspelled words separated by
768 carriage returns is marked
770 * khtml/editing/htmlediting_impl.cpp:
771 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Give the spellchecker a slightly larger
772 selection to work with while typing. This should preclude bugs of this type.
774 2004-08-26 Ken Kocienda <kocienda@apple.com>
780 <rdar://problem/3777804> Deleting all content in a document can result in giant tall-as-window insertion point
782 * khtml/rendering/render_box.cpp:
783 (RenderBox::caretPos): Always use the font height for calculating the caret height in
784 non-replaced elements (like blocks), rather than the height of the box.
786 2004-08-26 Ken Kocienda <kocienda@apple.com>
788 Silly me. Forgot to add this file before.
790 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt: Added.
792 2004-08-26 David Hyatt <hyatt@apple.com>
794 Fix for 3777172, crash from nested colgroup. Don't allow nested table sections or col groups.
798 * khtml/html/htmlparser.cpp:
799 (KHTMLParser::insertNode):
801 2004-08-26 Ken Kocienda <kocienda@apple.com>
807 <rdar://problem/3775316> document sprouts an extra newline character at the end
809 * khtml/editing/htmlediting_impl.cpp:
810 (khtml::InputNewlineCommandImpl::doApply): There was in insufficient check
811 in the code which adds extra BR elements at the ends of blocks, which we do
812 to work around the fact that BR elements, when they are the last element in a
813 block, do not render. Now the code sees whether there already is one of these
814 extra BR's in the document and won't add and "extra" extra.
815 * layout-tests/editing/inserting/insert-3775316-fix.html: Added.
817 2004-08-26 David Hyatt <hyatt@apple.com>
819 Fix for 3710721 and 3504114, crashes because of bad ownership model for list markers.
823 * khtml/rendering/render_container.cpp:
824 (RenderContainer::detach):
825 * khtml/rendering/render_list.cpp:
826 (RenderListItem::setStyle):
827 (RenderListItem::detach):
828 (RenderListItem::updateMarkerLocation):
829 * khtml/rendering/render_list.h:
831 2004-08-26 Ken Kocienda <kocienda@apple.com>
835 * khtml/editing/htmlediting_impl.cpp:
836 (khtml::ApplyStyleCommandImpl::doApply): Remove the StayInBlock modifier from the
837 call to upstream when passing the start position to removeStyle(). This makes the
838 start position sufficiently upstream so that all relevant style tags are removed.
839 (khtml::ApplyStyleCommandImpl::removeStyle): Pass the start position to nodeFullySelected.
840 (khtml::ApplyStyleCommandImpl::nodeFullySelected): Change interface so start position
841 for calculation is passed in, rather than recalculating it every time.
842 * khtml/editing/htmlediting_impl.h: nodeFullySelected interface change.
843 * khtml/xml/dom_position.h: Add a comment about the working of upstream() and
846 2004-08-26 Ken Kocienda <kocienda@apple.com>
848 Fix garbled contenteditable attribute. I must have checked
851 * layout-tests/editing/deleting/delete-3775172-fix.html
853 2004-08-25 Kevin Decker <kdecker@apple.com>
855 Reviewed by John and Maciej.
857 - Fixes SAP bug <rdar://problem/3751295> Personalize link at the
858 top gives an error in the pop-up window.
860 * khtml/ecma/kjs_window.cpp:
861 (WindowFunc::tryCall): Passes a referrer to KHTMLPart::begin()
863 2004-08-25 Richard Williamson <rjw@apple.com>
865 Updated to <canvas> API to match the spec. (Still need
866 to implement gradients and patterns.)
870 * khtml/ecma/kjs_html.cpp:
871 (KJS::Context2DFunction::tryCall):
872 (Context2D::getValueProperty):
873 (Context2D::drawingContext):
874 (Context2D::colorRefFromValue):
875 (Context2D::colorFromValue):
876 (Context2D::setShadow):
877 (Context2D::putValue):
879 (Context2D::restore):
880 (Context2D::Context2D):
881 * khtml/ecma/kjs_html.h:
883 * khtml/ecma/kjs_html.lut.h:
886 2004-08-25 Ken Kocienda <kocienda@apple.com>
888 * layout-tests/editing/deleting/delete-3775172-fix.html: Wrong version of test checked in
891 2004-08-25 Ken Kocienda <kocienda@apple.com>
893 Added test case for <rdar://problem/3775172> Blot crashes after typing one character then deleting it
895 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Added.
896 * layout-tests/editing/deleting/delete-3775172-fix.html: Added.
898 2004-08-25 Ken Kocienda <kocienda@apple.com>
900 * layout-tests/editing/style/style-3690704-fix-expected.txt: Fewer styling spans added
901 on this test as a result of the previously-checked-in fix.
903 2004-08-25 Ken Kocienda <kocienda@apple.com>
909 <rdar://problem/3775214> BR elements cause unnecessary spans to be added when applying style
911 * khtml/editing/htmlediting_impl.cpp:
912 (khtml::ApplyStyleCommandImpl::doApply): BR elements can be grouped more liberally with other nodes
913 now in the iteration when attempting to find nodes that can be styled together with one span.
914 * layout-tests/editing/style/style-3690704-fix-expected.txt: Updated with new results after
917 2004-08-25 Ken Kocienda <kocienda@apple.com>
923 <rdar://problem/3775172> Blot crashes after typing one character then deleting it
925 * khtml/css/css_computedstyle.cpp:
926 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Bail early if the element
927 being queried does not have a renderer or that renderer does not have a style. Prevents
928 a crash in the cases that it does not.
929 * khtml/editing/htmlediting_impl.cpp:
930 (khtml::DeleteSelectionCommandImpl::doApply): Add one more case to deleting when the
931 start and end nodes are different. If the downstream end node is the last node in the
932 block, then it may need to be deleted completely. Before this patch, the code
933 erroneously assumed that any deletion in this node had to be trimming of a text node.
934 This was asserted, and the description in 3775172 shows a simple case where this assertion
935 does not hold. The additional case and associated checks now make it all better.
936 * layout-tests/editing/deleting/delete-3775172-fix.html: Added.
938 2004-08-25 David Hyatt <hyatt@apple.com>
940 Fix for 3365086, large tables crash Safari. Make sure to use ints rather than shorts for row and column
941 counts. Also fix a pathological array resize scenario for tables as rows are added.
945 * khtml/rendering/render_table.cpp:
946 (RenderTable::splitColumn):
947 (RenderTable::appendColumn):
948 (RenderTableSection::RenderTableSection):
949 (RenderTableSection::ensureRows):
950 (RenderTableSection::setCellWidths):
951 (RenderTableSection::calcRowHeight):
952 (RenderTableSection::layoutRows):
953 (RenderTableSection::paint):
954 (RenderTableSection::recalcCells):
955 (RenderTableSection::clearGrid):
956 * khtml/rendering/render_table.h:
957 (khtml::RenderTableSection::numRows):
959 2004-08-25 David Hyatt <hyatt@apple.com>
961 To save memory in the common case, move the margin***Collapse variables into the CSS3 struct instead of
962 bloating the surround struct.
964 * khtml/rendering/render_style.cpp:
965 (StyleSurroundData::StyleSurroundData):
966 (StyleSurroundData::operator==):
967 (marginBottomCollapse):
968 (StyleCSS3NonInheritedData::operator==):
970 * khtml/rendering/render_style.h:
971 (khtml::RenderStyle::marginTopCollapse):
972 (khtml::RenderStyle::marginBottomCollapse):
973 (khtml::RenderStyle::setMarginTopCollapse):
974 (khtml::RenderStyle::setMarginBottomCollapse):
976 2004-08-25 David Hyatt <hyatt@apple.com>
978 Fix the "extra space in TypePad blogs" Emerson problem by adding the ability to collapse away margins.
979 Also added support for explicitly preventing margin collapsing.
983 * khtml/css/cssparser.cpp:
984 (CSSParser::parseValue):
985 * khtml/css/cssproperties.c:
988 * khtml/css/cssproperties.h:
989 * khtml/css/cssproperties.in:
990 * khtml/css/cssstyleselector.cpp:
991 (khtml::CSSStyleSelector::applyProperty):
992 * khtml/css/cssvalues.c:
995 * khtml/css/cssvalues.h:
996 * khtml/css/cssvalues.in:
997 * khtml/rendering/render_block.cpp:
998 (khtml::RenderBlock::isSelfCollapsingBlock):
999 (khtml::RenderBlock::layoutBlockChildren):
1000 * khtml/rendering/render_style.cpp:
1001 (StyleSurroundData::StyleSurroundData):
1002 (StyleSurroundData::operator==):
1003 (RenderStyle::diff):
1004 * khtml/rendering/render_style.h:
1006 (khtml::RenderStyle::marginTopCollapse):
1007 (khtml::RenderStyle::marginBottomCollapse):
1008 (khtml::RenderStyle::setMarginTopCollapse):
1009 (khtml::RenderStyle::setMarginBottomCollapse):
1010 (khtml::RenderStyle::initialMarginTopCollapse):
1011 (khtml::RenderStyle::initialMarginBottomCollapse):
1013 2004-08-24 Ken Kocienda <kocienda@apple.com>
1017 Improved the ability of the bridge to report selection state.
1019 * khtml/editing/htmlediting_impl.cpp:
1020 (khtml::TypingCommandImpl::doApply): Bail when there is no selection.
1021 * kwq/WebCoreBridge.h: Added an enum to report selection state. These constants
1022 mirror those used in DOM::Selection.
1023 * kwq/WebCoreBridge.mm:
1024 (-[WebCoreBridge selectionState]): Replacement for haveSelection. Returns a value
1025 from an enum telling whether the selection is in the None, Caret, or Range state,
1026 rather than just true/false for the Range state as it did before.
1028 2004-08-24 David Hyatt <hyatt@apple.com>
1030 Make sure the ifdef XSLT is present for Panther.
1032 * khtml/xml/xml_tokenizer.cpp:
1033 (khtml::XMLTokenizer::insertErrorMessageBlock):
1035 2004-08-24 David Hyatt <hyatt@apple.com>
1037 Polish the XML error message so that it indicates when a document is the result of an XSL transformation
1038 when reporting line/col #s.
1040 * khtml/xml/dom_docimpl.cpp:
1041 (DocumentImpl::applyXSLTransform):
1042 * khtml/xml/xml_tokenizer.cpp:
1043 (khtml::XMLTokenizer::insertErrorMessageBlock):
1044 * khtml/xsl/xslt_processorimpl.cpp:
1045 (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
1047 2004-08-24 David Hyatt <hyatt@apple.com>
1049 Add support for Atom and RSS MIME types to the set of XML types.
1053 * khtml/ecma/xmlhttprequest.cpp:
1054 (KJS::XMLHttpRequest::getValueProperty):
1055 * khtml/khtml_part.cpp:
1057 * khtml/misc/loader.cpp:
1058 (CachedXSLStyleSheet::CachedXSLStyleSheet):
1059 (CachedXBLDocument::CachedXBLDocument):
1060 * khtml/xml/dom_xmlimpl.cpp:
1061 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1063 2004-08-24 Chris Blumenberg <cblu@apple.com>
1065 Fixed: <rdar://problem/3746447> hang loading geocities.com/cinemaorchestra
1069 * khtml/rendering/render_frames.cpp:
1070 (RenderPartObject::updateWidget): do nothing if the src URL is the same as the part's URL
1072 2004-08-24 Ken Kocienda <kocienda@apple.com>
1078 <rdar://problem/3773564> REGRESSION (125-159): Code to remove HTML styles before applying new HTML styles is broken
1080 * khtml/editing/htmlediting_impl.cpp:
1081 (khtml::ApplyStyleCommandImpl::doApply): Unrelated change to constrain downstream position of selection
1082 start to block boundaries. This is a new feature of the downstream function and I missed this usage
1083 when adding the feature.
1084 (khtml::ApplyStyleCommandImpl::removeCSSStyle): There once was code to remove style attributes from spans
1085 which became emptied as a result of removing CSS properties, but I do not see such code in the
1086 tree any more. A quick review of the ChangeLog did not reveal anything. I do not remember making such
1089 In any case, I have restored logic to prune out styling spans we insert if the process of
1090 removing styles caused a span-plus-styles node to become emptied of markup which changes the style
1091 of its contents. This fixes the bug.
1093 2004-08-24 Ken Kocienda <kocienda@apple.com>
1099 <rdar://problem/3765535> paste of text with newlines into text with newlines results in broken doc, crash
1101 This is a "belt and suspenders" fix. The issue is with the paste code path which was creating
1102 zero-length DOM text nodes when a selection being pasted ended with a newline. The normal
1103 code path for parsing HTML does not allow this, but the code to convert newlines to BR's
1104 during paste was creating such nodes. This will no longer happen.
1106 In the case where someone inserts such zero-length nodes using the DOM API, the render tree
1107 will no longer create render objects for these nodes, and it was these empty render text
1108 nodes that was confusing the code doing editing navigation.
1110 * khtml/xml/dom_textimpl.cpp:
1111 (CharacterDataImpl::rendererIsNeeded): Do not create renderers for zero-length DOM text nodes.
1112 * khtml/xml/dom_textimpl.h:
1113 * kwq/WebCoreBridge.mm:
1114 (-[WebCoreBridge documentFragmentWithText:]): Do not insert zero-length DOM text nodes as part
1115 of converting line-end sequences to BR's.
1117 2004-08-23 Maciej Stachowiak <mjs@apple.com>
1119 Reviewed by Richard.
1121 - reduce cost of innerHTML from O(N^2) to O(N*D) where N is the
1122 number of nodes and D is the maximum DOM tree depth.
1124 * khtml/xml/dom_nodeimpl.cpp:
1125 (NodeImpl::recursive_toString): New static helper method for
1126 recursive_toHTML - this is recursive for children but iterative
1128 (NodeImpl::recursive_toHTML): Call the helper with this as the
1130 * khtml/xml/dom_nodeimpl.h:
1132 2004-08-23 David Hyatt <hyatt@apple.com>
1136 Init the encodedURL explicitly for CSSStyleSelectors. Construction time was too early to be passing in the
1137 document m_url, since it doesn't get set during construction.
1139 Fix for 3769643, crash on vancouverblast.org.
1143 * khtml/css/cssstyleselector.cpp:
1144 (khtml::CSSStyleSelector::CSSStyleSelector):
1145 (khtml::CSSStyleSelector::init):
1146 (khtml::CSSStyleSelector::setEncodedURL):
1147 * khtml/css/cssstyleselector.h:
1148 * khtml/xml/dom_docimpl.cpp:
1149 (DocumentImpl::DocumentImpl):
1150 (DocumentImpl::setURL):
1151 (DocumentImpl::recalcStyleSelector):
1152 * khtml/xml/dom_docimpl.h:
1153 (DOM::DocumentImpl::URL):
1155 2004-08-23 Kevin Decker <kdecker@apple.com>
1159 - fixed rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
1160 * khtml/ecma/kjs_window.cpp:
1161 (WindowFunc::tryCall): since this is an xml document, we get the
1162 domain from the xmlDocImpl(), not docImpl().
1164 2004-08-23 Maciej Stachowiak <mjs@apple.com>
1168 <rdar://problem/3771426> assertion failed due to reentering dispatchImageLoadEventsNow
1170 * khtml/xml/dom_docimpl.cpp:
1171 (DocumentImpl::dispatchImageLoadEventsNow): Avoid re-entering this
1172 function, since it uses a data member for the copy of the list of events
1175 2004-08-23 Maciej Stachowiak <mjs@apple.com>
1179 <rdar://problem/3770306> XMLHttpRequest does not honor character set encoding
1181 * khtml/ecma/xmlhttprequest.cpp:
1182 (KJS::XMLHttpRequest::slotData): Get encoding from the transfer job.
1183 * kwq/KWQKJobClasses.h:
1184 * kwq/KWQKJobClasses.mm:
1185 (KIO::TransferJobPrivate::TransferJobPrivate): Added retrievedCharset
1187 (KIO::TransferJob::retrieveCharset): New method, gets the charset
1189 (KIO::TransferJob::queryMetaData): Handle charset.
1190 (KIO::TransferJob::emitReceivedResponse): Clear retreivedCharset flag.
1193 (KWQResponseTextEncodingName): New function, gets the encoding from the response.
1195 2004-08-23 David Hyatt <hyatt@apple.com>
1197 Apply leo's fix to marquees.
1201 * khtml/rendering/render_layer.cpp:
1204 2004-08-20 Darin Adler <darin@apple.com>
1208 - added an ascii() member function to DOMString and DOMStringImpl to help debugging
1210 * khtml/dom/dom_string.h: Add ascii member function for debugging.
1211 * khtml/dom/dom_string.cpp: (DOM::DOMString::ascii): Added. Calls through to DOMStringImpl::ascii.
1212 * khtml/xml/dom_stringimpl.h: Add ascii member function for debugging.
1213 * khtml/xml/dom_stringimpl.cpp: (DOM::DOMStringImpl::ascii): Added. Makes a new buffer and puts
1214 a simple ASCII version in it. Maybe make it better about characters outside the 0x20-0x7E range
1215 some day, but for now this is way better than what we had before.
1217 2004-08-20 David Hyatt <hyatt@apple.com>
1219 Divorce the notion of a marquee being stopped from JS from the notion of being suspended by the back/forward cache.
1221 * khtml/ecma/kjs_html.cpp:
1222 (KJS::HTMLElementFunction::tryCall):
1223 * khtml/rendering/render_layer.cpp:
1227 (Marquee::updateMarqueePosition):
1228 * khtml/rendering/render_layer.h:
1230 2004-08-20 Richard Williamson <rjw@apple.com>
1232 Implemented new JNI abstraction. We no longer invoke Java methods
1233 directly with JNI, rather we call into the plugin. This allows the
1234 plugin to dispatch the call to the appropriate VM thread. This
1235 change should (will?) fix a whole class of threading related problems with
1240 * kwq/KWQKHTMLPart.mm:
1241 (KWQKHTMLPart::getAppletInstanceForView):
1242 * kwq/WebCoreBridge.mm:
1244 (-[WebCoreBridge executionContextForView:]):
1246 2004-08-19 Maciej Stachowiak <mjs@apple.com>
1250 More text paint cleanup. Separated the background and foreground
1251 passes instead of doing a weird for loop thing. Eliminated
1252 redundant if conditions. Added comments.
1254 * khtml/rendering/render_text.cpp:
1255 (RenderText::paint):
1257 2004-08-19 Ken Kocienda <kocienda@apple.com>
1261 * khtml/css/css_computedstyle.cpp:
1262 (DOM::): Changed CopyProperties constant to InheritableProperties. This reflects the
1263 name change of copy() to copyInheritableProperties()
1264 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties: Renamed from copy().
1265 Now just copies those properties which can be inherited.
1266 (DOM::CSSComputedStyleDeclarationImpl::diff): Add a couple null checks.
1267 * khtml/css/css_computedstyle.h: copyInheritableProperties name change. No longer needs to be virtual.
1268 * khtml/css/css_valueimpl.cpp: Removed unneeded copy() function from CSSStyleDeclarationImpl.
1269 * khtml/css/css_valueimpl.h: Ditto.
1270 * khtml/editing/htmlediting.cpp:
1271 (khtml::EditCommand::typingStyle): Added.
1272 (khtml::EditCommand::setTypingStyle): Added.
1273 * khtml/editing/htmlediting.h:
1274 * khtml/editing/htmlediting_impl.cpp:
1275 (khtml::StyleChange::currentlyHasStyle): Fix leak of computed style used in this function.
1276 (khtml::EditCommandImpl::EditCommandImpl): Initialize m_typingStyle.
1277 (khtml::EditCommandImpl::~EditCommandImpl): Deref m_typingStyle.
1278 (khtml::EditCommandImpl::assignTypingStyle): New helper used in setting typing style.
1279 (khtml::EditCommandImpl::setTypingStyle): New setter.
1280 (khtml::DeleteSelectionCommandImpl::doApply): Use new method for managing typing style.
1281 * khtml/editing/htmlediting_impl.h:
1282 (khtml::EditCommandImpl::typingStyle): New accessor.
1283 * khtml/khtml_part.cpp:
1284 (KHTMLPart::appliedEditing): Restores typing style from command after setting selection.
1285 (KHTMLPart::applyStyle): Does a diff between the current style and the style of the caret.
1286 * khtml/khtml_part.h:
1287 * khtml/xml/dom_position.cpp:
1288 (DOM::Position::computedStyle): Now returns a CSSComputedStyleDeclarationImpl instead of a plain
1289 CSSStyleDeclarationImpl.
1290 * khtml/xml/dom_position.h:
1291 * layout-tests/editing/style/style-3681552-fix-002-expected.txt:
1293 2004-08-20 Trey Matteson <trey@apple.com>
1295 3655407 - Editing: -complete: method unimplemented (WebKit editing API)
1297 One new support routine here.
1301 * kwq/WebCoreBridge.h:
1302 * kwq/WebCoreBridge.mm:
1303 (-[WebCoreBridge caretRectAtNode:offset:]): New routine.
1304 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
1305 Fixed former misleading method name.
1307 2004-08-20 Ken Kocienda <kocienda@apple.com>
1313 <rdar://problem/3768378> crash typing newline in Blot
1315 * khtml/editing/htmlediting_impl.cpp:
1316 (khtml::InputNewlineCommandImpl::doApply): Adding an assert in a recent change
1317 showed up that inserting newlines that was not being handled correctly for the
1318 case described in the bug. I added a new case to handle inserting BR's when
1319 at the caret max offset for a node, and this new code runs instead of the
1320 fall-through case that should not have been running and triggered the assert.
1321 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Regenerated results.
1322 * layout-tests/editing/inserting/insert-br-case6-expected.txt: Added.
1323 * layout-tests/editing/inserting/insert-br-case6.html: Added.
1325 2004-08-20 Trey Matteson <trey@apple.com>
1327 Fixing: Spellchecker called once or twice for every char typed.
1331 * khtml/khtml_part.cpp:
1332 (KHTMLPart::setSelection): Don't do any spell checking if we're typing (it's done
1333 elsewhere, in markMisspellingsAfterTyping)
1335 2004-08-19 Maciej Stachowiak <mjs@apple.com>
1339 - fixed <rdar://problem/3549369> Crash at www.e1.ru in HTMLTokenizer::notifyFinished
1341 Probably also fixed the following likely duplicates:
1343 <rdar://problem/3503938> Safari crashed opening many tabs (HTMLTokenizer::notifyFinished(khtml::CachedObject*))
1344 <rdar://problem/3566332> CrashTracer: ..405 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
1345 <rdar://problem/3703964> CrashTracer: ...86 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
1346 <rdar://problem/3703969> CrashTracer: ..234 crashes at com.apple.WebCore: HTMLTokenizer::notifyFinished + 0x1c8
1348 * khtml/xml/dom_docimpl.cpp:
1349 (DocumentImpl::open): call setParsing(true), because we need to know we are once again
1350 parsing when we re-open a document that has previously completed loading.
1352 2004-08-19 Maciej Stachowiak <mjs@apple.com>
1354 Reviewed by Dave and Darin.
1356 * khtml/rendering/render_text.cpp:
1357 (RenderText::paint): Split apple and non-apple code paths to allow further cleanup.
1359 2004-08-19 Darin Adler <darin@apple.com>
1363 - fixed <rdar://problem/3767274> crash in partForWidget inside setFocus (test page attached)
1365 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::nextKeyViewInFrame): Remove code to do position
1366 the widget; no longer needed since we reworked how widgets get their positions.
1367 * kwq/KWQWidget.mm: (QWidget::setFocus): Ditto. This was the one that caused the bug.
1369 2004-08-19 David Hyatt <hyatt@apple.com>
1371 Fix crash when text is contained inside a table-colgroup.
1375 * khtml/xml/dom_textimpl.cpp:
1376 (TextImpl::rendererIsNeeded):
1378 2004-08-19 Trey Matteson <trey@apple.com>
1380 Unexpected errors hit while finding word boundaries, leading to crash.
1384 * kwq/KWQTextUtilities.cpp:
1385 (KWQFindWordBoundary): Don't call UCFindTextBreak with edge cases it thinks
1386 are param errors, and pass correct mask for forward case. Also fix off-by-one
1387 crashers in fallback code.
1389 2004-08-19 David Hyatt <hyatt@apple.com>
1391 Make XSLT imports/includes work. This code has to be turned off until the newer version of libxslt is
1394 Reviewed by kocienda
1396 * khtml/css/css_ruleimpl.cpp:
1397 (CSSImportRuleImpl::init):
1398 * khtml/xml/dom_docimpl.cpp:
1399 (DocumentImpl::DocumentImpl):
1400 (DocumentImpl::~DocumentImpl):
1401 (DocumentImpl::applyXSLTransform):
1402 * khtml/xml/dom_docimpl.h:
1403 (DOM::DocumentImpl::setTransformSource):
1404 (DOM::DocumentImpl::transformSource):
1405 * khtml/xml/dom_xmlimpl.cpp:
1406 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1407 * khtml/xml/xml_tokenizer.cpp:
1412 (khtml::createQStringParser):
1413 (khtml::XMLTokenizer::setTransformSource):
1414 * khtml/xsl/xsl_stylesheetimpl.cpp:
1415 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
1416 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
1417 (DOM::XSLStyleSheetImpl::isLoading):
1418 (DOM::XSLStyleSheetImpl::clearDocuments):
1419 (DOM::XSLStyleSheetImpl::parseString):
1420 (DOM::XSLStyleSheetImpl::loadChildSheets):
1421 (DOM::XSLStyleSheetImpl::loadChildSheet):
1422 (DOM::XSLImportRuleImpl::parentStyleSheet):
1423 (DOM::XSLStyleSheetImpl::compileStyleSheet):
1424 (DOM::XSLStyleSheetImpl::locateStylesheetSubResource):
1425 (DOM::XSLImportRuleImpl::XSLImportRuleImpl):
1426 (DOM::XSLImportRuleImpl::~XSLImportRuleImpl):
1427 (DOM::XSLImportRuleImpl::setStyleSheet):
1428 (DOM::XSLImportRuleImpl::isLoading):
1429 (DOM::XSLImportRuleImpl::loadSheet):
1430 * khtml/xsl/xsl_stylesheetimpl.h:
1431 (DOM::XSLStyleSheetImpl::setOwnerDocument):
1432 (DOM::XSLStyleSheetImpl::setDocument):
1433 (DOM::XSLStyleSheetImpl::markAsProcessed):
1434 (DOM::XSLStyleSheetImpl::processed):
1435 (DOM::XSLImportRuleImpl::href):
1436 (DOM::XSLImportRuleImpl::styleSheet):
1437 (DOM::XSLImportRuleImpl::isImportRule):
1438 * khtml/xsl/xslt_processorimpl.cpp:
1439 (DOM::m_sourceDocument):
1440 (DOM::stylesheetLoadFunc):
1441 (DOM::XSLTProcessorImpl::transformDocument):
1442 * khtml/xsl/xslt_processorimpl.h:
1446 2004-08-18 Trey Matteson <trey@apple.com>
1448 3765958 - downstreamPosition() can hit infinite loop when at end of doc
1450 The problem was that I had a position that was after the maximum position in the text
1451 node, because it was the old caret position before a backspace was processed. Later
1452 I happened to call downstream() on that position, and hit the bug. Fix is to consider
1453 a position past the end point of its node if it is *greater than* or equal to its max offset.
1457 * khtml/xml/dom_positioniterator.cpp:
1458 (DOM::PositionIterator::atEnd):
1460 2004-08-18 David Hyatt <hyatt@apple.com>
1462 - did WebCore part of <rdar://problem/3682969> SLIDER: absolute left position of slider should be headline only
1464 Make the header overlap the footer in the zero-line case. Changes to Emerson's template will ensure the
1465 header draws over the footer.
1469 * khtml/rendering/render_block.cpp:
1470 (khtml::getHeightForLineCount):
1472 2004-08-18 Richard Williamson <rjw@apple.com>
1474 Replace horrible pollForAppletInView: with new
1475 webPlugInGetApplet. The details of how the applet instance
1476 is provided now belong to the Java team. Yeh.
1480 * kwq/KWQKHTMLPart.mm:
1481 (KWQKHTMLPart::getAppletInstanceForView):
1482 * kwq/WebCoreBridge.h:
1484 2004-08-18 Chris Blumenberg <cblu@apple.com>
1486 Fixed: <rdar://problem/3692199> 8A146: Safari crashes in toHTMLWithOptions, selection with no renderer (various sites)
1490 * khtml/xml/dom2_rangeimpl.cpp:
1491 (DOM::RangeImpl::toHTML): renamed, don't assume that nodes of the range had renderers, use the common ancestor of the range as the root
1492 * khtml/xml/dom2_rangeimpl.h:
1493 * khtml/xml/dom_nodeimpl.cpp:
1494 (NodeImpl::recursive_toHTML): renamed, removed code that determines whether to include the root in the HTML, leave this up to the caller
1495 * khtml/xml/dom_nodeimpl.h:
1496 * kwq/WebCoreBridge.mm:
1497 (-[WebCoreBridge markupStringFromNode:nodes:]): call renamed methods
1498 (-[WebCoreBridge markupStringFromRange:nodes:]): ditto
1500 2004-08-18 Ken Kocienda <kocienda@apple.com>
1502 * khtml/css/css_valueimpl.cpp:
1503 (CSSStyleDeclarationImpl::copy): Roll back silly last minute change that broke this code.
1504 Note to self: read code before making changes to it.
1506 2004-08-18 Ken Kocienda <kocienda@apple.com>
1508 Coded by Darin and Ken
1510 * khtml/css/css_computedstyle.cpp: Added CopyProperties static array. This contains
1511 the properties we implement that we also want to copy in the new
1512 CSSComputedStyleDeclarationImpl::copy described below.
1513 (DOM::CSSComputedStyleDeclarationImpl::copy): New function. In this class, copies the
1514 computed values of all the properties listed in CopyProperties. In essence, this makes
1515 a freeze-dired version of a computed style.
1516 (DOM::CSSComputedStyleDeclarationImpl::diff): Removes every property from the passed-in
1517 CSSStyleDeclarationImpl that is also in the computed style.
1518 * khtml/css/css_computedstyle.h:
1519 * khtml/css/css_valueimpl.cpp:
1520 (CSSStyleDeclarationImpl::copy): New function. In this class, the copy operation is
1521 straightforward. Returns a copy that will be unchanged when the original changes.
1522 * khtml/css/css_valueimpl.h:
1523 (DOM::CSSStyleDeclarationImpl::values): Added a accessor suitable for use when the
1524 CSSStyleDeclarationImpl is const.
1526 2004-08-17 Maciej Stachowiak <mjs@apple.com>
1530 <rdar://problem/3703768> CrashTracer: ...50 crashes at com.apple.WebCore: KHTMLPart::xmlDocImpl const + 0
1532 * khtml/khtmlview.cpp:
1533 (KHTMLView::viewportMouseMoveEvent): Add a nil check and an
1534 assertion for m_part being null. It seems impossible for this to
1535 happen, so we want to debug it ourselves, but in the meantime,
1536 let's try to avoid causing crashes for our users.
1538 2004-08-17 David Hyatt <hyatt@apple.com>
1540 Fix the line truncation function for Emerson so that at the far left setting of the slider, only the header
1545 * khtml/rendering/render_block.cpp:
1546 (khtml::getHeightForLineCount):
1547 * khtml/rendering/render_flexbox.cpp:
1548 (khtml::RenderFlexibleBox::layoutVerticalBox):
1550 2004-08-17 Ken Kocienda <kocienda@apple.com>
1554 Rewrite of the command that deletes a selection. I deleted great
1555 big swaths of bug-ridden code to accomplish this and replaced it
1556 with code that is much cleaner and smarter.
1558 Also, renamed equivalentUpstreamPosition and equivalentDownstreamPosition to
1559 upstream to downstream, respectively.
1561 Added a couple of new helper methods.
1563 * khtml/editing/htmlediting.cpp: DeleteCollapsibleWhitespaceCommand and
1564 RemoveNodeAndPruneCommand now obsolete. A huge win.
1565 * khtml/editing/htmlediting.h: Ditto.
1566 * khtml/editing/htmlediting_impl.cpp:
1567 (khtml::debugPosition): Fix printf which had a placeholder, but no argument passed in the varargs.
1568 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): New helper. Much simplified and cleaner
1570 (khtml::ApplyStyleCommandImpl::doApply): upstream/downstream name change
1571 (khtml::ApplyStyleCommandImpl::nodeFullySelected): upstream/downstream name change
1572 (khtml::DeleteSelectionCommandImpl::doApply): upstream/downstream name change
1573 (khtml::DeleteTextCommandImpl::DeleteTextCommandImpl): Add an assert to check that the
1574 passed offset is less than the length of the text node.
1575 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition): upstream/downstream name change
1576 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition): upstream/downstream name change
1577 (khtml::InputNewlineCommandImpl::doApply): upstream/downstream name change
1578 (khtml::InputTextCommandImpl::prepareForTextInsertion): upstream/downstream name change
1579 (khtml::InputTextCommandImpl::execute): upstream/downstream name change
1580 (khtml::InputTextCommandImpl::insertSpace): upstream/downstream name change
1581 (khtml::ReplaceSelectionCommandImpl::doApply): upstream/downstream name change
1582 (khtml::TypingCommandImpl::issueCommandForDeleteKey): upstream/downstream name change
1583 (khtml::TypingCommandImpl::deleteKeyPressed):
1584 * khtml/editing/htmlediting_impl.h:
1585 * khtml/xml/dom_position.cpp:
1586 (DOM::Position::previousWordBoundary):
1587 (DOM::Position::nextWordBoundary):
1588 (DOM::Position::upstream):
1589 (DOM::Position::downstream):
1590 (DOM::Position::inRenderedText): Add null check.
1591 (DOM::Position::isRenderedCharacter): New helper.
1592 (DOM::isWS): New helper in this file.
1593 (DOM::Position::leadingWhitespacePosition): New helper. Factored out from htmlediting_impl.cpp.
1594 (DOM::Position::trailingWhitespacePosition): Ditto.
1595 (DOM::Position::debugPosition): Add null check.
1596 * khtml/xml/dom_position.h:
1597 * khtml/xml/dom_selection.cpp:
1598 (DOM::Selection::toRange): upstream/downstream name change
1599 (DOM::Selection::validate): upstream/downstream name change
1600 (DOM::Selection::debugPosition): upstream/downstream name change
1601 * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Updated tests with new expected results.
1602 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
1603 * layout-tests/editing/deleting/delete-selection-001-expected.txt: Ditto.
1604 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Ditto.
1605 * layout-tests/editing/inserting/insert-br-case1-expected.txt: Ditto.
1606 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Ditto.
1607 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Ditto.
1609 2004-08-17 Trey Matteson <trey@apple.com>
1611 Various spelling fixes.
1615 * khtml/khtml_part.cpp:
1616 (KHTMLPart::setSelection): No misspellings in the spelling code comments
1617 * khtml/xml/dom_docimpl.cpp:
1618 (DocumentImpl::removeMarker): Repaint if doc changes. Sometimes the markers
1619 were not being erased when you clicked in a word.
1620 * khtml/xml/dom_position.cpp:
1621 (DOM::Position::previousWordBoundary): Small optimization. Bail after first
1622 try if the second try will not come out any different.
1623 (DOM::Position::nextWordBoundary): Ditto
1624 * kwq/KWQKHTMLPart.mm:
1625 (KWQKHTMLPart::markMisspellingsInSelection): Comment.
1627 2004-08-17 Darin Adler <darin@apple.com>
1631 - fixed <rdar://problem/3689700> crash loading page; stoxx.com (works in IE and Firefox)
1633 * khtml/khtml_part.h: Make completeURL public.
1634 * kwq/KWQKJavaAppletWidget.mm: (KJavaAppletWidget::KJavaAppletWidget): Complete the base URL
1635 before passing it across the bridge. This sidesteps the crashing bug in CFURL, filed as
1636 '<rdar://problem/3764632> CFURLCreateAbsoluteURLWithBytes crashes if passed the string "../.."'
1637 and also is obviously correct behavior that may fix other sites too.
1639 - fixed <rdar://problem/3547725> Crashes at csuohio.edu, list box vs. mouse event problem (Spoof No Fix)
1641 * kwq/KWQListBox.mm:
1642 (QListBox::~QListBox): Nil out the pointer from the KWQTableView back to the widget by calling
1643 a new detach method.
1644 (-[KWQTableView detach]): Set the pointer to the QListBox to 0. Also set the delegate and data
1645 source to nil, so we don't need nil checks in delegate and data source methods.
1646 (-[KWQTableView mouseDown:]): Add nil check.
1647 (-[KWQTableView keyDown:]): Add nil check.
1648 (-[KWQTableView keyUp:]): Add nil check.
1649 (-[KWQTableView becomeFirstResponder]): Add nil check.
1650 (-[KWQTableView resignFirstResponder]): Add nil check.
1651 (-[KWQTableView canBecomeKeyView]): Add nil check.
1652 (-[KWQTableView tableViewSelectionDidChange:]): Add nil checks, even though this is a delegate
1653 callback, to handle cases where calls to JavaScript result in the QListBox going away partway
1655 (-[KWQTableView drawRow:clipRect:]): Add nil check.
1656 (-[KWQTableView _accessibilityTableCell:tableColumn:]): Add nil check.
1658 2004-08-17 Trey Matteson <trey@apple.com>
1660 Fix ASSERT in spelling marker management.
1664 * khtml/xml/dom_docimpl.cpp:
1665 (DocumentImpl::shiftMarkers): Use assert instead of ASSERT.
1666 Tweak test to allow for a start position of 0.
1668 2004-08-17 Trey Matteson <trey@apple.com>
1670 3764147 - failure of subframe to load leaves links in parent doc broken
1674 * khtml/khtml_part.cpp:
1675 (KHTMLPart::childBegin): New method to mark part as not complete.
1676 (KHTMLPart::processObjectRequest): Mark child part imcomplete, so if we
1677 later get a failure on load it won't think it's already complete and do nothing.
1678 * khtml/khtml_part.h:
1682 2004-08-16 David Hyatt <hyatt@apple.com>
1684 Fix the #define. I had it all backwards.
1688 2004-08-16 David Hyatt <hyatt@apple.com>
1690 Land initial support for XSLT using xml-stylesheet PIs.
1692 * WebCore.pbproj/project.pbxproj:
1693 * khtml/khtml_part.cpp:
1694 (KHTMLPart::replaceDocImpl):
1695 * khtml/khtml_part.h:
1696 * khtml/khtmlview.h:
1697 * khtml/xml/dom_docimpl.cpp:
1698 (DocumentImpl::DocumentImpl):
1699 (DocumentImpl::~DocumentImpl):
1700 (DocumentImpl::recalcStyleSelector):
1701 (DocumentImpl::applyXSLTransform):
1702 (DocumentImpl::setTransformSourceDocument):
1703 * khtml/xml/dom_docimpl.h:
1704 (DOM::DocumentImpl::setTransformSource):
1705 (DOM::DocumentImpl::transformSource):
1706 (DOM::DocumentImpl::transformSourceDocument):
1707 * khtml/xml/dom_xmlimpl.cpp:
1708 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1709 * khtml/xml/dom_xmlimpl.h:
1710 (DOM::ProcessingInstructionImpl::isXSL):
1711 * khtml/xml/xml_tokenizer.cpp:
1714 (khtml::createQStringParser):
1715 (khtml::XMLTokenizer::processingInstruction):
1716 (khtml::XMLTokenizer::finish):
1717 (khtml::XMLTokenizer::setTransformSource):
1718 * khtml/xml/xml_tokenizer.h:
1719 (khtml::Tokenizer::setTransformSource):
1720 * khtml/xml/xsl_stylesheetimpl.cpp: Removed.
1721 * khtml/xml/xsl_stylesheetimpl.h: Removed.
1722 * khtml/xsl/xsl_stylesheetimpl.cpp: Added.
1723 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
1724 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
1725 (DOM::XSLStyleSheetImpl::isLoading):
1726 (DOM::XSLStyleSheetImpl::checkLoaded):
1727 (DOM::XSLStyleSheetImpl::docLoader):
1728 (DOM::XSLStyleSheetImpl::parseString):
1729 * khtml/xsl/xsl_stylesheetimpl.h: Added.
1730 (DOM::XSLStyleSheetImpl::isXSLStyleSheet):
1731 (DOM::XSLStyleSheetImpl::type):
1732 (DOM::XSLStyleSheetImpl::ownerDocument):
1733 (DOM::XSLStyleSheetImpl::document):
1734 (DOM::XSLStyleSheetImpl::clearDocument):
1735 * khtml/xsl/xslt_processorimpl.cpp: Added.
1736 (DOM::m_sourceDocument):
1737 (DOM::XSLTProcessorImpl::~XSLTProcessorImpl):
1738 (DOM::XSLTProcessorImpl::transformDocument):
1740 (DOM::XSLTProcessorImpl::addToResult):
1741 (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
1742 * khtml/xsl/xslt_processorimpl.h: Added.
1744 2004-08-16 Maciej Stachowiak <mjs@apple.com>
1748 * khtml/khtml_part.cpp:
1749 (KHTMLPart::isImmediateRedirectPending):
1751 2004-08-16 Richard Williamson <rjw@apple.com>
1753 Fixed <rdar://problem/3704339> Context2D forces integer positions in drawImage
1755 Use floats instead of ints to draw images.
1759 * khtml/ecma/kjs_html.cpp:
1760 (KJS::Context2DFunction::tryCall):
1762 * kwq/KWQPainter.mm:
1763 (QPainter::drawPixmap):
1764 (QPainter::drawFloatPixmap):
1766 2004-08-13 Maciej Stachowiak <mjs@apple.com>
1770 - 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)
1772 (actually the previous fix for this bug was mostly correct, but
1773 this additional change is needed to avoid the regression in
1774 <rdar://problem/3751025> REGRESSION: website rejects Safari 125.9
1775 as "need to upgrade to IE 6", but didn't reject 125.8
1777 So if merging for a software update, make sure to include both
1778 this and the previous fix.
1780 * khtml/html/htmltokenizer.cpp:
1781 (khtml::HTMLTokenizer::write): When there is an immediate reidrect pending,
1782 make sure to stop tokenizing, because we need to make sure no further
1783 script tags are processed beyond the one that triggered the redirect.
1784 * khtml/khtml_part.cpp:
1785 (KHTMLPart::isImmediateRedirectPending): New method to allow
1786 checking if a redirect is pending.
1787 * khtml/khtml_part.h:
1789 2004-08-15 David Hyatt <hyatt@apple.com>
1791 - fixed <rdar://problem/3760508> REGRESSION (154-155): No text in textarea
1793 Fix the blank textarea problem by ensuring that any change to a <textarea>'s DOM children causes the form control
1794 to resync with the DOM. This behavior matches WinIE.
1796 Reviewed by kocienda
1798 * khtml/html/html_formimpl.cpp:
1799 (HTMLTextAreaElementImpl::childrenChanged):
1800 * khtml/html/html_formimpl.h:
1802 2004-08-13 Trey Matteson <trey@apple.com>
1804 3761794 Slider doesn't call onmouseup handler
1808 * khtml/rendering/render_form.cpp:
1809 (RenderSlider::RenderSlider): Listen for signal.
1810 (RenderSlider::slotClicked): Pass to superclass.
1811 * khtml/rendering/render_form.h:
1814 (-[KWQSlider mouseDown:]): Generate mouseUp and clicked events,
1815 since AK consumes the mouseUp event in a modal tracking loop.
1816 (QSlider::QSlider): Make signal.
1817 (QSlider::clicked): Send signal.
1819 2004-08-12 Trey Matteson <trey@apple.com>
1821 3761329 - query result links all dead in ingrammicro.com (sometimes)
1822 3761328 - links in some docs dead when doc is loaded from WebArchive
1824 Make sure to get part to completed state when end is called,
1825 even if we have no doc. See WebKit changelog for more info.
1827 Reviewed by Richard and Darin.
1829 * khtml/khtml_part.cpp:
1832 2004-08-13 Trey Matteson <trey@apple.com>
1834 3761098 - red dotted underline for misspelled words shows up in drag image
1838 * khtml/rendering/render_text.cpp:
1839 (RenderText::paint): Don't draw misspelling when creating selection image.
1841 2004-08-12 Richard Williamson <rjw@apple.com>
1843 Bring npruntime.h and friends closer to compliance with
1848 * kwq/KWQKHTMLPart.mm:
1849 (KWQKHTMLPart::windowScriptNPObject):
1851 2004-08-12 Maciej Stachowiak <mjs@apple.com>
1853 Reviewed by Richard.
1855 <rdar://problem/3245706> URLs with backslashes instead of slashes work on WinIE; should work on Safari (SAP)
1856 <rdar://problem/3506429> <BASE> tag containing backslash is breaking images with absolute URLs
1859 (substituteBackslashes): Helper method
1860 (KURL::KURL): If the URL contains any backslashes, substitute all
1861 that appear before the query or fragment.
1863 2004-08-12 Ken Kocienda <kocienda@apple.com>
1869 <rdar://problem/3761014> command-down-arrow takes you to start of document instead of end of document
1871 * khtml/xml/dom_selection.cpp:
1872 (DOM::Selection::modifyExtendingRightForward): Code used to assume, incorrectly, that index 1 of the
1873 document element was beyond the last node in the document. But this is not true, since the document
1874 element is the HTML element (generally). Instead, move to the index equal to the number of children
1875 of the document element. This puts us past everything.
1876 (DOM::Selection::modifyMovingRightForward): Ditto.
1878 2004-08-12 Ken Kocienda <kocienda@apple.com>
1884 <rdar://problem/3695446> shift-down-arrow on last line of editable text should select to end of document
1886 Detect when current position is on first or last line and move to the
1887 start or end of that line, respectively.
1889 * khtml/xml/dom_position.cpp:
1890 (DOM::Position::previousLinePosition)
1891 (DOM::Position::nextLinePosition)
1895 2004-08-12 Ken Kocienda <kocienda@apple.com>
1899 Some consolidation in style application code.
1901 * khtml/editing/htmlediting_impl.cpp:
1902 (khtml::StyleChange::StyleChange): Made this a full-on class and added a couple of
1903 members and a constructors to make a StyleChange from a CSSStyleDeclarationImpl, as
1904 well as from a CSSStyleDeclarationImpl and a Position.
1905 (khtml::StyleChange::init): Common init function for StyleChange constructors.
1906 (khtml::StyleChange::currentlyHasStyle): Moved this here from ApplyStyleCommandImpl.
1907 (khtml::CompositeEditCommandImpl::applyTypingStyle): Tweak to adjust to new StyleChange
1909 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Ditto.
1910 * khtml/editing/htmlediting_impl.h:
1911 (khtml::StyleChange::StyleChange):
1912 (khtml::StyleChange::cssStyle): New accessor.
1913 (khtml::StyleChange::applyBold): Ditto.
1914 (khtml::StyleChange::applyItalic): Ditto.
1915 * khtml/xml/dom_position.cpp:
1916 (DOM::Position::computedStyle): New helper.
1917 * khtml/xml/dom_position.h: Ditto.
1919 2004-08-12 Ken Kocienda <kocienda@apple.com>
1924 <rdar://problem/3751098> HTML email has one set of SPAN tags per character in the message
1926 Progress on this bug:
1927 <rdar://problem/3755562> Typing styles do not use same tag application conventions as font and color panel
1929 * khtml/editing/htmlediting_impl.cpp:
1930 (khtml::CompositeEditCommandImpl::applyTypingStyle): Name changed from createTypingStyleElement.
1931 Also, interface changed to take the node to which the typing style is to be applied.
1932 This makes it easier to apply what may be up to three levels of nested tags to get the
1933 desired style (<B>, <I>, and <SPAN STYLE="">).
1934 Also, Borrow some of the style change smarts from ApplyStyleCommandImpl to use bold and
1935 italic tags for applying styles when that is apprpriate. This creates on opportunity to
1936 factor the code to do this so that this function and the ApplyStyleCommandImpl class can
1937 share the implementation. I will follow up with a change to do that after landing this
1938 change. Some future code factoring could be done here to bring together some similar code
1940 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Add comment about code factoring work.
1941 (khtml::ApplyStyleCommandImpl::computeStyleChange): StyleChange struct no longer a member of the
1942 ApplyStyleCommandImpl class. CompositeEditCommandImpl needs it now in its applyTypingStyle()
1944 (khtml::InputNewlineCommandImpl::doApply): Pass along node to style to applyTypingStyle.
1945 (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
1946 * khtml/editing/htmlediting_impl.h:
1947 (khtml::StyleChange::StyleChange): Pull this struct out of ApplyStyleCommandImpl so
1948 CompositeEditCommandImpl can use it.
1949 * khtml/khtml_part.cpp:
1950 (KHTMLPart::notifySelectionChanged): Always clear typing style when the selection
1951 changes, not only when closing typing. This fixes 3751098.
1953 These three tests actually had results that treated the buggy behavior as correct!
1955 * layout-tests/editing/style/style-3681552-fix-001-expected.txt
1956 * layout-tests/editing/style/style-3681552-fix-002-expected.txt
1957 * layout-tests/editing/style/typing-style-002-expected.txt
1959 2004-08-12 Darin Adler <darin@apple.com>
1963 - fixed <rdar://problem/3740485> Repro crash involving replacing content that includes form field
1965 * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Since this function calls selectText: which has a side
1966 effect of making the text field be first responder, call to bridge first to make it first responder.
1967 The bridge version lets WebHTMLView know we are changing the responder, avoiding some unpleasantness
1968 because it sets the "changing focus programmatically" flag. Without that flag set, we were getting
1969 an additional setFocusNode(0) call, which is unnecessary and incorrect.
1971 2004-08-12 Darin Adler <darin@apple.com>
1975 - fixed <rdar://problem/3758756> copying text selected with down arrow results in all text to end of document
1977 * khtml/xml/dom2_rangeimpl.h: Make startNode and pastEndNode public.
1978 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::pastEndNode): Fix bug where this would return
1979 one node too far in the case where the end container was not a text node.
1981 * khtml/xml/dom_nodeimpl.cpp:
1982 (NodeImpl::recursive_toHTMLWithOptions): Rewrite loop, using startNode and pastEndNode,
1983 to fix bug where it would run past the end node, including too many nodes in the generated
1984 HTML. Nice side benefit: easier to read the code.
1986 2004-08-11 Chris Blumenberg <cblu@apple.com>
1988 Fixed: <rdar://problem/3758216> PARENTAL: buttons on parental controls page only work once
1992 * kwq/KWQKHTMLPart.mm:
1993 (KWQKHTMLPart::submitForm): prevent a form from being submitted more than once only if it uses a scheme of http or https
1995 2004-08-11 Darin Adler <darin@apple.com>
1999 - fixed <rdar://problem/3715878> 8A162: connect.apple.com password field showed in cleartext
2001 * kwq/KWQTextField.mm: (-[KWQSecureTextField textDidEndEditing:]):
2002 Enhanced workaround for shifting focus from one secure text field to another so that it works
2003 even for the case of shifting focus from a secure text field back to itself.
2005 2004-08-11 Ken Kocienda <kocienda@apple.com>
2007 Missed adding this file before.
2009 * kwq/KWQTextUtilities.mm: Added.
2010 (KWQFindNextWordFromIndex):
2012 2004-08-11 Ken Kocienda <kocienda@apple.com>
2016 Efficiency improvements on string manipulations in these two new function
2017 implementations. Use the versions of QString append/prepend that take
2018 (QChar *c, uint length) instead of creating new strings each time.
2020 * khtml/xml/dom_position.cpp:
2021 (DOM::Position::previousWordPosition): Changed, as described above.
2022 (DOM::Position::nextWordPosition): Ditto.
2024 2004-08-11 Ken Kocienda <kocienda@apple.com>
2029 <rdar://problem/3675812> Moving a word at a time does not use the correct conception of "word"
2031 I have implemented versions of previousWordPosition and nextWordPosition that are now
2032 different than previousWordBoundary and nextWordBoundary. The behavior of the new
2033 functions attempts to match what Cocoa does as closely as it can. Let the bug filing begin!
2035 * WebCore.pbproj/project.pbxproj: Added KWQTextUtilities.mm
2036 * khtml/misc/helper.cpp:
2037 (khtml::nextWordFromIndex): Glue to call through to KWQFindNextWordFromIndex.
2038 * khtml/misc/helper.h: Declare the function above.
2039 * khtml/misc/khtml_text_operations.cpp: Added SimplifiedBackwardsTextIterator class.
2040 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): New
2041 (khtml::SimplifiedBackwardsTextIterator::advance): Ditto.
2042 (khtml::SimplifiedBackwardsTextIterator::handleTextNode): Ditto.
2043 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement): Ditto.
2044 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Ditto.
2045 (khtml::SimplifiedBackwardsTextIterator::exitNode): Ditto.
2046 (khtml::SimplifiedBackwardsTextIterator::emitCharacter): Ditto.
2047 (khtml::SimplifiedBackwardsTextIterator::range): Ditto.
2048 * khtml/misc/khtml_text_operations.h:
2049 (khtml::SimplifiedBackwardsTextIterator::atEnd): Ditto.
2050 (khtml::SimplifiedBackwardsTextIterator::length): Ditto.
2051 (khtml::SimplifiedBackwardsTextIterator::characters): Ditto.
2052 * khtml/xml/dom_position.cpp:
2053 (DOM::Position::previousWordBoundary): Updated to gather appropriate text and call through to
2054 AppKit to perform the same calculations NSText uses.
2055 (DOM::Position::nextWordBoundary): Ditto.
2056 (DOM::Position::previousWordPosition): Unrelated change to fix case where the function could get "stuck".
2057 (DOM::Position::nextWordPosition): Ditto
2058 (DOM::Position::equivalentDeepPosition): Changed to look backwards if the position's offset is equal
2059 to the number of child nodes it has. This handles more cases correctly, like when the position is
2060 gives as one beyond the end of a document element's last child.
2061 * kwq/KWQTextUtilities.h: Declared KWQFindNextWordFromIndex.
2062 * kwq/KWQTextUtilities.mm: Added.
2063 (KWQFindNextWordFromIndex): New function.
2065 2004-08-11 Ken Kocienda <kocienda@apple.com>
2071 <rdar://problem/3732702> crash in CSSComputedStyleDeclarationImpl running devtools.com editing sample code
2073 * khtml/khtml_part.cpp:
2074 (KHTMLPart::selectionComputedStyle): Added a null check.
2076 2004-08-10 Darin Adler <darin@apple.com>
2080 - fixed <rdar://problem/3710123> Loading iframe that replaces content in the parent document crashes Safari
2082 I fixed three problems:
2084 1) script interpreter destroyed while it was interpreting scripts, caused random havoc
2085 2) code trying to get to view after view was detached from part, caused nil-deref
2086 3) signals sent to parent after child was no longer in the parent's frames list, caused nil-deref
2088 Now the test page works fine. Hope the real sites do too.
2090 * khtml/khtml_part.h: Add connectChild and disconnectChild helper functions (private).
2091 * khtml/khtml_part.cpp:
2092 (KHTMLPart::clear): Call disconnectChild on each frame as we detach it (see below).
2093 (KHTMLPart::end): Ref the part at the start, and deref the part at the end, of this function.
2094 Otherwise, we can end up destroying the part, and hence the interpreter, inside a script that
2095 the interpreter itself is running.
2096 (KHTMLPart::slotFinishedParsing): Add another check for a nil m_view, after the call to
2098 (KHTMLPart::checkCompleted): Remove bogus if statement with empty body.
2099 (KHTMLPart::processObjectRequest): Call disconnectChild to disconnect the child <-> parent signals of the
2100 old child that the new one is replacing, and connectChild to connect the signals (nicer factoring).
2101 (KHTMLPart::slotChildCompleted): Fixed up a confusing boolean if/expression to be simpler. Not related to
2102 the bug fix, but an earlier version of the fix had changes in this function.
2103 (KHTMLPart::connectChild): Added. Connects the appropriate signals for a child frame.
2104 (KHTMLPart::disconnectChild): Added. Disconnects the same signals that connectChild connects.
2106 * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Added a call to disconnectChild before removing the
2107 child from the frames list.
2109 2004-08-09 Maciej Stachowiak <mjs@apple.com>
2115 - made basic marked text highlighting work to complete basic level of <rdar://problem/3704359> input method support not yet implemented for HTML editing
2117 * kwq/WebCoreBridge.mm:
2118 (-[WebCoreBridge setMarkedDOMRange:]): Added this new call to support storing
2119 a marked range in WebCore. The provided DOMRange must start and end in the same
2120 node, which must be a text node.
2121 (-[WebCoreBridge markedDOMRange]): New call to get the marked range.
2122 (-[WebCoreBridge clearMarkedDOMRange]): New call to clear the marked range.
2123 * kwq/WebCoreBridge.h: Prototype new methods.
2124 * kwq/KWQKHTMLPart.mm:
2125 (KWQKHTMLPart::markedRange): Implementation of WebCore call above.
2126 (KWQKHTMLPart::setMarkedRange): Implementation of WebCore call above -
2127 store the marked range, and repaint new and old nodes if needed.
2128 (KWQKHTMLPart::clear): Clear marked range.
2129 * kwq/KWQKHTMLPart.h: Prototype new methods.
2130 * khtml/rendering/render_text.cpp:
2131 (InlineTextBox::paintMarkedTextBackground): New method to paint the background
2132 for marked text, modeled on paintSelection.
2133 (RenderText::paint): Optionally handle painting marked text
2134 background as well as selection background in the marked text
2136 * khtml/rendering/render_text.h: Prototype new method.
2138 2004-08-10 Darin Adler <darin@apple.com>
2142 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
2145 (QRegExp::KWQRegExpPrivate::compile): Null-terminate the pattern and pass it.
2146 (QRegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
2148 2004-08-10 Darin Adler <darin@apple.com>
2154 * khtml/editing/jsediting.cpp: Capitalize command names to match Windows.
2155 The dictionary lookup is case insensitive.
2157 * kwq/KWQFoundationExtras.h: Remove inaccurate comment.
2159 2004-08-10 Trey Matteson <trey@apple.com>
2161 3757094 - crash spell checking after a paste
2165 * khtml/rendering/render_text.cpp:
2166 (InlineTextBox::paintSelection): Add nil check.
2168 2004-08-09 Trey Matteson <trey@apple.com>
2170 3756195 - spell checking leaves misspelling marker behind after bad word is deleted
2171 ... and other follow-on spell check fixes
2175 * khtml/rendering/render_text.cpp:
2176 (InlineTextBox::paintMarker): Close inspection shows we were drawing the
2177 misspelling marker one pixel lower than AK, and one pixel outside the selection
2178 rect we draw, in the case of Times-16. So move it up one. Still not an exact
2179 match for AK, but less bad.
2180 * khtml/xml/dom_docimpl.cpp:
2181 (DocumentImpl::removeMarker): Track whether we make any changes, so we only
2182 repaint if something actually changed.
2183 (DocumentImpl::removeAllMarkers): New utility.
2184 (DocumentImpl::removeAllMarkers): Use clear() instead of (errant)
2185 hand-rolled loop to empty array.
2186 (DocumentImpl::shiftMarkers): Track whether we make any changes, so we only
2187 repaint if something actually changed.
2188 * khtml/xml/dom_docimpl.h:
2189 * khtml/xml/dom_textimpl.cpp:
2190 (CharacterDataImpl::deleteData): Along with shifting existing markers around,
2191 remove any markers in the deleted range. Fixes 3756195.
2192 (CharacterDataImpl::replaceData): Ditto for the replaced range.
2193 * kwq/KWQKHTMLPart.mm:
2194 (KWQKHTMLPart::updateSpellChecking): comment
2196 2004-08-08 Trey Matteson <trey@apple.com>
2198 3745023 - Safari crashes trying to access anchor while downloading
2200 I bet this is behind a few other crashers as well. In this bug the start of the
2201 download leaves a KWQPageState hanging around, and when that is freed it damages
2202 the part and view. If you're still using that page, you're dead.
2204 The fix is to properly invalidate the PageState when we receive an error before
2205 reaching WebFrameCommitted state. Normally this happens when a page is reheated
2206 from the PageState, but in this case we never manage to leave the page to begin
2207 with, although we've already created the PageState.
2209 Other errors besides the synthetic one download generates would have caused similar
2210 crashing. Another example would be clicking on a second link before the load
2211 caused by clicking on the first link reached committed state.
2215 * kwq/WebCoreBridge.h:
2216 * kwq/WebCoreBridge.mm:
2217 (-[WebCoreBridge didNotOpenURL:pageCache:]): Invalidate the pageCache state
2218 when a load doesn't get off the ground.
2220 2004-08-06 Ken Kocienda <kocienda@apple.com>
2224 Finish off spellchecking support to HTML editing. Includes work to
2225 enable continuous spellchecking.
2227 * khtml/editing/htmlediting_impl.cpp:
2228 (khtml::EditCommandImpl::markMisspellingsInSelection): Basically, a one-liner convenience to
2229 make the call over to the KWQKHTMLPart.
2230 (khtml::ReplaceSelectionCommandImpl::doApply): Did some rearranging of code so that the
2231 inserted content can be spell-checked. The function is basically the same, except for
2232 the addition of calls to markMisspellingsInSelection.
2233 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): New function. Takes a look at the
2234 selection that results after typing and determines whether it needs to spellcheck.
2235 Since the word containing the current selection is never marked, this does a check to
2236 see if typing made a new word that is not in the current selection. Basically, you
2237 get this by being at the end of a word and typing a space.
2238 (khtml::TypingCommandImpl::typingAddedToOpenCommand): Call markMisspellingsAfterTyping.
2239 * khtml/editing/htmlediting_impl.h: Add new function declarations.
2240 * khtml/khtml_part.cpp:
2241 (KHTMLPart::setSelection): Since spell checks are updated when the selection changes,
2242 and every selection change passes through here, this is a good place to put the call
2243 to the spellchecker.
2244 * khtml/rendering/render_text.cpp:
2245 (InlineTextBox::paintMarker): Remove temporary misspelling line drawing code. Replace with
2246 call that does AppKit-style drawing. Fix up some comments.
2247 * khtml/xml/dom_docimpl.cpp:
2248 (DocumentImpl::addMarker): Repaint the node that had the marker added. This makes it show
2250 (DocumentImpl::removeMarker): Ditto.
2251 (DocumentImpl::removeAllMarkers): New function. Convenience for clearing all markers.
2252 Used when not in continuous spellchecking mode.
2253 (DocumentImpl::shiftMarkers): Moves markers in response to changes in a node's contents.
2254 This shifts the marker offsets by a given amount. This keeps the markers in the right
2255 place when a user types in a node with markers already set on it.
2256 * khtml/xml/dom_docimpl.h: Added new functions. Removed unnecessary enum qualifier from some
2258 * khtml/xml/dom_position.cpp:
2259 (DOM::Position::previousWordBoundary): This function was susceptible to endless loops...and
2260 needlessly so. Basically, if the current position is at a word boundary, run the code again
2261 to find the previous word boundary.
2262 (DOM::Position::nextWordBoundary): Same as above, but for next word boundary.
2263 * khtml/xml/dom_textimpl.cpp:
2264 (CharacterDataImpl::setData): Call shiftMarkers to update markers when this node changes.
2265 (CharacterDataImpl::insertData): Ditto.
2266 (CharacterDataImpl::deleteData): Ditto.
2267 (CharacterDataImpl::replaceData): Ditto.
2268 * kwq/KWQKHTMLPart.h:
2269 * kwq/KWQKHTMLPart.mm:
2270 (KWQKHTMLPart::advanceToNextMisspelling):
2271 (KWQKHTMLPart::markMisspellingsInSelection):
2272 (KWQKHTMLPart::updateSpellChecking):
2273 (KWQKHTMLPart::respondToChangedSelection):
2275 * kwq/KWQPainter.mm:
2276 (QPainter::drawLineForMisspelling): New function. Call over to WebKit to do the drawing.
2277 * kwq/WebCoreBridge.h:
2278 * kwq/WebCoreBridge.mm:
2279 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Pass markMisspellings flag to
2281 * kwq/WebCoreTextRenderer.h:
2285 2004-08-05 David Hyatt <hyatt@apple.com>
2287 Fix for 3752542, stack overflow that crashes Safari at www.dr.dk. This bug is a regression caused by a fix that
2288 attempted to repair <caption> behavior to make it behave like Panther. This fix was incorrect, and in addition
2289 even our <caption> behavior on Panther was incorrect.
2291 The patch that fixes this bug also makes <caption> handling work when <caption>s are contained inside a <td>, a <tr>,
2292 a <th>, or various table section tags (<tbody>, <tfoot>, <thead>). The <caption> is pulled out and inserted just before
2293 the relevant ancestor table section. This behavior matches other browsers.
2297 * khtml/html/htmlparser.cpp:
2298 (KHTMLParser::insertNode):
2300 2004-08-04 David Hyatt <hyatt@apple.com>
2302 The top-level XSL sheet is now loaded and shows up in the activity window. It is not yet parsed.
2304 Reviewed by kocienda
2306 * WebCore.pbproj/project.pbxproj:
2307 * khtml/css/css_base.h:
2308 (DOM::StyleBaseImpl::isXSLStyleSheet):
2309 * khtml/css/css_stylesheetimpl.cpp:
2310 (CSSStyleSheetImpl::CSSStyleSheetImpl):
2311 * khtml/css/css_stylesheetimpl.h:
2312 (DOM::StyleSheetImpl::isLoading):
2313 * khtml/misc/loader.cpp:
2314 * khtml/xml/dom_xmlimpl.cpp:
2315 (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
2316 (DOM::ProcessingInstructionImpl::checkStyleSheet):
2317 (DOM::ProcessingInstructionImpl::sheet):
2318 (DOM::ProcessingInstructionImpl::isLoading):
2319 (DOM::ProcessingInstructionImpl::setStyleSheet):
2320 * khtml/xml/dom_xmlimpl.h:
2322 2004-08-04 David Hyatt <hyatt@apple.com>
2324 Add XSL Stylesheets to the WebCore cache.
2326 Reviewed by kocienda
2328 * khtml/misc/loader.cpp:
2329 (CachedXSLStyleSheet::CachedXSLStyleSheet):
2330 (CachedXSLStyleSheet::ref):
2331 (CachedXSLStyleSheet::deref):
2332 (CachedXSLStyleSheet::data):
2333 (CachedXSLStyleSheet::checkNotify):
2334 (CachedXSLStyleSheet::error):
2335 (DocLoader::requestXSLStyleSheet):
2336 (Cache::requestXSLStyleSheet):
2337 (Cache::getStatistics):
2338 * khtml/misc/loader.h:
2339 (khtml::CachedObject::):
2340 (khtml::CachedXSLStyleSheet::sheet):
2341 (khtml::CachedXSLStyleSheet::schedule):
2343 2004-08-03 Ken Kocienda <kocienda@apple.com>
2347 Changes to improve our handling of object tags during editing, including
2350 <rdar://problem/3744533> Problem editing <OBJECT> elements displayed by WebPlugIns
2352 Part of the fix for this bug involves removing the close() function from render objects.
2353 It was decided that this code was no longer needed, as the work it did could be moved
2354 to other, more modern, places.
2358 <rdar://problem/3748537> crash due to nil node passed into parentNode in computeTypingStyle deleting text
2360 Finally, I filed and fixed this bug I discovered while fixing the one above:
2362 <rdar://problem/3749338> Select-all + delete leaves editing view without blinking caret
2364 * khtml/editing/htmlediting_impl.cpp:
2365 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Fix for 3748537. Put in some more null
2366 checks. Bail, returning 0 for typing style if any null checks yield a null.
2367 (khtml::DeleteSelectionCommandImpl::doApply): Fix for 3749338. A removeNodeAndPrune call may wind
2368 up deleting the node where we calculated that we wanted to put the selection after deleting.
2369 If this happens, move this ending selection to a sensible alternative.
2370 (khtml::RemoveNodeAndPruneCommandImpl::doApply): Call previousNodeConsideringAtomicNodes instead
2371 of traversePreviousNode when doing the prune.
2372 * khtml/html/html_objectimpl.cpp:
2373 (HTMLObjectElementImpl::attach): Part of the fix for 3744533.
2374 (HTMLObjectElementImpl::recalcStyle): Change old strcmp check for type of renderer to be a call
2375 to canRenderImageType.
2376 (HTMLObjectElementImpl::childrenChanged): New function. Helps to keep object tags up to date
2377 as their children change. This also will help to make object tags respond properly to having their
2378 params changed by DOM calls.
2379 * khtml/html/html_objectimpl.h: Cosmetic change.
2380 * khtml/html/htmlparser.cpp:
2381 (KHTMLParser::insertNode): Remove call to obsolete closeRenderer() function.
2382 (KHTMLParser::popOneBlock): Ditto.
2383 * khtml/rendering/render_block.cpp:
2384 (khtml::RenderBlock::makeChildrenNonInline): Remove call to obsolete close() function.
2385 * khtml/rendering/render_container.cpp:
2386 (RenderContainer::updatePseudoChild): Ditto.
2387 * khtml/rendering/render_form.cpp: Remove obsolete close() function.
2388 * khtml/rendering/render_form.h: Ditto.
2389 * khtml/rendering/render_frames.cpp: Ditto.
2390 * khtml/rendering/render_frames.h: Ditto.
2391 * khtml/rendering/render_inline.cpp:
2392 (RenderInline::splitFlow): Remove calls to obsolete close() function.
2393 * khtml/rendering/render_object.h: Remove obsolete close() function.
2394 * khtml/rendering/render_table.cpp:
2395 (RenderTableCell::layout): Ditto.
2396 * khtml/rendering/render_table.h: Ditto.
2397 * khtml/xml/dom_docimpl.cpp:
2398 (DocumentImpl::closeInternal): Remove call to obsolete close() function.
2399 * khtml/xml/dom_nodeimpl.cpp: Remove obsolete m_rendererNeedsClose initialization.
2400 (NodeImpl::NodeImpl): Remove obsolete closeRenderer() function.
2401 (NodeImpl::attach): Remove call to obsolete close() function.
2402 (NodeImpl::isAtomicNode): New function. Helps to fix 3744533. Determines if a node should
2403 be treated as an atomic node for the purposes of editing.
2404 (NodeImpl::previousNodeConsideringAtomicNodes): New helper to traverse tree taking atomic nodes
2406 (NodeImpl::nextNodeConsideringAtomicNodes): Ditto.
2407 (NodeImpl::previousLeafNode): Now calls nextNodeConsideringAtomicNodes to iterate. This helps to
2408 prevent deleting PARAM tag portions of object tags erroneously.
2409 (NodeImpl::nextLeafNode): Ditto.
2410 * khtml/xml/dom_nodeimpl.h: Removed m_rendererNeedsClose bit. Added declarations for new functions.
2411 * khtml/xml/dom_position.cpp:
2412 (DOM::Position::equivalentDeepPosition): Now takes atomic nodes into account as it drills down into the
2414 * khtml/xml/xml_tokenizer.cpp:
2415 (khtml::XMLTokenizer::endElement): Remove call to obsolete closeRenderer() function.
2417 2004-08-03 David Hyatt <hyatt@apple.com>
2419 Add the deprecated text/xsl MIME type (introduced by Internet Explorer 5) as an acceptable MIME type for XML
2424 * khtml/ecma/xmlhttprequest.cpp:
2425 (KJS::XMLHttpRequest::getValueProperty):
2426 * khtml/khtml_part.cpp:
2428 * khtml/misc/loader.cpp:
2429 (CachedXBLDocument::CachedXBLDocument):
2431 2004-08-03 Maciej Stachowiak <mjs@apple.com>
2435 - remove assertions that asserted text is non-empty, just avoid
2436 doing anything for the empty case; this is needed because input
2437 methods like to insert empty text in various cases.
2439 * khtml/editing/htmlediting_impl.cpp:
2440 (khtml::InsertTextCommandImpl::InsertTextCommandImpl):
2441 (khtml::InsertTextCommandImpl::doApply):
2442 (khtml::InsertTextCommandImpl::doUnapply):
2444 2004-08-03 Darin Adler <darin@apple.com>
2448 - fixed <rdar://problem/3740937> ER: A way to turn a DOMRange into text (equivalent of -innerText)
2450 * khtml/xml/dom2_rangeimpl.h: Added text function. Like innerText, but on a range.
2451 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::text): Added.
2453 * kwq/DOM.mm: (-[DOMRange _text]): Added. Calls DOM::RangeImpl::text.
2454 * kwq/DOMPrivate.h: Added.
2456 * WebCore.pbproj/project.pbxproj: Added DOMPrivate.h, an internal header (private in WebKit, internal here).
2458 2004-08-02 John Sullivan <sullivan@apple.com>
2462 WebCore part of fix for <rdar://problem/3631868> NSToolbar adoption:
2463 Tab key should cycle around toolbar and page content
2465 * kwq/WebCoreBridge.mm:
2466 (-[WebCoreBridge nextKeyViewInsideWebFrameViews]):
2467 Made this method start looking from the current focus node. This won't
2468 affect any existing callers because there were no existing callers.
2469 (-[WebCoreBridge previousKeyViewInsideWebFrameViews]):
2472 2004-08-02 David Hyatt <hyatt@apple.com>
2474 Create a #define for XSLT support that at the moment will only be enabled on Tiger.
2476 Reviewed by kocienda
2480 2004-08-02 Ken Kocienda <kocienda@apple.com>
2486 <rdar://problem/3747945> Deleting replaced element can cause crash
2488 * khtml/xml/dom_selection.cpp:
2489 (DOM::Selection::layoutCaret): The crux of the problem is that
2490 the caret drawing code tries to draw the caret at the image
2491 offset after it has been removed from the document. So, make
2492 sure the start node for the selection is in the document before
2493 trying to lay out the caret using that node.
2495 2004-07-31 Ken Kocienda <kocienda@apple.com>
2499 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
2500 <rdar://problem/3746408> HTMLCompose: cannot type in message body of new messages (and tabbing causes a crash.)
2502 * kwq/KWQKHTMLPart.mm:
2503 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Add in some smarts to look around for
2504 a good place to put the caret if focus is turning "on", the part is contentEditable,
2505 and it does not currently have a selection. This has the effect of flashing the caret
2506 in a contentEditable view automatically without requiring the programmer to set a
2507 selection explicitly. This also fixes the bug listed above. Both are cases where the
2508 bad behavior happened since the editing code tried to process input without an active
2509 selection. I always took the extra step of setting the selection explicitly when
2510 opening new windows in programs like Blot, but it seems silly to require developers to
2511 do this in general. With this patch, they no longer need to.
2513 2004-07-30 Ken Kocienda <kocienda@apple.com>
2519 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
2521 * khtml/xml/dom_selection.cpp:
2522 (DOM::Selection::layoutCaret): Don't bail when the start position of the selection is not in rendered
2523 content. The validate() bottleneck function will do all it can to make sure that the start is
2524 moved to rendered content if at all possible before this function runs. If no rendered position can
2525 be found, like in the case of an empty body element, we still want to flash the caret there.
2526 (DOM::Selection::validate): Look for rendered positions for the base and extent, but save off the
2527 base before making this move, and set the selection to the enclosing block flow element of this
2528 original base if no rendered positions can be found. This has the effect of flashing the caret
2529 someplace in an editable block, even if it does not contain any rendered content.
2531 2004-07-30 Ken Kocienda <kocienda@apple.com>
2535 Fix a large number of editing layout test regressions.
2537 * khtml/misc/khtml_text_operations.cpp:
2538 (khtml::TextIterator::TextIterator): Use a new way to compute the end offset of a node for
2539 purposes of text iteration. The end offset is either child count of a node with children,
2540 or the maxOffset() of a node that does not.
2541 * khtml/xml/dom_nodeimpl.cpp: Remove maxOffset() implementation from NodeBaseImpl. This
2542 conflicted with the usage of this function that is needed for editing.
2543 * khtml/xml/dom_nodeimpl.h: Ditto.
2545 2004-07-30 Trey Matteson <trey@apple.com>
2547 Next steps for spell checking: We have data structures for the marked pieces of
2548 text and the smarts to draw them (although at this point, they just get a green
2549 underline instead of using the real AppKit pattern.)
2551 Note we don't call this code outside of development, since at this point I suspect
2552 it could be made to crash by mixing spelling and editing.
2556 * khtml/rendering/render_text.cpp:
2557 (InlineTextBox::paintMarker): Paint one marker's intersection with a text run
2558 (RenderText::paint): Find intersections of all markers and runs, call paintMarker
2559 * khtml/rendering/render_text.h:
2560 * khtml/xml/dom_docimpl.cpp:
2561 (DocumentImpl::addMarker): Adds a marker to a DOM Range.
2562 (DocumentImpl::removeMarker): Removes a marker from a DOM Range.
2563 (DocumentImpl::addMarker): Adds a marker to a single DOM Node, merging previous
2565 (DocumentImpl::removeMarker): Removes a marker from a single DOM Node, breaking
2566 up previous markers as needed.
2567 (DocumentImpl::markersForNode): Return markers for a Node.
2568 * khtml/xml/dom_docimpl.h:
2569 (DOM::DocumentMarker::): New marker struct
2570 (DOM::DocumentMarker::operator == ):
2571 (DOM::DocumentMarker::operator != ):
2572 * kwq/KWQKHTMLPart.mm:
2573 (KWQKHTMLPart::advanceToNextMisspelling): Mark misspelled ranges when we find them.
2576 2004-07-29 Maciej Stachowiak <mjs@apple.com>
2580 <rdar://problem/3745808> Seed: WebKit: Table's caption broken
2582 * khtml/html/htmlparser.cpp:
2583 (KHTMLParser::insertNode): When a caption appears in an illegal
2584 place in a table, pop blocks until we hit a place where it's
2589 2004-07-29 Darin Adler <darin@apple.com>
2593 - added constants for motion across entire document for use in operations like
2594 move to beginning of document
2596 * khtml/xml/dom_selection.h: Added DOCUMENT to ETextGranularity.
2597 * khtml/xml/dom_selection.cpp:
2598 (DOM::Selection::modifyExtendingRightForward): Added case for DOCUMENT.
2599 (DOM::Selection::modifyMovingRightForward): Added case for DOCUMENT.
2600 (DOM::Selection::modifyExtendingLeftBackward): Added case for DOCUMENT.
2601 (DOM::Selection::modifyMovingLeftBackward): Added case for DOCUMENT.
2602 (DOM::Selection::validate): Changed if statements into switch statement,
2603 added case for DOCUMENT.
2605 * kwq/WebCoreBridge.h: Added WebCoreBridge to WebSelectionGranularity.
2607 2004-07-28 Trey Matteson <trey@apple.com>
2609 Small refinement of last checkin. The text iterators now return reasonable values
2610 for range() when atEnd, which gets rid of special cases and pitfalls in the client.
2614 * khtml/misc/khtml_text_operations.cpp:
2615 (khtml::TextIterator::TextIterator): Set endOffset to a valid value instead of
2617 (khtml::TextIterator::range): Implement when atEnd.
2618 (khtml::CharacterIterator::range): Don't massage result when atEnd.
2619 (khtml::WordAwareIterator::WordAwareIterator): Now that this is fixed, we no
2620 longer need this special case.
2621 (khtml::WordAwareIterator::advance): Always set range, even when atEnd, now that
2622 TextIterator::range() always works.
2623 * khtml/xml/dom_nodeimpl.cpp:
2624 (NodeImpl::childNodeCount): Made const
2625 (NodeBaseImpl::maxOffset): Add missing implementation
2626 * khtml/xml/dom_nodeimpl.h:
2627 * kwq/KWQKHTMLPart.mm:
2628 (KWQKHTMLPart::advanceToNextMisspelling): Get rid of special cases, always call
2629 range on our iterator even when it is atEnd.
2631 2004-07-28 Maciej Stachowiak <mjs@apple.com>
2635 <rdar://problem/3678534> controls on page at http://help.sap.com don't work properly
2637 To fix this I implemented the various JavaScript BarInfo properties in JavaScript.
2639 * khtml/ecma/kjs_window.cpp:
2641 (Window::locationbar):
2643 (Window::personalbar):
2644 (Window::statusbar):
2646 (Window::scrollbars):
2649 (SelectionFunc::tryCall):
2651 (BarInfo::~BarInfo):
2654 * khtml/ecma/kjs_window.h:
2657 (KJS::BarInfo::part):
2658 (KJS::BarInfo::classInfo):
2659 * khtml/ecma/kjs_window.lut.h:
2661 * kwq/KWQKHTMLPart.h:
2662 * kwq/KWQKHTMLPart.mm:
2663 (KWQKHTMLPart::locationbarVisible):
2664 (KWQKHTMLPart::menubarVisible):
2665 (KWQKHTMLPart::personalbarVisible):
2666 (KWQKHTMLPart::scrollbarsVisible):
2667 (KWQKHTMLPart::statusbarVisible):
2668 (KWQKHTMLPart::toolbarVisible):
2670 2004-07-28 Ken Kocienda <kocienda@apple.com>
2672 Added more layout tests.
2674 * layout-tests/editing/style/style-3681552-fix-001-expected.txt: Added.
2675 * layout-tests/editing/style/style-3681552-fix-001.html: Added.
2676 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Added.
2677 * layout-tests/editing/style/style-3681552-fix-002.html: Added.
2678 * layout-tests/editing/style/style-3690704-fix-expected.txt: Added.
2679 * layout-tests/editing/style/style-3690704-fix.html: Added.
2680 * layout-tests/editing/style/typing-style-001-expected.txt: Added.
2681 * layout-tests/editing/style/typing-style-001.html: Added.
2682 * layout-tests/editing/style/typing-style-002-expected.txt: Added.
2683 * layout-tests/editing/style/typing-style-002.html: Added.
2685 2004-07-28 Ken Kocienda <kocienda@apple.com>
2687 Added some layout tests.
2689 * layout-tests/editing/selection/select-all-001-expected.txt: Added.
2690 * layout-tests/editing/selection/select-all-001.html: Added.
2691 * layout-tests/editing/selection/select-all-002-expected.txt: Added.
2692 * layout-tests/editing/selection/select-all-002.html: Added.
2693 * layout-tests/editing/selection/select-all-003-expected.txt: Added.
2694 * layout-tests/editing/selection/select-all-003.html: Added.
2696 2004-07-28 Trey Matteson <trey@apple.com>
2698 Spellchecking, Part I. Basic spellcheck is working. Spelling panel is hooked up.
2700 At this point, no special marking of misspellings, no grammar check, no context
2701 menu integration, no "check continually" mode.
2703 Much of the TextIterator and CharacterIterator interface got published outside
2704 of khtml_text_operations.cpp, with a little API rationalizing.
2708 * khtml/misc/khtml_text_operations.cpp:
2709 (khtml::TextIterator::range): Name changes.
2710 (khtml::CharacterIterator::CharacterIterator): Ditto.
2711 (khtml::CharacterIterator::range): Ditto.
2712 (khtml::CharacterIterator::advance): Ditto.
2713 (khtml::CharacterIterator::string): New method to consume chars into a string.
2714 (khtml::WordAwareIterator::WordAwareIterator): New class that iterates over
2715 the text respecting word boundaries.
2716 (khtml::WordAwareIterator::advance):
2717 (khtml::WordAwareIterator::length):
2718 (khtml::WordAwareIterator::characters):
2719 (khtml::plainText): Name changes.
2720 (khtml::findPlainText): Ditto.
2722 API moved from cpp to header file.
2723 * khtml/misc/khtml_text_operations.h:
2724 (khtml::TextIterator::atEnd):
2725 (khtml::TextIterator::length):
2726 (khtml::TextIterator::characters):
2727 (khtml::CharacterIterator::atBreak):
2728 (khtml::CharacterIterator::atEnd):
2729 (khtml::CharacterIterator::length):
2730 (khtml::CharacterIterator::characters):
2731 (khtml::CharacterIterator::characterOffset):
2732 (khtml::WordAwareIterator::atEnd):
2733 (khtml::WordAwareIterator::range):
2735 * khtml/xml/dom_position.cpp:
2736 (DOM::Position::previousWordBoundary): New name for the old routine. This routines semantics
2737 match the current behavior of this code.
2738 (DOM::Position::nextWordBoundary): Ditto.
2739 (DOM::Position::previousWordPosition): Call old code with the new name. When we fix
2740 word advancement, this routine will have its own impl.
2741 (DOM::Position::nextWordPosition): Ditto.
2742 * khtml/xml/dom_position.h:
2743 * khtml/xml/dom_selection.h:
2744 (DOM::Selection::rangeStart): New convenience methods
2745 (DOM::Selection::rangeEnd):
2746 * kwq/KWQKHTMLPart.h:
2747 * kwq/KWQKHTMLPart.mm:
2748 (KWQKHTMLPart::findString): Ensure we use range-compatible positions.
2749 (KWQKHTMLPart::advanceToNextMisspelling): Brand new.
2750 * kwq/WebCoreBridge.h:
2751 * kwq/WebCoreBridge.mm:
2752 (-[WebCoreBridge advanceToNextMisspelling]): Typical bridge glue.
2754 2004-07-28 Ken Kocienda <kocienda@apple.com>
2760 <rdar://problem/3690704> marking partly bold text italic across blocks wrongly extends the bold section
2762 * khtml/editing/htmlediting_impl.cpp:
2763 (khtml::ApplyStyleCommandImpl::doApply): Fixed loop that gathers up groups of nodes to
2764 pass off to the function that applies styles. While this is meant to be conservative in
2765 order to leave the DOM well-formed in all cases, it contained an error where the set
2766 of nodes to be styled together erroneously could include a node that was meant for
2767 the next set. Fixed.
2768 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Unrelated change to remove DOM:: scope
2769 resolution qualifier. Unneeded here.
2771 2004-07-28 Darin Adler <darin@apple.com>
2775 - fixed <rdar://problem/3658471> REGRESSION: Node.appendChild( ) fails when parent already contains that child
2777 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::isAncestor): Restore the original meaning of this function.
2778 It returns true if the parameter is an ancestor of this, but had been changed to return true if this
2779 is an ancestor of the parameter. However, we do retain one change we made at the same time, which is
2780 that it does not consider a node an ancestor of itself.
2782 * khtml/editing/htmlediting_impl.cpp: (khtml::ApplyStyleCommandImpl::nodeFullySelected):
2783 * khtml/xml/dom2_traversalimpl.cpp: (DOM::NodeIteratorImpl::notifyBeforeNodeRemoval):
2784 Reverse parameters for callers who wanted the new meaning of isAncestor, with care to not use it in
2785 any cases where the pointer might be 0.
2787 * khtml/xml/dom_nodeimpl.h: Added const to the parameter to make things more symmetric and allow the
2788 new uses to all compile.
2790 2004-07-28 Ken Kocienda <kocienda@apple.com>
2796 <rdar://problem/3681552> html editing needs to preserve typing font when replacing selection
2798 * khtml/css/css_valueimpl.cpp:
2799 (CSSStyleDeclarationImpl::merge): New helper that merges styles together. Helpful for
2800 dealing with typing styles.
2801 * khtml/css/css_valueimpl.h:
2802 * khtml/editing/htmlediting_impl.cpp:
2803 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): New helper that updates the
2804 typing style based on the current selection. This is a convenient bottleneck for all
2805 the code that needs to worry about typing style.
2806 (khtml::DeleteSelectionCommandImpl::doApply): Update typing style before doing the delete.
2807 (khtml::InputNewlineCommandImpl::doApply): No need to redeclare exceptionCode local.
2809 (khtml::InputTextCommandImpl::prepareForTextInsertion): Remove unneeded complication when
2810 figuring out where to insert style node. Not even sure what I was trying to do here, but
2811 it does not seem to be needed any more.
2812 (khtml::InputTextCommandImpl::execute): Remove unneeded comment.
2813 * khtml/editing/htmlediting_impl.h: Declare new computeTypingStyle helper.
2814 * khtml/khtml_part.cpp:
2815 (KHTMLPart::setCaretVisible): Call selectionLayoutChanged instead of notifySelectionChanged
2816 in this function. The selection did not change simply by calling this function, but it
2818 (KHTMLPart::notifySelectionChanged): Treat clearing the typing style much like closing typing,
2819 instead of clearing it unconditionally.
2820 (KHTMLPart::applyStyle): In the case where the current selection is a caret, merge the
2821 style being applied with any current typing style that already exists.
2823 2004-07-28 Darin Adler <darin@apple.com>
2827 - fixed <rdar://problem/3711080> REGRESSION (125-146): form fields have shrunk by 1 pixel, and now clip descenders
2829 * kwq/KWQLineEdit.mm: (QLineEdit::sizeForCharacterWidth):
2830 Compute the size without ever calling cellSize. After talking with Andrew Platzer,
2831 we decided that hard-coding the size of the borders of a text field was the best
2832 way for WebCore to handle this.
2834 2004-07-28 Darin Adler <darin@apple.com>
2838 - fixed <rdar://problem/3743204> REGRESSION: crash at startribune.com in InlineBox::root()
2840 * khtml/rendering/render_flow.cpp: (RenderFlow::dirtyLinesFromChangedChild):
2841 Added a check for nil.
2843 2004-07-27 Darin Adler <darin@apple.com>
2847 - fixed <rdar://problem/3743138> opaque colors come out of getComputedStyle as "rgba", transparent ones as "rgb"
2849 * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cssText): Use "rgb" rather than
2850 "rgba" when alpha is 0xFF, not when alpha is 0.
2852 2004-07-27 Ken Kocienda <kocienda@apple.com>
2856 Fixed the problem where BR elements on lines by themselves don't paint when selected.
2858 * khtml/khtml_part.cpp:
2859 (KHTMLPart::selectAll): Related fix. Include BR's when figuring out what "all" is.
2860 * khtml/rendering/render_br.cpp:
2861 (RenderBR::paint): New function implementation. Teach BR's how to paint selections.
2862 * khtml/rendering/render_br.h:
2863 * khtml/rendering/render_text.cpp:
2864 (InlineTextBox::paintSelection): Fix some geometry calculations to be more readable (i.e. don't
2865 reuse function argument as a local). Also, improve the logic for determining whether to
2866 extend the selection to block boundaries.
2867 (RenderText::paint): Remove extendSelection argument from paintSelection. The logic to figure out
2868 extensions is now fully contained in paintSelection.
2869 * khtml/rendering/render_text.h:
2871 2004-07-27 David Hyatt <hyatt@apple.com>
2873 Fix for 3665211 (again). Make sure not to leave child line boxes pointing to deleted ancestor line boxes.
2875 Reviewed by kocienda
2877 * khtml/rendering/render_block.cpp:
2878 (khtml::RenderBlock::removeChild):
2880 2004-07-26 Chris Blumenberg <cblu@apple.com>
2882 Fixed: WebView scrolls to the top after making an editing change via drag & drop
2884 Fixed by Ken, reviewed by me.
2886 * kwq/WebCoreBridge.mm:
2887 (-[WebCoreBridge ensureCaretVisible]): do nothing if the selection is not a caret
2891 2004-07-26 Maciej Stachowiak <mjs@apple.com>
2895 <rdar://problem/3740855> REGRESSION: Flash incorrectly positioned at macromedia.com
2897 * khtml/html/htmltokenizer.cpp:
2898 (khtml::HTMLTokenizer::scriptExecution): Do the prepending-src
2899 trick as for inline script execution.
2901 Added new layout tests covering this and other recent tokenizer
2904 * layout-tests/fast/tokenizer/001-expected.txt: Added.
2905 * layout-tests/fast/tokenizer/001.html: Added.
2906 * layout-tests/fast/tokenizer/002-expected.txt: Added.
2907 * layout-tests/fast/tokenizer/002.html: Added.
2908 * layout-tests/fast/tokenizer/003-expected.txt: Added.
2909 * layout-tests/fast/tokenizer/003.html: Added.
2910 * layout-tests/fast/tokenizer/resources/003-script.js: Added.
2912 2004-07-23 Ken Kocienda <kocienda@apple.com>
2918 <rdar://problem/3738920> Caret blinks in inactive window
2920 As part of the fix, I cleaned up the way we handle special drawing that needs
2921 to be done in the HTML view that is first responder in the key window (e.g the
2922 drawing of text selection highlight and caret blinking).
2924 * khtml/khtml_part.cpp: Removed setCaretVisible function. Updating caret visibility
2925 is now done in setDisplaysWithFocusAttributes, described below.
2926 * khtml/khtml_part.h: Ditto.
2927 * khtml/khtmlpart_p.h:
2928 (KHTMLPartPrivate::KHTMLPartPrivate): m_caretVisible now defaults to false. This prevents
2929 the caret from blinking when an app is started from the command line and remains in the
2931 * khtml/khtmlview.cpp:
2932 (KHTMLView::focusInEvent): Remove caret code from here. Not needed.
2933 (KHTMLView::focusOutEvent): Ditto.
2934 * kwq/KWQKHTMLPart.h:
2935 (KWQKHTMLPart::displaysWithFocusAttributes): New accessor to return cached value to other code
2937 * kwq/KWQKHTMLPart.mm:
2938 (KWQKHTMLPart::KWQKHTMLPart):
2939 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Renamed from setShowsFirstResponder and modified
2940 to do the display updating in a clearer way....and now has comments!
2941 * kwq/WebCoreBridge.h: Remove several obsolete functions that use to try to do the work of the new
2942 setDisplaysWithFocusAttributes function (and did so less well).
2943 * kwq/WebCoreBridge.mm:
2944 (-[WebCoreBridge drawRect:]): Now calls displaysWithFocusAttributes to figure out how to draw the
2945 text selection background.
2946 (-[WebCoreBridge setDisplaysWithFocusAttributes:]): Calls through to setDisplaysWithFocusAttributes in
2948 (-[WebCoreBridge selectionColor]): Flipped the value of this ternary expression to accommodate the
2949 change from usesInactiveTextBackgroundColor to setDisplaysWithFocusAttributes.
2950 (-[WebCoreBridge setCaretVisible:]): Removed.
2952 2004-07-23 John Sullivan <sullivan@apple.com>
2956 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
2957 now also extends selection (even if there wasn't one before)
2959 * khtml/khtml_part.cpp:
2960 (KHTMLPart::handleMousePressEventSingleClick):
2961 Uh, duh. Got a ! wrong last time somehow, so it did even more the wrong thing
2962 than ever. I did test this before, so my best guess is an accidental undo or
2963 something before committing.
2965 2004-07-23 David Hyatt <hyatt@apple.com>
2967 Fix for 3735084 and 3737209, when you can find no line boxes in your previous sibling, the line box to dirty
2968 should be the *first* line box and not the last.
2970 Reviewed by kocienda
2972 * khtml/rendering/render_flow.cpp:
2973 (RenderFlow::dirtyLinesFromChangedChild):
2975 2004-07-23 Ken Kocienda <kocienda@apple.com>
2979 * khtml/xml/dom_selection.cpp:
2980 (DOM::Selection::validate): Not exactly a fix of anything per se, but more of a refinement
2981 of how selection validation works. The idea is to let the selection validation process
2982 end up with an empty selection given real DOM position inputs if the validation code
2983 cannot find a rendered position. Since selection is all about display, this makes sense.
2984 Currently, the code will allow the selection to be placed in a location that is not
2985 rendered, and this does nobody any good, as it can lead to bugs like accepting key input
2986 in a div that is set to display:none.
2988 2004-07-23 Ken Kocienda <kocienda@apple.com>
2990 Updated layout tests with new expected results.
2992 * layout-tests/editing/execCommand/boldSelection-expected.txt
2993 * layout-tests/editing/selection/extend-by-character-001-expected.txt
2994 * layout-tests/editing/selection/extend-by-character-003-expected.txt
2995 * layout-tests/editing/selection/unrendered-005-expected.txt
2997 2004-07-22 Maciej Stachowiak <mjs@apple.com>
3001 <rdar://problem/3725467> REGRESSION(140-142) nothing displayed at http://Ye-Olde-Movies.tripod.com
3002 <rdar://problem/3599494> REGRESSION (100-125): Frame does not refresh until user clicks on browser.
3004 * khtml/rendering/render_frames.cpp:
3005 (RenderFrameSet::layout): When returning early because there are
3006 no children, make sure to mark self as no longer needing
3007 layout. Otherwise, when children are added, we'll fail to
3008 propagate childrenNeedLayout to our own parent! This is almost
3009 certainly a long-standing bug that was just masked by our old
3012 2004-07-22 Kevin Decker <kdecker@apple.com>
3016 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
3018 * khtml/ecma/kjs_events.cpp:
3019 (JSLazyEventListener::JSLazyEventListener):
3020 (JSLazyEventListener::parseCode):
3021 * khtml/ecma/kjs_events.h:
3022 * khtml/ecma/kjs_proxy.cpp:
3023 (KJSProxyImpl::createHTMLEventHandler):
3024 * khtml/ecma/kjs_window.cpp:
3025 (Window::getJSLazyEventListener):
3026 * khtml/ecma/kjs_window.h:
3028 2004-07-22 Ken Kocienda <kocienda@apple.com>
3034 <rdar://problem/3724344> Bolding and unbolding creates extraneous tags
3036 * khtml/editing/htmlediting_impl.cpp:
3037 (khtml::ApplyStyleCommandImpl::doApply): Move the start of the selection upstream
3038 before calling removeStyle. This makes sure we remove all styles that could apply to the
3039 selection, and not just ones in from the start position of the selection passed to us.
3041 * khtml/xml/dom_selection.cpp:
3042 (DOM::Selection::validate): Related fix to "constrain" the selection to be the
3043 smallest equivalent range of nodes, in effect making a "canonical" version of the
3044 selection. While this is not strictly necessary to fix the bug, it is a step I have been
3045 wanting to take this step for a long time, and some recent improvements made it
3046 possible for me to do now in just two lines of code.
3048 2004-07-22 Ken Kocienda <kocienda@apple.com>
3054 <rdar://problem/3711264> difficult (impossible?) to get cursor in an editable webview containing only tags
3056 * khtml/rendering/render_container.cpp:
3057 (RenderContainer::positionForCoordinates): Don't assume you can pass off
3058 the check to a first child if there is one, since the child can be an element
3059 we do not want to place the caret in, like a table row with no cells (the case
3060 in the bug above). So now, we iterate of the renderer's children looking for
3061 the closest one, but only consider those renderers which either have children
3062 themselves, or are render block flows or are render inlines.
3064 2004-07-22 Darin Adler <darin@apple.com>
3066 - remove a bunch of now-unused code
3068 * ForwardingHeaders/qxml.h: Removed.
3069 * kwq/KWQXmlAttributes.h: Removed.
3070 * kwq/KWQXmlAttributes.mm: Removed.
3071 * kwq/KWQXmlDefaultHandler.h: Removed.
3072 * kwq/KWQXmlDefaultHandler.mm: Removed.
3073 * kwq/KWQXmlSimpleReader.h: Removed.
3074 * kwq/KWQXmlSimpleReader.mm: Removed.
3076 2004-07-22 Darin Adler <darin@apple.com>
3080 - got rid of QXml classes and changed XML parsing to use libxml directly
3082 This is the first step toward more direct use of libxml and libxslt.
3083 Dave is planning to build on this to implement XSLT and to improve our handling
3084 of XML documents (faster and more feature complete, including DTDs).
3086 * khtml/html/html_elementimpl.cpp:
3087 (HTMLElementImpl::createContextualFragment):
3088 * khtml/html/htmltokenizer.cpp:
3089 (khtml::HTMLTokenizer::HTMLTokenizer):
3090 * khtml/html/htmltokenizer.h:
3091 * khtml/xml/dom_docimpl.cpp:
3092 (DocumentImpl::createTokenizer):
3093 (DocumentImpl::open):
3094 * khtml/xml/dom_docimpl.h:
3095 (DOM::DocumentImpl::tokenizer):
3096 * khtml/xml/dom_xmlimpl.cpp:
3097 (DOM::ProcessingInstructionImpl::checkStyleSheet):
3098 * khtml/xml/dom_xmlimpl.h:
3099 * khtml/xml/xml_tokenizer.h:
3100 * khtml/xml/xml_tokenizer.cpp: Redid this all to use libxml directly.
3102 * WebCore.pbproj/project.pbxproj: Removed a bunch of files.
3104 2004-07-21 Trey Matteson <trey@apple.com>
3106 DHTML dragging should use UTI for MIME-pboard type conversion
3110 * kwq/KWQClipboard.mm:
3111 (cocoaTypeFromMIMEType): Use UTI, except for cases we need to hardwire. Only cut off
3112 MIME args following a semi-colon for text/plain.
3113 (MIMETypeFromCocoaType): Use UTI, except for cases we need to hardwire.
3114 (KWQClipboard::types): Filter out ancient NSAsciiPboardType so DHTML never sees this cruft.
3116 2004-07-21 Ken Kocienda <kocienda@apple.com>
3120 Remove handling of HTML editing key events from WebCore.
3121 This now happens in WebKit if an event passes all the
3122 way through WebCore without being handled by the DOM.
3124 In each case below, function were removed, as their
3125 only purpose was to handle editing key events.
3127 * khtml/xml/dom_elementimpl.cpp
3128 * khtml/xml/dom_elementimpl.h
3129 * kwq/KWQKHTMLPart.h
3130 * kwq/KWQKHTMLPart.mm
3131 * kwq/WebCoreBridge.h
3133 2004-07-21 Ken Kocienda <kocienda@apple.com>
3137 * khtml/xml/dom_selection.cpp:
3138 (DOM::Selection::modifyExtendingRightForward): Add LINE_BOUNDARY case to the switch statement in this
3139 function. Use the startAndEndLineNodesIncludingNode helper which already existed to get the right
3141 (DOM::Selection::modifyMovingRightForward): Ditto
3142 (DOM::Selection::modifyExtendingLeftBackward): Ditto
3143 (DOM::Selection::modifyMovingLeftBackward): Ditto
3144 * khtml/xml/dom_selection.h:
3145 (DOM::Selection::): Add LINE_BOUNDARY constant to ETextGranularity enum. This
3146 specifies a new kind of movement that we need to implement the "move-to beggining/end of line"
3147 behavior which AppKit binds to cmd+left/right arrow keys.
3148 * kwq/WebCoreBridge.h: Add WebSelectToLineBoundary constant. This matches
3150 2004-07-20 David Hyatt <hyatt@apple.com>
3152 Fix for 3714434, user stylesheet is always parsed in strict mode, when it should honor the document's setting.
3156 * khtml/css/cssstyleselector.cpp:
3157 (khtml::CSSStyleSelector::CSSStyleSelector):
3159 2004-07-20 Ken Kocienda <kocienda@apple.com>
3163 * khtml/xml/dom_elementimpl.cpp:
3164 (ElementImpl::defaultEventHandler): No longer check whether
3165 the command key is modifying the key event. This check is
3166 now done elsewhere in the code. See the WebKit checkin that
3167 added the _web_keyBindingManagerHasBinding method to
3170 2004-07-20 Chris Blumenberg <cblu@apple.com>
3173 <rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
3174 <rdar://problem/3612691> Missing image icons (blue ?) lack context menu
3178 * kwq/WebCoreBridge.mm:
3179 (-[WebCoreBridge elementAtPoint:]): if there is no image, put the image URL on the element anyway
3181 2004-07-20 David Hyatt <hyatt@apple.com>
3183 Fix for alt text not working on images.
3187 * khtml/rendering/render_image.cpp:
3188 (RenderImage::RenderImage):
3189 (RenderImage::setPixmap):
3190 (RenderImage::paint):
3191 (RenderImage::calcReplacedWidth):
3192 (RenderImage::calcReplacedHeight):
3194 2004-07-20 Maciej Stachowiak <mjs@apple.com>
3198 <rdar://problem/3720111> REGRESSION(125-152): map fails to load depending on banner ad; weather.com (works in IE and Firefox)
3200 * khtml/html/htmltokenizer.cpp:
3201 (khtml::HTMLTokenizer::begin): Initialize currentPrependingSrc.
3202 (khtml::HTMLTokenizer::scriptHandler): Store a pointer to the currently
3203 active prependingSrc variable on the stack, the better to handle weird cases
3204 of scripts writing out additional script tags and so forth.
3205 (khtml::HTMLTokenizer::write): Deal with the above.
3206 * khtml/html/htmltokenizer.h: Declare new member field.
3208 2004-07-20 David Hyatt <hyatt@apple.com>
3210 Fix for layer positioning error that occurs when absolute positioned blocks are inside static positioned overflow:auto
3215 * khtml/rendering/render_layer.cpp:
3216 (RenderLayer::updateLayerPosition):
3218 2004-07-20 Trey Matteson <trey@apple.com>
3220 3705624 REGRESSION: can't rearrange photos on homepage.mac.com album
3222 A subtle problem stemming from some interaction between focus handing and
3223 event propagation. We previously made it so when a focus shift fails we
3224 don't propagate the event to KHTML. The fix is to get rid of the inverse
3225 effect, so now even if a focus shift succeeds, we don't propagate to KHTML if
3226 the page already canceled default behavior.
3228 In this specific case, the page is cancelling default behavior since it
3229 does its own dragging, and the bug was our new system dragging was
3234 * khtml/khtmlview.cpp:
3235 (KHTMLView::dispatchMouseEvent): What he said.
3237 2004-07-20 Ken Kocienda <kocienda@apple.com>
3243 <rdar://problem/3695240> pasting plain text with newlines in it turns them into spaces
3245 * kwq/WebCoreBridge.mm:
3246 (-[WebCoreBridge documentFragmentWithText:]): Refine this function to be smart about converting
3247 line endings into BR elements.
3249 2004-07-20 Ken Kocienda <kocienda@apple.com>
3255 <rdar://problem/3707505> HTMLCompose: blinking cursor in both an address text field and the message body
3257 * khtml/khtml_part.cpp:
3258 (KHTMLPart::setCaretVisible): This method renamed from setSelectionVisible. Since it really only operates
3259 on the caret, this seems like a better name.
3260 * khtml/khtml_part.h:
3261 * khtml/khtmlview.cpp:
3262 (KHTMLView::focusInEvent): Call setCaretVisible(true)
3263 (KHTMLView::focusOutEvent): Call setCaretVisible(false)
3264 * kwq/KWQKHTMLPart.mm:
3265 (KWQKHTMLPart::setShowsFirstResponder): Name change: setSelectionVisible becomes setCaretVisible.
3266 * kwq/WebCoreBridge.h: Expose setCaretVisible as a bridge method.
3267 * kwq/WebCoreBridge.mm:
3268 (-[WebCoreBridge setCaretVisible:]): Ditto.
3270 2004-07-19 Maciej Stachowiak <mjs@apple.com>
3274 <rdar://problem/3721428> REGRESSION (125.8-146): external javascript statements produce extra garbage character (sina.com)
3276 * khtml/misc/stringit.h:
3277 (khtml::TokenizerSubstring::TokenizerSubstring): For the apple branch, use the new
3278 stableUnicode() method to get the unicode pointer.
3281 (QString::detachIfInternal): Reorganize this to be a bit less wacky about refcounts.
3282 It does not leave around a zombie internal data handle but rather destroys it right away,
3283 and leaves the object pointing to the new handle (which it can then deref). This makes
3284 the code more clear.
3285 (QString::~QString): Simplify.
3286 (QString::stableUnicode): New method that detaches a copy of the KWQStringData if it
3287 is internal to a string besides this one. This guarantees that if you get the unicode()
3288 pointer, it won't go bad so long as this string is still alive.
3290 2004-07-19 David Hyatt <hyatt@apple.com>
3292 Fix for 3715117, crash from a bug in removeChildren. Clean up node removal and fix an n-squared removal
3293 bug. Also clean up checks in removeChild and in the dispatch of removedFromDocument mutation events to
3294 make node removal more efficient.
3296 Reviewed by kocienda
3298 * khtml/xml/dom_nodeimpl.cpp:
3300 2004-07-19 John Sullivan <sullivan@apple.com>
3304 - fixed <rdar://problem/3141150> can't undo in form textarea fields
3306 * kwq/KWQTextArea.mm:
3307 (-[KWQTextArea _createTextView]):
3308 call setAllowsUndo:YES. My, wasn't this easy?
3310 2004-07-19 David Hyatt <hyatt@apple.com>
3312 Merge @import fix for CSS1 test suite from Stephan Kulow.
3316 * khtml/css/parser.cpp:
3317 * khtml/css/parser.y:
3318 * layout-tests/css1/basic/containment-expected.txt:
3320 2004-07-19 David Hyatt <hyatt@apple.com>
3322 Fix for 3718697, crash clicking on JS tab at alaskaair.com.
3324 Reviewed by kocienda
3326 * khtml/rendering/render_flow.cpp:
3327 (RenderFlow::detach):
3328 (RenderFlow::dirtyLinesFromChangedChild):
3329 * khtml/rendering/render_flow.h:
3330 * khtml/rendering/render_object.cpp:
3331 (RenderObject::dirtyLinesFromChangedChild):
3332 * khtml/rendering/render_object.h:
3334 2004-07-16 David Hyatt <hyatt@apple.com>
3336 Fix for 3726471, need to ensure that it's safe to do updateRendering from within layout, since isContentEditable
3337 relies on it. The fix is to just recalcStyle up front before beginning the layout, so that all of our renderobjects
3342 * khtml/khtmlview.cpp:
3343 (KHTMLView::layout):