1 2004-08-19 David Hyatt <hyatt@apple.com>
3 Fix crash when text is contained inside a table-colgroup.
7 * khtml/xml/dom_textimpl.cpp:
8 (TextImpl::rendererIsNeeded):
10 2004-08-19 Trey Matteson <trey@apple.com>
12 Unexpected errors hit while finding word boundaries, leading to crash.
16 * kwq/KWQTextUtilities.cpp:
17 (KWQFindWordBoundary): Don't call UCFindTextBreak with edge cases it thinks
18 are param errors, and pass correct mask for forward case. Also fix off-by-one
19 crashers in fallback code.
21 2004-08-19 David Hyatt <hyatt@apple.com>
23 Make XSLT imports/includes work. This code has to be turned off until the newer version of libxslt is
28 * khtml/css/css_ruleimpl.cpp:
29 (CSSImportRuleImpl::init):
30 * khtml/xml/dom_docimpl.cpp:
31 (DocumentImpl::DocumentImpl):
32 (DocumentImpl::~DocumentImpl):
33 (DocumentImpl::applyXSLTransform):
34 * khtml/xml/dom_docimpl.h:
35 (DOM::DocumentImpl::setTransformSource):
36 (DOM::DocumentImpl::transformSource):
37 * khtml/xml/dom_xmlimpl.cpp:
38 (DOM::ProcessingInstructionImpl::checkStyleSheet):
39 * khtml/xml/xml_tokenizer.cpp:
44 (khtml::createQStringParser):
45 (khtml::XMLTokenizer::setTransformSource):
46 * khtml/xsl/xsl_stylesheetimpl.cpp:
47 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
48 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
49 (DOM::XSLStyleSheetImpl::isLoading):
50 (DOM::XSLStyleSheetImpl::clearDocuments):
51 (DOM::XSLStyleSheetImpl::parseString):
52 (DOM::XSLStyleSheetImpl::loadChildSheets):
53 (DOM::XSLStyleSheetImpl::loadChildSheet):
54 (DOM::XSLImportRuleImpl::parentStyleSheet):
55 (DOM::XSLStyleSheetImpl::compileStyleSheet):
56 (DOM::XSLStyleSheetImpl::locateStylesheetSubResource):
57 (DOM::XSLImportRuleImpl::XSLImportRuleImpl):
58 (DOM::XSLImportRuleImpl::~XSLImportRuleImpl):
59 (DOM::XSLImportRuleImpl::setStyleSheet):
60 (DOM::XSLImportRuleImpl::isLoading):
61 (DOM::XSLImportRuleImpl::loadSheet):
62 * khtml/xsl/xsl_stylesheetimpl.h:
63 (DOM::XSLStyleSheetImpl::setOwnerDocument):
64 (DOM::XSLStyleSheetImpl::setDocument):
65 (DOM::XSLStyleSheetImpl::markAsProcessed):
66 (DOM::XSLStyleSheetImpl::processed):
67 (DOM::XSLImportRuleImpl::href):
68 (DOM::XSLImportRuleImpl::styleSheet):
69 (DOM::XSLImportRuleImpl::isImportRule):
70 * khtml/xsl/xslt_processorimpl.cpp:
71 (DOM::m_sourceDocument):
72 (DOM::stylesheetLoadFunc):
73 (DOM::XSLTProcessorImpl::transformDocument):
74 * khtml/xsl/xslt_processorimpl.h:
78 2004-08-18 Trey Matteson <trey@apple.com>
80 3765958 - downstreamPosition() can hit infinite loop when at end of doc
82 The problem was that I had a position that was after the maximum position in the text
83 node, because it was the old caret position before a backspace was processed. Later
84 I happened to call downstream() on that position, and hit the bug. Fix is to consider
85 a position past the end point of its node if it is *greater than* or equal to its max offset.
89 * khtml/xml/dom_positioniterator.cpp:
90 (DOM::PositionIterator::atEnd):
92 2004-08-18 David Hyatt <hyatt@apple.com>
94 Make the header overlap the footer in the zero-line case. Changes to Emerson's template will ensure the
95 header draws over the footer.
99 * khtml/rendering/render_block.cpp:
100 (khtml::getHeightForLineCount):
102 2004-08-18 Richard Williamson <rjw@apple.com>
104 Replace horrible pollForAppletInView: with new
105 webPlugInGetApplet. The details of how the applet instance
106 is provided now belong to the Java team. Yeh.
109 * kwq/KWQKHTMLPart.mm:
110 (KWQKHTMLPart::getAppletInstanceForView):
111 * kwq/WebCoreBridge.h:
113 2004-08-18 Chris Blumenberg <cblu@apple.com>
115 Fixed: <rdar://problem/3692199> 8A146: Safari crashes in toHTMLWithOptions, selection with no renderer (various sites)
119 * khtml/xml/dom2_rangeimpl.cpp:
120 (DOM::RangeImpl::toHTML): renamed, don't assume that nodes of the range had renderers, use the common ancestor of the range as the root
121 * khtml/xml/dom2_rangeimpl.h:
122 * khtml/xml/dom_nodeimpl.cpp:
123 (NodeImpl::recursive_toHTML): renamed, removed code that determines whether to include the root in the HTML, leave this up to the caller
124 * khtml/xml/dom_nodeimpl.h:
125 * kwq/WebCoreBridge.mm:
126 (-[WebCoreBridge markupStringFromNode:nodes:]): call renamed methods
127 (-[WebCoreBridge markupStringFromRange:nodes:]): ditto
129 2004-08-18 Ken Kocienda <kocienda@apple.com>
133 * khtml/css/css_valueimpl.cpp:
134 (CSSStyleDeclarationImpl::copy): Roll back silly last minute change that broke this code.
135 Note to self: read code before making changes to it.
137 2004-08-18 Ken Kocienda <kocienda@apple.com>
139 Coded by Darin and Ken
141 * khtml/css/css_computedstyle.cpp: Added CopyProperties static array. This contains
142 the properties we implement that we also want to copy in the new
143 CSSComputedStyleDeclarationImpl::copy described below.
144 (DOM::CSSComputedStyleDeclarationImpl::copy): New function. In this class, copies the
145 computed values of all the properties listed in CopyProperties. In essence, this makes
146 a freeze-dired version of a computed style.
147 (DOM::CSSComputedStyleDeclarationImpl::diff): Removes every property from the passed-in
148 CSSStyleDeclarationImpl that is also in the computed style.
149 * khtml/css/css_computedstyle.h:
150 * khtml/css/css_valueimpl.cpp:
151 (CSSStyleDeclarationImpl::copy): New function. In this class, the copy operation is
152 straightforward. Returns a copy that will be unchanged when the original changes.
153 * khtml/css/css_valueimpl.h:
154 (DOM::CSSStyleDeclarationImpl::values): Added a accessor suitable for use when the
155 CSSStyleDeclarationImpl is const.
157 2004-08-17 Maciej Stachowiak <mjs@apple.com>
161 <rdar://problem/3703768> CrashTracer: ...50 crashes at com.apple.WebCore: KHTMLPart::xmlDocImpl const + 0
163 * khtml/khtmlview.cpp:
164 (KHTMLView::viewportMouseMoveEvent): Add a nil check and an
165 assertion for m_part being null. It seems impossible for this to
166 happen, so we want to debug it ourselves, but in the meantime,
167 let's try to avoid causing crashes for our users.
169 2004-08-17 David Hyatt <hyatt@apple.com>
171 Fix the line truncation function for Emerson so that at the far left setting of the slider, only the header
176 * khtml/rendering/render_block.cpp:
177 (khtml::getHeightForLineCount):
178 * khtml/rendering/render_flexbox.cpp:
179 (khtml::RenderFlexibleBox::layoutVerticalBox):
181 2004-08-17 Ken Kocienda <kocienda@apple.com>
185 Rewrite of the command that deletes a selection. I deleted great
186 big swaths of bug-ridden code to accomplish this and replaced it
187 with code that is much cleaner and smarter.
189 Also, renamed equivalentUpstreamPosition and equivalentDownstreamPosition to
190 upstream to downstream, respectively.
192 Added a couple of new helper methods.
194 * khtml/editing/htmlediting.cpp: DeleteCollapsibleWhitespaceCommand and
195 RemoveNodeAndPruneCommand now obsolete. A huge win.
196 * khtml/editing/htmlediting.h: Ditto.
197 * khtml/editing/htmlediting_impl.cpp:
198 (khtml::debugPosition): Fix printf which had a placeholder, but no argument passed in the varargs.
199 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): New helper. Much simplified and cleaner
201 (khtml::ApplyStyleCommandImpl::doApply): upstream/downstream name change
202 (khtml::ApplyStyleCommandImpl::nodeFullySelected): upstream/downstream name change
203 (khtml::DeleteSelectionCommandImpl::doApply): upstream/downstream name change
204 (khtml::DeleteTextCommandImpl::DeleteTextCommandImpl): Add an assert to check that the
205 passed offset is less than the length of the text node.
206 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition): upstream/downstream name change
207 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition): upstream/downstream name change
208 (khtml::InputNewlineCommandImpl::doApply): upstream/downstream name change
209 (khtml::InputTextCommandImpl::prepareForTextInsertion): upstream/downstream name change
210 (khtml::InputTextCommandImpl::execute): upstream/downstream name change
211 (khtml::InputTextCommandImpl::insertSpace): upstream/downstream name change
212 (khtml::ReplaceSelectionCommandImpl::doApply): upstream/downstream name change
213 (khtml::TypingCommandImpl::issueCommandForDeleteKey): upstream/downstream name change
214 (khtml::TypingCommandImpl::deleteKeyPressed):
215 * khtml/editing/htmlediting_impl.h:
216 * khtml/xml/dom_position.cpp:
217 (DOM::Position::previousWordBoundary):
218 (DOM::Position::nextWordBoundary):
219 (DOM::Position::upstream):
220 (DOM::Position::downstream):
221 (DOM::Position::inRenderedText): Add null check.
222 (DOM::Position::isRenderedCharacter): New helper.
223 (DOM::isWS): New helper in this file.
224 (DOM::Position::leadingWhitespacePosition): New helper. Factored out from htmlediting_impl.cpp.
225 (DOM::Position::trailingWhitespacePosition): Ditto.
226 (DOM::Position::debugPosition): Add null check.
227 * khtml/xml/dom_position.h:
228 * khtml/xml/dom_selection.cpp:
229 (DOM::Selection::toRange): upstream/downstream name change
230 (DOM::Selection::validate): upstream/downstream name change
231 (DOM::Selection::debugPosition): upstream/downstream name change
232 * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Updated tests with new expected results.
233 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
234 * layout-tests/editing/deleting/delete-selection-001-expected.txt: Ditto.
235 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Ditto.
236 * layout-tests/editing/inserting/insert-br-case1-expected.txt: Ditto.
237 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Ditto.
238 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Ditto.
240 2004-08-17 Trey Matteson <trey@apple.com>
242 Various spelling fixes.
246 * khtml/khtml_part.cpp:
247 (KHTMLPart::setSelection): No misspellings in the spelling code comments
248 * khtml/xml/dom_docimpl.cpp:
249 (DocumentImpl::removeMarker): Repaint if doc changes. Sometimes the markers
250 were not being erased when you clicked in a word.
251 * khtml/xml/dom_position.cpp:
252 (DOM::Position::previousWordBoundary): Small optimization. Bail after first
253 try if the second try will not come out any different.
254 (DOM::Position::nextWordBoundary): Ditto
255 * kwq/KWQKHTMLPart.mm:
256 (KWQKHTMLPart::markMisspellingsInSelection): Comment.
258 2004-08-17 Darin Adler <darin@apple.com>
262 - fixed <rdar://problem/3689700> crash loading page; stoxx.com (works in IE and Firefox)
264 * khtml/khtml_part.h: Make completeURL public.
265 * kwq/KWQKJavaAppletWidget.mm: (KJavaAppletWidget::KJavaAppletWidget): Complete the base URL
266 before passing it across the bridge. This sidesteps the crashing bug in CFURL, filed as
267 '<rdar://problem/3764632> CFURLCreateAbsoluteURLWithBytes crashes if passed the string "../.."'
268 and also is obviously correct behavior that may fix other sites too.
270 - fixed <rdar://problem/3547725> Crashes at csuohio.edu, list box vs. mouse event problem (Spoof No Fix)
273 (QListBox::~QListBox): Nil out the pointer from the KWQTableView back to the widget by calling
275 (-[KWQTableView detach]): Set the pointer to the QListBox to 0. Also set the delegate and data
276 source to nil, so we don't need nil checks in delegate and data source methods.
277 (-[KWQTableView mouseDown:]): Add nil check.
278 (-[KWQTableView keyDown:]): Add nil check.
279 (-[KWQTableView keyUp:]): Add nil check.
280 (-[KWQTableView becomeFirstResponder]): Add nil check.
281 (-[KWQTableView resignFirstResponder]): Add nil check.
282 (-[KWQTableView canBecomeKeyView]): Add nil check.
283 (-[KWQTableView tableViewSelectionDidChange:]): Add nil checks, even though this is a delegate
284 callback, to handle cases where calls to JavaScript result in the QListBox going away partway
286 (-[KWQTableView drawRow:clipRect:]): Add nil check.
287 (-[KWQTableView _accessibilityTableCell:tableColumn:]): Add nil check.
289 2004-08-17 Trey Matteson <trey@apple.com>
291 Fix ASSERT in spelling marker management.
295 * khtml/xml/dom_docimpl.cpp:
296 (DocumentImpl::shiftMarkers): Use assert instead of ASSERT.
297 Tweak test to allow for a start position of 0.
299 2004-08-17 Trey Matteson <trey@apple.com>
301 3764147 - failure of subframe to load leaves links in parent doc broken
305 * khtml/khtml_part.cpp:
306 (KHTMLPart::childBegin): New method to mark part as not complete.
307 (KHTMLPart::processObjectRequest): Mark child part imcomplete, so if we
308 later get a failure on load it won't think it's already complete and do nothing.
309 * khtml/khtml_part.h:
313 2004-08-16 David Hyatt <hyatt@apple.com>
315 Fix the #define. I had it all backwards.
319 2004-08-16 David Hyatt <hyatt@apple.com>
321 Land initial support for XSLT using xml-stylesheet PIs.
323 * WebCore.pbproj/project.pbxproj:
324 * khtml/khtml_part.cpp:
325 (KHTMLPart::replaceDocImpl):
326 * khtml/khtml_part.h:
328 * khtml/xml/dom_docimpl.cpp:
329 (DocumentImpl::DocumentImpl):
330 (DocumentImpl::~DocumentImpl):
331 (DocumentImpl::recalcStyleSelector):
332 (DocumentImpl::applyXSLTransform):
333 (DocumentImpl::setTransformSourceDocument):
334 * khtml/xml/dom_docimpl.h:
335 (DOM::DocumentImpl::setTransformSource):
336 (DOM::DocumentImpl::transformSource):
337 (DOM::DocumentImpl::transformSourceDocument):
338 * khtml/xml/dom_xmlimpl.cpp:
339 (DOM::ProcessingInstructionImpl::checkStyleSheet):
340 * khtml/xml/dom_xmlimpl.h:
341 (DOM::ProcessingInstructionImpl::isXSL):
342 * khtml/xml/xml_tokenizer.cpp:
345 (khtml::createQStringParser):
346 (khtml::XMLTokenizer::processingInstruction):
347 (khtml::XMLTokenizer::finish):
348 (khtml::XMLTokenizer::setTransformSource):
349 * khtml/xml/xml_tokenizer.h:
350 (khtml::Tokenizer::setTransformSource):
351 * khtml/xml/xsl_stylesheetimpl.cpp: Removed.
352 * khtml/xml/xsl_stylesheetimpl.h: Removed.
353 * khtml/xsl/xsl_stylesheetimpl.cpp: Added.
354 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
355 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
356 (DOM::XSLStyleSheetImpl::isLoading):
357 (DOM::XSLStyleSheetImpl::checkLoaded):
358 (DOM::XSLStyleSheetImpl::docLoader):
359 (DOM::XSLStyleSheetImpl::parseString):
360 * khtml/xsl/xsl_stylesheetimpl.h: Added.
361 (DOM::XSLStyleSheetImpl::isXSLStyleSheet):
362 (DOM::XSLStyleSheetImpl::type):
363 (DOM::XSLStyleSheetImpl::ownerDocument):
364 (DOM::XSLStyleSheetImpl::document):
365 (DOM::XSLStyleSheetImpl::clearDocument):
366 * khtml/xsl/xslt_processorimpl.cpp: Added.
367 (DOM::m_sourceDocument):
368 (DOM::XSLTProcessorImpl::~XSLTProcessorImpl):
369 (DOM::XSLTProcessorImpl::transformDocument):
371 (DOM::XSLTProcessorImpl::addToResult):
372 (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
373 * khtml/xsl/xslt_processorimpl.h: Added.
375 2004-08-16 Maciej Stachowiak <mjs@apple.com>
379 * khtml/khtml_part.cpp:
380 (KHTMLPart::isImmediateRedirectPending):
382 2004-08-16 Richard Williamson <rjw@apple.com>
384 Fixed <rdar://problem/3704339> Context2D forces integer positions in drawImage
386 Use floats instead of ints to draw images.
390 * khtml/ecma/kjs_html.cpp:
391 (KJS::Context2DFunction::tryCall):
394 (QPainter::drawPixmap):
395 (QPainter::drawFloatPixmap):
397 2004-08-13 Maciej Stachowiak <mjs@apple.com>
401 - 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)
403 (actually the previous fix for this bug was mostly correct, but
404 this additional change is needed to avoid the regression in
405 <rdar://problem/3751025> REGRESSION: website rejects Safari 125.9
406 as "need to upgrade to IE 6", but didn't reject 125.8
408 So if merging for a software update, make sure to include both
409 this and the previous fix.
411 * khtml/html/htmltokenizer.cpp:
412 (khtml::HTMLTokenizer::write): When there is an immediate reidrect pending,
413 make sure to stop tokenizing, because we need to make sure no further
414 script tags are processed beyond the one that triggered the redirect.
415 * khtml/khtml_part.cpp:
416 (KHTMLPart::isImmediateRedirectPending): New method to allow
417 checking if a redirect is pending.
418 * khtml/khtml_part.h:
420 2004-08-15 David Hyatt <hyatt@apple.com>
422 - fixed <rdar://problem/3760508> REGRESSION (154-155): No text in textarea
424 Fix the blank textarea problem by ensuring that any change to a <textarea>'s DOM children causes the form control
425 to resync with the DOM. This behavior matches WinIE.
429 * khtml/html/html_formimpl.cpp:
430 (HTMLTextAreaElementImpl::childrenChanged):
431 * khtml/html/html_formimpl.h:
433 2004-08-13 Trey Matteson <trey@apple.com>
435 3761794 Slider doesn't call onmouseup handler
439 * khtml/rendering/render_form.cpp:
440 (RenderSlider::RenderSlider): Listen for signal.
441 (RenderSlider::slotClicked): Pass to superclass.
442 * khtml/rendering/render_form.h:
445 (-[KWQSlider mouseDown:]): Generate mouseUp and clicked events,
446 since AK consumes the mouseUp event in a modal tracking loop.
447 (QSlider::QSlider): Make signal.
448 (QSlider::clicked): Send signal.
450 2004-08-12 Trey Matteson <trey@apple.com>
452 3761329 - query result links all dead in ingrammicro.com (sometimes)
453 3761328 - links in some docs dead when doc is loaded from WebArchive
455 Make sure to get part to completed state when end is called,
456 even if we have no doc. See WebKit changelog for more info.
458 Reviewed by Richard and Darin.
460 * khtml/khtml_part.cpp:
463 2004-08-13 Trey Matteson <trey@apple.com>
465 3761098 - red dotted underline for misspelled words shows up in drag image
469 * khtml/rendering/render_text.cpp:
470 (RenderText::paint): Don't draw misspelling when creating selection image.
472 2004-08-12 Richard Williamson <rjw@apple.com>
474 Bring npruntime.h and friends closer to compliance with
479 * kwq/KWQKHTMLPart.mm:
480 (KWQKHTMLPart::windowScriptNPObject):
482 2004-08-12 Maciej Stachowiak <mjs@apple.com>
486 <rdar://problem/3245706> URLs with backslashes instead of slashes work on WinIE; should work on Safari (SAP)
487 <rdar://problem/3506429> <BASE> tag containing backslash is breaking images with absolute URLs
490 (substituteBackslashes): Helper method
491 (KURL::KURL): If the URL contains any backslashes, substitute all
492 that appear before the query or fragment.
494 2004-08-12 Ken Kocienda <kocienda@apple.com>
500 <rdar://problem/3761014> command-down-arrow takes you to start of document instead of end of document
502 * khtml/xml/dom_selection.cpp:
503 (DOM::Selection::modifyExtendingRightForward): Code used to assume, incorrectly, that index 1 of the
504 document element was beyond the last node in the document. But this is not true, since the document
505 element is the HTML element (generally). Instead, move to the index equal to the number of children
506 of the document element. This puts us past everything.
507 (DOM::Selection::modifyMovingRightForward): Ditto.
509 2004-08-12 Ken Kocienda <kocienda@apple.com>
515 <rdar://problem/3695446> shift-down-arrow on last line of editable text should select to end of document
517 Detect when current position is on first or last line and move to the
518 start or end of that line, respectively.
520 * khtml/xml/dom_position.cpp:
521 (DOM::Position::previousLinePosition)
522 (DOM::Position::nextLinePosition)
526 2004-08-12 Ken Kocienda <kocienda@apple.com>
530 Some consolidation in style application code.
532 * khtml/editing/htmlediting_impl.cpp:
533 (khtml::StyleChange::StyleChange): Made this a full-on class and added a couple of
534 members and a constructors to make a StyleChange from a CSSStyleDeclarationImpl, as
535 well as from a CSSStyleDeclarationImpl and a Position.
536 (khtml::StyleChange::init): Common init function for StyleChange constructors.
537 (khtml::StyleChange::currentlyHasStyle): Moved this here from ApplyStyleCommandImpl.
538 (khtml::CompositeEditCommandImpl::applyTypingStyle): Tweak to adjust to new StyleChange
540 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Ditto.
541 * khtml/editing/htmlediting_impl.h:
542 (khtml::StyleChange::StyleChange):
543 (khtml::StyleChange::cssStyle): New accessor.
544 (khtml::StyleChange::applyBold): Ditto.
545 (khtml::StyleChange::applyItalic): Ditto.
546 * khtml/xml/dom_position.cpp:
547 (DOM::Position::computedStyle): New helper.
548 * khtml/xml/dom_position.h: Ditto.
550 2004-08-12 Ken Kocienda <kocienda@apple.com>
555 <rdar://problem/3751098> HTML email has one set of SPAN tags per character in the message
557 Progress on this bug:
558 <rdar://problem/3755562> Typing styles do not use same tag application conventions as font and color panel
560 * khtml/editing/htmlediting_impl.cpp:
561 (khtml::CompositeEditCommandImpl::applyTypingStyle): Name changed from createTypingStyleElement.
562 Also, interface changed to take the node to which the typing style is to be applied.
563 This makes it easier to apply what may be up to three levels of nested tags to get the
564 desired style (<B>, <I>, and <SPAN STYLE="">).
565 Also, Borrow some of the style change smarts from ApplyStyleCommandImpl to use bold and
566 italic tags for applying styles when that is apprpriate. This creates on opportunity to
567 factor the code to do this so that this function and the ApplyStyleCommandImpl class can
568 share the implementation. I will follow up with a change to do that after landing this
569 change. Some future code factoring could be done here to bring together some similar code
571 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Add comment about code factoring work.
572 (khtml::ApplyStyleCommandImpl::computeStyleChange): StyleChange struct no longer a member of the
573 ApplyStyleCommandImpl class. CompositeEditCommandImpl needs it now in its applyTypingStyle()
575 (khtml::InputNewlineCommandImpl::doApply): Pass along node to style to applyTypingStyle.
576 (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
577 * khtml/editing/htmlediting_impl.h:
578 (khtml::StyleChange::StyleChange): Pull this struct out of ApplyStyleCommandImpl so
579 CompositeEditCommandImpl can use it.
580 * khtml/khtml_part.cpp:
581 (KHTMLPart::notifySelectionChanged): Always clear typing style when the selection
582 changes, not only when closing typing. This fixes 3751098.
584 These three tests actually had results that treated the buggy behavior as correct!
586 * layout-tests/editing/style/style-3681552-fix-001-expected.txt
587 * layout-tests/editing/style/style-3681552-fix-002-expected.txt
588 * layout-tests/editing/style/typing-style-002-expected.txt
590 2004-08-12 Darin Adler <darin@apple.com>
594 - fixed <rdar://problem/3740485> Repro crash involving replacing content that includes form field
596 * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Since this function calls selectText: which has a side
597 effect of making the text field be first responder, call to bridge first to make it first responder.
598 The bridge version lets WebHTMLView know we are changing the responder, avoiding some unpleasantness
599 because it sets the "changing focus programmatically" flag. Without that flag set, we were getting
600 an additional setFocusNode(0) call, which is unnecessary and incorrect.
602 2004-08-12 Darin Adler <darin@apple.com>
606 - fixed <rdar://problem/3758756> copying text selected with down arrow results in all text to end of document
608 * khtml/xml/dom2_rangeimpl.h: Make startNode and pastEndNode public.
609 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::pastEndNode): Fix bug where this would return
610 one node too far in the case where the end container was not a text node.
612 * khtml/xml/dom_nodeimpl.cpp:
613 (NodeImpl::recursive_toHTMLWithOptions): Rewrite loop, using startNode and pastEndNode,
614 to fix bug where it would run past the end node, including too many nodes in the generated
615 HTML. Nice side benefit: easier to read the code.
617 2004-08-11 Chris Blumenberg <cblu@apple.com>
619 Fixed: <rdar://problem/3758216> PARENTAL: buttons on parental controls page only work once
623 * kwq/KWQKHTMLPart.mm:
624 (KWQKHTMLPart::submitForm): prevent a form from being submitted more than once only if it uses a scheme of http or https
626 2004-08-11 Darin Adler <darin@apple.com>
630 - fixed <rdar://problem/3715878> 8A162: connect.apple.com password field showed in cleartext
632 * kwq/KWQTextField.mm: (-[KWQSecureTextField textDidEndEditing:]):
633 Enhanced workaround for shifting focus from one secure text field to another so that it works
634 even for the case of shifting focus from a secure text field back to itself.
636 2004-08-11 Ken Kocienda <kocienda@apple.com>
640 Missed adding this file before.
642 * kwq/KWQTextUtilities.mm: Added.
643 (KWQFindNextWordFromIndex):
645 2004-08-11 Ken Kocienda <kocienda@apple.com>
649 Efficiency improvements on string manipulations in these two new function
650 implementations. Use the versions of QString append/prepend that take
651 (QChar *c, uint length) instead of creating new strings each time.
653 * khtml/xml/dom_position.cpp:
654 (DOM::Position::previousWordPosition): Changed, as described above.
655 (DOM::Position::nextWordPosition): Ditto.
657 2004-08-11 Ken Kocienda <kocienda@apple.com>
662 <rdar://problem/3675812> Moving a word at a time does not use the correct conception of "word"
664 I have implemented versions of previousWordPosition and nextWordPosition that are now
665 different than previousWordBoundary and nextWordBoundary. The behavior of the new
666 functions attempts to match what Cocoa does as closely as it can. Let the bug filing begin!
668 * WebCore.pbproj/project.pbxproj: Added KWQTextUtilities.mm
669 * khtml/misc/helper.cpp:
670 (khtml::nextWordFromIndex): Glue to call through to KWQFindNextWordFromIndex.
671 * khtml/misc/helper.h: Declare the function above.
672 * khtml/misc/khtml_text_operations.cpp: Added SimplifiedBackwardsTextIterator class.
673 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): New
674 (khtml::SimplifiedBackwardsTextIterator::advance): Ditto.
675 (khtml::SimplifiedBackwardsTextIterator::handleTextNode): Ditto.
676 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement): Ditto.
677 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Ditto.
678 (khtml::SimplifiedBackwardsTextIterator::exitNode): Ditto.
679 (khtml::SimplifiedBackwardsTextIterator::emitCharacter): Ditto.
680 (khtml::SimplifiedBackwardsTextIterator::range): Ditto.
681 * khtml/misc/khtml_text_operations.h:
682 (khtml::SimplifiedBackwardsTextIterator::atEnd): Ditto.
683 (khtml::SimplifiedBackwardsTextIterator::length): Ditto.
684 (khtml::SimplifiedBackwardsTextIterator::characters): Ditto.
685 * khtml/xml/dom_position.cpp:
686 (DOM::Position::previousWordBoundary): Updated to gather appropriate text and call through to
687 AppKit to perform the same calculations NSText uses.
688 (DOM::Position::nextWordBoundary): Ditto.
689 (DOM::Position::previousWordPosition): Unrelated change to fix case where the function could get "stuck".
690 (DOM::Position::nextWordPosition): Ditto
691 (DOM::Position::equivalentDeepPosition): Changed to look backwards if the position's offset is equal
692 to the number of child nodes it has. This handles more cases correctly, like when the position is
693 gives as one beyond the end of a document element's last child.
694 * kwq/KWQTextUtilities.h: Declared KWQFindNextWordFromIndex.
695 * kwq/KWQTextUtilities.mm: Added.
696 (KWQFindNextWordFromIndex): New function.
698 2004-08-11 Ken Kocienda <kocienda@apple.com>
704 <rdar://problem/3732702> crash in CSSComputedStyleDeclarationImpl running devtools.com editing sample code
706 * khtml/khtml_part.cpp:
707 (KHTMLPart::selectionComputedStyle): Added a null check.
709 2004-08-10 Darin Adler <darin@apple.com>
713 - fixed <rdar://problem/3710123> Loading iframe that replaces content in the parent document crashes Safari
715 I fixed three problems:
717 1) script interpreter destroyed while it was interpreting scripts, caused random havoc
718 2) code trying to get to view after view was detached from part, caused nil-deref
719 3) signals sent to parent after child was no longer in the parent's frames list, caused nil-deref
721 Now the test page works fine. Hope the real sites do too.
723 * khtml/khtml_part.h: Add connectChild and disconnectChild helper functions (private).
724 * khtml/khtml_part.cpp:
725 (KHTMLPart::clear): Call disconnectChild on each frame as we detach it (see below).
726 (KHTMLPart::end): Ref the part at the start, and deref the part at the end, of this function.
727 Otherwise, we can end up destroying the part, and hence the interpreter, inside a script that
728 the interpreter itself is running.
729 (KHTMLPart::slotFinishedParsing): Add another check for a nil m_view, after the call to
731 (KHTMLPart::checkCompleted): Remove bogus if statement with empty body.
732 (KHTMLPart::processObjectRequest): Call disconnectChild to disconnect the child <-> parent signals of the
733 old child that the new one is replacing, and connectChild to connect the signals (nicer factoring).
734 (KHTMLPart::slotChildCompleted): Fixed up a confusing boolean if/expression to be simpler. Not related to
735 the bug fix, but an earlier version of the fix had changes in this function.
736 (KHTMLPart::connectChild): Added. Connects the appropriate signals for a child frame.
737 (KHTMLPart::disconnectChild): Added. Disconnects the same signals that connectChild connects.
739 * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Added a call to disconnectChild before removing the
740 child from the frames list.
742 2004-08-09 Maciej Stachowiak <mjs@apple.com>
748 - made basic marked text highlighting work to complete basic level of <rdar://problem/3704359> input method support not yet implemented for HTML editing
750 * kwq/WebCoreBridge.mm:
751 (-[WebCoreBridge setMarkedDOMRange:]): Added this new call to support storing
752 a marked range in WebCore. The provided DOMRange must start and end in the same
753 node, which must be a text node.
754 (-[WebCoreBridge markedDOMRange]): New call to get the marked range.
755 (-[WebCoreBridge clearMarkedDOMRange]): New call to clear the marked range.
756 * kwq/WebCoreBridge.h: Prototype new methods.
757 * kwq/KWQKHTMLPart.mm:
758 (KWQKHTMLPart::markedRange): Implementation of WebCore call above.
759 (KWQKHTMLPart::setMarkedRange): Implementation of WebCore call above -
760 store the marked range, and repaint new and old nodes if needed.
761 (KWQKHTMLPart::clear): Clear marked range.
762 * kwq/KWQKHTMLPart.h: Prototype new methods.
763 * khtml/rendering/render_text.cpp:
764 (InlineTextBox::paintMarkedTextBackground): New method to paint the background
765 for marked text, modeled on paintSelection.
766 (RenderText::paint): Optionally handle painting marked text
767 background as well as selection background in the marked text
769 * khtml/rendering/render_text.h: Prototype new method.
771 2004-08-10 Darin Adler <darin@apple.com>
775 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
778 (QRegExp::KWQRegExpPrivate::compile): Null-terminate the pattern and pass it.
779 (QRegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
781 2004-08-10 Darin Adler <darin@apple.com>
787 * khtml/editing/jsediting.cpp: Capitalize command names to match Windows.
788 The dictionary lookup is case insensitive.
790 * kwq/KWQFoundationExtras.h: Remove inaccurate comment.
792 2004-08-10 Trey Matteson <trey@apple.com>
794 3757094 - crash spell checking after a paste
798 * khtml/rendering/render_text.cpp:
799 (InlineTextBox::paintSelection): Add nil check.
801 2004-08-09 Trey Matteson <trey@apple.com>
803 3756195 - spell checking leaves misspelling marker behind after bad word is deleted
804 ... and other follow-on spell check fixes
808 * khtml/rendering/render_text.cpp:
809 (InlineTextBox::paintMarker): Close inspection shows we were drawing the
810 misspelling marker one pixel lower than AK, and one pixel outside the selection
811 rect we draw, in the case of Times-16. So move it up one. Still not an exact
812 match for AK, but less bad.
813 * khtml/xml/dom_docimpl.cpp:
814 (DocumentImpl::removeMarker): Track whether we make any changes, so we only
815 repaint if something actually changed.
816 (DocumentImpl::removeAllMarkers): New utility.
817 (DocumentImpl::removeAllMarkers): Use clear() instead of (errant)
818 hand-rolled loop to empty array.
819 (DocumentImpl::shiftMarkers): Track whether we make any changes, so we only
820 repaint if something actually changed.
821 * khtml/xml/dom_docimpl.h:
822 * khtml/xml/dom_textimpl.cpp:
823 (CharacterDataImpl::deleteData): Along with shifting existing markers around,
824 remove any markers in the deleted range. Fixes 3756195.
825 (CharacterDataImpl::replaceData): Ditto for the replaced range.
826 * kwq/KWQKHTMLPart.mm:
827 (KWQKHTMLPart::updateSpellChecking): comment
829 2004-08-08 Trey Matteson <trey@apple.com>
831 3745023 - Safari crashes trying to access anchor while downloading
833 I bet this is behind a few other crashers as well. In this bug the start of the
834 download leaves a KWQPageState hanging around, and when that is freed it damages
835 the part and view. If you're still using that page, you're dead.
837 The fix is to properly invalidate the PageState when we receive an error before
838 reaching WebFrameCommitted state. Normally this happens when a page is reheated
839 from the PageState, but in this case we never manage to leave the page to begin
840 with, although we've already created the PageState.
842 Other errors besides the synthetic one download generates would have caused similar
843 crashing. Another example would be clicking on a second link before the load
844 caused by clicking on the first link reached committed state.
848 * kwq/WebCoreBridge.h:
849 * kwq/WebCoreBridge.mm:
850 (-[WebCoreBridge didNotOpenURL:pageCache:]): Invalidate the pageCache state
851 when a load doesn't get off the ground.
853 2004-08-06 Ken Kocienda <kocienda@apple.com>
857 Finish off spellchecking support to HTML editing. Includes work to
858 enable continuous spellchecking.
860 * khtml/editing/htmlediting_impl.cpp:
861 (khtml::EditCommandImpl::markMisspellingsInSelection): Basically, a one-liner convenience to
862 make the call over to the KWQKHTMLPart.
863 (khtml::ReplaceSelectionCommandImpl::doApply): Did some rearranging of code so that the
864 inserted content can be spell-checked. The function is basically the same, except for
865 the addition of calls to markMisspellingsInSelection.
866 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): New function. Takes a look at the
867 selection that results after typing and determines whether it needs to spellcheck.
868 Since the word containing the current selection is never marked, this does a check to
869 see if typing made a new word that is not in the current selection. Basically, you
870 get this by being at the end of a word and typing a space.
871 (khtml::TypingCommandImpl::typingAddedToOpenCommand): Call markMisspellingsAfterTyping.
872 * khtml/editing/htmlediting_impl.h: Add new function declarations.
873 * khtml/khtml_part.cpp:
874 (KHTMLPart::setSelection): Since spell checks are updated when the selection changes,
875 and every selection change passes through here, this is a good place to put the call
877 * khtml/rendering/render_text.cpp:
878 (InlineTextBox::paintMarker): Remove temporary misspelling line drawing code. Replace with
879 call that does AppKit-style drawing. Fix up some comments.
880 * khtml/xml/dom_docimpl.cpp:
881 (DocumentImpl::addMarker): Repaint the node that had the marker added. This makes it show
883 (DocumentImpl::removeMarker): Ditto.
884 (DocumentImpl::removeAllMarkers): New function. Convenience for clearing all markers.
885 Used when not in continuous spellchecking mode.
886 (DocumentImpl::shiftMarkers): Moves markers in response to changes in a node's contents.
887 This shifts the marker offsets by a given amount. This keeps the markers in the right
888 place when a user types in a node with markers already set on it.
889 * khtml/xml/dom_docimpl.h: Added new functions. Removed unnecessary enum qualifier from some
891 * khtml/xml/dom_position.cpp:
892 (DOM::Position::previousWordBoundary): This function was susceptible to endless loops...and
893 needlessly so. Basically, if the current position is at a word boundary, run the code again
894 to find the previous word boundary.
895 (DOM::Position::nextWordBoundary): Same as above, but for next word boundary.
896 * khtml/xml/dom_textimpl.cpp:
897 (CharacterDataImpl::setData): Call shiftMarkers to update markers when this node changes.
898 (CharacterDataImpl::insertData): Ditto.
899 (CharacterDataImpl::deleteData): Ditto.
900 (CharacterDataImpl::replaceData): Ditto.
901 * kwq/KWQKHTMLPart.h:
902 * kwq/KWQKHTMLPart.mm:
903 (KWQKHTMLPart::advanceToNextMisspelling):
904 (KWQKHTMLPart::markMisspellingsInSelection):
905 (KWQKHTMLPart::updateSpellChecking):
906 (KWQKHTMLPart::respondToChangedSelection):
909 (QPainter::drawLineForMisspelling): New function. Call over to WebKit to do the drawing.
910 * kwq/WebCoreBridge.h:
911 * kwq/WebCoreBridge.mm:
912 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Pass markMisspellings flag to
914 * kwq/WebCoreTextRenderer.h:
918 2004-08-05 David Hyatt <hyatt@apple.com>
920 Fix for 3752542, stack overflow that crashes Safari at www.dr.dk. This bug is a regression caused by a fix that
921 attempted to repair <caption> behavior to make it behave like Panther. This fix was incorrect, and in addition
922 even our <caption> behavior on Panther was incorrect.
924 The patch that fixes this bug also makes <caption> handling work when <caption>s are contained inside a <td>, a <tr>,
925 a <th>, or various table section tags (<tbody>, <tfoot>, <thead>). The <caption> is pulled out and inserted just before
926 the relevant ancestor table section. This behavior matches other browsers.
930 * khtml/html/htmlparser.cpp:
931 (KHTMLParser::insertNode):
933 2004-08-04 David Hyatt <hyatt@apple.com>
935 The top-level XSL sheet is now loaded and shows up in the activity window. It is not yet parsed.
939 * WebCore.pbproj/project.pbxproj:
940 * khtml/css/css_base.h:
941 (DOM::StyleBaseImpl::isXSLStyleSheet):
942 * khtml/css/css_stylesheetimpl.cpp:
943 (CSSStyleSheetImpl::CSSStyleSheetImpl):
944 * khtml/css/css_stylesheetimpl.h:
945 (DOM::StyleSheetImpl::isLoading):
946 * khtml/misc/loader.cpp:
947 * khtml/xml/dom_xmlimpl.cpp:
948 (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
949 (DOM::ProcessingInstructionImpl::checkStyleSheet):
950 (DOM::ProcessingInstructionImpl::sheet):
951 (DOM::ProcessingInstructionImpl::isLoading):
952 (DOM::ProcessingInstructionImpl::setStyleSheet):
953 * khtml/xml/dom_xmlimpl.h:
955 2004-08-04 David Hyatt <hyatt@apple.com>
957 Add XSL Stylesheets to the WebCore cache.
961 * khtml/misc/loader.cpp:
962 (CachedXSLStyleSheet::CachedXSLStyleSheet):
963 (CachedXSLStyleSheet::ref):
964 (CachedXSLStyleSheet::deref):
965 (CachedXSLStyleSheet::data):
966 (CachedXSLStyleSheet::checkNotify):
967 (CachedXSLStyleSheet::error):
968 (DocLoader::requestXSLStyleSheet):
969 (Cache::requestXSLStyleSheet):
970 (Cache::getStatistics):
971 * khtml/misc/loader.h:
972 (khtml::CachedObject::):
973 (khtml::CachedXSLStyleSheet::sheet):
974 (khtml::CachedXSLStyleSheet::schedule):
976 2004-08-03 Ken Kocienda <kocienda@apple.com>
980 Changes to improve our handling of object tags during editing, including
983 <rdar://problem/3744533> Problem editing <OBJECT> elements displayed by WebPlugIns
985 Part of the fix for this bug involves removing the close() function from render objects.
986 It was decided that this code was no longer needed, as the work it did could be moved
987 to other, more modern, places.
991 <rdar://problem/3748537> crash due to nil node passed into parentNode in computeTypingStyle deleting text
993 Finally, I filed and fixed this bug I discovered while fixing the one above:
995 <rdar://problem/3749338> Select-all + delete leaves editing view without blinking caret
997 * khtml/editing/htmlediting_impl.cpp:
998 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Fix for 3748537. Put in some more null
999 checks. Bail, returning 0 for typing style if any null checks yield a null.
1000 (khtml::DeleteSelectionCommandImpl::doApply): Fix for 3749338. A removeNodeAndPrune call may wind
1001 up deleting the node where we calculated that we wanted to put the selection after deleting.
1002 If this happens, move this ending selection to a sensible alternative.
1003 (khtml::RemoveNodeAndPruneCommandImpl::doApply): Call previousNodeConsideringAtomicNodes instead
1004 of traversePreviousNode when doing the prune.
1005 * khtml/html/html_objectimpl.cpp:
1006 (HTMLObjectElementImpl::attach): Part of the fix for 3744533.
1007 (HTMLObjectElementImpl::recalcStyle): Change old strcmp check for type of renderer to be a call
1008 to canRenderImageType.
1009 (HTMLObjectElementImpl::childrenChanged): New function. Helps to keep object tags up to date
1010 as their children change. This also will help to make object tags respond properly to having their
1011 params changed by DOM calls.
1012 * khtml/html/html_objectimpl.h: Cosmetic change.
1013 * khtml/html/htmlparser.cpp:
1014 (KHTMLParser::insertNode): Remove call to obsolete closeRenderer() function.
1015 (KHTMLParser::popOneBlock): Ditto.
1016 * khtml/rendering/render_block.cpp:
1017 (khtml::RenderBlock::makeChildrenNonInline): Remove call to obsolete close() function.
1018 * khtml/rendering/render_container.cpp:
1019 (RenderContainer::updatePseudoChild): Ditto.
1020 * khtml/rendering/render_form.cpp: Remove obsolete close() function.
1021 * khtml/rendering/render_form.h: Ditto.
1022 * khtml/rendering/render_frames.cpp: Ditto.
1023 * khtml/rendering/render_frames.h: Ditto.
1024 * khtml/rendering/render_inline.cpp:
1025 (RenderInline::splitFlow): Remove calls to obsolete close() function.
1026 * khtml/rendering/render_object.h: Remove obsolete close() function.
1027 * khtml/rendering/render_table.cpp:
1028 (RenderTableCell::layout): Ditto.
1029 * khtml/rendering/render_table.h: Ditto.
1030 * khtml/xml/dom_docimpl.cpp:
1031 (DocumentImpl::closeInternal): Remove call to obsolete close() function.
1032 * khtml/xml/dom_nodeimpl.cpp: Remove obsolete m_rendererNeedsClose initialization.
1033 (NodeImpl::NodeImpl): Remove obsolete closeRenderer() function.
1034 (NodeImpl::attach): Remove call to obsolete close() function.
1035 (NodeImpl::isAtomicNode): New function. Helps to fix 3744533. Determines if a node should
1036 be treated as an atomic node for the purposes of editing.
1037 (NodeImpl::previousNodeConsideringAtomicNodes): New helper to traverse tree taking atomic nodes
1039 (NodeImpl::nextNodeConsideringAtomicNodes): Ditto.
1040 (NodeImpl::previousLeafNode): Now calls nextNodeConsideringAtomicNodes to iterate. This helps to
1041 prevent deleting PARAM tag portions of object tags erroneously.
1042 (NodeImpl::nextLeafNode): Ditto.
1043 * khtml/xml/dom_nodeimpl.h: Removed m_rendererNeedsClose bit. Added declarations for new functions.
1044 * khtml/xml/dom_position.cpp:
1045 (DOM::Position::equivalentDeepPosition): Now takes atomic nodes into account as it drills down into the
1047 * khtml/xml/xml_tokenizer.cpp:
1048 (khtml::XMLTokenizer::endElement): Remove call to obsolete closeRenderer() function.
1050 2004-08-03 David Hyatt <hyatt@apple.com>
1052 Add the deprecated text/xsl MIME type (introduced by Internet Explorer 5) as an acceptable MIME type for XML
1057 * khtml/ecma/xmlhttprequest.cpp:
1058 (KJS::XMLHttpRequest::getValueProperty):
1059 * khtml/khtml_part.cpp:
1061 * khtml/misc/loader.cpp:
1062 (CachedXBLDocument::CachedXBLDocument):
1064 2004-08-03 Maciej Stachowiak <mjs@apple.com>
1068 - remove assertions that asserted text is non-empty, just avoid
1069 doing anything for the empty case; this is needed because input
1070 methods like to insert empty text in various cases.
1072 * khtml/editing/htmlediting_impl.cpp:
1073 (khtml::InsertTextCommandImpl::InsertTextCommandImpl):
1074 (khtml::InsertTextCommandImpl::doApply):
1075 (khtml::InsertTextCommandImpl::doUnapply):
1077 2004-08-03 Darin Adler <darin@apple.com>
1081 - fixed <rdar://problem/3740937> ER: A way to turn a DOMRange into text (equivalent of -innerText)
1083 * khtml/xml/dom2_rangeimpl.h: Added text function. Like innerText, but on a range.
1084 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::text): Added.
1086 * kwq/DOM.mm: (-[DOMRange _text]): Added. Calls DOM::RangeImpl::text.
1087 * kwq/DOMPrivate.h: Added.
1089 * WebCore.pbproj/project.pbxproj: Added DOMPrivate.h, an internal header (private in WebKit, internal here).
1091 2004-08-02 John Sullivan <sullivan@apple.com>
1095 WebCore part of fix for <rdar://problem/3631868> NSToolbar adoption:
1096 Tab key should cycle around toolbar and page content
1098 * kwq/WebCoreBridge.mm:
1099 (-[WebCoreBridge nextKeyViewInsideWebFrameViews]):
1100 Made this method start looking from the current focus node. This won't
1101 affect any existing callers because there were no existing callers.
1102 (-[WebCoreBridge previousKeyViewInsideWebFrameViews]):
1105 2004-08-02 David Hyatt <hyatt@apple.com>
1107 Create a #define for XSLT support that at the moment will only be enabled on Tiger.
1109 Reviewed by kocienda
1113 2004-08-02 Ken Kocienda <kocienda@apple.com>
1119 <rdar://problem/3747945> Deleting replaced element can cause crash
1121 * khtml/xml/dom_selection.cpp:
1122 (DOM::Selection::layoutCaret): The crux of the problem is that
1123 the caret drawing code tries to draw the caret at the image
1124 offset after it has been removed from the document. So, make
1125 sure the start node for the selection is in the document before
1126 trying to lay out the caret using that node.
1128 2004-07-31 Ken Kocienda <kocienda@apple.com>
1132 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
1133 <rdar://problem/3746408> HTMLCompose: cannot type in message body of new messages (and tabbing causes a crash.)
1135 * kwq/KWQKHTMLPart.mm:
1136 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Add in some smarts to look around for
1137 a good place to put the caret if focus is turning "on", the part is contentEditable,
1138 and it does not currently have a selection. This has the effect of flashing the caret
1139 in a contentEditable view automatically without requiring the programmer to set a
1140 selection explicitly. This also fixes the bug listed above. Both are cases where the
1141 bad behavior happened since the editing code tried to process input without an active
1142 selection. I always took the extra step of setting the selection explicitly when
1143 opening new windows in programs like Blot, but it seems silly to require developers to
1144 do this in general. With this patch, they no longer need to.
1146 2004-07-30 Ken Kocienda <kocienda@apple.com>
1152 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
1154 * khtml/xml/dom_selection.cpp:
1155 (DOM::Selection::layoutCaret): Don't bail when the start position of the selection is not in rendered
1156 content. The validate() bottleneck function will do all it can to make sure that the start is
1157 moved to rendered content if at all possible before this function runs. If no rendered position can
1158 be found, like in the case of an empty body element, we still want to flash the caret there.
1159 (DOM::Selection::validate): Look for rendered positions for the base and extent, but save off the
1160 base before making this move, and set the selection to the enclosing block flow element of this
1161 original base if no rendered positions can be found. This has the effect of flashing the caret
1162 someplace in an editable block, even if it does not contain any rendered content.
1164 2004-07-30 Ken Kocienda <kocienda@apple.com>
1168 Fix a large number of editing layout test regressions.
1170 * khtml/misc/khtml_text_operations.cpp:
1171 (khtml::TextIterator::TextIterator): Use a new way to compute the end offset of a node for
1172 purposes of text iteration. The end offset is either child count of a node with children,
1173 or the maxOffset() of a node that does not.
1174 * khtml/xml/dom_nodeimpl.cpp: Remove maxOffset() implementation from NodeBaseImpl. This
1175 conflicted with the usage of this function that is needed for editing.
1176 * khtml/xml/dom_nodeimpl.h: Ditto.
1178 2004-07-30 Trey Matteson <trey@apple.com>
1180 Next steps for spell checking: We have data structures for the marked pieces of
1181 text and the smarts to draw them (although at this point, they just get a green
1182 underline instead of using the real AppKit pattern.)
1184 Note we don't call this code outside of development, since at this point I suspect
1185 it could be made to crash by mixing spelling and editing.
1189 * khtml/rendering/render_text.cpp:
1190 (InlineTextBox::paintMarker): Paint one marker's intersection with a text run
1191 (RenderText::paint): Find intersections of all markers and runs, call paintMarker
1192 * khtml/rendering/render_text.h:
1193 * khtml/xml/dom_docimpl.cpp:
1194 (DocumentImpl::addMarker): Adds a marker to a DOM Range.
1195 (DocumentImpl::removeMarker): Removes a marker from a DOM Range.
1196 (DocumentImpl::addMarker): Adds a marker to a single DOM Node, merging previous
1198 (DocumentImpl::removeMarker): Removes a marker from a single DOM Node, breaking
1199 up previous markers as needed.
1200 (DocumentImpl::markersForNode): Return markers for a Node.
1201 * khtml/xml/dom_docimpl.h:
1202 (DOM::DocumentMarker::): New marker struct
1203 (DOM::DocumentMarker::operator == ):
1204 (DOM::DocumentMarker::operator != ):
1205 * kwq/KWQKHTMLPart.mm:
1206 (KWQKHTMLPart::advanceToNextMisspelling): Mark misspelled ranges when we find them.
1209 2004-07-29 Maciej Stachowiak <mjs@apple.com>
1213 <rdar://problem/3745808> Seed: WebKit: Table's caption broken
1215 * khtml/html/htmlparser.cpp:
1216 (KHTMLParser::insertNode): When a caption appears in an illegal
1217 place in a table, pop blocks until we hit a place where it's
1222 2004-07-29 Darin Adler <darin@apple.com>
1226 - added constants for motion across entire document for use in operations like
1227 move to beginning of document
1229 * khtml/xml/dom_selection.h: Added DOCUMENT to ETextGranularity.
1230 * khtml/xml/dom_selection.cpp:
1231 (DOM::Selection::modifyExtendingRightForward): Added case for DOCUMENT.
1232 (DOM::Selection::modifyMovingRightForward): Added case for DOCUMENT.
1233 (DOM::Selection::modifyExtendingLeftBackward): Added case for DOCUMENT.
1234 (DOM::Selection::modifyMovingLeftBackward): Added case for DOCUMENT.
1235 (DOM::Selection::validate): Changed if statements into switch statement,
1236 added case for DOCUMENT.
1238 * kwq/WebCoreBridge.h: Added WebCoreBridge to WebSelectionGranularity.
1240 2004-07-28 Trey Matteson <trey@apple.com>
1242 Small refinement of last checkin. The text iterators now return reasonable values
1243 for range() when atEnd, which gets rid of special cases and pitfalls in the client.
1247 * khtml/misc/khtml_text_operations.cpp:
1248 (khtml::TextIterator::TextIterator): Set endOffset to a valid value instead of
1250 (khtml::TextIterator::range): Implement when atEnd.
1251 (khtml::CharacterIterator::range): Don't massage result when atEnd.
1252 (khtml::WordAwareIterator::WordAwareIterator): Now that this is fixed, we no
1253 longer need this special case.
1254 (khtml::WordAwareIterator::advance): Always set range, even when atEnd, now that
1255 TextIterator::range() always works.
1256 * khtml/xml/dom_nodeimpl.cpp:
1257 (NodeImpl::childNodeCount): Made const
1258 (NodeBaseImpl::maxOffset): Add missing implementation
1259 * khtml/xml/dom_nodeimpl.h:
1260 * kwq/KWQKHTMLPart.mm:
1261 (KWQKHTMLPart::advanceToNextMisspelling): Get rid of special cases, always call
1262 range on our iterator even when it is atEnd.
1264 2004-07-28 Maciej Stachowiak <mjs@apple.com>
1268 <rdar://problem/3678534> controls on page at http://help.sap.com don't work properly
1270 To fix this I implemented the various JavaScript BarInfo properties in JavaScript.
1272 * khtml/ecma/kjs_window.cpp:
1274 (Window::locationbar):
1276 (Window::personalbar):
1277 (Window::statusbar):
1279 (Window::scrollbars):
1282 (SelectionFunc::tryCall):
1284 (BarInfo::~BarInfo):
1287 * khtml/ecma/kjs_window.h:
1290 (KJS::BarInfo::part):
1291 (KJS::BarInfo::classInfo):
1292 * khtml/ecma/kjs_window.lut.h:
1294 * kwq/KWQKHTMLPart.h:
1295 * kwq/KWQKHTMLPart.mm:
1296 (KWQKHTMLPart::locationbarVisible):
1297 (KWQKHTMLPart::menubarVisible):
1298 (KWQKHTMLPart::personalbarVisible):
1299 (KWQKHTMLPart::scrollbarsVisible):
1300 (KWQKHTMLPart::statusbarVisible):
1301 (KWQKHTMLPart::toolbarVisible):
1303 2004-07-28 Ken Kocienda <kocienda@apple.com>
1307 Added more layout tests.
1309 * layout-tests/editing/style/style-3681552-fix-001-expected.txt: Added.
1310 * layout-tests/editing/style/style-3681552-fix-001.html: Added.
1311 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Added.
1312 * layout-tests/editing/style/style-3681552-fix-002.html: Added.
1313 * layout-tests/editing/style/style-3690704-fix-expected.txt: Added.
1314 * layout-tests/editing/style/style-3690704-fix.html: Added.
1315 * layout-tests/editing/style/typing-style-001-expected.txt: Added.
1316 * layout-tests/editing/style/typing-style-001.html: Added.
1317 * layout-tests/editing/style/typing-style-002-expected.txt: Added.
1318 * layout-tests/editing/style/typing-style-002.html: Added.
1320 2004-07-28 Ken Kocienda <kocienda@apple.com>
1324 Added some layout tests.
1326 * layout-tests/editing/selection/select-all-001-expected.txt: Added.
1327 * layout-tests/editing/selection/select-all-001.html: Added.
1328 * layout-tests/editing/selection/select-all-002-expected.txt: Added.
1329 * layout-tests/editing/selection/select-all-002.html: Added.
1330 * layout-tests/editing/selection/select-all-003-expected.txt: Added.
1331 * layout-tests/editing/selection/select-all-003.html: Added.
1333 2004-07-28 Trey Matteson <trey@apple.com>
1335 Spellchecking, Part I. Basic spellcheck is working. Spelling panel is hooked up.
1337 At this point, no special marking of misspellings, no grammar check, no context
1338 menu integration, no "check continually" mode.
1340 Much of the TextIterator and CharacterIterator interface got published outside
1341 of khtml_text_operations.cpp, with a little API rationalizing.
1345 * khtml/misc/khtml_text_operations.cpp:
1346 (khtml::TextIterator::range): Name changes.
1347 (khtml::CharacterIterator::CharacterIterator): Ditto.
1348 (khtml::CharacterIterator::range): Ditto.
1349 (khtml::CharacterIterator::advance): Ditto.
1350 (khtml::CharacterIterator::string): New method to consume chars into a string.
1351 (khtml::WordAwareIterator::WordAwareIterator): New class that iterates over
1352 the text respecting word boundaries.
1353 (khtml::WordAwareIterator::advance):
1354 (khtml::WordAwareIterator::length):
1355 (khtml::WordAwareIterator::characters):
1356 (khtml::plainText): Name changes.
1357 (khtml::findPlainText): Ditto.
1359 API moved from cpp to header file.
1360 * khtml/misc/khtml_text_operations.h:
1361 (khtml::TextIterator::atEnd):
1362 (khtml::TextIterator::length):
1363 (khtml::TextIterator::characters):
1364 (khtml::CharacterIterator::atBreak):
1365 (khtml::CharacterIterator::atEnd):
1366 (khtml::CharacterIterator::length):
1367 (khtml::CharacterIterator::characters):
1368 (khtml::CharacterIterator::characterOffset):
1369 (khtml::WordAwareIterator::atEnd):
1370 (khtml::WordAwareIterator::range):
1372 * khtml/xml/dom_position.cpp:
1373 (DOM::Position::previousWordBoundary): New name for the old routine. This routines semantics
1374 match the current behavior of this code.
1375 (DOM::Position::nextWordBoundary): Ditto.
1376 (DOM::Position::previousWordPosition): Call old code with the new name. When we fix
1377 word advancement, this routine will have its own impl.
1378 (DOM::Position::nextWordPosition): Ditto.
1379 * khtml/xml/dom_position.h:
1380 * khtml/xml/dom_selection.h:
1381 (DOM::Selection::rangeStart): New convenience methods
1382 (DOM::Selection::rangeEnd):
1383 * kwq/KWQKHTMLPart.h:
1384 * kwq/KWQKHTMLPart.mm:
1385 (KWQKHTMLPart::findString): Ensure we use range-compatible positions.
1386 (KWQKHTMLPart::advanceToNextMisspelling): Brand new.
1387 * kwq/WebCoreBridge.h:
1388 * kwq/WebCoreBridge.mm:
1389 (-[WebCoreBridge advanceToNextMisspelling]): Typical bridge glue.
1391 2004-07-28 Ken Kocienda <kocienda@apple.com>
1397 <rdar://problem/3690704> marking partly bold text italic across blocks wrongly extends the bold section
1399 * khtml/editing/htmlediting_impl.cpp:
1400 (khtml::ApplyStyleCommandImpl::doApply): Fixed loop that gathers up groups of nodes to
1401 pass off to the function that applies styles. While this is meant to be conservative in
1402 order to leave the DOM well-formed in all cases, it contained an error where the set
1403 of nodes to be styled together erroneously could include a node that was meant for
1404 the next set. Fixed.
1405 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Unrelated change to remove DOM:: scope
1406 resolution qualifier. Unneeded here.
1408 2004-07-28 Darin Adler <darin@apple.com>
1412 - fixed <rdar://problem/3658471> REGRESSION: Node.appendChild( ) fails when parent already contains that child
1414 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::isAncestor): Restore the original meaning of this function.
1415 It returns true if the parameter is an ancestor of this, but had been changed to return true if this
1416 is an ancestor of the parameter. However, we do retain one change we made at the same time, which is
1417 that it does not consider a node an ancestor of itself.
1419 * khtml/editing/htmlediting_impl.cpp: (khtml::ApplyStyleCommandImpl::nodeFullySelected):
1420 * khtml/xml/dom2_traversalimpl.cpp: (DOM::NodeIteratorImpl::notifyBeforeNodeRemoval):
1421 Reverse parameters for callers who wanted the new meaning of isAncestor, with care to not use it in
1422 any cases where the pointer might be 0.
1424 * khtml/xml/dom_nodeimpl.h: Added const to the parameter to make things more symmetric and allow the
1425 new uses to all compile.
1427 2004-07-28 Ken Kocienda <kocienda@apple.com>
1433 <rdar://problem/3681552> html editing needs to preserve typing font when replacing selection
1435 * khtml/css/css_valueimpl.cpp:
1436 (CSSStyleDeclarationImpl::merge): New helper that merges styles together. Helpful for
1437 dealing with typing styles.
1438 * khtml/css/css_valueimpl.h:
1439 * khtml/editing/htmlediting_impl.cpp:
1440 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): New helper that updates the
1441 typing style based on the current selection. This is a convenient bottleneck for all
1442 the code that needs to worry about typing style.
1443 (khtml::DeleteSelectionCommandImpl::doApply): Update typing style before doing the delete.
1444 (khtml::InputNewlineCommandImpl::doApply): No need to redeclare exceptionCode local.
1446 (khtml::InputTextCommandImpl::prepareForTextInsertion): Remove unneeded complication when
1447 figuring out where to insert style node. Not even sure what I was trying to do here, but
1448 it does not seem to be needed any more.
1449 (khtml::InputTextCommandImpl::execute): Remove unneeded comment.
1450 * khtml/editing/htmlediting_impl.h: Declare new computeTypingStyle helper.
1451 * khtml/khtml_part.cpp:
1452 (KHTMLPart::setCaretVisible): Call selectionLayoutChanged instead of notifySelectionChanged
1453 in this function. The selection did not change simply by calling this function, but it
1455 (KHTMLPart::notifySelectionChanged): Treat clearing the typing style much like closing typing,
1456 instead of clearing it unconditionally.
1457 (KHTMLPart::applyStyle): In the case where the current selection is a caret, merge the
1458 style being applied with any current typing style that already exists.
1460 2004-07-28 Darin Adler <darin@apple.com>
1464 - fixed <rdar://problem/3711080> REGRESSION (125-146): form fields have shrunk by 1 pixel, and now clip descenders
1466 * kwq/KWQLineEdit.mm: (QLineEdit::sizeForCharacterWidth):
1467 Compute the size without ever calling cellSize. After talking with Andrew Platzer,
1468 we decided that hard-coding the size of the borders of a text field was the best
1469 way for WebCore to handle this.
1471 2004-07-28 Darin Adler <darin@apple.com>
1475 - fixed <rdar://problem/3743204> REGRESSION: crash at startribune.com in InlineBox::root()
1477 * khtml/rendering/render_flow.cpp: (RenderFlow::dirtyLinesFromChangedChild):
1478 Added a check for nil.
1480 2004-07-27 Darin Adler <darin@apple.com>
1484 - fixed <rdar://problem/3743138> opaque colors come out of getComputedStyle as "rgba", transparent ones as "rgb"
1486 * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cssText): Use "rgb" rather than
1487 "rgba" when alpha is 0xFF, not when alpha is 0.
1489 2004-07-27 Ken Kocienda <kocienda@apple.com>
1493 Fixed the problem where BR elements on lines by themselves don't paint when selected.
1495 * khtml/khtml_part.cpp:
1496 (KHTMLPart::selectAll): Related fix. Include BR's when figuring out what "all" is.
1497 * khtml/rendering/render_br.cpp:
1498 (RenderBR::paint): New function implementation. Teach BR's how to paint selections.
1499 * khtml/rendering/render_br.h:
1500 * khtml/rendering/render_text.cpp:
1501 (InlineTextBox::paintSelection): Fix some geometry calculations to be more readable (i.e. don't
1502 reuse function argument as a local). Also, improve the logic for determining whether to
1503 extend the selection to block boundaries.
1504 (RenderText::paint): Remove extendSelection argument from paintSelection. The logic to figure out
1505 extensions is now fully contained in paintSelection.
1506 * khtml/rendering/render_text.h:
1508 2004-07-27 David Hyatt <hyatt@apple.com>
1510 Fix for 3665211 (again). Make sure not to leave child line boxes pointing to deleted ancestor line boxes.
1512 Reviewed by kocienda
1514 * khtml/rendering/render_block.cpp:
1515 (khtml::RenderBlock::removeChild):
1517 2004-07-26 Chris Blumenberg <cblu@apple.com>
1519 Fixed: WebView scrolls to the top after making an editing change via drag & drop
1521 Fixed by Ken, reviewed by me.
1523 * kwq/WebCoreBridge.mm:
1524 (-[WebCoreBridge ensureCaretVisible]): do nothing if the selection is not a caret
1528 2004-07-26 Maciej Stachowiak <mjs@apple.com>
1532 <rdar://problem/3740855> REGRESSION: Flash incorrectly positioned at macromedia.com
1534 * khtml/html/htmltokenizer.cpp:
1535 (khtml::HTMLTokenizer::scriptExecution): Do the prepending-src
1536 trick as for inline script execution.
1538 Added new layout tests covering this and other recent tokenizer
1541 * layout-tests/fast/tokenizer/001-expected.txt: Added.
1542 * layout-tests/fast/tokenizer/001.html: Added.
1543 * layout-tests/fast/tokenizer/002-expected.txt: Added.
1544 * layout-tests/fast/tokenizer/002.html: Added.
1545 * layout-tests/fast/tokenizer/003-expected.txt: Added.
1546 * layout-tests/fast/tokenizer/003.html: Added.
1547 * layout-tests/fast/tokenizer/resources/003-script.js: Added.
1549 2004-07-23 Ken Kocienda <kocienda@apple.com>
1555 <rdar://problem/3738920> Caret blinks in inactive window
1557 As part of the fix, I cleaned up the way we handle special drawing that needs
1558 to be done in the HTML view that is first responder in the key window (e.g the
1559 drawing of text selection highlight and caret blinking).
1561 * khtml/khtml_part.cpp: Removed setCaretVisible function. Updating caret visibility
1562 is now done in setDisplaysWithFocusAttributes, described below.
1563 * khtml/khtml_part.h: Ditto.
1564 * khtml/khtmlpart_p.h:
1565 (KHTMLPartPrivate::KHTMLPartPrivate): m_caretVisible now defaults to false. This prevents
1566 the caret from blinking when an app is started from the command line and remains in the
1568 * khtml/khtmlview.cpp:
1569 (KHTMLView::focusInEvent): Remove caret code from here. Not needed.
1570 (KHTMLView::focusOutEvent): Ditto.
1571 * kwq/KWQKHTMLPart.h:
1572 (KWQKHTMLPart::displaysWithFocusAttributes): New accessor to return cached value to other code
1574 * kwq/KWQKHTMLPart.mm:
1575 (KWQKHTMLPart::KWQKHTMLPart):
1576 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Renamed from setShowsFirstResponder and modified
1577 to do the display updating in a clearer way....and now has comments!
1578 * kwq/WebCoreBridge.h: Remove several obsolete functions that use to try to do the work of the new
1579 setDisplaysWithFocusAttributes function (and did so less well).
1580 * kwq/WebCoreBridge.mm:
1581 (-[WebCoreBridge drawRect:]): Now calls displaysWithFocusAttributes to figure out how to draw the
1582 text selection background.
1583 (-[WebCoreBridge setDisplaysWithFocusAttributes:]): Calls through to setDisplaysWithFocusAttributes in
1585 (-[WebCoreBridge selectionColor]): Flipped the value of this ternary expression to accommodate the
1586 change from usesInactiveTextBackgroundColor to setDisplaysWithFocusAttributes.
1587 (-[WebCoreBridge setCaretVisible:]): Removed.
1589 2004-07-23 John Sullivan <sullivan@apple.com>
1593 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
1594 now also extends selection (even if there wasn't one before)
1596 * khtml/khtml_part.cpp:
1597 (KHTMLPart::handleMousePressEventSingleClick):
1598 Uh, duh. Got a ! wrong last time somehow, so it did even more the wrong thing
1599 than ever. I did test this before, so my best guess is an accidental undo or
1600 something before committing.
1602 2004-07-23 David Hyatt <hyatt@apple.com>
1604 Fix for 3735084 and 3737209, when you can find no line boxes in your previous sibling, the line box to dirty
1605 should be the *first* line box and not the last.
1607 Reviewed by kocienda
1609 * khtml/rendering/render_flow.cpp:
1610 (RenderFlow::dirtyLinesFromChangedChild):
1612 2004-07-23 Ken Kocienda <kocienda@apple.com>
1616 * khtml/xml/dom_selection.cpp:
1617 (DOM::Selection::validate): Not exactly a fix of anything per se, but more of a refinement
1618 of how selection validation works. The idea is to let the selection validation process
1619 end up with an empty selection given real DOM position inputs if the validation code
1620 cannot find a rendered position. Since selection is all about display, this makes sense.
1621 Currently, the code will allow the selection to be placed in a location that is not
1622 rendered, and this does nobody any good, as it can lead to bugs like accepting key input
1623 in a div that is set to display:none.
1625 2004-07-23 Ken Kocienda <kocienda@apple.com>
1629 Updated layout tests with new expected results.
1631 * layout-tests/editing/execCommand/boldSelection-expected.txt
1632 * layout-tests/editing/selection/extend-by-character-001-expected.txt
1633 * layout-tests/editing/selection/extend-by-character-003-expected.txt
1634 * layout-tests/editing/selection/unrendered-005-expected.txt
1636 2004-07-22 Maciej Stachowiak <mjs@apple.com>
1640 <rdar://problem/3725467> REGRESSION(140-142) nothing displayed at http://Ye-Olde-Movies.tripod.com
1641 <rdar://problem/3599494> REGRESSION (100-125): Frame does not refresh until user clicks on browser.
1643 * khtml/rendering/render_frames.cpp:
1644 (RenderFrameSet::layout): When returning early because there are
1645 no children, make sure to mark self as no longer needing
1646 layout. Otherwise, when children are added, we'll fail to
1647 propagate childrenNeedLayout to our own parent! This is almost
1648 certainly a long-standing bug that was just masked by our old
1651 2004-07-22 Kevin Decker <kdecker@apple.com>
1655 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1657 * khtml/ecma/kjs_events.cpp:
1658 (JSLazyEventListener::JSLazyEventListener):
1659 (JSLazyEventListener::parseCode):
1660 * khtml/ecma/kjs_events.h:
1661 * khtml/ecma/kjs_proxy.cpp:
1662 (KJSProxyImpl::createHTMLEventHandler):
1663 * khtml/ecma/kjs_window.cpp:
1664 (Window::getJSLazyEventListener):
1665 * khtml/ecma/kjs_window.h:
1667 2004-07-22 Ken Kocienda <kocienda@apple.com>
1673 <rdar://problem/3724344> Bolding and unbolding creates extraneous tags
1675 * khtml/editing/htmlediting_impl.cpp:
1676 (khtml::ApplyStyleCommandImpl::doApply): Move the start of the selection upstream
1677 before calling removeStyle. This makes sure we remove all styles that could apply to the
1678 selection, and not just ones in from the start position of the selection passed to us.
1680 * khtml/xml/dom_selection.cpp:
1681 (DOM::Selection::validate): Related fix to "constrain" the selection to be the
1682 smallest equivalent range of nodes, in effect making a "canonical" version of the
1683 selection. While this is not strictly necessary to fix the bug, it is a step I have been
1684 wanting to take this step for a long time, and some recent improvements made it
1685 possible for me to do now in just two lines of code.
1687 2004-07-22 Ken Kocienda <kocienda@apple.com>
1693 <rdar://problem/3711264> difficult (impossible?) to get cursor in an editable webview containing only tags
1695 * khtml/rendering/render_container.cpp:
1696 (RenderContainer::positionForCoordinates): Don't assume you can pass off
1697 the check to a first child if there is one, since the child can be an element
1698 we do not want to place the caret in, like a table row with no cells (the case
1699 in the bug above). So now, we iterate of the renderer's children looking for
1700 the closest one, but only consider those renderers which either have children
1701 themselves, or are render block flows or are render inlines.
1703 2004-07-22 Darin Adler <darin@apple.com>
1705 - remove a bunch of now-unused code
1707 * ForwardingHeaders/qxml.h: Removed.
1708 * kwq/KWQXmlAttributes.h: Removed.
1709 * kwq/KWQXmlAttributes.mm: Removed.
1710 * kwq/KWQXmlDefaultHandler.h: Removed.
1711 * kwq/KWQXmlDefaultHandler.mm: Removed.
1712 * kwq/KWQXmlSimpleReader.h: Removed.
1713 * kwq/KWQXmlSimpleReader.mm: Removed.
1715 2004-07-22 Darin Adler <darin@apple.com>
1719 - got rid of QXml classes and changed XML parsing to use libxml directly
1721 This is the first step toward more direct use of libxml and libxslt.
1722 Dave is planning to build on this to implement XSLT and to improve our handling
1723 of XML documents (faster and more feature complete, including DTDs).
1725 * khtml/html/html_elementimpl.cpp:
1726 (HTMLElementImpl::createContextualFragment):
1727 * khtml/html/htmltokenizer.cpp:
1728 (khtml::HTMLTokenizer::HTMLTokenizer):
1729 * khtml/html/htmltokenizer.h:
1730 * khtml/xml/dom_docimpl.cpp:
1731 (DocumentImpl::createTokenizer):
1732 (DocumentImpl::open):
1733 * khtml/xml/dom_docimpl.h:
1734 (DOM::DocumentImpl::tokenizer):
1735 * khtml/xml/dom_xmlimpl.cpp:
1736 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1737 * khtml/xml/dom_xmlimpl.h:
1738 * khtml/xml/xml_tokenizer.h:
1739 * khtml/xml/xml_tokenizer.cpp: Redid this all to use libxml directly.
1741 * WebCore.pbproj/project.pbxproj: Removed a bunch of files.
1743 2004-07-21 Trey Matteson <trey@apple.com>
1745 DHTML dragging should use UTI for MIME-pboard type conversion
1749 * kwq/KWQClipboard.mm:
1750 (cocoaTypeFromMIMEType): Use UTI, except for cases we need to hardwire. Only cut off
1751 MIME args following a semi-colon for text/plain.
1752 (MIMETypeFromCocoaType): Use UTI, except for cases we need to hardwire.
1753 (KWQClipboard::types): Filter out ancient NSAsciiPboardType so DHTML never sees this cruft.
1755 2004-07-21 Ken Kocienda <kocienda@apple.com>
1759 Remove handling of HTML editing key events from WebCore.
1760 This now happens in WebKit if an event passes all the
1761 way through WebCore without being handled by the DOM.
1763 In each case below, function were removed, as their
1764 only purpose was to handle editing key events.
1766 * khtml/xml/dom_elementimpl.cpp
1767 * khtml/xml/dom_elementimpl.h
1768 * kwq/KWQKHTMLPart.h
1769 * kwq/KWQKHTMLPart.mm
1770 * kwq/WebCoreBridge.h
1772 2004-07-21 Ken Kocienda <kocienda@apple.com>
1776 * khtml/xml/dom_selection.cpp:
1777 (DOM::Selection::modifyExtendingRightForward): Add LINE_BOUNDARY case to the switch statement in this
1778 function. Use the startAndEndLineNodesIncludingNode helper which already existed to get the right
1780 (DOM::Selection::modifyMovingRightForward): Ditto
1781 (DOM::Selection::modifyExtendingLeftBackward): Ditto
1782 (DOM::Selection::modifyMovingLeftBackward): Ditto
1783 * khtml/xml/dom_selection.h:
1784 (DOM::Selection::): Add LINE_BOUNDARY constant to ETextGranularity enum. This
1785 specifies a new kind of movement that we need to implement the "move-to beggining/end of line"
1786 behavior which AppKit binds to cmd+left/right arrow keys.
1787 * kwq/WebCoreBridge.h: Add WebSelectToLineBoundary constant. This matches
1789 2004-07-20 David Hyatt <hyatt@apple.com>
1791 Fix for 3714434, user stylesheet is always parsed in strict mode, when it should honor the document's setting.
1795 * khtml/css/cssstyleselector.cpp:
1796 (khtml::CSSStyleSelector::CSSStyleSelector):
1798 2004-07-20 Ken Kocienda <kocienda@apple.com>
1802 * khtml/xml/dom_elementimpl.cpp:
1803 (ElementImpl::defaultEventHandler): No longer check whether
1804 the command key is modifying the key event. This check is
1805 now done elsewhere in the code. See the WebKit checkin that
1806 added the _web_keyBindingManagerHasBinding method to
1809 2004-07-20 Chris Blumenberg <cblu@apple.com>
1812 <rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
1813 <rdar://problem/3612691> Missing image icons (blue ?) lack context menu
1817 * kwq/WebCoreBridge.mm:
1818 (-[WebCoreBridge elementAtPoint:]): if there is no image, put the image URL on the element anyway
1820 2004-07-20 David Hyatt <hyatt@apple.com>
1822 Fix for alt text not working on images.
1826 * khtml/rendering/render_image.cpp:
1827 (RenderImage::RenderImage):
1828 (RenderImage::setPixmap):
1829 (RenderImage::paint):
1830 (RenderImage::calcReplacedWidth):
1831 (RenderImage::calcReplacedHeight):
1833 2004-07-20 Maciej Stachowiak <mjs@apple.com>
1837 <rdar://problem/3720111> REGRESSION(125-152): map fails to load depending on banner ad; weather.com (works in IE and Firefox)
1839 * khtml/html/htmltokenizer.cpp:
1840 (khtml::HTMLTokenizer::begin): Initialize currentPrependingSrc.
1841 (khtml::HTMLTokenizer::scriptHandler): Store a pointer to the currently
1842 active prependingSrc variable on the stack, the better to handle weird cases
1843 of scripts writing out additional script tags and so forth.
1844 (khtml::HTMLTokenizer::write): Deal with the above.
1845 * khtml/html/htmltokenizer.h: Declare new member field.
1847 2004-07-20 David Hyatt <hyatt@apple.com>
1849 Fix for layer positioning error that occurs when absolute positioned blocks are inside static positioned overflow:auto
1854 * khtml/rendering/render_layer.cpp:
1855 (RenderLayer::updateLayerPosition):
1857 2004-07-20 Trey Matteson <trey@apple.com>
1859 3705624 REGRESSION: can't rearrange photos on homepage.mac.com album
1861 A subtle problem stemming from some interaction between focus handing and
1862 event propagation. We previously made it so when a focus shift fails we
1863 don't propagate the event to KHTML. The fix is to get rid of the inverse
1864 effect, so now even if a focus shift succeeds, we don't propagate to KHTML if
1865 the page already canceled default behavior.
1867 In this specific case, the page is cancelling default behavior since it
1868 does its own dragging, and the bug was our new system dragging was
1873 * khtml/khtmlview.cpp:
1874 (KHTMLView::dispatchMouseEvent): What he said.
1876 2004-07-20 Ken Kocienda <kocienda@apple.com>
1882 <rdar://problem/3695240> pasting plain text with newlines in it turns them into spaces
1884 * kwq/WebCoreBridge.mm:
1885 (-[WebCoreBridge documentFragmentWithText:]): Refine this function to be smart about converting
1886 line endings into BR elements.
1888 2004-07-20 Ken Kocienda <kocienda@apple.com>
1894 <rdar://problem/3707505> HTMLCompose: blinking cursor in both an address text field and the message body
1896 * khtml/khtml_part.cpp:
1897 (KHTMLPart::setCaretVisible): This method renamed from setSelectionVisible. Since it really only operates
1898 on the caret, this seems like a better name.
1899 * khtml/khtml_part.h:
1900 * khtml/khtmlview.cpp:
1901 (KHTMLView::focusInEvent): Call setCaretVisible(true)
1902 (KHTMLView::focusOutEvent): Call setCaretVisible(false)
1903 * kwq/KWQKHTMLPart.mm:
1904 (KWQKHTMLPart::setShowsFirstResponder): Name change: setSelectionVisible becomes setCaretVisible.
1905 * kwq/WebCoreBridge.h: Expose setCaretVisible as a bridge method.
1906 * kwq/WebCoreBridge.mm:
1907 (-[WebCoreBridge setCaretVisible:]): Ditto.
1909 2004-07-19 Maciej Stachowiak <mjs@apple.com>
1913 <rdar://problem/3721428> REGRESSION (125.8-146): external javascript statements produce extra garbage character (sina.com)
1915 * khtml/misc/stringit.h:
1916 (khtml::TokenizerSubstring::TokenizerSubstring): For the apple branch, use the new
1917 stableUnicode() method to get the unicode pointer.
1920 (QString::detachIfInternal): Reorganize this to be a bit less wacky about refcounts.
1921 It does not leave around a zombie internal data handle but rather destroys it right away,
1922 and leaves the object pointing to the new handle (which it can then deref). This makes
1923 the code more clear.
1924 (QString::~QString): Simplify.
1925 (QString::stableUnicode): New method that detaches a copy of the KWQStringData if it
1926 is internal to a string besides this one. This guarantees that if you get the unicode()
1927 pointer, it won't go bad so long as this string is still alive.
1929 2004-07-19 David Hyatt <hyatt@apple.com>
1931 Fix for 3715117, crash from a bug in removeChildren. Clean up node removal and fix an n-squared removal
1932 bug. Also clean up checks in removeChild and in the dispatch of removedFromDocument mutation events to
1933 make node removal more efficient.
1935 Reviewed by kocienda
1937 * khtml/xml/dom_nodeimpl.cpp:
1939 2004-07-19 John Sullivan <sullivan@apple.com>
1943 - fixed <rdar://problem/3141150> can't undo in form textarea fields
1945 * kwq/KWQTextArea.mm:
1946 (-[KWQTextArea _createTextView]):
1947 call setAllowsUndo:YES. My, wasn't this easy?
1949 2004-07-19 David Hyatt <hyatt@apple.com>
1951 Merge @import fix for CSS1 test suite from Stephan Kulow.
1955 * khtml/css/parser.cpp:
1956 * khtml/css/parser.y:
1957 * layout-tests/css1/basic/containment-expected.txt:
1959 2004-07-19 David Hyatt <hyatt@apple.com>
1961 Fix for 3718697, crash clicking on JS tab at alaskaair.com.
1963 Reviewed by kocienda
1965 * khtml/rendering/render_flow.cpp:
1966 (RenderFlow::detach):
1967 (RenderFlow::dirtyLinesFromChangedChild):
1968 * khtml/rendering/render_flow.h:
1969 * khtml/rendering/render_object.cpp:
1970 (RenderObject::dirtyLinesFromChangedChild):
1971 * khtml/rendering/render_object.h:
1973 2004-07-16 David Hyatt <hyatt@apple.com>
1975 Fix for 3726471, need to ensure that it's safe to do updateRendering from within layout, since isContentEditable
1976 relies on it. The fix is to just recalcStyle up front before beginning the layout, so that all of our renderobjects
1981 * khtml/khtmlview.cpp:
1982 (KHTMLView::layout):
1984 2004-07-16 Ken Kocienda <kocienda@apple.com>
1990 <rdar://problem/3722153> Random crash while typing (DOM::NodeImpl::parentNode (this=0x0))
1992 * khtml/editing/htmlediting_impl.cpp:
1993 (khtml::DeleteSelectionCommandImpl::doApply): This check merely makes the code
1994 more robust. I do not understand how Grant ended up with null start or end
1995 blocks in the case of his bug report, but by adding two null checks, the code is
1996 now hardened a bit in case it happens again.
1998 2004-07-16 Ken Kocienda <kocienda@apple.com>
2004 <rdar://problem/3730785> Crash when arrow navigation goes to empty table cell
2005 <rdar://problem/3730790> Caret does not blink when placed in empty table cell
2007 * khtml/rendering/render_block.cpp:
2008 (khtml::RenderBlock::paintObject): Caret node's renderer might be this block, so
2009 don't block the painting of the caret in this case. This was the case in 3730790.
2010 We had the right geometry for the caret but blocked its painting.
2011 * khtml/xml/dom_position.cpp:
2012 (DOM::Position::previousLinePosition): Rework the logic here. This function asserted
2013 that the new position we would navigate to had a line box, but empty table cells, for
2014 instance will not. So, deal with this situation as well. The end result is a
2015 function that worked like it did before in cases where the previous line position has
2016 a line box, but now also will allow navigation to work when it does not.
2017 (DOM::Position::nextLinePosition): Ditto.
2019 2004-07-16 Ken Kocienda <kocienda@apple.com>
2025 <rdar://problem/3687216> editable inline causes crash when focused
2027 * khtml/xml/dom_docimpl.cpp:
2028 (DocumentImpl::relinquishesEditingFocus): Add null check for rootEditableElement.
2029 (DocumentImpl::acceptsEditingFocus): Ditto.
2031 2004-07-16 David Hyatt <hyatt@apple.com>
2033 Fix for 3709337, crash when using display: compact. Need to make sure that the isCompact() check in bidi.cpp is
2034 also checking for RenderBlocks, since otherwise you match text nodes (and that's just wrong).
2036 Reviewed by kocienda
2038 * khtml/rendering/bidi.cpp:
2039 (khtml::RenderBlock::layoutInlineChildren):
2043 2004-07-15 David Hyatt <hyatt@apple.com>
2045 Fix for 3625611, images offset on first visit to page. The method for determining the last clean line was
2046 flawed and would incorrectly miss dirty lines that occurred after the first clean line.
2050 * khtml/rendering/bidi.cpp:
2051 (khtml::RenderBlock::determineEndPosition):
2053 2004-07-15 Ken Kocienda <kocienda@apple.com>
2058 <rdar://problem/3587601> reproducible assertion failure in Blot deleting text, then image at Yahoo.com
2060 * khtml/editing/htmlediting_impl.cpp:
2061 (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): Relax assertion
2062 that nodes are text nodes during the walk of eligible nodes that could possibly be
2063 deleted. Change the assertion to an conditional check for text nodes. We may have
2064 unrendered nodes in the mix here (as is the case in the bug where the assertion
2065 failed on an AREA element), and the conditional check is sufficient to
2066 skip them while leaving the delete logic we want unperturbed.
2068 2004-07-14 Ken Kocienda <kocienda@apple.com>
2072 * khtml/rendering/render_block.cpp:
2073 (khtml::RenderBlock::paintObject): Add null check on DOM node before
2074 asking if it is contentEditable.
2076 2004-07-14 David Hyatt <hyatt@apple.com>
2078 Fix for 3595073, setting innerHTML on a <table> should work.
2082 * khtml/html/html_elementimpl.cpp:
2083 (HTMLElementImpl::createContextualFragment):
2085 2004-07-14 Ken Kocienda <kocienda@apple.com>
2089 Updated these layout tests as a result of the last patch.
2090 These results are better.
2092 * layout-tests/editing/execCommand/selectAll-expected.txt
2093 * layout-tests/editing/selection/extend-by-character-006-expected.txt
2094 * layout-tests/editing/selection/unrendered-001-expected.txt
2095 * layout-tests/editing/selection/unrendered-003-expected.txt
2097 2004-07-14 Ken Kocienda <kocienda@apple.com>
2101 * khtml/rendering/render_block.cpp:
2102 (khtml::RenderBlock::paintObject): Change back to start() from caretPosition().
2103 Since the policy is now to move the selection to rendered content, if possible,
2104 when the selection is set, there is no longer any reason to have the additional
2105 caretPosition() function to store where the caret should be drawn.
2106 * khtml/xml/dom_docimpl.cpp:
2107 (DocumentImpl::updateSelection): No longer any need to call closestRenderedPosition here.
2108 This is done in Selection::validate.
2109 * khtml/xml/dom_position.cpp:
2110 (DOM::Position::closestRenderedPosition): Improved algorithm. Now much simpler.
2111 * khtml/xml/dom_selection.cpp:
2112 (DOM::Selection::Selection): caretPosition() and m_caretPosition now obsolete.
2113 (DOM::Selection::init): Ditto.
2114 (DOM::Selection::modifyExtendingRightForward): No longer any need to call
2115 closestRenderedPosition here. This is done in Selection::validate.
2116 (DOM::Selection::modifyMovingRightForward): Ditto.
2117 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
2118 (DOM::Selection::modifyMovingLeftBackward): Ditto.
2119 (DOM::Selection::layoutCaret): Ditto.
2120 (DOM::Selection::validate): Add code to move the selection to rendered content if possible.
2121 * khtml/xml/dom_selection.h: caretPosition() and m_caretPosition now obsolete.
2123 2004-07-14 David Hyatt <hyatt@apple.com>
2125 Fix for 3716082, assert when you dynamically remove float or position styles.
2129 * khtml/rendering/render_object.cpp:
2130 (RenderObject::setStyle):
2132 2004-07-14 David Hyatt <hyatt@apple.com>
2134 Fix for various table regressions (malumovies.com and cityofheroes.gameamp.com) involving bungling of
2137 Reviewed by kocienda
2139 * khtml/rendering/render_box.cpp:
2140 (RenderBox::calcPercentageHeight):
2141 (RenderBox::availableHeightUsing):
2142 * khtml/rendering/render_table.cpp:
2143 (RenderTable::layout):
2144 (RenderTableSection::calcRowHeight):
2145 (RenderTableSection::layoutRows):
2146 (RenderTableCell::updateFromElement):
2147 * khtml/rendering/render_table.h:
2149 2004-07-14 Ken Kocienda <kocienda@apple.com>
2153 * khtml/xml/dom_position.cpp:
2154 (DOM::Position::equivalentDeepPosition): New helper function to improve selection handling.
2155 Soon, I plan to land some changes that use this new function.
2156 * khtml/xml/dom_position.h:
2158 2004-07-14 Ken Kocienda <kocienda@apple.com>
2162 * WebCore-combined.exp: Added QString.at symbol to tests exports to facilitate debugging
2163 data formatting change that is to come.
2164 * WebCore-tests.exp:
2166 2004-07-13 John Sullivan <sullivan@apple.com>
2170 - fixed <rdar://problem/3705500> REGRESSION (125.8-146): Cmd-E on an
2171 HTML page puts a trailing space on Find pasteboard
2173 * khtml/misc/khtml_text_operations.cpp:
2174 (khtml::TextIterator::handleTextBox):
2175 In the case where a subrun doesn't extend to the end of the text box,
2176 the well-commented code was supposed to return from this routine, but
2177 the wrong variable was being compared. This would send us through another
2178 pass of the loop, which would end up worrying about collapsed space at the
2179 end of the current box, even though we only cared about the beginning of the
2182 2004-07-12 Richard Williamson <rjw@apple.com>
2184 Fixed 3717982. Implemented navigator.language!
2188 * khtml/ecma/kjs_navigator.cpp:
2189 (Navigator::getValueProperty):
2191 2004-07-12 Ken Kocienda <kocienda@apple.com>
2195 * khtml/xml/dom_position.cpp:
2196 (DOM::Position::inRenderedContent): I broke selection drawing with my last patch. This
2197 function is now used in selection drawing, and it was making an unneeded check to see
2198 that content was editable to answer whether or not is was rendered. Bad. Fixed.
2200 2004-07-12 David Hyatt <hyatt@apple.com>
2202 Fix for 3621138, crash on hrweb.apple.com. Make sure that in the case where objects get pulled up from merging
2203 blocks that we just delete all line boxes.
2205 Reviewed by kocienda
2207 * khtml/rendering/render_block.cpp:
2208 (khtml::RenderBlock::removeChild):
2210 2004-07-10 Maciej Stachowiak <mjs@apple.com>
2214 <rdar://problem/3706080>: (REGRESSION (125.8-147u): Nested <ul> do not display bullets)
2215 <rdar://problem/3676376>: (Second level bullets not printed when printing Xcode release notes)
2218 * kwq/KWQPainter.mm:
2219 (CGColorFromNSColor):
2220 (QPainter::drawEllipse):
2221 (QPainter::setShadow):
2223 2004-07-12 Ken Kocienda <kocienda@apple.com>
2227 Added new editing-related layout tests
2229 * layout-tests/editing/deleting/delete-after-span-ws-001-expected.txt: Added.
2230 * layout-tests/editing/deleting/delete-after-span-ws-001.html: Added.
2231 * layout-tests/editing/deleting/delete-after-span-ws-002-expected.txt: Added.
2232 * layout-tests/editing/deleting/delete-after-span-ws-002.html: Added.
2233 * layout-tests/editing/deleting/delete-after-span-ws-003-expected.txt: Added.
2234 * layout-tests/editing/deleting/delete-after-span-ws-003.html: Added.
2235 * layout-tests/editing/selection/unrendered-001-expected.txt: Added.
2236 * layout-tests/editing/selection/unrendered-001.html: Added.
2237 * layout-tests/editing/selection/unrendered-002-expected.txt: Added.
2238 * layout-tests/editing/selection/unrendered-002.html: Added.
2239 * layout-tests/editing/selection/unrendered-003-expected.txt: Added.
2240 * layout-tests/editing/selection/unrendered-003.html: Added.
2241 * layout-tests/editing/selection/unrendered-004-expected.txt: Added.
2242 * layout-tests/editing/selection/unrendered-004.html: Added.
2243 * layout-tests/editing/selection/unrendered-005-expected.txt: Added.
2244 * layout-tests/editing/selection/unrendered-005.html: Added.
2245 * layout-tests/traversal/node-iterator-008-expected.txt: Added.
2246 * layout-tests/traversal/node-iterator-008.html: Added.
2247 * layout-tests/traversal/tree-walker-005-expected.txt: Added.
2248 * layout-tests/traversal/tree-walker-005.html: Added.
2250 2004-07-12 Ken Kocienda <kocienda@apple.com>
2254 Fixes for these bugs:
2256 <rdar://problem/3723359> Extending then "unextending" selection with arrow keys should draw caret but doesn't
2257 <rdar://problem/3724626> White-space deletion code deletes wrong character when space follows span
2259 * khtml/editing/htmlediting_impl.cpp:
2260 (khtml::DeleteSelectionCommandImpl::doApply): Modify special-case white-space deletion code so it runs
2261 only in the special case. It was throwing its net too widely, catching the case described in 3724626.
2262 By tightening up the special-case white-space deletion, and allowing the more general-purpose code to run,
2264 * khtml/xml/dom_docimpl.cpp:
2265 (DocumentImpl::updateSelection): Use recently-added closestRenderedPosition helper in Position class
2266 to figure out the start and end positions for selection drawing.
2267 * khtml/xml/dom_position.cpp:
2268 (DOM::Position::equivalentUpstreamPosition): Added code to handle white-space that causes line breaks.
2269 (DOM::Position::equivalentDownstreamPosition): Ditto.
2270 (DOM::Position::closestRenderedPosition): Trap empty selections at function entry, return *this.
2271 (DOM::Position::isFirstRenderedPositionOnLine): Can't be first rendered position on line if not rendered.
2273 (DOM::Position::isLastRenderedPositionOnLine): Ditto, but s/first/last/
2274 * khtml/xml/dom_selection.cpp:
2275 (DOM::Selection::validate): A selection is in caret state if the start and end are equal *or* equivalent.
2276 The equivalence case is new, and fixes 3723359.
2278 2004-07-09 Kevin Decker <kdecker@apple.com>
2282 fixes the width:auto problem in
2283 <rdar://problem/3698344> REGRESSION (143?-144): macrumors.com tabs are compressed and illegible
2285 * khtml/css/cssstyleselector.cpp:
2286 (khtml::CSSStyleSelector::applyProperty):
2288 2004-07-09 Ken Kocienda <kocienda@apple.com>
2292 Updated some layout test results.
2294 * layout-tests/editing/deleting/delete-image-004-expected.txt:
2295 * layout-tests/editing/selection/extend-by-character-006-expected.txt:
2297 2004-07-09 Chris Blumenberg <cblu@apple.com>
2299 Allowed my change for 3715785 to compile on Jaguar.
2301 Reviewed by kocienda.
2303 * kwq/WebCoreBridge.h:
2304 * kwq/WebCoreBridge.mm:
2305 (-[WebCoreBridge domain]): new, allows access to the domain without using the DOM API which doesn't exist on Jaguar
2307 2004-07-09 Ken Kocienda <kocienda@apple.com>
2311 Some improvements to fix:
2313 <rdar://problem/3723111> Caret not drawn when selection set to unrendered content
2315 * khtml/editing/htmlediting_impl.cpp:
2316 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Adjust selection to delete if
2317 selected position is not rendered.
2318 * khtml/rendering/render_block.cpp:
2319 (khtml::RenderBlock::paintObject): Use new caretPosition() function on Selection to
2320 figure out whether to paint.
2321 * khtml/xml/dom_position.cpp:
2322 (DOM::Position::previousCharacterPosition): Now correctly deals with a start
2323 position that is not rendered.
2324 (DOM::Position::nextCharacterPosition): Ditto.
2325 (DOM::Position::closestRenderedPosition): New helper.
2326 * khtml/xml/dom_position.h:
2327 (DOM::): Moved in EAffinity from Selection header. Now used in closestRenderedPosition function.
2328 * khtml/xml/dom_selection.cpp:
2329 (DOM::Selection::Selection): Added new m_caretPosition member. This is the position of the caret
2330 after a caret layout. This may be different from start or end if start and end are not rendered.
2331 (DOM::Selection::init):
2332 (DOM::Selection::modifyExtendingRightForward): New helper to clean up modify() and make it more readble.
2333 (DOM::Selection::modifyMovingRightForward): Ditto.
2334 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
2335 (DOM::Selection::modifyMovingLeftBackward): Ditto.
2336 (DOM::Selection::modify): Use new helpers to make this more readble.
2337 (DOM::Selection::layoutCaret): Uses new closestRenderedPosition helper to place the caret if in unrendered
2339 (DOM::Selection::paintCaret): Remove moveToRenderedContent. obsolete.
2340 * khtml/xml/dom_selection.h:
2341 (DOM::Selection::caretPosition): New accessor.
2342 * kwq/WebCoreBridge.mm:
2343 (-[WebCoreBridge setSelectedDOMRange:affinity:]): EAffinity no longer a member enum of Selection class.
2345 2004-07-08 David Hyatt <hyatt@apple.com>
2347 Fix for the table layout test that failed because of a change in how innerText worked. We need to do
2348 updateLayout now when using innerText, since the method has been changed to use line boxes in the render tree
2349 that might otherwise be out of date.
2351 Reviewed by kocienda
2353 * khtml/html/html_elementimpl.cpp:
2354 (HTMLElementImpl::innerText):
2356 2004-07-08 John Sullivan <sullivan@apple.com>
2360 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
2361 now also extends selection (even if there wasn't one before)
2363 * khtml/khtml_part.cpp:
2364 (KHTMLPart::handleMousePressEventSingleClick):
2365 if there's a URL associated with the event, don't extend the selection
2367 2004-07-08 Ken Kocienda <kocienda@apple.com>
2371 Added some helper functions which provide strings to display in the
2372 Xcode debugger's variable inspector window. These functions are called
2373 from the LabyrinthDataFormatter debugger plugin I just checked in to
2374 the Labyrinth/Tools directory.
2376 Note that these functions are compiled in on Development builds only.
2378 * WebCore-combined.exp:
2379 * WebCore-tests.exp: Export all the formatForDebugger symbols so the
2380 debugger program can link with them.
2381 * khtml/xml/dom2_rangeimpl.cpp:
2382 (DOM::RangeImpl::formatForDebugger):
2383 * khtml/xml/dom2_rangeimpl.h:
2384 * khtml/xml/dom_elementimpl.cpp:
2385 (ElementImpl::formatForDebugger):
2386 * khtml/xml/dom_elementimpl.h:
2387 * khtml/xml/dom_nodeimpl.cpp:
2388 * khtml/xml/dom_nodeimpl.h:
2389 * khtml/xml/dom_position.cpp:
2390 (DOM::Position::formatForDebugger):
2391 * khtml/xml/dom_position.h:
2392 * khtml/xml/dom_selection.cpp:
2393 (DOM::Selection::formatForDebugger):
2394 * khtml/xml/dom_selection.h:
2395 * khtml/xml/dom_textimpl.cpp:
2396 (TextImpl::formatForDebugger):
2397 * khtml/xml/dom_textimpl.h:
2399 2004-07-08 John Sullivan <sullivan@apple.com>
2403 - fixed <rdar://problem/3721544> crash increasing font size;
2404 entrezeroetun.com (works in IE and Firefox)
2406 * khtml/rendering/render_block.cpp:
2407 (khtml::RenderBlock::updateFirstLetter):
2408 Check for nil originalString() before dereffing
2410 2004-07-08 David Hyatt <hyatt@apple.com>
2412 Fix for 3721453, CSS3 initial property caused crashes because the macros were not written correctly.
2416 * khtml/css/cssstyleselector.cpp:
2420 2004-07-07 David Hyatt <hyatt@apple.com>
2422 Fix for 3712133, crash from first-line pseudo-style use.
2424 Reviewed by kocienda
2426 * khtml/css/cssstyleselector.cpp:
2427 (khtml::CSSStyleSelector::styleForElement):
2428 * khtml/css/cssstyleselector.h:
2429 * khtml/rendering/render_object.cpp:
2430 (RenderObject::getPseudoStyle):
2432 2004-07-07 Ken Kocienda <kocienda@apple.com>
2438 <rdar://problem/3716479> calling setInnerHTML during a webViewDidChange delegate call causes a crash
2440 The fix involves some rearrangement of code in TypingCommand and TypingCommandImpl.
2441 Formerly, new TypingCommands would apply themselves (which was a no-op) and then
2442 do their action in some code a way different than other commands. This type of command
2443 application is different than for all other commands since TypingCommands can be coalesced.
2444 The crash occurred as a result of the "no-op" TypingCommand having the unconsidered
2445 consequence of causing editing delegate notifications to be sent before the command
2446 has actually run. This change takes a small step towards making TypingCommandImpl function like
2447 other commands, where the command work is done in doApply. This makes the notification
2448 happen in the right order.
2450 * khtml/editing/htmlediting.cpp:
2451 (khtml::TypingCommand::TypingCommand):
2452 (khtml::TypingCommand::insertText):
2453 (khtml::TypingCommand::insertNewline):
2454 (khtml::TypingCommand::deleteKeyPressed):
2455 * khtml/editing/htmlediting.h:
2456 (khtml::TypingCommand::):
2457 * khtml/editing/htmlediting_impl.cpp:
2458 (khtml::TypingCommandImpl::TypingCommandImpl):
2459 (khtml::TypingCommandImpl::doApply):
2460 * khtml/editing/htmlediting_impl.h:
2462 2004-07-06 Ken Kocienda <kocienda@apple.com>
2466 * khtml/html/html_tableimpl.cpp:
2467 (HTMLTableElementImpl::addChild): Added a better comment in the
2468 code I just checked in a few minutes ago.
2470 2004-07-06 Ken Kocienda <kocienda@apple.com>
2476 <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply
2477 due to non-0 exception code trying to insert a DIV markup string
2479 The solution was to revert to the code that was rolled out, and removing
2480 the child checks from NodeImpl::checkAddChild. However, this time, I added
2481 code very similar to this check into the code that runs while HTML is
2482 being parsed to build up tables. This code relies on child-add failure
2483 to ensure the proper construction of well-formed tables (as gross as that
2484 sounds), so the check needs to be retained there. No other code seems to
2485 be so affected. Layout tests are unchanged by this patch.
2487 * khtml/html/html_tableimpl.cpp:
2488 (HTMLTableElementImpl::addChild):
2489 * khtml/xml/dom_nodeimpl.cpp:
2490 (NodeImpl::checkAddChild):
2492 2004-07-06 Ken Kocienda <kocienda@apple.com>
2496 Simple change. I switched the arguments of the appendNode helper function
2497 and the AppendNodeCommand and AppendNodeCommandImpl classes. The node to
2498 insert now comes before the parent node in the argument list. I did this
2499 to make this function match the convention of others in the HTML editing code.
2500 This was the only one that was "different" in the way that it ordered arguments.
2501 As a result, I was always looking to see that I was passing things in the right
2504 * khtml/editing/htmlediting.cpp:
2505 (khtml::AppendNodeCommand::AppendNodeCommand):
2506 (khtml::AppendNodeCommand::appendChild):
2507 (khtml::AppendNodeCommand::parentNode):
2508 * khtml/editing/htmlediting.h:
2509 * khtml/editing/htmlediting_impl.cpp:
2510 (khtml::CompositeEditCommandImpl::insertNodeAfter):
2511 (khtml::CompositeEditCommandImpl::insertNodeAt):
2512 (khtml::CompositeEditCommandImpl::appendNode):
2513 (khtml::AppendNodeCommandImpl::AppendNodeCommandImpl):
2514 (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl):
2515 (khtml::AppendNodeCommandImpl::doApply):
2516 (khtml::AppendNodeCommandImpl::doUnapply):
2517 (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
2518 (khtml::DeleteSelectionCommandImpl::doApply):
2519 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition):
2520 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition):
2521 (khtml::InputTextCommandImpl::prepareForTextInsertion):
2522 * khtml/editing/htmlediting_impl.h:
2523 (khtml::AppendNodeCommandImpl::parentNode):
2525 2004-07-06 Ken Kocienda <kocienda@apple.com>
2529 Fixed several problems with traversal classes. For one, NodeIterators treat
2530 FILTER_REJECT and FILTER_SKIP the same, since it treats the DOM tree as a
2531 flat collection of nodes free of hierarchy. The code before this change did
2532 not do this correctly. It sure pays to go back and read the specs. :)
2534 Also, the code to traverse from node to node when filters were applied was
2535 not working correctly. My first attemmpt to implement this was just plain
2536 buggy, as I discovered when I tried to write tests for my WWDC talk. I have
2537 settled on an implementation which is much simpler and worked for all the
2538 tests I threw at it.
2540 * khtml/xml/dom2_traversalimpl.cpp:
2541 (DOM::NodeIteratorImpl::findNextNode):
2542 (DOM::NodeIteratorImpl::nextNode):
2543 (DOM::NodeIteratorImpl::findPreviousNode):
2544 (DOM::NodeIteratorImpl::previousNode):
2545 (DOM::TreeWalkerImpl::parentNode):
2546 (DOM::TreeWalkerImpl::firstChild):
2547 (DOM::TreeWalkerImpl::lastChild):
2548 (DOM::TreeWalkerImpl::previousSibling):
2549 (DOM::TreeWalkerImpl::nextSibling):
2550 (DOM::TreeWalkerImpl::previousNode):
2551 (DOM::TreeWalkerImpl::nextNode):
2552 (DOM::TreeWalkerImpl::ancestorRejected):
2553 * khtml/xml/dom2_traversalimpl.h:
2555 2004-07-06 Vicki Murley <vicki@apple.com>
2557 Reviewed by kocienda.
2559 - added backColorCommand, foreColorCommand, fontNameCommand,
2562 * layout-tests/editing/editing.js:
2564 2004-07-06 Trey Matteson <trey@apple.com>
2566 3716053 - www.theage.com.au has extra back/forward items due to ads
2568 This turned out to be easily fixed by generalizing the fix to 3438441. We prevent
2569 addition to the b/f list not just during an onload event, but during any non-user
2570 gesture, which includes top level script executing.
2572 Reviewed by Richard.
2574 * kwq/KWQKHTMLPart.mm:
2575 (KWQKHTMLPart::openURL): Only real change - prevent adding to b/f list if not
2577 (KWQKHTMLPart::openURLRequest): Rename "onLoadEvent" to "userGesture", swap sense
2578 (KWQKHTMLPart::submitForm): Ditto
2579 (KWQKHTMLPart::urlSelected): Ditto
2580 * kwq/KWQKHTMLPartBrowserExtension.mm:
2581 (KHTMLPartBrowserExtension::createNewWindow): Ditto
2582 * kwq/WebCoreBridge.h:
2584 2004-07-02 Darin Adler <darin@apple.com>
2588 - fixed half of <rdar://problem/3709244> utf-8 meta tag not parsed when page title contains angle brackets or if </meta> tag used
2590 * khtml/misc/decoder.cpp: (Decoder::decode): Allow </meta> tags without deciding we
2591 are done with the header.
2593 2004-06-30 Trey Matteson <trey@apple.com>
2595 Dragging within a web view should be allowed to start when the window isn't key.
2597 A few months ago, Chris made this work, but it relied on the fact that all dragging
2598 was done in WebKit. When WebCore got involved in dragging, it was broken. Now we
2599 have a new scheme that gets it working again that properly involves WebCore.
2601 The general idea is that when AK asks us whether to accept the first mouse and do
2602 "delayed window ordering", we must consult WC to see if we might start a drag. In
2603 addition, instead of these drags in non-active windows being started as a special
2604 case in WK, they go through the normal WK-WC drag machinery.
2608 * khtml/khtml_part.cpp:
2609 (KHTMLPart::shouldDragAutoNode): New x,y args.
2610 * khtml/khtml_part.h:
2611 * khtml/rendering/render_object.cpp:
2612 (RenderObject::draggableNode): Pass through new x,y args.
2613 * khtml/rendering/render_object.h:
2614 * kwq/KWQKHTMLPart.h:
2615 (KWQKHTMLPart::setActivationEventNumber): New setter.
2616 * kwq/KWQKHTMLPart.mm:
2617 (KWQKHTMLPart::KWQKHTMLPart): Init new ivar.
2618 (KWQKHTMLPart::eventMayStartDrag): New routine that checks if we might start
2619 a drag in response to a mouseDown.
2620 (KWQKHTMLPart::khtmlMouseMoveEvent): Pass x,y to the routine that finds a draggable
2621 node. This eventually gets back up to WK's _mayStartDragAtEventLocation:.
2622 Delay requirement when dragging the selection now implemented here.
2623 (KWQKHTMLPart::khtmlMouseReleaseEvent): Must avoid changing the selection if we
2624 wind up here as part of the first click in a window (because we started handling
2625 the click to possible start a drag, but that never came through).
2626 (KWQKHTMLPart::mouseDown): Save away event timestamp.
2627 (KWQKHTMLPart::shouldDragAutoNode): Pass location up to WK instead of the
2628 most recent event we stashed.
2629 * kwq/WebCoreBridge.h:
2630 * kwq/WebCoreBridge.mm:
2631 (-[WebCoreBridge setActivationEventNumber:]): Trivial glue.
2632 (-[WebCoreBridge eventMayStartDrag:]): Ditto.
2634 2004-06-29 Trey Matteson <trey@apple.com>
2636 Need to tighten up JS error checking for requesting drag props
2641 * khtml/ecma/kjs_events.cpp:
2642 (Clipboard::getValueProperty): Assert if someone somehow set
2643 dropEffect or effectAllowed and it's a copy/paste clipboard
2644 instead of a dragging clipboard.
2645 (Clipboard::putValue): Don't let anyone set dropEffect or
2646 effectAllowed on a copy/paste clipboard.
2647 (ClipboardProtoFunc::tryCall): Disallow setting dragImage on
2648 a copy/paste clipboard.
2650 2004-06-29 Trey Matteson <trey@apple.com>
2652 DHTML dragging - source should have access to the operation chosen
2657 * kwq/KWQKHTMLPart.h:
2658 * kwq/KWQKHTMLPart.mm:
2659 (KWQKHTMLPart::dragSourceEndedAt): Set the destination's operation
2661 * kwq/WebCoreBridge.mm:
2662 (-[WebCoreBridge dragExitedWithDraggingInfo:]): For completeness
2663 we set the source op for the ondragexit event.
2664 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto for the
2666 (-[WebCoreBridge dragSourceEndedAt:operation:]): Pass through of operation.
2668 2004-06-24 Trey Matteson <trey@apple.com>
2670 3710422 - REGRESSION: Safari crashes trying to send onbeforecut event at about://blank
2672 Simple fix - don't try to send the event to the body element if we have no body element.
2676 * kwq/KWQKHTMLPart.mm:
2677 (KWQKHTMLPart::dispatchCPPEvent):
2679 2004-06-24 Trey Matteson <trey@apple.com>
2681 3704950 drag image in DB ConfigBar has horizontal graphics turd WebCore JavaScript
2683 When we generate a drag image (or a selection image too, for that matter) we
2684 translate the CTM using a CG call. Later, WebImageRenderer adjusts the pattern
2685 phase based on the CTM of the focused view, which doesn't include our translate.
2686 So we must inform WebKit about the additional phase adjustment.
2690 * kwq/KWQKHTMLPart.mm: Tell WebKit about the phase adjustment.
2691 (KWQKHTMLPart::imageFromRect):
2692 * kwq/WebCoreGraphicsBridge.h:
2693 * kwq/WebCoreGraphicsBridge.m:
2694 (-[WebCoreGraphicsBridge setAdditionalPatternPhase:]): New routine to receive
2695 the phase adjustment.
2697 2004-06-24 Trey Matteson <trey@apple.com>
2699 3679986 - screenX and screenY are flipped and relative to the bottom left of the WebView, rather than the screen
2700 3699510 - synthesized click events have bogus screen coords
2704 * khtml/khtmlview.cpp:
2705 (KHTMLView::dispatchDragEvent): Generate screen coords for drag events using new func.
2706 (KHTMLView::dispatchMouseEvent): Ditto.
2707 * khtml/khtmlview.h:
2708 * khtml/xml/dom_nodeimpl.cpp:
2709 (NodeImpl::dispatchMouseEvent): Comment tricky semantics.
2710 Calc screen coords in apple-specific way.
2711 * kwq/KWQKHTMLView.mm:
2712 (KHTMLView::viewportToGlobal): Passthrough to window widget.
2713 * kwq/KWQScrollView.mm:
2714 * kwq/KWQWindowWidget.h:
2715 * kwq/KWQWindowWidget.mm:
2716 (KWQWindowWidget::mapToGlobal): Call former code factored to new method below.
2717 (KWQWindowWidget::viewportToGlobal): New method to convert "viewport" (which for us
2718 really means NSWindow coords) to screen coords.
2720 2004-06-24 Trey Matteson <trey@apple.com>
2722 3693420 - onbeforecut and onbeforepaste need real implementaion
2726 * kwq/KWQKHTMLPart.h:
2727 * kwq/KWQKHTMLPart.mm:
2728 (KWQKHTMLPart::mayCut): Dispatch event to DHTML.
2729 (KWQKHTMLPart::mayCopy): Ditto
2730 (KWQKHTMLPart::mayPaste): Ditto
2731 (KWQKHTMLPart::tryCut): No more need to send fake onbefore event
2732 (KWQKHTMLPart::tryCopy): Ditto
2733 (KWQKHTMLPart::tryPaste): Ditto
2734 * kwq/WebCoreBridge.h:
2735 * kwq/WebCoreBridge.mm:
2736 (-[WebCoreBridge mayDHTMLCut]): Standard glue
2737 (-[WebCoreBridge mayDHTMLCopy]): Ditto
2738 (-[WebCoreBridge mayDHTMLPaste]): Ditto
2740 2004-06-24 Darin Adler <darin@apple.com>
2744 - fixed <rdar://problem/3709385> Find on page doesn't find a string at the very end of the file
2746 * khtml/misc/khtml_text_operations.cpp: (khtml::findPlainText): Rearrange loop to avoid an early
2747 exit once we have all the characters we need, but are at the end of the range we are searching.
2749 - fixed <rdar://problem/3102271>: (text areas have scroll bars even when they don't need them)
2750 - fixed <rdar://problem/3665430>: (horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode)
2752 * kwq/KWQTextArea.mm:
2753 (-[KWQTextArea _configureTextViewForWordWrapMode]): Added. Helper method that sets up the
2754 view for a new word wrap mode.
2755 (-[KWQTextArea _createTextView]): Moved much of the code inside _configureTextViewForWordWrapMode.
2756 (-[KWQTextArea _frameSizeChanged]): Added. Method shared by setFrame: and initWithFrame: to
2757 avoid duplicate code that was there before. The old code also had redundant code to update
2758 the text container size, but NSText handles that automatically.
2759 (-[KWQTextArea initWithFrame:]): Set wrap to YES by default, which is the key to fixing bug 3665430.
2760 Call setAutohidesScrollers:YES, which fixes bug 3102271. Also call the new _frameSizeChanged method.
2761 (-[KWQTextArea setWordWrap:]): Call _configureTextViewForWordWrapMode instead of trying
2762 to do the work here. The old version did both too little and too much.
2763 (-[KWQTextArea setFrame:]): Call _frameSizeChanged instead of trying to do the work here.
2764 The old version did both too little and too much.
2766 2004-06-24 John Sullivan <sullivan@apple.com>
2768 Darin made this change on my machine; I reviewed it.
2770 - fixed <rdar://problem/3698333> Find on page doesn't find a particular string
2771 with a newline in the source
2773 * khtml/misc/khtml_text_operations.cpp:
2774 (khtml::TextIterator::handleTextBox):
2775 Clear m_lastTextNodeEndedWithCollapsedSpace after taking it into account.
2777 2004-06-23 Richard Williamson <rjw@apple.com>
2779 Implemented changes for latest npruntime.h.
2783 * kwq/KWQKHTMLPart.h:
2784 * kwq/KWQKHTMLPart.mm:
2785 (KWQKHTMLPart::KWQKHTMLPart):
2786 (KWQKHTMLPart::windowScriptNPObject):
2787 (KWQKHTMLPart::getEmbedInstanceForView):
2788 * kwq/WebCoreBridge.h:
2789 * kwq/WebCoreBridge.mm:
2790 (-[WebCoreBridge windowScriptObject]):
2791 (-[WebCoreBridge windowScriptNPObject]):
2793 2004-06-22 Richard Williamson <rjw@apple.com>
2795 Fixed <rdar://problem/3707162>: accessing embeds[] plug-in interface may crash
2797 embedInstance was uninitialized.
2801 * khtml/html/html_objectimpl.cpp:
2802 (HTMLEmbedElementImpl::HTMLEmbedElementImpl):
2804 2004-06-18 John Sullivan <sullivan@apple.com>
2808 - fixed <rdar://problem/3534851> Pop up windows not showing up within SAP's
2809 BW Module (changing location.href on new window created by window.open)
2811 * khtml/khtml_part.cpp:
2812 (KHTMLPart::scheduleRedirection):
2813 allow new redirect to win if delay <= current delay, not just <
2815 === WebCore-146.1 ===
2817 2004-06-18 Trey Matteson <trey@apple.com>
2819 3702053 - DHTML dragging destination can't control the cursor (by setting the drop operation)
2821 Fallout from security work, but an easy fix.
2825 * kwq/KWQClipboard.mm:
2826 (KWQClipboard::setDropEffect): Allow dest side to set dropEffect.
2828 2004-06-18 Darin Adler <darin@apple.com>
2832 - re-fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)
2834 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
2835 Check !isInlineFlow rather than checking hasMarkupTruncation. Otherwise, we break
2836 plain old non-markup truncation.
2838 2004-06-18 Darin Adler <darin@apple.com>
2842 - fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)
2844 * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
2845 Only walk the ellipsis list if hasMarkupTruncation is true.
2849 2004-06-17 Richard Williamson <rjw@apple.com>
2851 Fixed <rdar://problem/3698867> setting the canvas or parent to display:none and updating the causes a nil-deref
2853 Ensured that we have a renderer before rendering.
2857 * khtml/ecma/kjs_html.cpp:
2858 (KJS::Context2DFunction::tryCall):
2860 2004-06-17 David Hyatt <hyatt@apple.com>
2862 Fix for 3674601, "Read More..." links should trail articles in Emerson.
2866 * khtml/rendering/bidi.cpp:
2867 (khtml::RenderBlock::layoutInlineChildren):
2868 (khtml::RenderBlock::deleteEllipsisLineBoxes):
2869 (khtml::RenderBlock::checkLinesForTextOverflow):
2870 * khtml/rendering/render_block.cpp:
2871 (khtml:::RenderFlow):
2872 (khtml::RenderBlock::paintEllipsisBoxes):
2873 (khtml::RenderBlock::nodeAtPoint):
2874 (khtml::shouldCheckLines):
2875 (khtml::getLineAtIndex):
2876 (khtml::getHeightForLineCount):
2877 (khtml::RenderBlock::lineAtIndex):
2878 (khtml::RenderBlock::lineCount):
2879 (khtml::RenderBlock::heightForLineCount):
2880 (khtml::RenderBlock::clearTruncation):
2881 * khtml/rendering/render_block.h:
2882 (khtml::RenderBlock::setHasMarkupTruncation):
2883 (khtml::RenderBlock::hasMarkupTruncation):
2884 * khtml/rendering/render_flexbox.cpp:
2885 (khtml::RenderFlexibleBox::layoutVerticalBox):
2886 * khtml/rendering/render_line.cpp:
2887 (khtml::EllipsisBox::m_str):
2888 (khtml::InlineBox::adjustPosition):
2889 (khtml::InlineFlowBox::adjustPosition):
2890 (khtml::InlineFlowBox::clearTruncation):
2891 (khtml::EllipsisBox::paint):
2892 (khtml::EllipsisBox::nodeAtPoint):
2893 (khtml::RootInlineBox::clearTruncation):
2894 (khtml::RootInlineBox::placeEllipsis):
2895 (khtml::RootInlineBox::paintEllipsisBox):
2896 (khtml::RootInlineBox::hitTestEllipsisBox):
2897 (khtml::RootInlineBox::adjustPosition):
2898 (khtml::RootInlineBox::childRemoved):
2899 * khtml/rendering/render_line.h:
2900 (khtml::InlineBox::clearTruncation):
2901 * khtml/rendering/render_text.cpp:
2902 * khtml/rendering/render_text.h:
2903 (khtml::InlineTextBox::clearTruncation):
2905 2004-06-17 Trey Matteson <trey@apple.com>
2907 3698514 - coordinates in ondragstart and ondrag events are wrong
2909 This part fixes the ondragstart coords. We salt away the window-based mouseDown
2910 location, since we need that when we dispatch the ondragstart event. Previously
2911 we were errantly using a mouseDown point that had already been converted to view
2912 coords, and then the dispatch converted it again.
2916 * kwq/KWQKHTMLPart.h:
2917 * kwq/KWQKHTMLPart.mm:
2918 (KWQKHTMLPart::khtmlMouseMoveEvent): Use window based mouse event coords to dispatch event.
2919 (KWQKHTMLPart::mouseDown): Save window based mouse event coords .
2921 2004-06-16 David Hyatt <hyatt@apple.com>
2923 Fix for 3596620, implement a subset of CSS3 text truncation for Emerson.
2927 * khtml/rendering/bidi.cpp:
2928 (khtml::RenderBlock::checkLinesForTextOverflow):
2929 * khtml/rendering/font.cpp:
2930 (Font::checkSelectionPoint):
2931 * khtml/rendering/font.h:
2932 * khtml/rendering/render_block.cpp:
2933 (khtml::RenderBlock::paintObject):
2934 (khtml::RenderBlock::paintFloats):
2935 (khtml::RenderBlock::paintEllipsisBoxes):
2936 * khtml/rendering/render_block.h:
2937 * khtml/rendering/render_line.cpp:
2938 (InlineBox::canAccommodateEllipsis):
2939 (InlineBox::placeEllipsisBox):
2940 (InlineFlowBox::paintDecorations):
2941 (InlineFlowBox::placeEllipsisBox):
2942 (EllipsisBox::paint):
2943 (RootInlineBox::placeEllipsis):
2944 (RootInlineBox::placeEllipsisBox):
2945 * khtml/rendering/render_line.h:
2946 (khtml::EllipsisBox::m_str):
2947 (khtml::RootInlineBox::ellipsisBox):
2948 * khtml/rendering/render_text.cpp:
2949 (InlineTextBox::placeEllipsisBox):
2950 (InlineTextBox::paintDecoration):
2951 (InlineTextBox::offsetForPosition):
2952 (RenderText::positionForCoordinates):
2953 (RenderText::paint):
2954 * khtml/rendering/render_text.h:
2955 * kwq/KWQFontMetrics.h:
2956 * kwq/KWQFontMetrics.mm:
2957 (QFontMetrics::checkSelectionPoint):
2958 * kwq/WebCoreTextRenderer.h:
2960 === WebCore-145.1 ===
2962 2004-06-16 Maciej Stachowiak <mjs@apple.com>
2966 <rdar://problem/3697602> REGRESSION (144.2-TOT) Selection highlight does not draw
2968 * khtml/rendering/render_canvas.cpp:
2969 (RenderCanvas::setSelection):
2973 2004-06-16 Richard Williamson <rjw@apple.com>
2975 Fixed 3695730: Added support for embeds[], much like
2976 applets[], to allow access to a plugin's exported interface.
2980 * khtml/dom/html_document.cpp:
2981 (HTMLDocument::embeds):
2982 * khtml/dom/html_document.h:
2983 * khtml/ecma/kjs_dom.cpp:
2984 (KJS::getRuntimeObject):
2985 * khtml/ecma/kjs_html.cpp:
2986 (KJS::HTMLDocument::tryGet):
2987 (KJS::HTMLElement::tryGet):
2988 (KJS::HTMLCollection::tryGet):
2989 (KJS::HTMLCollection::getNamedItems):
2990 * khtml/ecma/kjs_html.h:
2991 (KJS::HTMLDocument::):
2992 * khtml/ecma/kjs_html.lut.h:
2994 * khtml/html/html_miscimpl.cpp:
2995 (HTMLCollectionImpl::calcLength):
2996 (HTMLCollectionImpl::getItem):
2997 (HTMLCollectionImpl::getNamedItem):
2998 * khtml/html/html_miscimpl.h:
2999 (DOM::HTMLCollectionImpl::):
3000 * khtml/html/html_objectimpl.cpp:
3001 (HTMLEmbedElementImpl::getEmbedInstance):
3002 * khtml/html/html_objectimpl.h:
3003 * kwq/KWQKHTMLPart.h:
3004 * kwq/KWQKHTMLPart.mm:
3005 (KWQKHTMLPart::getEmbedInstanceForView):
3007 2004-06-15 Maciej Stachowiak <mjs@apple.com>
3011 <rdar://problem/3695907>: (can't enable selection inside parent where it is disabled via CSS)
3013 * khtml/css/cssparser.cpp:
3014 (CSSParser::parseValue):
3015 * khtml/css/cssstyleselector.cpp:
3016 (khtml::CSSStyleSelector::applyProperty):
3017 * khtml/rendering/render_object.cpp:
3018 (RenderObject::shouldSelect):
3019 * khtml/rendering/render_style.h:
3021 (khtml::RenderStyle::userSelect):
3022 (khtml::RenderStyle::setUserSelect):
3023 (khtml::RenderStyle::initialUserSelect):
3025 2004-06-15 David Hyatt <hyatt@apple.com>
3027 Initial impl of the EllipsisBox. This code just gets the box created and gets it placed vertically. The next
3028 stage will be to position the box horizontally as well.
3032 * khtml/rendering/bidi.cpp:
3033 (khtml::RenderBlock::checkLinesForTextOverflow):
3034 * khtml/rendering/render_line.cpp:
3035 (RootInlineBox::placeEllipsis):
3036 * khtml/rendering/render_line.h:
3037 (khtml::EllipsisBox::m_str):
3039 2004-06-15 David Hyatt <hyatt@apple.com>
3041 Implement canAccommodateEllipsis. The basic idea is that everything on a line will allow an ellipsis to be
3042 drawn on top of it unless it's a replaced element. Then, if the replaced element overlaps, the ellipsis won't
3047 * khtml/rendering/bidi.cpp:
3048 (khtml::RenderBlock::checkLinesForTextOverflow):
3049 * khtml/rendering/render_line.cpp:
3050 (InlineBox::closestLeafChildForXPos):
3051 (InlineBox::canAccommodateEllipsis):
3052 (InlineFlowBox::canAccommodateEllipsis):
3053 (RootInlineBox::canAccommodateEllipsis):
3054 * khtml/rendering/render_line.h:
3056 2004-06-15 Vicki Murley <vicki@apple.com>
3058 - added a few layout tests, rdar://3694510
3060 * layout-tests/editing/deleting/delete-image-004-expected.txt: Added.
3061 * layout-tests/editing/deleting/delete-image-004.html: Added.
3062 * layout-tests/editing/selection/extend-by-character-006-expected.txt: Added.
3063 * layout-tests/editing/selection/extend-by-character-006.html: Added.
3065 2004-06-15 Trey Matteson <trey@apple.com>
3067 Dragging tweak: We pass the mouse down coords instead of the
3068 latest mouse drag coords to the ondragstart event. This makes it
3069 easy for the client to figure the correct drag image offset,
3070 whereas the mouse drag location is next to useless for that.
3074 * kwq/KWQKHTMLPart.mm:
3075 (KWQKHTMLPart::khtmlMouseMoveEvent):
3077 2004-06-15 Maciej Stachowiak <mjs@apple.com>
3081 <rdar://problem/3685236>: (Safari does not support onselectstart event handler)
3083 * khtml/ecma/kjs_dom.cpp:
3084 (DOMNode::getValueProperty):
3085 (DOMNode::putValue):
3086 * khtml/ecma/kjs_dom.h:
3088 * khtml/ecma/kjs_dom.lut.h:
3090 * khtml/html/html_elementimpl.cpp:
3091 (HTMLElementImpl::parseHTMLAttribute):
3092 * khtml/misc/htmlattrs.c:
3095 * khtml/misc/htmlattrs.h:
3096 * khtml/misc/htmlattrs.in:
3097 * khtml/rendering/render_object.cpp:
3098 (RenderObject::shouldSelect):
3099 * khtml/xml/dom2_eventsimpl.cpp:
3100 (EventImpl::typeToId):
3101 (EventImpl::idToType):
3102 * khtml/xml/dom2_eventsimpl.h:
3105 2004-06-15 Maciej Stachowiak <mjs@apple.com>
3109 Fix crash with last checkin.
3111 * khtml/ecma/kjs_binding.cpp:
3112 (ScriptInterpreter::domObjectsPerDocument): check the same
3113 property we want to initialize.
3115 2004-06-15 Maciej Stachowiak <mjs@apple.com>
3119 <rdar://problem/3685309>: (properties not shared for JS wrappers of same DOM object, accessed from different frames)
3121 * khtml/ecma/kjs_binding.cpp:
3122 (ScriptInterpreter::domObjects):
3123 (ScriptInterpreter::domObjectsPerDocument):
3124 (ScriptInterpreter::ScriptInterpreter):
3125 (ScriptInterpreter::forgetDOMObject):
3126 (ScriptInterpreter::getDOMObjectForDocument):
3127 (ScriptInterpreter::putDOMObjectForDocument):
3128 (ScriptInterpreter::deleteDOMObjectsForDocument):
3129 (ScriptInterpreter::mark):
3130 (ScriptInterpreter::forgetDOMObjectsForDocument):
3131 (ScriptInterpreter::updateDOMObjectDocument):
3132 * khtml/ecma/kjs_binding.h:
3133 (KJS::ScriptInterpreter::getDOMObject):
3134 (KJS::ScriptInterpreter::putDOMObject):
3135 (KJS::ScriptInterpreter::deleteDOMObject):
3137 2004-06-15 Darin Adler <darin@apple.com>
3139 - rolled out Ken's fix for <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply due to non-0 exception code trying to insert a DIV markup string
3140 (it was making most layout tests fail)
3142 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::checkAddChild): Rolled check back in.
3144 2004-06-15 David Hyatt <hyatt@apple.com>
3146 Add a truncation variable to text run boxes that will eventually be used to know how to cut out some of the glyphs when
3151 * khtml/rendering/render_text.cpp:
3152 (RenderText::clearTextOverflowTruncation):
3153 * khtml/rendering/render_text.h:
3154 (khtml::InlineTextBox:::InlineRunBox):
3155 (khtml::InlineTextBox::clearTruncation):
3157 2004-06-14 Darin Adler <darin@apple.com>
3161 - fixed some things for GC that Patrick missed, or that happened after the branch
3164 (-[DOMStyleSheet finalize]): Added.
3165 (-[DOMStyleSheetList finalize]): Added.
3166 (-[DOMCSSStyleSheet finalize]): Added.
3167 (-[DOMMediaList finalize]): Added.
3168 (-[DOMCSSRuleList finalize]): Added.
3169 (-[DOMCSSRule finalize]): Added.
3170 (-[DOMCSSStyleDeclaration finalize]): Added.
3171 (-[DOMCSSValue finalize]): Added.
3172 (-[DOMRGBColor finalize]): Added.
3173 (-[DOMRect finalize]): Added.
3174 (-[DOMCounter finalize]): Added.
3176 (-[DOMObject finalize]): Added.
3177 (-[DOMNode finalize]): Added.
3178 (-[DOMNamedNodeMap finalize]): Added.
3179 (-[DOMNodeList finalize]): Added.
3180 (-[DOMImplementation finalize]): Added.
3181 (-[DOMRange finalize]): Added.
3182 (-[DOMNodeFilter finalize]): Added.
3183 (-[DOMNodeIterator finalize]): Added.
3184 (-[DOMTreeWalker dealloc]): Removed unneeded nil check.
3185 (-[DOMTreeWalker finalize]): Added.
3187 (-[DOMHTMLCollection finalize]): Added.
3188 (-[DOMHTMLOptionsCollection finalize]): Added.
3189 * kwq/KWQClipboard.mm:
3190 (KWQClipboard::KWQClipboard): Use KWQRetain instead of retain.
3191 (KWQClipboard::~KWQClipboard): Use KWQRelease instead of release.
3192 * kwq/KWQEditCommand.mm:
3193 (-[KWQEditCommand finalize]): Added.
3195 (QFont::~QFont): Use KWQRelease instead of release.
3196 * kwq/KWQKHTMLPart.mm:
3197 (KWQKHTMLPart::keyEvent): Use KWQRetain instead of retain, and KWQRelease instead of release.
3198 (KWQKHTMLPart::mouseDown): Use KWQRetain instead of retain, and KWQRelease instead of release.
3199 (KWQKHTMLPart::mouseDragged): Use KWQRetain instead of retain, and KWQRelease instead of release.
3200 (KWQKHTMLPart::mouseUp): Use KWQRetain instead of retain, and KWQRelease instead of release.
3201 (KWQKHTMLPart::mouseMoved): Use KWQRetain instead of retain, and KWQRelease instead of release.
3202 (KWQKHTMLPart::sendContextMenuEvent): Use KWQRetain instead of retain, and KWQRelease instead of release.
3203 * kwq/KWQPageState.mm:
3204 (-[KWQPageState finalize]): Added. Filed <rdar://problem/3694163> about the fact that this is not right.
3206 (-[KWQSingleShotTimerTarget finalize]): Added.
3207 * kwq/WebCoreBridge.mm:
3208 (-[WebCoreBridge finalize]): Added. Filed <rdar://problem/3694165> about the fact that this is not right.
3210 2004-06-15 David Hyatt <hyatt@apple.com>
3212 Initial work on text truncation. Working top-down, I think I've made all the changes I will need to bidi.cpp
3213 and to the block code itself. The rest of the code can be concentrated in the render_line and render_text files.
3217 * khtml/rendering/bidi.cpp:
3218 (khtml::RenderBlock::layoutInlineChildren):
3219 (khtml::RenderBlock::findNextLineBreak):
3220 (khtml::RenderBlock::deleteEllipsisLineBoxes):
3221 (khtml::RenderBlock::checkLinesForTextOverflow):
3222 * khtml/rendering/render_block.h:
3223 * khtml/rendering/render_line.cpp:
3224 (RootInlineBox::detach):
3225 (RootInlineBox::detachEllipsisBox):
3226 (RootInlineBox::canAccommodateEllipsis):
3227 (RootInlineBox::placeEllipsis):
3228 * khtml/rendering/render_line.h:
3229 (khtml::RootInlineBox::RootInlineBox):
3230 * khtml/rendering/render_text.cpp:
3231 (RenderText::clearTextOverflowTruncation):
3232 * khtml/rendering/render_text.h:
3234 2004-06-14 Trey Matteson <trey@apple.com>
3236 3692690 - REGRESSION: canceling drag from WebView cause link to load
3237 Just need to take extra care to cancel any click handling in
3238 all cases once we're committed to doing the drag.
3242 * kwq/KWQKHTMLPart.mm:
3243 (KWQKHTMLPart::khtmlMouseMoveEvent): Call invalidateClick once
3244 we're past the hysteresis point, and definitely going to try
3245 to start a drag and drop.
3247 2004-06-14 Darin Adler <darin@apple.com>
3249 - fixed crash on boot
3251 * kwq/KWQFoundationExtras.h: (KWQRetainNSRelease):
3252 Fixed return value of this method; was uninitialized.
3254 2004-06-14 Trey Matteson <trey@apple.com>
3256 Dashboard wants access to pastboard data during the drag gesture.
3258 We address this need be allowing docs that are local files to access the
3259 pasteboard data during a drag, while other pages can only get at the types
3260 list until the drop happens. This is deemed safe because local files already
3261 have such broad super powers.
3267 (KURL::isLocalFile): Implement this QT method to look for the file scheme.
3268 * kwq/WebCoreBridge.mm:
3269 (-[WebCoreBridge dragOperationForDraggingInfo:]): Use more relaxed clipboard
3270 security for local file pages.
3271 (-[WebCoreBridge dragExitedWithDraggingInfo:]): Ditto.
3273 2004-06-14 Darin Adler <darin@apple.com>
3275 Reviewed by me, code changes by Patrick Beard.
3277 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
3279 * WebCore.pbproj/project.pbxproj: Added KWQFoundationExtras.h.
3280 * kwq/KWQFoundationExtras.h: Added.
3281 (KWQRetain): Cover for CFRetain that is tolerant of nil.
3282 (KWQRelease): Cover for CFRelease that is tolerant of nil.
3283 (KWQRetainNSRelease): Combination of a CFRetain and an -[NSObject release] that is tolerant of nil.
3284 Also includes a declaration of finalize so we can call [super finalize] without warnings on Panther.
3287 (ObjCNodeFilterCondition::ObjCNodeFilterCondition): Use CFRetain instead of retain.
3288 (ObjCNodeFilterCondition::~ObjCNodeFilterCondition): Use CFRelease instead of release.
3289 * kwq/KWQComboBox.mm:
3290 (QComboBox::~QComboBox): Use KWQRelease instead of release.
3291 (QComboBox::setFont): Use KWQRelease instead of release.
3292 (QComboBox::labelFont): Use KWQRetain instead of retain.
3294 (QCursor::QCursor): Use KWQRetain instead of retain.
3295 (QCursor::~QCursor): Use KWQRelease instead of release.
3296 (QCursor::operator=): More of the same.
3297 * kwq/KWQFileButton.mm:
3298 (KWQFileButton::KWQFileButton): Use KWQRetainNSRelease to retain a newly-allocated object.
3299 (KWQFileButton::~KWQFileButton): Use CFRelease instead of release.
3301 (QFont::QFont): Use KWQRetain instead of retain.
3302 (QFont::operator=): More of the same.
3303 (QFont::setFamily): Use KWQRelease instead of release.
3304 (QFont::setFirstFamily): Use KWQRelease instead of release.
3305 (QFont::setPixelSize): Use KWQRelease instead of release.
3306 (QFont::setWeight): Use KWQRelease instead of release.
3307 (QFont::setItalic): Use KWQRelease instead of release.
3308 (QFont::getNSFont): Use KWQRetain instead of retain.
3309 * kwq/KWQFontMetrics.mm:
3310 (QFontMetricsPrivate::~QFontMetricsPrivate): Use KWQRelease instead of release.
3311 (QFontMetricsPrivate::getRenderer): Use KWQRetain instead of retain.
3312 (QFontMetricsPrivate::setFont): Use KWQRelease instead of release.
3313 * kwq/KWQKHTMLPart.mm:
3314 (KWQKHTMLPart::~KWQKHTMLPart): Use KWQRelease instead of release.
3315 (KWQKHTMLPart::clearRecordedFormValues): Use KWQRelease instead of release.
3316 (KWQKHTMLPart::recordFormValue): Use KWQRetainNSRelease and use KWQRetain instead of retain.
3317 (KWQKHTMLPart::windowScriptObject): Use KWQRetainNSRelease.
3318 * kwq/KWQKJobClasses.mm:
3319 (KIO::TransferJobPrivate::TransferJobPrivate): Use KWQRetainNSRelease.
3320 (KIO::TransferJobPrivate::~TransferJobPrivate): Use KWQRelease instead of release.
3321 (KIO::TransferJob::setLoader): More of the same.
3323 (KWQRetainResponse): Use KWQRetain instead of retain.
3324 (KWQReleaseResponse): Use KWQRelease instead of release.
3325 * kwq/KWQPainter.mm:
3326 (QPainterPrivate::~QPainterPrivate): Use KWQRelease instead of release.
3327 (QPainter::_updateRenderer): More of the same.
3328 (QPainter::initFocusRing): Use KWQRetainNSRelease.
3329 (QPainter::clearFocusRing): Use KWQRelease instead of release.
3331 (QPixmap::QPixmap): Use KWQRetain instead of retain.
3332 (QPixmap::~QPixmap): Use KWQRelease instead of release.
3333 (QPixmap::receivedData): Use KWQRetain instead of retain.
3334 (QPixmap::resize): Use KWQRetainNSRelease and use KWQRelease instead of release.
3335 (QPixmap::operator=): More of the same.
3337 (QRegion::QRegion): Use KWQRetain instead of retain.
3338 (QRegion::~QRegion): Use KWQRelease instead of release.
3339 (QRegion::operator=): More of the same.
3341 (QTimer::start): Use KWQRetain instead of retain.
3342 (QTimer::stop): Use KWQRelease instead of release.
3343 (QTimer::fire): Use KWQRelease instead of release.
3345 (QWidget::QWidget): Use KWQRetain instead of retain.
3346 (QWidget::~QWidget): Use KWQRelease instead of release.
3347 (QWidget::setView): More of the same.
3348 * kwq/WebCoreSettings.mm: (-[WebCoreSettings finalize]):
3349 Delete the storage here, as well as in dealloc.
3351 2004-06-14 Maciej Stachowiak <mjs@apple.com>
3355 <rdar://problem/3693818>: (Safari should use CG calls for circle drawing for better performance)