3 2005-02-11 Darin Adler <darin@apple.com>
7 - fixed <rdar://problem/3915449> paths are relative to the old src URL after document.open, which is supposed to clear the document, including the URL
9 * khtml/xml/dom_docimpl.h: Added a new openInternal function for use by KHTMLPart.
10 * khtml/xml/dom_docimpl.cpp:
11 (DocumentImpl::open): Changed to do everything we did before, but also clear the URL and set the
12 base URL based on the enclosing document. This is the basic JavaScript/DOM operation of opening a
13 document, which is supposed to clear the document, including the URL. In the long run we might want
14 to do even more document "resetting and clearing" in here, but this URL clearing is what's needed
15 now to fix the most important problem.
16 (DocumentImpl::openInternal): Moved the old open code in here, except for the "parsing" check, which
17 is unnecessary and inappropriate in the one place we call this.
19 * khtml/khtml_part.cpp: (KHTMLPart::begin): Call openInternal instead of open.
21 2005-02-10 Ken Kocienda <kocienda@apple.com>
27 <rdar://problem/3992092> 8A374: Mail crash while pasting - RemoveNodeCommand
29 * khtml/editing/htmlediting.cpp:
30 (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in
31 the document. We try to do a good job of detecting all these cases, and generally do. This
32 one was missed. Fixed.
34 2005-02-10 Darin Adler <darin@apple.com>
38 - added support needed to fix <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined
40 * kwq/WebCoreBridge.h: Added selectionHasStyle: method.
41 * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part.
43 2005-02-10 Darin Adler <darin@apple.com>
47 - fixed <rdar://problem/3990484> cursor changes to I-beam when moving over text in widgets, even when selection off via CSS
49 * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent): Changed code to check canSelect when deciding
50 whether to show an I-beam cursor.
52 * khtml/rendering/render_object.h: Added canSelect.
53 * khtml/rendering/render_object.cpp:
54 (selectStartNode): Added. Helper function with the guts of shouldSelect.
55 (RenderObject::canSelect): Added. Like shouldSelect, but does not call the "start selecting" event handler.
56 (RenderObject::shouldSelect): Refactored to use selectStartNode.
58 * khtml/css/cssvalues.c: Regnerated with newer gperf.
60 2005-02-10 David Hyatt <hyatt@apple.com>
62 Fix for 3867759, .mac regression where scrollers don't show up. Make sure you can set the .width and
63 .height properties on the Image object.
65 Reviewed by John Sullivan
67 * khtml/ecma/kjs_html.cpp:
68 (ImageConstructorImp::construct):
69 (Image::getValueProperty):
72 * khtml/ecma/kjs_html.h:
74 2005-02-10 Ken Kocienda <kocienda@apple.com>
80 <rdar://problem/3965158> Drag-n-drop within a rich text message sometimes changes the color of the dragged text
82 This change fixes the bug....and much more. Now, for the first time, the paste code can do "smart merging"
83 or "smooshing" of styles during its operation. Since this new code is actively, rather than passively
84 working with styles, it fixes the bug, and lays the groundwork for similar work we need to do to
85 preserve quote levels in Mail.
87 * khtml/css/css_valueimpl.cpp:
88 (DOM::CSSMutableStyleDeclarationImpl::clear): New method.
89 (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
90 (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): Ditto.
91 (DOM::operator==): Add operator for CSSProperty.
92 * khtml/css/css_valueimpl.h: Declare new functions.
93 * khtml/editing/htmlediting.cpp:
94 (khtml::isEmptyStyleSpan): Improved the test in this function, rolling together the old implementation
95 with some code that did this work inline elsewhere. Sum of the parts is better than either test was by itself.
96 (khtml::isStyleSpan): Check for ID_SPAN.
97 (khtml::ApplyStyleCommand::removeCSSStyle): Call isEmptyStyleSpan. This was the place with an inline implementation before.
98 (khtml::ReplacementFragment::ReplacementFragment): Now takes a DocumentImpl argument. No longer does a "default style"
99 check, but rather calls functions which do a similar check to that, and much more.
100 (khtml::ReplacementFragment::~ReplacementFragment): Deref document, and computed styles.
101 (khtml::ReplacementFragment::styleForNode): New helper. Looks up and returns computed style for a node.
102 (khtml::ReplacementFragment::removeNodePreservingChildren): New helper.
103 (khtml::ReplacementFragment::computeStylesForNodes): New function which computes the "desired" style for
104 every node in the fragment. This information is used later after paste is done as a reference for testing
105 what styles need to be added, and which can be removed as redundant, from all the nodes inserted by the
107 (khtml::ReplacementFragment::removeStyleNodes): Clears out all style nodes from the fragment. They are
108 no longer needed after the call to computeStylesForNodes(),
109 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): Add a document to the call to initialize the
110 command's ReplacementFragment.
111 (khtml::ReplaceSelectionCommand::doApply): Call applyStyleToInsertedNodes() after inserting nodes to make
112 styles come out right.
113 (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): This is the "style smooshing" function. It
114 computes the styles that need to be added to each node inserted, comparing the style it gets from just
115 being inserted into its correct destination with the computed "desired style" done in the
116 ReplacementFragment constructor. It then adds in all the necessary styles, and will also remove redundant styles.
117 * khtml/editing/htmlediting.h: Update declarations and member variables as needed.
118 * khtml/editing/markup.cpp:
119 (khtml::startMarkup): Add additional style annotations to the markup we generate, so that paste code can preserve it.
120 (khtml::markup): Ditto.
121 (khtml::createMarkup): Ditto.
123 These test results are subtly better with this change. They no longer have an unneeded empty span.
124 Visually the same as before.
126 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
127 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
128 * layout-tests/editing/style/remove-underline-expected.txt
129 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt
133 * layout-tests/editing/style/smoosh-styles-001-expected.txt
134 * layout-tests/editing/style/smoosh-styles-002-expected.txt
135 * layout-tests/editing/style/smoosh-styles-001.html
136 * layout-tests/editing/style/smoosh-styles-002.html
138 2005-02-10 Darin Adler <darin@apple.com>
142 - fixed <rdar://problem/3974988> WebHTMLView drops scroll wheel events when deltas are 0
144 * kwq/WebCoreScrollView.m: (-[WebCoreScrollView autoforwardsScrollWheelEvents]): Added, for Tiger only.
145 For Tiger, removed the override of scrollWheel:, which doesn't work quite right because of how the
146 delta attributes return all 0 for newfangled scrolling events from the new trackpads.
148 2005-02-10 David Harrison <harrison@apple.com>
152 <rdar://problem/3991532> REGRESSION (Mail): Triple-click on trailing blank line should select previous line but doesn't
154 * khtml/css/cssvalues.c:
157 * khtml/editing/selection.cpp:
158 (khtml::Selection::validate):
159 Do moral equiavalent of LeftWordIfOnBoundary for PARAGRAPH.
161 2005-02-10 David Harrison <harrison@apple.com>
165 <rdar://problem/3991848> Double-click on first character selects wrong item
167 * khtml/editing/selection.cpp:
168 (khtml::Selection::validate):
169 Honor the fact that clicking on a character positions the cursor on the left side of the character.
171 2005-02-10 David Hyatt <hyatt@apple.com>
173 Fix for 3980778, repro crash in RootInlineBox::paint. Make sure that when merging blocks we dirty them for layout
174 up front. That way as we do the merge, we dont attempt to examine the lines in dirtyLinesForChangedChild.
178 * khtml/rendering/render_block.cpp:
179 (khtml::RenderBlock::removeChild):
181 2005-02-10 David Hyatt <hyatt@apple.com>
183 Fix for 3987010, fix a bug that caused the self-collapsing-block-cleared-float bit to never get set correctly.
187 * khtml/rendering/render_block.h:
188 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
190 2005-02-10 David Hyatt <hyatt@apple.com>
192 Fix for 3992440, text not wrapping correctly on half moon bay web site. Refine an incorrect optimization I
193 added to be less restrictive.
197 * khtml/rendering/render_block.cpp:
198 (khtml::RenderBlock::layoutBlockChildren):
200 2005-02-08 Maciej Stachowiak <mjs@apple.com>
204 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow
206 I fixed this by removing all event listeners for a document, it's
207 children, and any disconnected nodes that used to be in the
208 document at document detach time. Mozilla temporarily disables
209 event listeners on such nodes, but re-enables them if you
210 re-parant a node into a new document. However, in WebCore, you
211 can't re-parent a node into another document, so there is no
212 observable change in behavior.
214 We have to do this to break the possible reference cycles between
215 event listeners and the dom nodes they are attached to (e.g. via
216 scope chain, as in this case).
218 * khtml/xml/dom_docimpl.cpp:
219 (DocumentImpl::detach):
220 (DocumentImpl::removeAllEventListenersFromAllNodesx):
221 (DocumentImpl::registerDisconnectedNodeWithEventListeners):
222 (DocumentImpl::unregisterDisconnectedNodeWithEventListeners):
223 (DocumentImpl::removeAllDisconnectedNodeEventListeners):
224 * khtml/xml/dom_docimpl.h:
225 * khtml/xml/dom_nodeimpl.cpp:
226 (NodeImpl::~NodeImpl):
227 (NodeImpl::addEventListener):
228 (NodeImpl::removeEventListener):
229 (NodeImpl::removeAllEventListeners):
230 (NodeImpl::removeHTMLEventListener):
231 (NodeImpl::insertedIntoDocument):
232 (NodeImpl::removedFromDocument):
233 * khtml/xml/dom_nodeimpl.h:
235 2005-02-09 Chris Blumenberg <cblu@apple.com>
237 Fixed: <rdar://problem/3999213> Sometimes 2 Windows Media Player plugin instances are loaded
241 * khtml/html/html_objectimpl.cpp:
242 (HTMLObjectElementImpl::attach): Set needWidgetUpdate to false before calling updateWidget because updateWidget may cause this method or another method (which also calls updateWidget) to be called.
243 (HTMLObjectElementImpl::recalcStyle): ditto
245 2005-02-09 David Harrison <harrison@apple.com>
249 <rdar://problem/3937447> Mail-689: Arrow key navigation in new message body stops working when a line ends with a bold word
251 Added affinity to VisiblePosition. Changed Selection code to use affinity more.
253 (Partial) <rdar://problem/3982096> editing/pasteboard/paste-text-007 is failing
255 Changed ReplaceSelectionCommand to also pay attention to the top children of the incoming fragment, not just the very last node inserted, when deciding whether to insert a paragraph for the Apple interchange newline.
257 * khtml/ecma/kjs_window.cpp:
258 (SelectionFunc::tryCall):
259 * khtml/editing/htmlediting.cpp:
260 (khtml::EditCommandPtr::setStartingSelection):
261 (khtml::EditCommandPtr::setEndingSelection):
262 (khtml::EditCommand::setStartingSelection):
263 (khtml::EditCommand::setEndingSelection):
264 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream):
265 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
266 (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
267 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
268 (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
269 (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
270 (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
271 (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
272 (khtml::ApplyStyleCommand::joinChildTextNodes):
273 (khtml::DeleteSelectionCommand::initializePositionData):
274 (khtml::DeleteSelectionCommand::handleGeneralDelete):
275 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
276 (khtml::DeleteSelectionCommand::doApply):
277 (khtml::InsertLineBreakCommand::doApply):
278 (khtml::InsertParagraphSeparatorCommand::doApply):
279 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
280 (khtml::InsertTextCommand::input):
281 (khtml::MoveSelectionCommand::doApply):
282 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
283 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
284 (khtml::ReplaceSelectionCommand::doApply):
285 (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
286 (khtml::ReplaceSelectionCommand::updateNodesInserted):
287 (khtml::TypingCommand::deleteKeyPressed):
288 (khtml::TypingCommand::forwardDeleteKeyPressed):
289 (khtml::TypingCommand::markMisspellingsAfterTyping):
290 * khtml/editing/htmlediting.h:
291 * khtml/editing/selection.cpp:
292 (khtml::Selection::Selection):
293 (khtml::Selection::init):
294 (khtml::Selection::moveTo):
295 (khtml::Selection::modifyExtendingRightForward):
296 (khtml::Selection::modifyMovingRightForward):
297 (khtml::Selection::modifyExtendingLeftBackward):
298 (khtml::Selection::modifyMovingLeftBackward):
299 (khtml::Selection::modify):
300 (khtml::Selection::xPosForVerticalArrowNavigation):
301 (khtml::Selection::clear):
302 (khtml::Selection::setBase):
303 (khtml::Selection::setExtent):
304 (khtml::Selection::setBaseAndExtent):
305 (khtml::Selection::layout):
306 (khtml::Selection::validate):
307 * khtml/editing/selection.h:
308 (khtml::Selection::startAffinity):
309 (khtml::Selection::endAffinity):
310 (khtml::Selection::baseAffinity):
311 (khtml::Selection::extentAffinity):
313 * khtml/editing/text_affinity.h:
315 * khtml/editing/visible_position.cpp:
316 (khtml::VisiblePosition::VisiblePosition):
317 (khtml::VisiblePosition::init):
318 (khtml::VisiblePosition::initUpstream):
319 (khtml::VisiblePosition::initDownstream):
320 (khtml::VisiblePosition::next):
321 (khtml::VisiblePosition::previous):
322 (khtml::startVisiblePosition):
323 (khtml::endVisiblePosition):
324 * khtml/editing/visible_position.h:
325 (khtml::VisiblePosition::):
326 (khtml::VisiblePosition::VisiblePosition):
327 (khtml::VisiblePosition::affinity):
328 (khtml::VisiblePosition::setAffinity):
330 * khtml/editing/visible_units.cpp:
331 (khtml::previousBoundary):
332 (khtml::nextBoundary):
333 (khtml::startOfLine):
335 (khtml::previousLinePosition):
336 (khtml::nextLinePosition):
337 (khtml::startOfParagraph):
338 (khtml::endOfParagraph):
339 (khtml::previousParagraphPosition):
340 (khtml::nextParagraphPosition):
341 (khtml::startOfBlock):
343 (khtml::startOfDocument):
344 (khtml::endOfDocument):
345 * khtml/editing/visible_units.h:
346 * khtml/khtml_part.cpp:
347 (KHTMLPart::findTextNext):
348 (KHTMLPart::selectClosestWordFromMouseEvent):
349 (KHTMLPart::handleMousePressEventTripleClick):
350 (KHTMLPart::handleMousePressEventSingleClick):
351 (KHTMLPart::handleMouseMoveEventSelection):
352 (KHTMLPart::khtmlMouseReleaseEvent):
353 (KHTMLPart::selectAll):
354 (KHTMLPart::computeAndSetTypingStyle):
355 (KHTMLPart::selectionComputedStyle):
356 * khtml/rendering/render_br.cpp:
357 (RenderBR::positionForCoordinates):
358 * khtml/xml/dom_docimpl.cpp:
359 (DocumentImpl::updateSelection):
360 * khtml/xml/dom_nodeimpl.cpp:
361 (NodeBaseImpl::setFocus):
362 * khtml/xml/dom_position.cpp:
363 (DOM::Position::previousCharacterPosition):
364 (DOM::Position::nextCharacterPosition):
365 * khtml/xml/dom_position.h:
366 * kwq/KWQAccObject.mm:
367 (-[KWQAccObject value]):
368 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
369 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
370 (-[KWQAccObject accessibilityAttributeValue:]):
371 (-[KWQAccObject doAXLineForTextMarker:]):
372 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
373 (-[KWQAccObject doAXTextMarkerForPosition:]):
374 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
375 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
376 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
377 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
378 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
379 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
380 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
381 * kwq/KWQAccObjectCache.mm:
382 (KWQAccObjectCache::textMarkerForVisiblePosition):
383 (KWQAccObjectCache::visiblePositionForTextMarker):
384 * kwq/KWQKHTMLPart.mm:
385 (KWQKHTMLPart::findString):
386 (KWQKHTMLPart::advanceToNextMisspelling):
387 (KWQKHTMLPart::styleForSelectionStart):
388 (KWQKHTMLPart::baseWritingDirectionForSelectionStart):
389 (KWQKHTMLPart::setSelectionFromNone):
390 (KWQKHTMLPart::respondToChangedSelection):
391 * kwq/WebCoreBridge.mm:
392 (-[WebCoreBridge setSelectedDOMRange:affinity:]):
393 (-[WebCoreBridge selectionAffinity]):
394 (-[WebCoreBridge setMarkDOMRange:]):
395 (-[WebCoreBridge _visiblePositionForPoint:]):
396 (-[WebCoreBridge moveDragCaretToPoint:]):
397 (-[WebCoreBridge editableDOMRangeForPoint:]):
398 (-[WebCoreBridge ensureSelectionVisible]):
399 (-[WebCoreBridge rangeOfCharactersAroundCaret]):
401 2005-02-09 Chris Blumenberg <cblu@apple.com>
403 Fixed: <rdar://problem/3985211> Seed: Mail: Drag-and-drop destination indicator / insertion point disappears
405 Reviewed by kocienda.
407 * khtml/rendering/render_block.cpp:
408 (khtml::RenderBlock::paintCaret): new
409 (khtml::RenderBlock::paintObject): call paintCaret for the cursor caret and the drag caret
410 * khtml/rendering/render_block.h:
414 2005-02-08 Ken Kocienda <kocienda@apple.com>
420 <rdar://problem/3996344> Entire document content is deleted when only the first paragraph was supposed to be
422 Problem stems from my attempt to fix this bug: <rdar://problem/3986155> Insertion point goes
423 to beginning of doc after deleting.
425 I added an "optimization" that proved to do more harm than good. So, basically, the fix is to remove code.
427 * khtml/editing/htmlediting.cpp:
428 (khtml::DeleteSelectionCommand::handleGeneralDelete)
430 2005-02-07 Darin Adler <darin@apple.com>
434 - fixed <rdar://problem/3890352> REGRESSION (125-170, Panther-only): pasted textarea contents disappear (exception in NSText)
436 * kwq/KWQTextArea.mm: (-[KWQTextArea tile]): Don't resize the text view immediately here.
437 Use performWithDelay to defer it to avoid the re-entrancy that bothers the Panther version
438 of NSTextView. On Tiger, leave the code alone.
440 2005-02-07 Adele Amchan <adele@apple.com>
444 Fix for <rdar://problem/3993628> REGRESSION (180-181): Logitelnet bank's website doesn't work
446 This fixes an oversight in the fix for <rdar://problem/3964286>.
447 We're now making sure there is a document before calling checkCompleted in slotLoaderRequestDone.
448 That function is called even when other parts finish loads of their subresources, so we could end
449 up calling checkCompleted before we had a document. We also looked over all the other calls to
450 checkCompleted to convince ourselves no other call sites had a similar issue.
452 * khtml/khtml_part.cpp: (KHTMLPart::slotLoaderRequestDone): Check if doc is nil before calling
455 2005-02-07 Ken Kocienda <kocienda@apple.com>
461 <rdar://problem/3953302> Replacing quoted text ends up with blue-colored text that is not quoted
463 * khtml/editing/htmlediting.cpp:
464 (khtml::DeleteSelectionCommand::doApply): Removed special case delete code for select all. It was
465 causing as many bugs as it fixed. What's more, the design concept is a bit shaky. By removing
466 this special case, the bug goes away.
467 * khtml/editing/htmlediting.h: Remove declaration.
469 Test results using selectAll() updated to reflect changed behavior.
471 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
472 * layout-tests/editing/deleting/delete-select-all-001-expected.txt:
473 * layout-tests/editing/deleting/delete-select-all-003-expected.txt:
474 * layout-tests/editing/inserting/insert-3654864-fix-expected.txt:
475 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
476 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt:
477 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt:
478 * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
480 2005-02-06 Darin Adler <darin@apple.com>
484 - fixed <rdar://problem/3994164> setting a new style attribute with setAttribute("style") doesn't blow away the old style
486 * khtml/css/css_valueimpl.h: Renamed parseProperty to parseDeclaration, since it's used to parse
487 an entire style declaration, not a single property.
488 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::parseDeclaration): Renamed,
489 and added code to clear m_values.
490 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Call function by its
491 new name, and remove some unnecessary comments.
493 2005-02-06 Darin Adler <darin@apple.com>
497 - fixed <rdar://problem/3993722> need oncut and onpaste handlers implemented for <textarea> (needed for widgets)
499 * kwq/KWQTextArea.mm:
500 (-[KWQTextAreaTextView dispatchHTMLEvent:]): Added.
501 (-[KWQTextAreaTextView cut:]): Dispatch "before cut" and "cut" events.
502 (-[KWQTextAreaTextView copy:]): Dispatch "before copy" and "copy" events.
503 (-[KWQTextAreaTextView paste:]): Dispatch "before paste" and "paste" events.
504 (-[KWQTextAreaTextView pasteAsPlainText:]): Ditto.
505 (-[KWQTextAreaTextView pasteAsRichText:]): Ditto.
507 2005-02-06 Darin Adler <darin@apple.com>
511 - fixed <rdar://problem/3943038> <input type=search> that is focused in onload handler doesn't have a visible editor
513 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setFocusNode): Always update layout before giving focus to a widget.
514 This prevents the bad case where we give a widget focus before it has been positioned or sized, causing us to
515 exercise edge cases AppKit doesn't handle well.
517 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Remove workaround code I added
518 to fix bug 3943049. Updating the layout fixes the same problem in a cleaner, safer way, and solves another problem,
519 with the way the clip view is set up.
521 2005-02-06 Darin Adler <darin@apple.com>
525 - fixed <rdar://problem/3425232> textarea won't trigger onchange action when clicking to new field
527 * khtml/rendering/render_form.h: Added new m_dirty data member.
528 * khtml/rendering/render_form.cpp:
529 (RenderTextArea::RenderTextArea): Initialize m_dirty to false.
530 (RenderTextArea::detach): Call value() on the DOM element to cause it to fetch the value from this object.
531 (RenderTextArea::handleFocusOut): Ditto. Also send the onchange event based only on the m_dirty flag.
532 (RenderTextArea::updateFromElement): Clear the m_dirty flag if the edited value is blown away by a value
533 that comes from the DOM element. Remove code to clear the element's m_dirtyvalue flag; that's an unnecessary
534 optimization, and ideally we'll stop having code in the render object that knows about that flag later.
535 (RenderTextArea::slotTextChanged): Set the m_dirty flag.
537 2005-02-06 Darin Adler <darin@apple.com>
541 - re-fixed <rdar://problem/3760910> please add support for custom tag names in HTML
543 * khtml/xml/dom_docimpl.cpp:
544 (DocumentImpl::tagId): Use ID_LAST_TAG + 1 for the ID of the first assigned tag ID. Before we'd use ID_LAST_TAG,
545 which resulted in the same number being used for ID_COMMENT and the first custom tag.
546 (DocumentImpl::tagName): Use ID_LAST_TAG + 1, as above.
547 (DocumentImpl::namespaceURI): Change a < ID_LAST_TAG to <= ID_LAST_TAG in the same spirit as above.
549 2005-02-06 Darin Adler <darin@apple.com>
553 - fixed <rdar://problem/3986639> Crash occurs after choosing Undo Typing from the Edit menu
555 * kwq/KWQTextArea.mm: (-[KWQTextArea viewWillMoveToWindow:]): Remove actions from undo manager when the view is
556 removed from the window. Unfortunately, to do this the code has to know that the target of NSTextView actions
557 will be the text storage object, but given the NSText architecture, that's pretty clear.
559 2005-02-05 Chris Blumenberg <cblu@apple.com>
561 Fixed: <rdar://problem/3991974> REGRESSION: www.jabra.com world location screen does not work
565 * kwq/KWQKJavaAppletWidget.mm:
566 (KJavaAppletWidget::KJavaAppletWidget): fallback to the document's base URL if there is no baseURL attribute
567 * kwq/WebCoreBridge.h:
568 * kwq/WebCoreBridge.mm:
569 (-[WebCoreBridge baseURL]): new
571 2005-02-04 David Harrison <harrison@apple.com>
575 Rolled out Ken's accidental checkin when committing <rdar://problem/3986155> fix yesterday.
577 * khtml/editing/selection.cpp:
578 (khtml::Selection::validate):
580 2005-02-04 Adele Amchan <adele@apple.com>
584 Fix for <rdar://problem/3758785> Safari no longer works at BankOfAmerica online banking for military users
586 When closing the document, if a body doesn't exist we now create one. This bug was preventing the onload handler from
587 firing in cases where there wasn't a body. In the BankOfAmerica case, the page was just a bit of script where the onload
588 handler redirected to the correct page.
590 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):
592 2005-02-03 Ken Kocienda <kocienda@apple.com>
598 <rdar://problem/3986155> Insertion point goes to beginning of doc after deleting
600 * khtml/editing/htmlediting.cpp:
601 (khtml::DeleteSelectionCommand::setStartNode): New convenience to handle reference counting when setting.
602 (khtml::DeleteSelectionCommand::handleGeneralDelete): This contains the crux of the bug fix. Improve tests
603 that detect when a selected node needs to be retained, rather than deleted, to preserve the intent of the user.
604 This has the side effect of causing the insertion point placement code to succeed rather than fail. Before
605 this fix, the failure of the insertion point placement code caused the insertion point to jump to the start
606 of the document, which is the symptom that can be perceived by users when editing.
607 * khtml/editing/htmlediting.h: Add setStartNode declaration.
608 * khtml/editing/visible_units.cpp:
609 (khtml::startOfBlock): This function had a stubbed-in non-tested implementation. Implement and
610 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001-expected.txt: Added.
611 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001.html: Added.
612 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt: Added.
613 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002.html: Added.
614 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt: Added.
615 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003.html: Added.
616 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt: Added.
617 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004.html: Added.
618 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005-expected.txt: Added.
619 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005.html: Added.
620 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006-expected.txt: Added.
621 * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006.html: Added.
625 2005-02-03 Richard Williamson <rjw@apple.com>
627 Fixed <rdar://problem/3987419> Stocks and Weather leak what appears to XMLHTTPRequest results
629 XMLHTTPRequests were causing massive leaks. _webcore_initWithHeaderString: did funky things with
630 self replacement. Re-wrote to use more traditional factory constructor avoiding self replacement.
632 Reviewed by David Harrison.
635 (+[NSDictionary _webcore_dictionaryWithHeaderString:]):
637 (KWQServeSynchronousRequest):
639 2005-02-03 Chris Blumenberg <cblu@apple.com>
641 Fixed: <rdar://problem/3938763> Cannot view Windows Media Player videos (soundtrack is played twice with delay)
645 * khtml/html/html_objectimpl.cpp:
646 (HTMLObjectElementImpl::attach): set needWidgetUpdate to false right after calling updateWidget because dispatchHTMLEvent can end up calling this method again
647 (HTMLObjectElementImpl::recalcStyle): ditto
649 2005-02-02 John Sullivan <sullivan@apple.com>
653 - WebCore part of fix for <rdar://problem/3980651> REGRESSION (125-180): Huge number of pages printed from certain page,
656 This also fixes the problems with printing from GMail, yay!
658 * khtml/rendering/render_flow.cpp:
659 (RenderFlow::paintLines):
660 If the current line is taller than the entire page height (e.g. tall iFrame), don't try
661 to avoid splitting it across pages.
663 * kwq/WebCoreBridge.mm:
664 (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
665 Handle error cases in a more obvious manner; this will cause future problems like this
666 to print a blank page and complain to the console on debug builds, rather than print a
667 zillionty mostly-blank pages.
669 2005-02-02 Chris Blumenberg <cblu@apple.com>
671 Fixed: <rdar://problem/3960304> can't load a particular applet (at www.escape.de) unless it's the first applet to be loaded
675 * khtml/rendering/render_frames.cpp:
676 (RenderPartObject::updateWidget): when getting the MIME type from the PARAM tag, make sure the MIME type is the text from the left of the semi-colon if there is one. We do this elsewhere as well.
678 2005-02-02 Chris Blumenberg <cblu@apple.com>
680 Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)
684 * kwq/KWQKHTMLPart.mm:
685 (KWQKHTMLPart::sendContextMenuEvent): check if SPI to always enable selecting closest word is enabled
686 * kwq/WebCoreBridge.h:
688 2005-02-02 Ken Kocienda <kocienda@apple.com>
692 * khtml/editing/markup.cpp:
693 (khtml::createMarkup): Removed debug spam I committed earlier in error.
695 2005-02-02 Ken Kocienda <kocienda@apple.com>
701 <rdar://problem/3823109> WebKit should support -toggleBaseWritingDirection: (bidi editing support)
703 Since base writing direction is a paragraph-level property in AppKit, and we use the CSS direction
704 property in WebCore, which can be applied to inline elements as well as blocks, a new notion has
705 been added to the WebCore apply style logic. It is now possible to force all properties in a
706 style declaration to be applied as though they were block properties.
708 * khtml/editing/htmlediting.cpp:
709 (khtml::ApplyStyleCommand::ApplyStyleCommand): Add an enum and a flag to this command that controls whether to force all
710 properties in the style to be applied as block styles. Default is "no", retaining previous behavior.
711 (khtml::ApplyStyleCommand::doApply): Switch on new flag to apply styles as before, or force all preoperties to be applied
713 * khtml/editing/htmlediting.h:
714 (khtml::ApplyStyleCommand::): Add an enum and a flag, as above.
715 * khtml/khtml_part.cpp:
716 (KHTMLPart::applyParagraphStyle): New method to force application of all style properties as block styles.
717 * khtml/khtml_part.h: Update header declarations.
718 * kwq/KWQKHTMLPart.h: Update header declarations.
719 * kwq/KWQKHTMLPart.mm:
720 (KWQKHTMLPart::baseWritingDirectionForSelectionStart): Accessor to help WebKit do a toggle operation on
722 * kwq/WebCoreBridge.h: Update header declarations.
723 * kwq/WebCoreBridge.mm:
724 (-[WebCoreBridge applyParagraphStyle:withUndoAction:]): New method to force application of all style properties as block styles.
725 (-[WebCoreBridge baseWritingDirectionForSelectionStart]): Accessor to help WebKit do a toggle operation on
730 <rdar://problem/3985035> REGRESSION (Mail): Text copied from wrapped line contains extra character when pasted
732 * khtml/editing/markup.cpp:
733 (khtml::renderedText): Add an enum and a flag to this command that controls whether to force all
734 This is the result of an error in the code that computes the rendered text that is selected
735 when copying. Since spaces collapse at the end of lines, and these spaces need to be copied
736 when the selection spans line endings, code runs to compute this text. However, this code
737 was also running incorrectly in cases where lines wrapped. I have now added the missing
738 test to check that the selection does indeed extend to the end of the line.
741 2005-02-02 Ken Kocienda <kocienda@apple.com>
747 <rdar://problem/3984894> REGRESSION (Mail): Command-right-arrow in reply does the wrong thing (two ways)
748 <rdar://problem/3985130> REGRESSION (Mail): command-right-arrow in pasted RTF selects only up to tab
750 * khtml/editing/visible_units.cpp:
751 (khtml::endOfLine): Two separate problems in this new function recently added to take the place of
752 selectionForLine. In the first, endOfLine did not stop at BR elements, and returned the position
753 beyond them. In the second, the VisiblePosition constructor gives the wrong answer in certain cases.
754 Darin is going to work on a solution for that problem. In the meantime, I can fix the symptom of this
755 bug by going down to the last leaf child of the root line box; a one line change we will roll out when
758 2005-02-01 Richard Williamson <rjw@apple.com>
760 Fixed <rdar://problem/3985535> QT Plug-in JavaScript support now fails in <embed> tag only case
764 * khtml/ecma/kjs_html.cpp:
765 (KJS::HTMLDocument::tryGet):
767 2005-02-01 John Sullivan <sullivan@apple.com>
769 Written by Darin, reviewed and tested by me
771 - fixed <rdar://problem/3969684> Panther-only: extra blank lines between
772 pasted content from Blot
774 * kwq/KWQKHTMLPart.mm:
775 (KWQKHTMLPart::attributedString):
776 don't emit paragraph breaks if the margins are tiny; matches what
777 we do for plain-text conversion
781 2005-02-01 Ken Kocienda <kocienda@apple.com>
787 <rdar://problem/3985160> Deficiencies in pasting architecture blocking progress on other bugs
789 * khtml/editing/html_interchange.h: Move style span text used to mark element added to
790 add style to this header.
791 * khtml/editing/htmlediting.cpp:
792 (khtml::styleSpanClassString): Change to use constant moved to html_interchange.h.
793 (khtml::isStyleSpan): New helper function. Checks if this is a span we added to apply style.
794 (khtml::CompositeEditCommand::insertNodeBefore): Added an assert to check that the node
795 we are inserting before is not the body.
796 (khtml::CompositeEditCommand::insertNodeAfter): Ditto, but check is for after.
797 (khtml::ReplacementFragment::ReplacementFragment): Added code to process the "default style"
798 that is added by the copy code.
799 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): first and last nodes inserted are
800 now member variables instead of function locals. Initialize them here.
801 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): Deref first and last nodes inserted
803 (khtml::ReplaceSelectionCommand::doApply): Change design to fix the bug. Major change is to
804 separate out the code that inserts nodes into the tree so additional styling checks can
805 be done in a centralized way. Also got rid of the notion of "merging into the end block." That
806 concept was just wrong.
807 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Tweak interface now that first and
808 last nodes inserted are member variables.
809 (khtml::ReplaceSelectionCommand::insertNodeAfterAndUpdateNodesInserted): New helper used
810 by replace code to do the stated DOM operation and update state internal to the command.
811 This will also be a catch point to handle the kinds of additional style checks needed to
812 make paste work right.
813 (khtml::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted): Ditto.
814 (khtml::ReplaceSelectionCommand::insertNodeBeforeAndUpdateNodesInserted): Ditto.
815 (khtml::ReplaceSelectionCommand::updateNodesInserted): Ditto.
816 * khtml/editing/htmlediting.h: Update declarations as needed.
817 * khtml/editing/markup.cpp:
818 (khtml::createMarkup): Adds a "default style" span to the content written to the pasteboard.
819 This will help us to fix some of the bugs blocked by the bug above.
820 * khtml/xml/dom_nodeimpl.cpp:
821 (NodeImpl::lastDescendent): New helper.
822 * khtml/xml/dom_nodeimpl.h: Ditto.
823 * khtml/xml/dom_position.cpp:
824 (DOM::Position::upstream): Fixed a bug which would allow the upstream position returned to be
825 in unrendered content.
826 (DOM::Position::downstream): Ditto.
828 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Ending positions tweaked due to
829 changes in upstream() and downstream() functions.
830 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Ditto
831 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Ditto
832 * layout-tests/editing/selection/extend-by-character-006-expected.txt: Ditto
834 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Changed what we expect, given
835 new behavior of paste code.
837 2005-01-31 John Sullivan <sullivan@apple.com>
839 Reviewed by Dave Hyatt.
841 - fixed <rdar://problem/3983097> Tabbing on RSS pages gets stuck in search field
842 with "full keyboard navigation" off
846 (QSlider::focusPolicy):
847 Implemented this method for KWQSlider. It is needed for our widget subclasses that
848 can become focused in some situations. I missed this when fixing 3949203 because
849 it only comes into play when tab-to-controls is on, and because the other relevant
850 methods are objective-C methods.
852 2005-01-31 David Harrison <harrison@apple.com>
856 <rdar://problem/3964164> AXWebArea needs to unregister on going invisible
858 * khtml/xml/dom_docimpl.cpp:
859 (DocumentImpl::detach):
860 Detach the AX UIElement for the AXWebArea.
862 2005-01-31 David Harrison <harrison@apple.com>
866 <rdar://problem/3850876> AX: button exposed as only an AXImage at http://appleseed.apple.com/ site (<input type=image>)
868 * khtml/rendering/render_form.h:
869 (khtml::RenderImageButton::isImageButton):
871 * khtml/rendering/render_image.h:
872 (khtml::RenderImage::isImageButton):
874 * kwq/KWQAccObject.mm:
875 (-[KWQAccObject isImageButton]):
876 (-[KWQAccObject actionElement]):
877 (-[KWQAccObject role]):
878 (-[KWQAccObject accessibilityActionNames]):
879 (-[KWQAccObject accessibilityPerformAction:]):
880 Represent RenderImageButton elements as buttons instead of images.
882 2005-01-31 David Harrison <harrison@apple.com>
884 Prevent nil dereference in debug code.
886 * khtml/xml/dom_nodeimpl.cpp:
887 (NodeImpl::displayTree):
888 Stop when parent is 0, too.
890 2005-01-31 John Sullivan <sullivan@apple.com>
892 Reviewed by Dave Hyatt.
894 - fixed <rdar://problem/3949203> cannot tab to, within, or out of the RSS sidebar
897 (-[KWQSlider becomeFirstResponder]):
898 (-[KWQSlider resignFirstResponder]):
899 (-[KWQSlider nextKeyView]):
900 (-[KWQSlider previousKeyView]):
901 (-[KWQSlider canBecomeKeyView]):
902 (-[KWQSlider nextValidKeyView]):
903 (-[KWQSlider previousValidKeyView]):
904 Copied these methods from KWQButton. The lack of special handling for first-responder-ness
905 here was causing the focus to get "stuck" on the RSS page's slider widget. Added FIXME
906 about how it would be nice to share more of this code rather than replicating it in each
909 2005-01-31 Darin Adler <darin@apple.com>
911 Reviewed by Harrison.
913 - fixed <rdar://problem/3980066> Double-click on single character moves insertion point to previous line
915 * khtml/khtml_part.cpp:
916 (KHTMLPart::selectClosestWordFromMouseEvent): Set affinity too.
917 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
918 (KHTMLPart::handleMouseMoveEventSelection): Ditto.
919 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
921 * khtml/editing/selection.cpp:
922 (khtml::Selection::modifyExtendingRightForward): Use endOfLine and endOfDocument.
923 (khtml::Selection::modifyMovingRightForward): Ditto.
924 (khtml::Selection::modifyExtendingLeftBackward): Use startOfLine and startOfDocument.
925 (khtml::Selection::modifyMovingLeftBackward): Ditto.
926 (khtml::Selection::validate): Rewrote the section that handles double-click. Two main fixes: 1) use isStartOfLine to
927 check for another case where we want to select the word to the right, and 2) use isEndOfParagraph, which seems
928 to work correctly in cases where isLastVisiblePositionInParagraph is giving the wrong answer. Also changed the line
929 code to use startOfLine/endOfLine and the document code to use startOfDocument/endOfDocument.
931 2005-01-31 Darin Adler <darin@apple.com>
933 Reviewed by Harrison.
935 - fixed <rdar://problem/3935275> unexpected quit scrolling over link; last.fm (works in IE and Firefox)
937 * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): By using the correct document, fix the crash reported here.
938 The page still crashes when you close the browser window, but it's not trivial to fix so I'll file a new bug after that.
940 2005-01-31 Darin Adler <darin@apple.com>
942 Reviewed by Ken and Harrison.
944 - fixed <rdar://problem/3947901> REGRESSION (Mail): Pasting paragraph of rich text leaves insertion point before pasted text
945 - fixed <rdar://problem/3949790> hitting return after underlined line results in too much or too little underlined
946 - fixed <rdar://problem/3981759> nil-deref and crash when pasting just a paragraph break
947 - fixed a couple problems I discovered while working with bug 3949790
949 * khtml/editing/htmlediting.cpp:
950 (khtml::ApplyStyleCommand::applyInlineStyle): Pass StayInBlock to upstream. Without this, we end up going too far
951 upstream in the test case in bug 3949790.
952 (khtml::ApplyStyleCommand::removeInlineStyle): Pass StayInBlock to upstream and downstream. Same reason as above.
953 (khtml::ReplaceSelectionCommand::doApply): Update endPos if inserting a new node and endPos is using that node's
954 parent and an offset past the node being inserted. That change fixes a problem with the position of the insertion point
955 after pasting into the top level of a document (from test cases in 3947901 and 3949790). When setting insertionPos, use
956 code that works when lastNodeInserted is a block rather than a text node. That change fixes a problem where a newline is
957 not added when pasting an entire paragraph into the end of a document (from test case in 3949790). Added nil check before
958 checking if lastNodeInserted is a <br> element, which fixes the crash when pasting just a paragraph break.
960 * khtml/editing/visible_units.h: Filled out the set of calls to add some boolean checks for lines (needed for the
961 bug fix), and calls for blocks (not yet implemented), and documents. The document checks may need refinement to
962 properly handle documents with a mix of editable and non-editable content, but for now they just refactor code
963 and make things a little clearer. Also removed the "include line break" parameter from endOfSentence.
964 * khtml/editing/visible_units.cpp:
965 (khtml::rootBoxForLine): Added.
966 (khtml::startOfLine): Added. Algorithm taken from selectionForLine in selection.cpp.
967 (khtml::endOfLine): Ditto.
968 (khtml::inSameLine): Added.
969 (khtml::isStartOfLine): Added.
970 (khtml::isEndOfLine): Added.
971 (khtml::endOfSentence): Removed "include line break" parameter.
972 (khtml::inSameParagraph): Added a null check.
973 (khtml::isStartOfParagraph): Ditto.
974 (khtml::isEndOfParagraph): Ditto.
975 (khtml::startOfBlock): Added.
976 (khtml::endOfBlock): Added.
977 (khtml::inSameBlock): Added.
978 (khtml::isStartOfBlock): Added.
979 (khtml::isEndOfBlock): Added.
980 (khtml::startOfDocument): Added.
981 (khtml::endOfDocument): Added.
982 (khtml::inSameDocument): Added.
983 (khtml::isStartOfDocument): Added.
984 (khtml::isEndOfDocument): Added.
986 2005-01-30 Darin Adler <darin@apple.com>
990 - fixed <rdar://problem/3977000> form data set posted for <input type="image" ...> omits name/value pair
992 * khtml/html/html_formimpl.cpp:
993 (DOM::HTMLInputElementImpl::appendFormData): Append a name/value pair for type IMAGE in addition to the X/Y
996 2005-01-30 Darin Adler <darin@apple.com>
1000 - fixed <rdar://problem/3974246> REGRESSION (125-180): popup menus are missing item text on Harmony Remote web site
1002 * khtml/html/html_formimpl.cpp: (DOM::HTMLOptionElementImpl::text): Change this function to traverse the entire tree
1003 and gather all the text rather than just looking at immediate children.
1005 * khtml/xml/dom_nodeimpl.h: Added const.
1006 * khtml/xml/dom_nodeimpl.cpp:
1007 (NodeImpl::traverseNextNode): Added const.
1008 (NodeImpl::traverseNextSibling): Ditto.
1009 (NodeImpl::traversePreviousNodePostOrder): Ditto.
1010 (NodeImpl::detach): Add a missing nil check.
1012 2005-01-30 Darin Adler <darin@apple.com>
1016 - fixed <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
1018 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Added missing ref/deref of newly created element.
1020 2005-01-28 Darin Adler <darin@apple.com>
1022 * khtml/css/cssproperties.c: Regenerated with newer gperf.
1024 2005-01-28 David Harrison <harrison@apple.com>
1026 Reviewed by John Sullivan.
1028 <rdar://problem/3968144> AX need to be able to focus an AXLink by setting AXFocused to true
1030 * kwq/KWQAccObject.mm:
1031 (-[KWQAccObject accessibilityPerformAction:]):
1032 (-[KWQAccObject accessibilityIsAttributeSettable:]):
1033 Add AXFocused for AXLinks.
1035 2005-01-28 David Harrison <harrison@apple.com>
1039 <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
1041 Use AppKit SPI _accessibilityParentForSubview to return KWQAccObject parent of AppKit AX object.
1043 * kwq/KWQAccObject.mm:
1044 (-[KWQAccObject _accessibilityParentForSubview:]):
1047 2005-01-27 Adele Amchan <adele@apple.com>
1049 fixed by Darin, reviewed by me.
1051 <rdar://problem/3976314> REGRESSION (180-TOT): submitting password fields fail on Panther
1053 * kwq/KWQTextField.mm: (-[KWQTextFieldController string]): on panther, the secure text field's editor
1054 does not contain the real string, so now we just call stringValue on the field in that case.
1056 2005-01-26 Maciej Stachowiak <mjs@apple.com>
1058 Reviewed by Darin, Hyatt and Ken.
1060 <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
1062 * khtml/css/css_computedstyle.cpp:
1063 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support
1064 for -khtml-text-decorations-in-effect property. This works like text-docration
1065 but follows proper inline semantics, that is, if a parent is causing text
1066 decoration then -khtml-text-decorations-in-effect on this element will reflect that.
1067 * khtml/css/cssproperties.in: Add -khtml-text-decorations-in-effect property.
1068 * khtml/css/cssproperties.h: regenerated
1069 * khtml/css/cssvalues.c: regenerated
1070 * khtml/css/cssparser.cpp: regenerated
1071 * khtml/css/cssproperties.c: regenerated
1073 * khtml/css/css_valueimpl.h: Made copyPropertiesInSet public.
1075 * khtml/editing/htmlediting.cpp:
1076 (khtml::StyleChange::init): Handle -khtml-text-decorations-in-effect
1077 specially, translate to text-decoration
1078 (khtml::ApplyStyleCommand::applyInlineStyle): Fix a comment.
1079 (khtml::ApplyStyleCommand::removeInlineStyle): Add new way of pushing down
1080 text-decoration styles around the edges of the selected range.
1081 (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAroundNode): Helper for this.
1082 (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): ditto
1083 (khtml::ApplyStyleCommand::nodeFullyUnselected): ditto
1084 (khtml::hasTextDecorationProperty): ditto
1085 (khtml::highestAncestorWithTextDecoration): ditto
1086 (khtml::ApplyStyleCommand::extractTextDecorationStyle): ditto
1087 (khtml::ApplyStyleCommand::extractAndNegateTextDecorationStyle): ditto
1088 (khtml::ApplyStyleCommand::applyTextDecorationStyle): ditto
1089 * khtml/editing/htmlediting.h: Prototype new methods.
1090 * khtml/editing/jsediting.cpp: Make underline execCommand use the new CSS property.
1092 - as a necessary part of the fix, fixed the longstanding problem
1093 that mutating an element's inlineStyleDecl would not property
1094 update its style attribute. now it does.
1096 * khtml/css/css_valueimpl.cpp:
1097 (DOM::CSSMutableStyleDeclarationImpl::setChanged): If this is an inline style
1098 declaration, tell the element it's style attribute needs updating.
1099 * khtml/html/html_elementimpl.cpp:
1100 (HTMLElementImpl::invalidateStyleAttribute): New method, just calls down
1102 (HTMLElementImpl::updateStyleAttribute): Regenerate style attribute from
1103 inline style declaration.
1104 * khtml/html/html_elementimpl.h: Prototype new stuff.
1105 * khtml/xml/dom_elementimpl.cpp:
1106 (ElementImpl::ElementImpl): Initialize new attribute.
1107 (ElementImpl::updateStyleAttributeIfNeeded): New method to check if the style
1108 is dirty and this is an html element, and if so call the html element to
1109 regenerate the style attribute.
1110 (ElementImpl::attributes): update style if needed
1111 (ElementImpl::getAttribute): ditto
1112 (ElementImpl::hasAttributes): ditto
1113 (ElementImpl::dump): ditto
1114 (XMLElementImpl::cloneNode): ditto
1115 * khtml/xml/dom_elementimpl.h:
1116 (DOM::ElementImpl::isStyleAttributeValid): new method to manage style attr
1118 (DOM::ElementImpl::setStyleAttributeValid): ditto
1120 - added new layout tests for underlining:
1122 * layout-tests/editing/editing.js:
1123 * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt: Added.
1124 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt: Added.
1125 * layout-tests/editing/style/remove-underline-across-paragraph-in-bold.html: Added.
1126 * layout-tests/editing/style/remove-underline-across-paragraph.html: Added.
1127 * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt: Added.
1128 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt: Added.
1129 * layout-tests/editing/style/remove-underline-after-paragraph-in-bold.html: Added.
1130 * layout-tests/editing/style/remove-underline-after-paragraph.html: Added.
1131 * layout-tests/editing/style/remove-underline-expected.txt: Added.
1132 * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt: Added.
1133 * layout-tests/editing/style/remove-underline-from-stylesheet.html: Added.
1134 * layout-tests/editing/style/remove-underline-in-bold-expected.txt: Added.
1135 * layout-tests/editing/style/remove-underline-in-bold.html: Added.
1136 * layout-tests/editing/style/remove-underline.html: Added.
1137 * layout-tests/editing/style/underline-expected.txt: Added.
1138 * layout-tests/editing/style/underline.html: Added.
1140 2005-01-27 David Hyatt <hyatt@apple.com>
1142 Fix for 3875199, search field needs to be able to show a magnifying glass without a dropdown menu.
1144 Reviewed by kocienda
1146 * khtml/html/html_formimpl.cpp:
1147 (DOM::HTMLInputElementImpl::HTMLInputElementImpl):
1148 (DOM::HTMLInputElementImpl::parseHTMLAttribute):
1149 * kwq/KWQLineEdit.mm:
1150 (QLineEdit::setMaxResults):
1152 2005-01-27 Ken Kocienda <kocienda@apple.com>
1158 <rdar://problem/3973254> Deletions of ranges does not coalesce correctly with subsequent typing
1160 * khtml/editing/htmlediting.cpp:
1161 (khtml::InsertTextCommand::deleteCharacter): Remove this dead code.
1162 (khtml::ReplaceSelectionCommand::editingAction): Moved this code to a better place in the file.
1163 It was in with unrelated functions.
1164 (khtml::TypingCommand::TypingCommand): Reorganize initialization list so it is easier to read.
1165 (khtml::TypingCommand::issueCommandForDeleteKey): Remove dead code. Roll in remaining code into deleteKeyPressed.
1166 (khtml::TypingCommand::deleteKeyPressed): Add in support for carrying along smart delete flag.
1167 (khtml::TypingCommand::forwardDeleteKeyPressed): New function. Makes forward delete work like
1168 "regular" delete in terms of coalescing typing.
1169 (khtml::TypingCommand::doApply): Add case for ForwardDeleteKey.
1170 (khtml::TypingCommand::preservesTypingStyle): Ditto.
1171 * khtml/editing/htmlediting.h:
1172 (khtml::TypingCommand::): Add ForwardDeleteKey constant. Remove a couple declarations for now-dead code.
1173 (khtml::TypingCommand::smartDelete): New accessor.
1174 (khtml::TypingCommand::setSmartDelete): Ditto.
1175 * kwq/WebCoreBridge.h:
1176 * kwq/WebCoreBridge.mm:
1177 (-[WebCoreBridge deleteKeyPressedWithSmartDelete:]): Add smart delete flag.
1178 (-[WebCoreBridge forwardDeleteKeyPressedWithSmartDelete:]): New method.
1179 * khtml/editing/jsediting.cpp: Add supprt for ForwardDelete command
1180 * layout-tests/editing/editing.js: Ditto.
1181 * layout-tests/editing/deleting/delete-and-undo-expected.txt: Added.
1182 * layout-tests/editing/deleting/delete-and-undo.html: Added.
1183 * layout-tests/editing/deleting/forward-delete-expected.txt: Added.
1184 * layout-tests/editing/deleting/forward-delete.html: Added.
1188 2005-01-27 David Harrison <harrison@apple.com>
1192 <rdar://problem/3962214> AX: AXLeftLineTextMarkerRangeForTextMarker returns incorrect range
1194 * kwq/KWQAccObject.mm:
1195 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
1196 Allowed for selection to end of line including the linebreak.
1198 2005-01-27 David Harrison <harrison@apple.com>
1200 Reviewed by Darin, Ken.
1202 <rdar://problem/3964470> AX: Include attachments in AXAttributedStringForTextMarkerRange
1204 * kwq/KWQAccObject.mm:
1205 (-[KWQAccObject isAttachment]):
1206 (-[KWQAccObject attachmentView]):
1207 (-[KWQAccObject role]):
1208 (-[KWQAccObject subrole]):
1209 (-[KWQAccObject roleDescription]):
1210 (-[KWQAccObject value]):
1211 (-[KWQAccObject title]):
1212 (-[KWQAccObject accessibilityDescription]):
1213 (-[KWQAccObject accessibilityIsIgnored]):
1214 (-[KWQAccObject accessibilityAttributeNames]):
1215 (-[KWQAccObject accessibilityAttributeValue:]):
1216 Make attachments accessible.
1218 (CreateCGColorIfDifferent):
1219 (AXAttributeStringSetColor):
1220 (AXAttributeStringSetNumber):
1221 (AXAttributeStringSetFont):
1222 (AXAttributeStringSetStyle):
1223 (AXAttributeStringSetElement):
1224 (AXLinkElementForNode):
1225 (AXAttributedStringAppendText):
1226 (AXAttributedStringAppendReplaced):
1227 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
1228 Add attachments and more text attributes to AXAttributedStringForTextMarkerRange.
1230 2005-01-27 Darin Adler <darin@apple.com>
1234 - fixed <rdar://problem/3807935> DOM CSS computed style line-height is wrong in two ways
1236 * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1237 Use specified size rather than computed size when dealing with a percentage for line height.
1239 2005-01-27 Darin Adler <darin@apple.com>
1243 - fixed <rdar://problem/3971372> SWB: template function DOM_cast() won't compile with gcc 4.0
1244 - fixed other gcc 4.0 compiling problems Patrick Beard pointed out on the phone
1246 * kwq/DOMInternal.h: (DOM_cast): Change the "failToCompile()" trick to use a dependent name.
1247 Nowadays, if a name is not dependent, it is checked at template definition time. But we want
1248 a failure only at template instantiation time.
1250 * ForwardingHeaders/editing/text_granularity.h: Added. Needed but a bug in the 3.3 compiler made
1251 it compile anyway without this.
1255 * khtml/html/html_miscimpl.h: For clarity, mark these functions virtual too. They are automatically
1256 virtual because the base class ones are virtual, but it's ugly to leave it this way.
1258 2005-01-26 Ken Kocienda <kocienda@apple.com>
1264 <rdar://problem/3971609> REGRESSION (Mail): up/down arrow navigation broken after rewrapping text by resizing window
1265 <rdar://problem/3975661> REGRESSION (Mail): left/right arrow navigation can place insertion point after last character on line
1267 * khtml/editing/selection.cpp:
1268 (khtml::Selection::modifyAffinity): PARAGRAPH and LINE movements should not alter affinity. This was
1269 just a mistake before when it reset to upstream in some cases.
1270 * khtml/rendering/render_line.cpp:
1271 (khtml::RootInlineBox::closestLeafChildForXPos): Move this function down from InlineBox, and
1272 rework the implementation. This fixes 3971609.
1273 * khtml/rendering/render_line.h:
1274 * khtml/rendering/render_text.cpp:
1275 (RenderText::caretRect): Rework the algorithm to fix 3975661. This regressed when we began placing
1276 the spaces on the end of lines in text boxes when lines wrap.
1278 2005-01-26 Richard Williamson <rjw@apple.com>
1280 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
1282 I added a member variable to ObjectImp. This changed it's size and consequently
1283 hampered the optimizations built into the garbage collector. Objects no longer
1284 fit within the allocators cell size, and thus allocation fell back to a slower
1287 As a result of this fix I also dramatically cleaned up how runtime objects are
1288 accessed. The path mostly *removes* code.
1292 * khtml/ecma/kjs_dom.cpp:
1293 (DOMDocumentProtoFunc::tryCall):
1294 (DOMElementProtoFunc::tryCall):
1295 (KJS::getRuntimeObject):
1296 * khtml/ecma/kjs_dom.h:
1297 * khtml/ecma/kjs_html.cpp:
1298 (KJS::HTMLDocument::tryGet):
1299 (KJS::HTMLElement::tryGet):
1300 (KJS::HTMLElement::implementsCall):
1301 (KJS::HTMLElement::call):
1302 (KJS::HTMLElement::tryPut):
1303 (KJS::HTMLCollection::tryGet):
1304 (KJS::HTMLCollection::getNamedItems):
1305 * khtml/ecma/kjs_html.h:
1306 * khtml/ecma/kjs_window.cpp:
1309 2005-01-26 Richard Williamson <rjw@apple.com>
1311 Fixed <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
1313 For now we are using ICU UBreakIterator to determine grapheme boundaries for
1314 cursor and deletion. This does not match what Cocoa does exactly, but does match
1315 what Carbon does. The areas are difference are obscure, but, according to
1316 Deborah Goldsmith, using the UBreakIterator is the reasonable approach.
1320 * khtml/rendering/render_text.cpp:
1321 (RenderText::previousOffset):
1322 (RenderText::nextOffset):
1324 2005-01-25 David Harrison <harrison@apple.com>
1326 Reviewed by Maciej and Richard.
1328 <rdar://problem/3963731> AX VO: Changing window sizes causes a crash using with Voice Over - KWQPtrDictImpl::clear
1330 * khtml/html/html_miscimpl.cpp:
1331 (HTMLCollectionImpl::HTMLCollectionImpl):
1332 Ensure that isHTMLDocument before calling HTMLDocument-only method.
1334 2005-01-25 Richard Williamson <rjw@apple.com>
1336 Part one of fix for <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input
1338 This patch changes the semantics of next() and previous() on
1339 VisiblePosition to move a grapheme (character cluster) at a
1340 time. This means that cursor navigation with correctly move
1341 over an entire cluster.
1343 However, the expected behavior for deleting a grapheme is to
1344 delete individual code points, thus decomposing the grapheme
1345 into it constituent parts. That will be addressed in the next
1350 * khtml/editing/visible_position.cpp:
1351 (khtml::VisiblePosition::previousPosition):
1352 (khtml::VisiblePosition::nextPosition):
1353 * khtml/editing/visible_position.h:
1354 * khtml/rendering/render_object.cpp:
1355 (RenderObject::previousOffset):
1356 (RenderObject::nextOffset):
1357 * khtml/rendering/render_object.h:
1358 * khtml/rendering/render_text.cpp:
1359 (RenderText::previousOffset):
1360 (RenderText::nextOffset):
1361 (RenderText::findNextInlineTextBox):
1362 * khtml/rendering/render_text.h:
1363 * khtml/xml/dom_nodeimpl.cpp:
1364 (NodeImpl::previousOffset):
1365 (NodeImpl::nextOffset):
1366 * khtml/xml/dom_nodeimpl.h:
1368 2005-01-25 David Harrison <harrison@apple.com>
1372 <rdar://problem/3973067> AXWebArea for http://apple.netscape.com/ has an empty AXLinkUIElements
1374 * kwq/KWQAccObject.mm:
1375 (-[KWQAccObject accessibilityAttributeValue:]):
1376 Omit ignored AXLinks from AXLinkUIElements result
1378 2005-01-25 Ken Kocienda <kocienda@apple.com>
1384 <rdar://problem/3972851> REGRESSION (179-180+): Repro crash in ApplyStyleCommand::cleanUpEmptyStyleSpans
1386 * khtml/editing/htmlediting.cpp:
1387 (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans): Added two null checks.
1389 2005-01-25 Ken Kocienda <kocienda@apple.com>
1395 <rdar://problem/3954710> Mail crashed while editing signatures - NodeImpl::isBlockFlow
1397 The fix is more general than for this one bug, and may work to fix many crashers. The problem
1398 is that the ReplaceSelectionCommand never checked whether its starting selection is empty. If
1399 it is, then we need to bail before doing the work of the command, which we need to deref the
1400 start and end points of the selection in order to do its work. I think you can see the crash
1403 * khtml/editing/htmlediting.cpp:
1404 (khtml::ReplaceSelectionCommand::doApply): Assert selection is not empty.
1405 * kwq/WebCoreBridge.mm:
1406 (partHasSelection): New helper function to test that bridge has a part with a selection.
1408 Use new helper function to test part and selection; return from these function if this test fails.
1410 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:])
1411 (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:])
1412 (-[WebCoreBridge alterCurrentSelection:direction:granularity:])
1413 (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:])
1414 (-[WebCoreBridge alterCurrentSelection:verticalDistance:])
1415 (-[WebCoreBridge documentFragmentWithText:])
1416 (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
1417 (-[WebCoreBridge insertLineBreak])
1418 (-[WebCoreBridge insertParagraphSeparator])
1419 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent])
1420 (-[WebCoreBridge insertText:selectInsertedText:])
1421 (-[WebCoreBridge deleteSelectionWithSmartDelete:])
1422 (-[WebCoreBridge ensureSelectionVisible])
1424 2005-01-24 Kevin Decker <kdecker@apple.com>
1428 Fixed <rdar://problem/3932374> REGRESSION: 'ReferenceError - Can't find variable' JavaScript error at webxpress.fidelity.com
1430 * khtml/html/html_miscimpl.h: Missing virtual identifiers for namedItem() and nextNamedItem() exposed a flaw that prevented finding variables in form [HTMLFormCollectionImpl] scopes.
1433 2005-01-24 Vicki Murley <vicki@apple.com>
1435 Reviewed by kocienda.
1437 - fix <rdar://problem/3810661> computed style not handled for Apple extensions
1439 * khtml/css/css_computedstyle.cpp: (DOM::):
1440 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): add -apple-line-clamp and -apple-text-size-adjust
1442 2005-01-24 Darin Adler <darin@apple.com>
1446 - fixed <rdar://problem/3969884> REGRESSION (179-180): Typing password not echoed as "bullets" at paypal.com when field is first focused
1448 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]):
1449 Sizing up the form editor, which fixes things for normal fields and search fields,
1450 screws things up for password fields. Eventually, I'll need to figure out why this is
1451 and file a bug so that the AppKit team fixes it. In the mean time, just check for the
1452 case of the secure text field, and don't size up in that case.
1454 2005-01-24 Ken Kocienda <kocienda@apple.com>
1460 <rdar://problem/3963560> 8A354: Inserting Japanese text to the line head causes line break
1462 * khtml/editing/htmlediting.cpp:
1463 (khtml::ReplaceSelectionCommand::doApply): Add one more case where we merge content into the
1464 existing line. This covers the situation see using the steps to reproduce this bug.
1466 2005-01-21 Maciej Stachowiak <mjs@apple.com>
1470 <rdar://problem/3967572> Editing should split elements before removing style
1472 * khtml/editing/htmlediting.cpp:
1473 (khtml::CompositeEditCommand::splitElement):
1474 (khtml::CompositeEditCommand::mergeIdenticalElements):
1475 (khtml::CompositeEditCommand::wrapContentsInDummySpan):
1476 (khtml::CompositeEditCommand::splitTextNodeContainingElement):
1477 (khtml::ApplyStyleCommand::applyInlineStyle):
1478 (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
1479 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
1480 (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
1481 (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
1482 (khtml::areIdenticalElements):
1483 (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
1484 (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
1485 (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans):
1486 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
1487 (khtml::InsertParagraphSeparatorCommand::doApply):
1488 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
1489 (khtml::InsertTextCommand::prepareForTextInsertion):
1490 (khtml::SplitTextNodeCommand::doUnapply):
1491 (khtml::SplitElementCommand::SplitElementCommand):
1492 (khtml::SplitElementCommand::~SplitElementCommand):
1493 (khtml::SplitElementCommand::doApply):
1494 (khtml::SplitElementCommand::doUnapply):
1495 (khtml::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand):
1496 (khtml::MergeIdenticalElementsCommand::~MergeIdenticalElementsCommand):
1497 (khtml::MergeIdenticalElementsCommand::doApply):
1498 (khtml::MergeIdenticalElementsCommand::doUnapply):
1499 (khtml::WrapContentsInDummySpanCommand::WrapContentsInDummySpanCommand):
1500 (khtml::WrapContentsInDummySpanCommand::~WrapContentsInDummySpanCommand):
1501 (khtml::WrapContentsInDummySpanCommand::doApply):
1502 (khtml::WrapContentsInDummySpanCommand::doUnapply):
1503 (khtml::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand):
1504 (khtml::SplitTextNodeContainingElementCommand::~SplitTextNodeContainingElementCommand):
1505 (khtml::SplitTextNodeContainingElementCommand::doApply):
1506 * khtml/editing/htmlediting.h:
1508 New layout test that shows the side benefit of this.
1510 * layout-tests/editing/style/unbold-in-bold-expected.txt: Added.
1511 * layout-tests/editing/style/unbold-in-bold.html: Added.
1513 2005-01-24 Darin Adler <darin@apple.com>
1517 - fixed <rdar://problem/3933435> -[DOMRange cloneContents] sometimes alters the original DOMRange
1519 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Fixed code that was collapsing
1520 the range after processing the contents. That's right for extract and delete, but not clone.
1522 - fixed <rdar://problem/3714184> inline input works incorrectly when I type Korean slowly in textfield in form on www.google.co.kr
1523 - fixed <rdar://problem/3193848> Can't enter SSN to sign up for Chase visa online account (changing focus inside key press handler)
1524 - fixed <rdar://problem/3874683> REGRESSION (161-162): Crash after typing command-Z to undo after pasting text with newline in it into a text field <input type=text>
1526 * kwq/KWQLineEdit.mm:
1527 (QLineEdit::text): Changed to call a new string method on the controller instead of calling
1528 stringValue, since stringValue has a bad side effect of ending inline input.
1529 (QLineEdit::selectAll): Changed to only call selectText: when the field is already selected.
1530 When you are giving the field focus, it automatically gets all selected, and this change
1531 is required in the case where we defer the focus change.
1533 * kwq/KWQTextField.h: Added a new string method to the controller.
1534 * kwq/KWQTextField.mm:
1535 (-[KWQTextFieldController setMaximumLength:]): Call the new string method instead of using stringValue.
1536 (-[KWQTextFieldController controlTextDidChange:]): Removed the code to truncate at the first CR or LF.
1537 That's now handled in the shouldChangeTextInRange method instead.
1538 (-[KWQTextFieldController textView:shouldHandleEvent:]): Add new logic to defer responder changes until
1539 after the event is handled. This makes sure the key gets into the field that's already handling it at
1540 rather than ending up in the newly-focused field if the key press handler focuses a different element.
1541 (-[KWQTextFieldController textView:didHandleEvent:]): Turn off deferral here, now that the key press
1543 (-[KWQTextFieldController string]): Added. Calls stringValue only if there's no editor. If there is
1544 an editor, calls string on that instead.
1545 (-[KWQTextFieldController textView:shouldChangeTextInRange:replacementString:]): Added. Called by
1546 the three field subclasses. Truncates incoming strings at the first CR or LF character. This works
1547 properly with Undo, and the old technique did not.
1548 (-[KWQTextFieldController preprocessString:]): Added. Helper used for all the setStringValue methods
1549 so they all truncate at the first CR or LF as well as truncating to the appropriate length.
1550 (-[KWQTextField setStringValue:]): Changed to call the controller.
1551 (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): Added. Calls the controller.
1552 (-[KWQSecureTextField setStringValue:]): More of the same.
1553 (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
1554 (-[KWQSearchField setStringValue:]): Ditto.
1555 (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.
1557 * kwq/KWQWidget.h: Added the new setDeferFirstResponderChanges function.
1559 (QWidget::~QWidget): Clear out the deferredFirstResponder global just in case we are destroyed
1560 while we "have the ball".
1561 (QWidget::hasFocus): If we are in the deferred mode, use the global to decide who to say is focused.
1562 (QWidget::setFocus): If we are in the deferred mode, set the global instead of making something be
1563 the first responder.
1564 (QWidget::setDeferFirstResponderChanges): Set the boolean. If the boolean is being cleared, then
1565 get the deferred first responder and call setFocus on it again, which will do the work we didn't
1568 2005-01-24 Ken Kocienda <kocienda@apple.com>
1574 <rdar://problem/3964350> Deleting all content and typing in a message gets one letter, then beeps
1576 This is a problem with the way we turn key events, when a user starts typing, into editing commands.
1577 Right now, that initial delete key in an empty window is turned into an editing command, and much
1578 editing code runs that need not run. What's more, this is confusing the selection machinery. The
1579 solution is to detect the "delete in an empty window" case and don't turn this into an editing
1582 * khtml/editing/htmlediting.cpp:
1583 (khtml::TypingCommand::deleteKeyPressed)
1585 2005-01-23 Adele Amchan <adele@apple.com>
1587 Fixed <rdar://problem/3964286> REGRESSION (178-179): menus and "go to old site" link at Ameritrade's new site don't work
1589 Removed check for document from checkCompleted. In this case, WebCore never knew that a WebImageView was complete because
1590 it fell into this document check case in checkCompleted.
1591 Added check for document to tokenizerProcessedData (see <rdar://problem/3807144>)
1595 * khtml/khtml_part.cpp:
1597 (KHTMLPart::checkCompleted):
1598 * khtml/khtml_part.h:
1599 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::tokenizerProcessedData):
1601 2005-01-21 Richard Williamson <rjw@apple.com>
1603 Fixed <rdar://problem/3759399> Javascript / Liveconnect problems ((event handler):Undefined value)
1605 Java applets specified with <object> or <embed> weren't scriptable. Now they are.
1609 * khtml/html/html_objectimpl.cpp:
1610 (HTMLEmbedElementImpl::getEmbedInstance):
1611 (HTMLObjectElementImpl::getObjectInstance):
1613 2005-01-21 Ken Kocienda <kocienda@apple.com>
1619 <rdar://problem/3959464> REGRESSION (Mail): Insertion point goes back to beginning of document after deleting
1621 * khtml/editing/htmlediting.cpp:
1622 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add special case to handle retaining a fully-selected block.
1624 * layout-tests/editing/deleting/delete-3959464-fix-expected.txt: Added.
1625 * layout-tests/editing/deleting/delete-3959464-fix.html: Added.
1627 2005-01-21 Richard Williamson <rjw@apple.com>
1629 Fixed <rdar://problem/3966998> REGRESSION(179-TOT) clicking on gmail message brings me to blank screen
1631 getElementById() sometimes returns Undefined() instead of Null().
1635 * khtml/ecma/kjs_dom.cpp:
1636 (DOMDocumentProtoFunc::tryCall):
1638 2005-01-21 David Hyatt <hyatt@apple.com>
1640 Fix for 3773809, make sure that overflow regions never end up at an invalid scroll offset because of a layout change.
1642 Reviewed by kocienda
1644 * khtml/rendering/render_layer.cpp:
1645 (RenderLayer::updateScrollInfoAfterLayout):
1647 2005-01-21 David Hyatt <hyatt@apple.com>
1649 Fix for 3966349, hang loading page. Make sure that loops using popOneBlock properly check for a null
1650 blockStack to avoid an infinite loop.
1652 Reviewed by kocienda
1654 * khtml/html/htmlparser.cpp:
1655 (KHTMLParser::parseToken):
1656 (KHTMLParser::insertNode):
1657 (KHTMLParser::popInlineBlocks):
1659 2005-01-21 Ken Kocienda <kocienda@apple.com>
1665 <rdar://problem/3957204> Mail crashed when sending a message in ~InsertParagraphSeparatorInQuotedContentCommand
1667 * khtml/editing/htmlediting.cpp:
1668 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
1669 InsertParagraphSeparatorInQuotedContentCommand has this member variable: DOM::ElementImpl *m_breakNode;
1670 I failed to initialize this variable to null in the constructor, and there is an uncommonly-traveled
1671 code path which does not set this variable to something good. In the destructor, we check for null,
1672 and deref if non-null. Obvious "BOOM" potential. Fixed.
1674 2005-01-21 Ken Kocienda <kocienda@apple.com>
1680 <rdar://problem/3966311> REGRESSION (Mail): Hitting return makes space character disappear
1682 * khtml/editing/htmlediting.cpp:
1683 (khtml::InsertParagraphSeparatorCommand::doApply): When writing the code to insert a block
1684 in response to the return key, I did not write code to cover the case described in the bug.
1686 * layout-tests/editing/inserting/insert-div-025-expected.txt: Added.
1687 * layout-tests/editing/inserting/insert-div-025.html: Added.
1689 2005-01-20 Maciej Stachowiak <mjs@apple.com>
1693 <rdar://problem/3965196> security fix for javascript: exploit missed one case (already fixed in updates)
1695 * khtml/ecma/kjs_window.cpp:
1696 (WindowFunc::tryCall): correct mistake in earlier fix for the following bug, caught by Adele:
1698 2005-01-20 Maciej Stachowiak <mjs@apple.com>
1702 <rdar://problem/3965466> editing needs to insert text before applying typing style
1704 * khtml/editing/htmlediting.cpp:
1705 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Remove a FIXME comment.
1706 (khtml::InsertLineBreakCommand::doApply): Apply style to the BR
1707 node after inserting it.
1708 (khtml::InsertTextCommand::prepareForTextInsertion): Don't try to
1709 apply style to any new nodes created before inserting.
1710 (khtml::InsertTextCommand::input): Apply style to the inserted range
1711 after doing the text insert.
1712 * khtml/editing/htmlediting.h:
1714 This change leads to improved results on one of the layout tests:
1716 * layout-tests/editing/inserting/insert-div-024-expected.txt:
1720 2005-01-20 Ken Kocienda <kocienda@apple.com>
1726 <rdar://problem/3964646> REGRESSION (179-180): Typing space at end of line makes following paragraph disappear
1728 * khtml/editing/htmlediting.cpp:
1729 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Recent change to block placeholder removal code
1730 caused this regression. The code became too aggressive in removing block placeholders, and would remove them
1731 from blocks other than the block containing the selection.
1732 * layout-tests/editing/inserting/insert-div-023-expected.txt: This file had a spurious BR element in it that
1733 I did not notice earlier.
1734 * layout-tests/editing/inserting/insert-div-024-expected.txt: Ditto.
1736 2005-01-20 David Hyatt <hyatt@apple.com>
1738 Fix for oddness on albertsons.com. Make sure not to crash when setting/removing style properties on a node
1739 with no document. The bug # is 3813900.
1743 2005-01-20 David Harrison <harrison@apple.com>
1747 PARTIAL fix for following bug. Create attributed string with fonts and links. Still need to add attachments.
1748 <rdar://problem/3942606> AX: Support kAXAttributedStringForTextMarkerRangeParameterizedAttribute
1750 * kwq/KWQAccObject.mm:
1751 (-[KWQAccObject textUnderElement]):
1752 Touched up previous checkin to match code review comments.
1754 (-[KWQAccObject value]):
1755 Use plainText for this one instead of obsolete attributedString.
1757 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
1758 Advertise AXAttributedStringForTextMarkerRange.
1760 (AXAttributeStringAddFont):
1761 (AXAttributeStringAddElement):
1762 (-[KWQAccObject linkUIElementForNode:]):
1763 (-[KWQAccObject _addAttachmentForElement:URL:needsParagraph:usePlaceholder:]):
1764 (-[KWQAccObject accessibilityAttributedStringForRange:]):
1765 New routines to support AXAttributedStringForTextMarkerRange.
1767 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
1768 Use new routines instead of obsolete attributedString.
1770 2005-01-20 David Harrison <harrison@apple.com>
1774 <rdar://problem/3960196> AX Crash in DOM::Range::setStartBefore
1776 * khtml/xml/dom_docimpl.cpp:
1777 (DocumentImpl::getAccObjectCache):
1778 Adjust when detecting cache in non-top level WebArea.
1779 * kwq/KWQAccObject.mm:
1780 (-[KWQAccObject textUnderElement]):
1781 (-[KWQAccObject accessibilityAttributeValue:]):
1782 Make sure the elements document is the current one for the part.
1784 2005-01-20 Darin Adler <darin@apple.com>
1788 - fixed <rdar://problem/3922980> Mail not crashing, just quitting itself suddenly in -[WebHTMLView(MailExtras) findString:options:]
1790 * khtml/dom/dom2_range.cpp: (DOM::operator==): Handle null and detached ranges without raising exceptions.
1791 The uncaught exception would make the entire program terminate.
1793 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
1795 * kwq/DOM-CSS.mm: (-[DOMCSSStyleDeclaration setProperty:::]): Uncommented this code which I had to disable
1796 back in November because Mail was stumbling over it.
1798 - fixed <rdar://problem/3943049> focus() called during onload handler results in square text field on <input type=search>
1800 * kwq/KWQLineEdit.mm: (QLineEdit::baselinePosition): Change computation so it will work even for fields
1801 that position their text in a way that depends on vertical size. In the case of a search field, the text
1802 is centered, so the old logic was broken.
1803 * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Set the frame size to
1804 something large enough to accomodate the field editor. If we start the frame at size 0,0 we run into
1805 AppKit trouble when it insets the frame to figure out the frame for the field editor. In the case of this
1806 bug this happens because we become first responder before being sized and positioned by the HTML layout code.
1808 - improved debugging output when using "po" from gdb with Objective-C DOM
1811 (-[DOMNode description]): Added. Includes node name ("<tr>") and node value (e.g., string for text node).
1812 (-[DOMRange description]): Tweaked format.
1814 2005-01-19 Richard Williamson <rjw@apple.com>
1816 After further discussion with Real we have decided to NOT include the
1817 additional CLSID for the real plugin. See 3958601.
1821 * khtml/rendering/render_frames.cpp:
1822 (RenderPartObject::updateWidget):
1824 2005-01-19 David Harrison <harrison@apple.com>
1828 <rdar://problem/3949429> AX: word marker routines returns incorrect data for empty line
1830 Previous checkin for this bug was missing some of the patch. Editing snafu with multiple changes in tree.
1832 * kwq/KWQAccObject.mm:
1833 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
1834 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
1835 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
1836 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
1837 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
1838 (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
1839 (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
1841 2005-01-19 Ken Kocienda <kocienda@apple.com>
1845 * khtml/editing/htmlediting.cpp:
1846 (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Small, cosmetic change John and I decided
1847 to do on my last checkin, but I forgot to do before landing.
1849 2005-01-19 Ken Kocienda <kocienda@apple.com>
1855 <rdar://problem/3959727> REGRESSION (Mail): Style not preserved on blank lines
1857 * khtml/editing/htmlediting.cpp:
1858 (khtml::CompositeEditCommand::applyStyle):
1859 (khtml::CompositeEditCommand::insertBlockPlaceholder): New function that unconditionally adds a block placeholder.
1860 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Now returns bool based on whether
1861 placeholder was added or not.
1862 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now searches all the descendents of a block
1863 looking for a placeholder. The old code, which just looked at the last child of a node, started missing
1864 once block placeholders became styled (which started happening with this patch).
1865 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Now handles applying typing style
1866 to a block placeholder at call time, rather than setting the typing style as a latent style that
1867 might be applied later. This is an important part of the bug fix.
1868 (khtml::DeleteSelectionCommand::doApply): Now uses bool return value from insertBlockPlaceholderIfNeeded()
1869 and passes it along to calculateStyleBeforeInsertion, so the case where a block placeholder needs to
1870 be styled can be detected.
1871 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Changed the way this class
1872 managed style. Before it would calculate and set typing style for the block added. This is not
1873 sufficient. Added blocks need to styled immediately. Some name changes to instance variables in
1874 this class due to the change to accommodate this change.
1875 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Name changes, as above.
1876 (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Ditto.
1877 (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Ditto.
1878 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1879 (khtml::ReplaceSelectionCommand::doApply): Improve check for testing when a placeholder
1880 block can be removed in its entirety after the insertion.
1881 * khtml/editing/htmlediting.h: Update header accordingly.
1882 * khtml/khtml_part.cpp:
1883 (KHTMLPart::selectionComputedStyle): Move position for computed style check downstream before
1884 doing check when the position is in an empty block (this makes sure any style on any block
1885 placeholder is accounted for).
1887 New layout tests to check bug fix.
1889 * layout-tests/editing/style/block-style-004-expected.txt: Added.
1890 * layout-tests/editing/style/block-style-004.html: Added.
1891 * layout-tests/editing/style/block-style-005-expected.txt: Added.
1892 * layout-tests/editing/style/block-style-005.html: Added.
1893 * layout-tests/editing/style/block-style-006-expected.txt: Added.
1894 * layout-tests/editing/style/block-style-006.html: Added.
1896 Results updated to reflect new block placeholder code.
1898 * layout-tests/editing/inserting/insert-div-004-expected.txt
1899 * layout-tests/editing/inserting/insert-div-005-expected.txt
1900 * layout-tests/editing/inserting/insert-div-006-expected.txt
1901 * layout-tests/editing/inserting/insert-div-008-expected.txt
1902 * layout-tests/editing/inserting/insert-div-011-expected.txt
1903 * layout-tests/editing/inserting/insert-div-012-expected.txt
1904 * layout-tests/editing/inserting/insert-div-013-expected.txt
1905 * layout-tests/editing/inserting/insert-div-014-expected.txt
1906 * layout-tests/editing/inserting/insert-div-015-expected.txt
1907 * layout-tests/editing/inserting/insert-div-016-expected.txt
1908 * layout-tests/editing/inserting/insert-div-017-expected.txt
1909 * layout-tests/editing/inserting/insert-div-018-expected.txt
1910 * layout-tests/editing/inserting/insert-div-019-expected.txt
1911 * layout-tests/editing/inserting/insert-div-021-expected.txt
1912 * layout-tests/editing/inserting/insert-div-022-expected.txt
1913 * layout-tests/editing/inserting/insert-div-023-expected.txt
1914 * layout-tests/editing/inserting/insert-div-024-expected.txt
1916 2005-01-19 David Hyatt <hyatt@apple.com>
1918 Dont null-check the renderer before submitting, since a script can set it to display:none and still expect the
1919 submission to occur. Fixes bug #3477282.
1923 (DOM::HTMLInputElementImpl::defaultEventHandler):
1925 2005-01-18 Richard Williamson <rjw@apple.com>
1927 Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
1929 Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
1930 Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
1931 Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
1932 Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
1934 We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
1935 tags. Also, if any of these elements are named they can be accessed from the document or window objects.
1936 Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
1940 * khtml/dom/html_document.cpp:
1941 (HTMLDocument::objects):
1942 * khtml/dom/html_document.h:
1943 * khtml/ecma/kjs_dom.cpp:
1944 (DOMDocumentProtoFunc::tryCall):
1945 (DOMElementProtoFunc::tryCall):
1946 (KJS::getRuntimeObject):
1947 * khtml/ecma/kjs_dom.h:
1948 * khtml/ecma/kjs_html.cpp:
1949 (KJS::HTMLDocument::tryGet):
1950 (KJS::HTMLElement::tryGet):
1951 (KJS::HTMLCollection::tryGet):
1952 (KJS::HTMLCollection::getNamedItems):
1953 * khtml/ecma/kjs_window.cpp:
1955 * khtml/html/html_miscimpl.cpp:
1956 (HTMLCollectionImpl::traverseNextItem):
1957 * khtml/html/html_miscimpl.h:
1958 (DOM::HTMLCollectionImpl::):
1959 * khtml/html/html_objectimpl.cpp:
1960 (HTMLAppletElementImpl::getAppletInstance):
1961 (HTMLObjectElementImpl::HTMLObjectElementImpl):
1962 (HTMLObjectElementImpl::getObjectInstance):
1963 * khtml/html/html_objectimpl.h:
1964 * khtml/rendering/render_frames.cpp:
1965 (RenderPartObject::updateWidget):
1966 * kwq/KWQKHTMLPart.h:
1967 * kwq/KWQKHTMLPart.mm:
1968 (KWQKHTMLPart::getObjectInstanceForView):
1970 2005-01-18 David Hyatt <hyatt@apple.com>
1972 Fix for 3948123, rolling over link erases nearby text. The repaint rect check for lines was wrong whenever
1973 two lines overlapped.
1975 Reviewed by kocienda
1977 * khtml/rendering/render_flow.cpp:
1978 (RenderFlow::paintLines):
1980 2005-01-18 Ken Kocienda <kocienda@apple.com>
1986 <rdar://problem/3960116> Focus rings paint incorrectly for contenteditable blocks in web pages
1988 * khtml/rendering/render_flow.cpp:
1989 (RenderFlow::addFocusRingRects): Fix painting of focus rings so that ring only paints around
1990 outermost contenteditable elements.
1992 2005-01-18 David Harrison <harrison@apple.com>
1996 <rdar://problem/3959668> accessibilityFocusedUIElement sometimes returns an ignored element; it must not
1998 * kwq/KWQAccObject.mm:
1999 (-[KWQAccObject accessibilityFocusedUIElement]):
2000 Return parentObjectUnignored if focused object is ignored.
2002 2005-01-18 Ken Kocienda <kocienda@apple.com>
2008 <rdar://problem/3952877> REGRESSION (Mail): Command-left/right-arrows don't work with file attachment
2010 * khtml/editing/selection.cpp:
2011 (khtml::nodeForInlineBox): New helper function used in reimplementation of function below.
2012 (khtml::selectionForLine): Reimplemented using line box smarts. I originally wrote this code when
2013 I had a less than full understanding of line layout. I can do better now, and my new version no
2014 longer fails to notice attachments when doing the kind of navigation mentioned in the bug.
2016 2005-01-17 David Harrison <harrison@apple.com>
2018 Reviewed by John Sullivan.
2020 <rdar://problem/3949429> AX: word marker routines returns incorrect data for empty line
2021 <rdar://problem/3949848> AX: paragraph marker routines do not work when given a paragraph end marker
2023 Also fixed sentence support in the same way.
2025 * kwq/KWQAccObject.mm:
2026 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2027 (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
2028 (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
2029 (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
2030 (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
2031 Move one position in desired direction before calling visible_units.cpp code.
2033 2005-01-17 David Harrison <harrison@apple.com>
2035 Updated expected test results.
2037 <rdar://problem/3945880> line-ending space seems not to be present
2039 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt:
2040 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt:
2041 * layout-tests/editing/inserting/insert-div-020-expected.txt:
2042 * layout-tests/editing/inserting/insert-div-021-expected.txt:
2043 * layout-tests/editing/inserting/insert-div-022-expected.txt:
2044 * layout-tests/editing/inserting/insert-div-023-expected.txt:
2045 * layout-tests/editing/inserting/insert-div-024-expected.txt:
2047 2005-01-17 David Harrison <harrison@apple.com>
2049 Reviewed by Dave Hyatt (bidi.cpp) and Darin Adler (selection.cpp).
2051 <rdar://problem/3945880> line-ending space seems not to be present
2053 * khtml/editing/selection.cpp:
2054 (khtml::Selection::validate):
2055 Extend AFTER_WHITE_SPACE code to support white spac in the middle of paragraphs, not just the end.
2056 * khtml/rendering/bidi.cpp:
2057 (khtml::RenderBlock::findNextLineBreak):
2058 Pick left/rightness of word selection based on being at the end of paragraph (i.e. after a hard line break).
2060 2005-01-17 Darin Adler <darin@apple.com>
2062 Reviewed by John Louch.
2064 - fixed <rdar://problem/3958503> need screenX and screenY to use WebKit windowFrame delegate
2066 * khtml/ecma/kjs_window.cpp: (Window::get): Change screenX and screenY to use frameGeometry instead
2067 of using mapToGlobal and screen in a complicated way.
2068 * kwq/KWQKHTMLView.mm: Removed unused mapToGlobal function.
2069 * kwq/KWQWindowWidget.h: Ditto.
2070 * kwq/KWQWindowWidget.mm: Ditto.
2072 2005-01-17 David Hyatt <hyatt@apple.com>
2074 Fix a screwup in rightmost/lowets position computation. 3955207. Make sure floats with layers are still checked.
2076 Reviewed by kocienda
2078 * khtml/rendering/render_block.cpp
2080 2005-01-17 Ken Kocienda <kocienda@apple.com>
2084 <rdar://problem/3953366> Problems with typing attributes in HTML compose
2086 * khtml/editing/htmlediting.cpp:
2087 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Remove misguided "optimization"
2088 that tried to sense when typing style could be cleared without actually doing a style diff between
2089 before-delete and after-delete positions. Removing this extra check and running the
2090 general-purpose code fixes the bug.
2092 2005-01-17 Richard Williamson <rjw@apple.com>
2094 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
2096 Keep track of originating execution context and target execution
2097 context for native JS object wrappers, and perform appropriate
2100 Reviewed by David Harrison.
2102 * khtml/ecma/kjs_binding.cpp:
2103 (ScriptInterpreter::isGlobalObject):
2104 (ScriptInterpreter::isSafeScript):
2105 (ScriptInterpreter::interpreterForGlobalObject):
2106 * khtml/ecma/kjs_binding.h:
2107 * khtml/ecma/kjs_window.cpp:
2108 (Window::interpreter):
2109 (Window::isSafeScript):
2110 * khtml/ecma/kjs_window.h:
2111 * kwq/DOMInternal.mm:
2112 (-[WebScriptObject _initializeScriptDOMNodeImp]):
2113 * kwq/KWQKHTMLPart.mm:
2114 (KWQKHTMLPart::windowScriptObject):
2115 (KWQKHTMLPart::windowScriptNPObject):
2116 * kwq/WebCoreBridge.mm:
2118 (-[WebCoreBridge init]):
2120 2005-01-17 Ken Kocienda <kocienda@apple.com>
2126 <rdar://problem/3786659> REGRESSION (Mail): editable WebViews don't work with
2127 "size up" and "size down" NSFontManager changes
2129 * khtml/css/cssparser.cpp:
2130 (CSSParser::parseValue): Add support for parsing new font size delta property.
2131 * khtml/css/cssproperties.c: Generated file.
2132 * khtml/css/cssproperties.h: Ditto.
2133 * khtml/css/cssproperties.in: Add support for parsing new font size delta property.
2134 * khtml/editing/htmlediting.cpp:
2135 (khtml::isEmptyStyleSpan): New helper function. Code existed before, but now factored out for convenient use.
2136 (khtml::CompositeEditCommand::removeNodeAttribute): Does check on value to see it exists before creating
2137 and running command to do the removal.
2138 (khtml::ApplyStyleCommand::doApply): Now calls new applyRelativeFontStyleChange() function as part of its work.
2139 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): New function that does the "heavy lifting" to handle
2140 relative font size changes.
2141 (khtml::ApplyStyleCommand::applyInlineStyle): Range check the start and end positions to make sure the start is
2142 before or equal to the end. Swap them if not true. I ran into this problem in some similar code in
2143 applyRelativeFontStyleChange(). Moving that goodness here too.
2144 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded): Uses a local variable to save a value used often.
2145 Code is the same, but reads better now. Function now returns bool as well, just like splitTextAtStartIfNeeded.
2146 I use the bool return value now (I obviously did not need it before).
2147 (khtml::ApplyStyleCommand::computedFontSize): New helper function.
2148 (khtml::ApplyStyleCommand::joinChildTextNodes): Ditto.
2149 (khtml::createStyleSpanElement): Ditto.
2150 * khtml/editing/htmlediting.h: Update header accordingly.
2151 * khtml/editing/jsediting.cpp: Add new command string to enable relative font size changes.
2153 (-[DOMCSSStyleDeclaration _fontSizeDelta]): New convenience.
2154 (-[DOMCSSStyleDeclaration _setFontSizeDelta:]): Ditto.
2155 * kwq/DOMPrivate.h: Declare new conveniences.
2156 * layout-tests/editing/editing.js: Add new JS to enable relative font size changes, as well as explicit font size setting.
2157 * layout-tests/editing/style/relative-font-size-change-001-expected.txt: Added.
2158 * layout-tests/editing/style/relative-font-size-change-001.html: Added.
2159 * layout-tests/editing/style/relative-font-size-change-002-expected.txt: Added.
2160 * layout-tests/editing/style/relative-font-size-change-002.html: Added.
2161 * layout-tests/editing/style/relative-font-size-change-003-expected.txt: Added.
2162 * layout-tests/editing/style/relative-font-size-change-003.html: Added.
2163 * layout-tests/editing/style/relative-font-size-change-004-expected.txt: Added.
2164 * layout-tests/editing/style/relative-font-size-change-004.html: Added.
2166 2005-01-14 Darin Adler <darin@apple.com>
2168 * khtml/css/cssproperties.c: Regenerated with gperf 3.0.1.
2169 * khtml/css/cssvalues.c: Regenerated with gperf 3.0.1.
2170 * khtml/misc/htmlattrs.c: Regenerated with gperf 3.0.1.
2171 * khtml/misc/htmltags.c: Regenerated with gperf 3.0.1.
2173 2005-01-14 Chris Blumenberg <cblu@apple.com>
2175 Fixed: <rdar://problem/3886415> arrow keys don't work when the user hits Back to return to RSS page
2179 (KWQKHTMLPart::openURLFromPageCache): restore mousePressNode
2180 (KWQKHTMLPart::mousePressNode): new
2181 * kwq/KWQPageState.h:
2182 * kwq/KWQPageState.mm:
2183 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]): save the mousePressNode
2184 (-[KWQPageState clear]): clear the mousePressNode
2185 (-[KWQPageState dealloc]): deref the mousePressNode
2186 (-[KWQPageState mousePressNode]): new
2190 2005-01-13 Vicki Murley <vicki@apple.com>
2194 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
2196 * WebCore.pbproj/project.pbxproj: bump "2004" to "2005"
2198 2005-01-13 David Harrison <harrison@apple.com>
2200 Reviewed by Ken Kocienda.
2202 Better fix for 3905066.
2204 * khtml/editing/htmlediting.cpp:
2205 (khtml::InsertParagraphSeparatorCommand::doApply):
2207 2005-01-10 Maciej Stachowiak <mjs@apple.com>
2211 <rdar://problem/3758033> REGRESSION (Mail): Support attributes in marked text (International input)
2213 * khtml/rendering/render_text.cpp:
2214 (InlineTextBox::paint): Support painting custom underline markers for
2215 marked text in place of generic yellow.
2216 (InlineTextBox::paintMarkedTextUnderline): New method that handles this.
2217 * khtml/rendering/render_text.h:
2218 * kwq/KWQKHTMLPart.h: Declare new methods and structs.
2219 * kwq/KWQKHTMLPart.mm:
2220 (KWQKHTMLPart::clear): Clear marked test underlines.
2221 (KWQKHTMLPart::setMarkedTextRange): Takes attributes and ranges now.
2222 (convertAttributesToUnderlines): Converts NSAttributedString attributes
2223 to simplified and C++-friendly form.
2224 (KWQKHTMLPart::markedTextUsesUnderlines): New method.
2225 (KWQKHTMLPart::markedTextUnderlines): New method.
2226 * kwq/KWQPainter.mm:
2227 (QPainter::drawLineForText): Handle pen width.
2228 * kwq/WebCoreBridge.h:
2229 * kwq/WebCoreBridge.mm:
2230 (-[WebCoreBridge setMarkedTextDOMRange:customAttributes:ranges:]): Take attributes
2232 * kwq/WebCoreTextRenderer.h:
2234 2005-01-12 David Harrison <harrison@apple.com>
2236 Reviewed by Dave Hyatt.
2238 <rdar://problem/3888973> AX: Parent AXWebArea of nested AXWebAreas is messed up
2240 * kwq/KWQAccObject.mm:
2241 (-[KWQAccObject addChildrenToArray:]):
2242 Use the widget's outer view.
2244 2005-01-12 David Harrison <harrison@apple.com>
2246 Reviewed by Darin Adler.
2248 <rdar://problem/3949908> Crash when asking for the kAXLengthForTextMarkerRangeParameterizedAttribute
2250 * khtml/xml/dom_nodeimpl.cpp:
2251 (NodeImpl::displayNode):
2252 Add quotes around text node content.
2253 (NodeBaseImpl::childNode):
2254 Add nil check to return nil rather than crash when child node not found.
2255 * kwq/KWQAccObject.mm:
2256 (-[KWQAccObject doAXStringForTextMarkerRange:]):
2257 Pass range compliant positions to TextIterator.
2259 2005-01-12 David Hyatt <hyatt@apple.com>
2261 Fix for 3951203, CSS border style incorrectly clipped on inline elements. Make sure the repaint rect set during
2262 line layout is smarter about including the overflow for both old states and new states.
2266 * khtml/rendering/bidi.cpp:
2267 (khtml::RenderBlock::layoutInlineChildren):
2269 2005-01-12 David Hyatt <hyatt@apple.com>
2271 Fix for bug 3937608, versiontracker.com flashes and displays the right column below content. Make sure to move
2272 tables/overflows that dont fit within a block only in strict mode.
2274 Fix for bug 3931049, characters dont show up when typing. Make sure to dirty the right lines when this specific
2275 case in editing is hit.
2277 Reviewed by darin (first one), kocienda (second one)
2279 * khtml/rendering/render_block.cpp:
2280 (khtml::RenderBlock::getClearDelta):
2281 * khtml/rendering/render_flow.cpp:
2282 (RenderFlow::dirtyLinesFromChangedChild):
2283 * khtml/rendering/render_line.cpp:
2284 (khtml::InlineFlowBox::verticallyAlignBoxes):
2286 2005-01-12 Ken Kocienda <kocienda@apple.com>
2292 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
2294 * khtml/editing/htmlediting.cpp:
2295 (khtml::DeleteSelectionCommand::initializePositionData): Change test that will prevent block
2296 merging. End-of-line test was just wrong. Call new start-of and end-of paragraph functions
2297 added to visible_position files.
2298 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Add tests for BR elements, which makes
2299 tests to determine when to stop moving nodes more complete and correct. Also improved comments.
2300 * khtml/editing/visible_position.cpp:
2301 (khtml::isFirstVisiblePositionInParagraph): New function.
2302 (khtml::isLastVisiblePositionInParagraph): New function.
2303 * khtml/editing/visible_position.h: Update header accordingly.
2304 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: New results, slightly different from former
2305 results but still correct.
2306 * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Ditto.
2307 * layout-tests/editing/deleting/delete-block-merge-contents-018-expected.txt: Added.
2308 * layout-tests/editing/deleting/delete-block-merge-contents-018.html: Added.
2309 * layout-tests/editing/deleting/delete-block-merge-contents-019-expected.txt: Added.
2310 * layout-tests/editing/deleting/delete-block-merge-contents-019.html: Added.
2311 * layout-tests/editing/deleting/delete-block-merge-contents-020-expected.txt: Added.
2312 * layout-tests/editing/deleting/delete-block-merge-contents-020.html: Added.
2313 * layout-tests/editing/deleting/delete-block-merge-contents-021-expected.txt: Added.
2314 * layout-tests/editing/deleting/delete-block-merge-contents-021.html: Added.
2315 * layout-tests/editing/deleting/delete-line-014-expected.txt: These new results are actually better, and fix a bug.
2317 2005-01-11 Richard Williamson <rjw@apple.com>
2319 Fixed 3922875. Fall back to DOM object is EMBED element
2320 has no associated runtime object.
2324 * khtml/ecma/kjs_dom.cpp:
2325 (KJS::getRuntimeObject):
2326 * khtml/ecma/kjs_html.cpp:
2327 (KJS::HTMLDocument::tryGet):
2328 (KJS::HTMLElement::tryGet):
2329 (KJS::HTMLCollection::tryGet):
2330 (KJS::HTMLCollection::getNamedItems):
2332 2005-01-11 David Hyatt <hyatt@apple.com>
2334 Fix for 3882299, missing content on gibson.com. Change our handling of " and ' in certain states of the parser to match
2339 * khtml/html/htmltokenizer.cpp:
2340 (khtml::HTMLTokenizer::parseTag):
2342 2005-01-11 Chris Blumenberg <cblu@apple.com>
2344 Fixed: <rdar://problem/3930733> Mail prints second page of email blank
2348 * khtml/rendering/render_canvas.cpp:
2349 (RenderCanvas::paint): cache the print rect since the dirty rect can get changed during printing
2350 * khtml/rendering/render_flow.cpp:
2351 (RenderFlow::paintLines): removed null check since the print rect should never be null
2352 * khtml/rendering/render_list.cpp:
2353 (RenderListMarker::paint): ditto
2354 * kwq/KWQKHTMLPart.mm:
2355 (KWQKHTMLPart::adjustPageHeight): don't set the print rect here since this method is not called for the last page
2357 2005-01-10 Ken Kocienda <kocienda@apple.com>
2363 <rdar://problem/3943648> extra line is inserted after pressing return within quoted text of reply
2365 * khtml/editing/htmlediting.cpp:
2366 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): This bug was the result of a
2367 simple coding mistake. A local variable was erroneously redefined in a deeper scope, and so the
2368 result calculated in that deeper scope was not available when tested.
2370 2005-01-10 Ken Kocienda <kocienda@apple.com>
2376 <rdar://problem/3946852> Option-e goes to next line
2378 * khtml/editing/htmlediting.cpp:
2379 (khtml::ReplaceSelectionCommand::doApply): Tweak case used to determine when merging content
2380 into the start line is done. We plan to change pretty substantially soon to better handle
2381 the problem described in <rdar://problem/3937352> Quote level not maintained when copied
2382 and pasted within a Mail message. In the meantime, this change does no harm, and fixes the bug.
2384 2005-01-10 Ken Kocienda <kocienda@apple.com>
2390 <rdar://problem/3907005> Applying block styles to a line of text can unexpectedly affect other lines
2392 * khtml/editing/htmlediting.cpp:
2393 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): New function which moves "paragraphs"
2394 to their own blocks if needed so that a block style can be applied.
2395 (khtml::CompositeEditCommand::isMailBlockquote): Moved this function to base class so it can be used more generally.
2396 (khtml::ApplyStyleCommand::applyBlockStyle): Pass a node instead of a block to addBlockStyleIfNeeded().
2397 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Now accepts a node instead of a block for styling.
2398 This function also now calls moveParagraphContentsToNewBlockIfNecessary() to make sure that only the current
2399 paragraph is styled.
2400 (khtml::SetNodeAttributeCommand::doUnapply): Should not assert on undo if old value of attribute was null.
2401 Should remove attributue instead.
2402 * khtml/editing/htmlediting.h: Touch function declarations accordingly.
2403 * layout-tests/editing/style/create-block-for-style-001-expected.txt: Added.
2404 * layout-tests/editing/style/create-block-for-style-001.html: Added.
2405 * layout-tests/editing/style/create-block-for-style-002-expected.txt: Added.
2406 * layout-tests/editing/style/create-block-for-style-002.html: Added.
2407 * layout-tests/editing/style/create-block-for-style-003-expected.txt: Added.
2408 * layout-tests/editing/style/create-block-for-style-003.html: Added.
2409 * layout-tests/editing/style/create-block-for-style-004-expected.txt: Added.
2410 * layout-tests/editing/style/create-block-for-style-004.html: Added.
2411 * layout-tests/editing/style/create-block-for-style-005-expected.txt: Added.
2412 * layout-tests/editing/style/create-block-for-style-005.html: Added.
2413 * layout-tests/editing/style/create-block-for-style-006-expected.txt: Added.
2414 * layout-tests/editing/style/create-block-for-style-006.html: Added.
2415 * layout-tests/editing/style/create-block-for-style-007-expected.txt: Added.
2416 * layout-tests/editing/style/create-block-for-style-007.html: Added.
2417 * layout-tests/editing/style/create-block-for-style-008-expected.txt: Added.
2418 * layout-tests/editing/style/create-block-for-style-008.html: Added.
2419 * layout-tests/editing/style/create-block-for-style-009-expected.txt: Added.
2420 * layout-tests/editing/style/create-block-for-style-009.html: Added.
2421 * layout-tests/editing/style/create-block-for-style-010-expected.txt: Added.
2422 * layout-tests/editing/style/create-block-for-style-010.html: Added.
2423 * layout-tests/editing/style/create-block-for-style-011-expected.txt: Added.
2424 * layout-tests/editing/style/create-block-for-style-011.html: Added.
2425 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Added.
2426 * layout-tests/editing/style/create-block-for-style-012.html: Added.
2427 * layout-tests/editing/style/create-block-for-style-013-expected.txt: Added.
2428 * layout-tests/editing/style/create-block-for-style-013.html: Added.
2430 Unrelated updates to these expected results.
2431 * layout-tests/editing/inserting/insert-div-007-expected.txt
2432 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
2434 2005-01-10 Chris Blumenberg <cblu@apple.com>
2436 Fixed: <rdar://problem/3936844> Mail: Messages with rich text do not print
2440 * khtml/rendering/render_flow.cpp:
2441 (RenderFlow::paintLines): don't do pagination work if printRect is not set
2442 * khtml/rendering/render_list.cpp:
2443 (RenderListMarker::paint): ditto
2445 2005-01-10 David Harrison <harrison@apple.com>
2449 * kwq/KWQTextUtilities.mm:
2450 (currentTextBreakLocaleID):
2451 Return empty string (AKA root locale) if locale pref can not be canonicalized.
2453 2005-01-10 John Sullivan <sullivan@apple.com>
2455 Fixed broken Panther build.
2457 * kwq/KWQTextUtilities.mm:
2458 (currentTextBreakLocaleID):
2459 This recently-added function was using code copy/pasted from CarbonCore UnicodeUtilities.
2460 That code used a Tiger-only function, CFLocaleCreateCanonicalLanguageIdentifierFromString.
2461 To fix the build, I added a BUILDING_ON_PANTHER #ifdef that avoids the call to the Tiger
2462 function. However, the Tiger-only code was wrong; the string generated using
2463 CFLocaleCreateCanonicalLanguageIdentifierFromString was not used at all, so I fixed that
2466 2005-01-09 David Harrison <harrison@apple.com>
2468 Reviewed by Ken Kocienda.
2470 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
2472 * khtml/editing/htmlediting.cpp:
2473 (khtml::ReplaceSelectionCommand::doApply):
2474 Tune check for need for insertParagraphSeparator when hasInterchangeNewline.
2476 2005-01-09 Darin Adler <darin@apple.com>
2478 Reviewed by Harrison.
2480 - fixed <rdar://problem/3939176> select() method does not work on <input type=search>
2482 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::select): Changed if statement
2483 to a switch statement. Added SEARCH to the set of types that treat the renderer as a
2486 2005-01-09 David Harrison <harrison@apple.com>
2488 Reviewed by Ken Kocienda.
2490 <rdar://problem/3905066> REGRESSION (Mail): Hitting return key with caret in front of space causes space to become lost (resize fixes)
2492 Problem was that InsertParagraphSeparatorCommand::doApply() was not collapsing
2493 whitespace to a single non-breaking space when splitting a text node.
2495 * khtml/editing/htmlediting.cpp:
2496 (khtml::InsertParagraphSeparatorCommand::doApply):
2498 2005-01-08 Kevin Decker <kdecker@apple.com>
2502 Fixed: <rdar://problem/3924219> Calling setOuterHTML: on a DOMHTMLHtmlElement can crash a program
2504 * khtml/html/html_elementimpl.cpp:
2505 (HTMLElementImpl::setOuterHTML): Added a nil check for fragments who don't have parents.
2507 2005-01-07 Maciej Stachowiak <mjs@apple.com>
2511 <rdar://problem/3807144> REGRESSION (125-TOT): my bank's website doesn't work (Societe Generale, socgen.com)
2513 * Khtml/khtml_part.cpp:
2514 (KHTMLPart::checkCompleted): If the document is NULL, assume this frame has
2515 not started loading yet so it could not possibly be finishing here...
2516 (KHTMLPart::stop): ...unless the part is explicitly stopped and there is still
2517 no document, in this case we must have hit an error or been loading a non-HTML
2519 * khtml/khtml_part.h:
2521 2005-01-08 David Harrison <harrison@apple.com>
2525 <rdar://problem/3943415> REGRESSION (Mail): double-clicking past word selects previous word instead of only blank space
2527 * khtml/editing/selection.cpp:
2528 (khtml::Selection::validate):
2529 Tune word selections left/right choice to use right if on empty last line.
2531 2005-01-07 David Harrison <harrison@apple.com>
2535 <rdar://problem/3942619> AX: Support sentence ax attributes
2537 Needed to use the unicode utilities properly. Twas lame before.
2539 * khtml/editing/visible_units.cpp:
2540 (khtml::previousBoundary):
2541 (khtml::nextBoundary):
2542 (khtml::startOfWord):
2544 (khtml::previousWordPosition):
2545 (khtml::nextWordPosition):
2546 (khtml::startOfSentence):
2547 (khtml::endOfSentence):
2548 (khtml::previousSentencePosition):
2549 (khtml::nextSentencePosition):
2550 * kwq/KWQAccObject.mm:
2551 (-[KWQAccObject accessibilityAttributeNames]):
2552 (-[KWQAccObject accessibilityAttributeValue:]):
2553 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
2554 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
2555 * kwq/KWQTextUtilities.mm:
2556 (currentTextBreakLocaleID):
2557 (KWQFindSentenceBoundary):
2558 (KWQFindNextSentenceFromIndex):
2560 2005-01-07 Ken Kocienda <kocienda@apple.com>
2566 <rdar://problem/3939523> in some cases, text does not retain style info after pressing return twice
2567 <rdar://problem/3944492> after pressing return twice, text is bold when it shouldn't be
2569 * khtml/editing/htmlediting.cpp:
2570 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion):
2571 Merge the typing style with the computed style for the current position. Fixes both bugs.
2572 * khtml/editing/htmlediting.h:
2573 * layout-tests/editing/inserting/insert-div-023-expected.txt: Added.
2574 * layout-tests/editing/inserting/insert-div-023.html: Added.
2575 * layout-tests/editing/inserting/insert-div-024-expected.txt: Added.
2576 * layout-tests/editing/inserting/insert-div-024.html: Added.
2578 2005-01-07 David Hyatt <hyatt@apple.com>
2580 Fix for 3941364, make sure tables reset overflowWidth/Height when they lay out again. Fixes the odd scrolling
2581 behavior on worldofwarcraft.com.
2585 * khtml/rendering/render_table.cpp:
2586 (RenderTable::layout):
2588 2005-01-06 David Hyatt <hyatt@apple.com>
2590 Fix for 3932418 and 3920998, assertion failures caused by stray inline content inside tables. Bulletproof the hit testing to
2591 ignore inline flows in this case.
2595 * khtml/rendering/render_block.cpp:
2596 (khtml::RenderBlock::nodeAtPoint):
2598 2005-01-07 Ken Kocienda <kocienda@apple.com>
2604 <rdar://problem/3848412> for forwarded message, tabbing to message view scrolls to bottom of view
2606 * kwq/KWQKHTMLPart.mm:
2607 (KWQKHTMLPart::nextKeyViewInFrame): Don't scroll the focus node to visible if it is not
2608 in the document, or if it is not a descendent of the document element. In the case of the bug,
2609 since the selection has not yet been set up, the focus node passed here is the HTML element, and
2610 that does not yield a rect that is useful to us here. So now, in the case the bug mentions, we do nothing.
2612 2005-01-06 Kevin Decker <kdecker@apple.com>
2616 Fixed: <rdar://problem/3932215> REGRESSION (125-177): iFrame example at developer.apple.com fails in Safari
2618 * khtml/khtml_part.cpp:
2619 (KHTMLPart::processObjectRequest): m_bComplete was never true for frames generated by Javascript due to our synchronous loading and as a result, scheduled redirects wouldn't fire in KHTMLPart::scheduleLocationChange(). By virtue of being an empty document, a document is complete. In this special case it's safe at this point to call checkCompleted() which sets m_bComplete true.
2623 2005-01-06 David Harrison <harrison@apple.com>
2627 (addendum to previous checkin for this bug)
2628 <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
2630 Fix line navigation. Add AXUIElementForTextMarker.
2632 * kwq/KWQAccObject.mm:
2633 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
2634 (-[KWQAccObject doAXUIElementForTextMarker:]):
2635 (-[KWQAccObject doAXLineForTextMarker:]):
2636 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
2637 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2638 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2639 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
2640 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
2642 2005-01-06 Darin Adler <darin@apple.com>
2646 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
2648 (turns out the PLT regression was a false alarm)
2650 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
2651 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
2653 * khtml/html/htmlparser.cpp:
2654 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
2655 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
2656 to eliminate code that used ID_CLOSE_TAG for an array size.
2657 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
2658 that manages isindex to use deref instead of delete.
2659 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
2660 mistake of using ID_CLOSE_TAG for the array size too.
2661 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
2662 there and it would prevent custom tags from working. Added range check before using the forbidden
2663 tag array with the token ID since custom tags will use index values past the end of the array.
2664 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
2665 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
2666 createElement call is still here. Last time I left out a few form element types from this switch;
2668 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
2669 document if getTagID fails; this creates a unique per-document ID.
2671 * khtml/misc/htmltags.c: Regenerated.
2672 * khtml/misc/htmltags.h: Regenerated.
2674 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
2675 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
2676 Also rewrote getTagName to work with the new scheme.
2678 2005-01-06 David Harrison <harrison@apple.com>
2680 Fixed Panther build. Also, do not advertize sentence support since it is incomplete.
2682 * kwq/KWQAccObject.mm:
2683 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
2684 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
2685 (-[KWQAccObject accessibilityIsAttributeSettable:]):
2687 2005-01-06 David Harrison <harrison@apple.com>
2689 Reviewed by Dave Hyatt.
2691 <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
2692 <rdar://problem/3588548> AX: tabbing does not work correctly with the screen reader and a focused link; need AXFocusedUIElement to work
2694 Many more AX attributes supported. Numerous fixes to previous AX work.
2696 * khtml/editing/visible_units.cpp:
2697 (khtml::startSentenceBoundary):
2698 (khtml::startOfSentence):
2699 (khtml::endSentenceBoundary):
2700 (khtml::endOfSentence):
2701 (khtml::previousSentencePositionBoundary):
2702 (khtml::previousSentencePosition):
2703 (khtml::nextSentencePositionBoundary):
2704 (khtml::nextSentencePosition):
2705 * khtml/editing/visible_units.h:
2706 * khtml/khtmlview.cpp:
2707 (KHTMLView::layout):
2708 * khtml/misc/helper.cpp:
2709 (khtml::findSentenceBoundary):
2710 (khtml::nextSentenceFromIndex):
2711 * khtml/misc/helper.h:
2712 * khtml/misc/htmltags.c:
2715 * khtml/rendering/render_container.cpp:
2716 (RenderContainer::removeChildNode):
2717 (RenderContainer::appendChildNode):
2718 (RenderContainer::insertChildNode):
2719 * khtml/rendering/render_object.cpp:
2720 (RenderObject::remove):
2721 * khtml/xml/dom_docimpl.cpp:
2722 (DocumentImpl::getAccObjectCache):
2723 (DocumentImpl::updateSelection):
2724 (DocumentImpl::close):
2725 (DocumentImpl::setFocusNode):
2726 (DocumentImpl::parentDocument):
2727 (DocumentImpl::topDocument):
2728 * khtml/xml/dom_docimpl.h:
2729 * kwq/KWQAccObject.mm:
2730 (-[KWQAccObject accessibilityShouldUseUniqueId]):
2731 (-[KWQAccObject detach]):
2732 (-[KWQAccObject anchorElement]):
2733 (-[KWQAccObject firstChild]):
2734 (-[KWQAccObject lastChild]):
2735 (-[KWQAccObject previousSibling]):
2736 (-[KWQAccObject nextSibling]):
2737 (-[KWQAccObject parentObject]):
2738 (-[KWQAccObject value]):
2739 (-[KWQAccObject accessibilityAttributeNames]):
2740 (-[KWQAccObject accessibilityPerformAction:]):
2741 (-[KWQAccObject textMarkerForVisiblePosition:]):
2742 (-[KWQAccObject visiblePositionForTextMarker:]):
2743 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
2744 (-[KWQAccObject topDocument]):
2745 (-[KWQAccObject topRenderer]):
2746 (-[KWQAccObject topView]):
2747 (-[KWQAccObject accessibilityAttributeValue:]):
2748 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
2749 (-[KWQAccObject doAXLineForTextMarker:]):
2750 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
2751 (-[KWQAccObject doAXStringForTextMarkerRange:]):
2752 (-[KWQAccObject doAXTextMarkerForPosition:]):
2753 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
2754 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
2755 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
2756 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
2757 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
2758 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
2759 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
2760 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
2761 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
2762 (-[KWQAccObject doAXSentenceTextMarkerRangeForTextMarker:]):
2763 (-[KWQAccObject doAXParagraphTextMarkerRangeForTextMarker:]):
2764 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
2765 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
2766 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
2767 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
2768 (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
2769 (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
2770 (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
2771 (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
2772 (-[KWQAccObject doAXLengthForTextMarkerRange:]):
2773 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
2774 (-[KWQAccObject accessibilityHitTest:]):
2775 (-[KWQAccObject accessibilityFocusedUIElement]):
2776 (-[KWQAccObject accessibilityIsAttributeSettable:]):
2777 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
2778 (-[KWQAccObject setAccObjectID:]):
2779 (-[KWQAccObject removeAccObjectID]):
2780 * kwq/KWQAccObjectCache.h:
2781 * kwq/KWQAccObjectCache.mm:
2782 (KWQAccObjectCache::setAccObject):
2783 (KWQAccObjectCache::removeAccObject):
2784 (KWQAccObjectCache::visiblePositionForTextMarker):
2785 (KWQAccObjectCache::postNotificationToTopWebArea):
2786 (KWQAccObjectCache::postNotification):
2787 (KWQAccObjectCache::handleFocusedUIElementChanged):
2788 * kwq/KWQKHTMLPart.mm:
2789 (KWQKHTMLPart::respondToChangedContents):
2790 * kwq/KWQTextUtilities.h:
2791 * kwq/KWQTextUtilities.mm:
2792 (KWQFindNextWordFromIndex):
2793 (KWQFindSentenceBoundary):
2794 (KWQFindNextSentenceFromIndex):
2795 * kwq/WebCoreBridge.mm:
2796 (-[WebCoreBridge accessibilityTree]):
2798 2005-01-05 Darin Adler <darin@apple.com>
2802 - re-landing a subset of my custom tag change that does not fix the bug, but also does
2803 not introduce a performance regression
2805 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
2806 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
2808 * khtml/editing/htmlediting.cpp:
2809 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
2810 per-document tags and is just better all around for things like the document.
2811 (khtml::debugNode): Ditto.
2812 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
2813 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
2814 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
2815 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
2817 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
2818 non-HTML elements to be nested as desired.
2820 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
2821 * khtml/misc/htmlhashes.cpp:
2822 (khtml::getTagID): Changed return type to unsigned short.
2823 (khtml::getAttrID): Ditto.
2825 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
2826 * khtml/xml/dom_docimpl.cpp:
2827 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
2828 Also updated for a few tags that the parser handled but this did not.
2830 * kwq/KWQRenderTreeDebug.cpp:
2831 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
2832 the tag ID directly, which only works for standard nodes.
2833 (operator<<): Update to call getTagName.
2834 (nodePositionRelativeToRoot): Ditto.
2835 (writeSelection): Ditto.
2837 2005-01-05 Ken Kocienda <kocienda@apple.com>
2843 <rdar://problem/3941203> REGRESSION (Mail): Paste inserts content in wrong place
2845 * khtml/editing/htmlediting.cpp:
2846 (khtml::ReplaceSelectionCommand::doApply): Some cleanup and refinement of the concepts used to make
2847 this operation work correctly, particularly in the logic to figure out whether to merge content, and
2848 also performing merges.
2849 * khtml/editing/visible_position.cpp:
2850 (khtml::isFirstVisiblePositionInBlock): Simplification of test used to make this determination.
2851 * khtml/editing/visible_units.cpp:
2852 (khtml::isStartOfParagraph): New helper, used in khtml::ReplaceSelectionCommand::doApply().
2853 (khtml::isEndOfParagraph): Ditto.
2854 * khtml/editing/visible_units.h: Declare new functions.
2856 2005-01-04 Ken Kocienda <kocienda@apple.com>
2862 <rdar://problem/3926522> Pressing return in a quoted block inserts too many newlines
2864 * khtml/editing/htmlediting.cpp:
2865 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Call to insertBlockPlaceholderIfNeeded()
2866 for the block we are adding was being done at the wrong time, which led to the placeholder remaining
2867 in the document when it was not needed. This resulted in the extra space reported in the bug.
2869 2005-01-04 Kevin Decker <kdecker@apple.com>
2873 Fixed: <rdar://problem/3936879> nil-deref, crash in InlineFlowBox::nodeAtPoint closing DHTML menus at hrweb.apple.com
2875 * khtml/rendering/render_block.cpp:
2876 (khtml::RenderBlock::fillInlineSelectionGaps): Added a nil check. If there is no selection, don't try to get the selection's containing block. If we do, we'll crash.
2878 2005-01-04 David Hyatt <hyatt@apple.com>
2880 Fix for 3937203, force an update of the dashboard regions when scrollbars are added/removed.
2884 * khtml/rendering/render_layer.cpp:
2885 (RenderLayer::updateScrollInfoAfterLayout):
2887 2005-01-04 Ken Kocienda <kocienda@apple.com>
2891 Fix for these two bugs:
2893 <rdar://problem/3938935> REGRESSION (Mail): Pasting into an empty document mangles content
2894 <rdar://problem/3939148> REGRESSION (Mail): Pasting mistakenly reverses lines
2896 * khtml/editing/htmlediting.cpp:
2897 (khtml::ReplaceSelectionCommand::doApply): For 3938935, add one more case to handle an empty document; merge
2898 neither start nor end. For 3939148, improve the code which adjusts the insertion point during
2899 the process of pasting. It formerly handled only one of the possible cases.
2900 * layout-tests/editing/pasteboard/paste-text-015-expected.txt: Added.
2901 * layout-tests/editing/pasteboard/paste-text-015.html: Added.
2903 2005-01-04 David Hyatt <hyatt@apple.com>
2905 Fix for 3936571, placeholder attribute should work for normal inputs for Dashboard.
2909 * khtml/rendering/render_form.cpp:
2910 (RenderLineEdit::updateFromElement):
2911 * kwq/KWQLineEdit.mm:
2912 (QLineEdit::setPlaceholderString):
2914 2005-01-04 David Hyatt <hyatt@apple.com>
2916 Fix for 3830936, hang on changeforamerica.com. Make sure to ignore the style not yet available option when
2917 returning pseudo-styles.
2921 * khtml/css/cssstyleselector.cpp:
2922 (khtml::CSSStyleSelector::matchRulesForList):
2923 (khtml::CSSStyleSelector::pseudoStyleForElement):
2924 * khtml/rendering/render_style.cpp:
2925 (RenderStyle::addPseudoStyle):
2927 2005-01-04 Darin Adler <darin@apple.com>
2929 - rolled out my custom tag name change again -- it caused a 1 ms PLT regression
2931 * khtml/css/cssstyleselector.cpp:
2932 * khtml/editing/htmlediting.cpp:
2933 * khtml/editing/selection.cpp:
2934 * khtml/editing/visible_position.cpp:
2935 * khtml/html/dtd.cpp:
2936 * khtml/html/htmlparser.cpp:
2937 * khtml/html/htmlparser.h:
2938 * khtml/html/htmltokenizer.cpp:
2939 * khtml/misc/htmlhashes.cpp:
2940 * khtml/misc/htmlhashes.h:
2941 * khtml/misc/htmltags.c:
2942 * khtml/misc/htmltags.h:
2943 * khtml/misc/maketags:
2944 * khtml/xml/dom_docimpl.cpp:
2945 * khtml/xml/dom_docimpl.h:
2946 * khtml/xml/dom_nodeimpl.cpp:
2947 * khtml/xml/dom_position.cpp:
2948 * kwq/KWQRenderTreeDebug.cpp:
2950 2005-01-04 Ken Kocienda <kocienda@apple.com>
2956 <rdar://problem/3927554> Style info applied to remainder of document after a newline is entered
2958 * khtml/editing/htmlediting.cpp:
2959 (khtml::InsertParagraphSeparatorCommand::doApply): Clean up and simplification in code that inserts
2960 a paragraph separator. The bug was all about applying styles to the new paragraph that did not need
2961 to be applied. Now the code will detect when at the end of a style run and will not move and apply
2962 that ending style to the new paragraph, though it will place that style into the typing style. This
2963 seems to match NSText behavior.
2964 * layout-tests/editing/inserting/insert-div-021-expected.txt: This test result exhibited the bug fixed
2965 here. The only reason it was not noticed is that the erroneously copied inline was a span, and so did
2966 not have any visible effect on the document.
2967 * layout-tests/editing/inserting/insert-div-022-expected.txt: Added.
2968 * layout-tests/editing/inserting/insert-div-022.html: Added.
2970 2005-01-04 David Hyatt <hyatt@apple.com>
2972 Fix for 3904562, make sure to clear the outline dictionary when drawing so that random focus rings dont get drawn
2977 * khtml/rendering/render_flow.cpp:
2978 (RenderFlow::paintLines):
2980 2005-01-03 David Hyatt <hyatt@apple.com>
2982 Fix for float painting regressions 3932524, 3931664, and 3933068. Make the noPaint flag setting more
2983 robust and make it work regardless of which objects get a layout or not.
2987 * khtml/rendering/render_block.cpp:
2988 (khtml::RenderBlock::insertFloatingObject):
2989 (khtml::RenderBlock::addOverhangingFloats):
2990 (khtml::RenderBlock::addIntrudingFloats):
2991 * khtml/rendering/render_block.h:
2992 (khtml::RenderBlock::FloatingObject::FloatingObject):
2994 2005-01-03 Maciej Stachowiak <mjs@apple.com>
2998 <rdar://problem/3935390> Tiger 8A341: nil deref crash in DOM::NodeImpl::traverseNextNode
3000 * khtml/html/html_miscimpl.cpp:
3001 (HTMLCollectionImpl::traverseNextItem): Assert that the starting point is not nil,
3002 it should not ever be (now).
3003 (HTMLCollectionImpl::item): When traversing items stop when we hit
3004 nil, meaning the end to avoid triggering above assert (formerly crash).
3006 2005-01-03 Maciej Stachowiak <mjs@apple.com>
3008 Reviewed by John and Kevin.
3010 <rdar://problem/3870317> REGRESSION(125.9-125.11) broken behavior at test.profoundlearning.com - used to
3012 * khtml/ecma/kjs_window.cpp:
3013 (Window::get): Look up frame names before buitin window properties
3014 to match other browsers. This regressed because we added a builtin
3015 "toolbar" property but this site had a frame with that name.
3017 2004-12-21 Maciej Stachowiak <mjs@apple.com>
3021 <rdar://problem/3888931> frame naming allows malicious site to bring up a window when you click on a link in another
3023 Added opener bridge method to help WebKit implement security check
3024 for named frame visibility.
3026 * khtml/khtml_part.h:
3027 * kwq/WebCoreBridge.h:
3028 * kwq/WebCoreBridge.mm:
3029 (-[WebCoreBridge opener]):
3031 2005-01-03 Ken Kocienda <kocienda@apple.com>
3037 <rdar://problem/3933926> Tiger8A341: Mail crashes while forwarding embedded HTML message in -[WebCoreBridge ensureSelectionVisible]
3039 * kwq/WebCoreBridge.mm:
3040 (-[WebCoreBridge ensureSelectionVisible]): Put in some null checks to prevent crash experienced in bug.
3042 2005-01-03 David Hyatt <hyatt@apple.com>
3044 Fix for 3936881, make sure positioned objects prooperly update y-position.
3048 * khtml/rendering/render_block.cpp:
3049 (khtml::RenderBlock::layoutPositionedObjects):
3051 2005-01-03 Ken Kocienda <kocienda@apple.com>
3053 Reviewed by Harrison
3057 <rdar://problem/3928250> REGRESSION (Mail): Typing style lost after hitting return key
3059 * khtml/editing/htmlediting.cpp:
3060 (khtml::InsertLineBreakCommand::preservesTypingStyle): Now implemented, returning yes for this command.
3061 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Initialize new typing style member variable.
3062 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Deref new typing style member variable.
3063 (khtml::InsertParagraphSeparatorCommand::preservesTypingStyle): Now implemented, returning yes for this command.
3064 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion): New function to set the typing style
3065 (khtml::InsertParagraphSeparatorCommand::calculateAndSetTypingStyleAfterInsertion): Function called after the <p>
3066 insertion is done. This function diffs the style created in setFullTypingStyleBeforeInsertion() with the style
3067 of the new <p> and only sets those styles needed to preserve the style in effect before the insertion.
3068 (khtml::InsertParagraphSeparatorCommand::doApply): Call new functions.
3069 (khtml::TypingCommand::preservesTypingStyle): Now yes for inserting line breaks and paragraphs.
3070 * khtml/editing/htmlediting.h: Declare new functions.
3072 2004-12-25 Kevin Decker <kdecker@apple.com>
3076 Fixed: <rdar://problem/3505072> hang in KHTMLParser::parseToken (consulting.soroos.net)
3078 * khtml/html/dtd.cpp: <label> needed a much higher priority such that it will close block elements. Malformed HTML (ugh) is the only reason why we need to do this.
3080 2004-12-23 Darin Adler <darin@apple.com>
3084 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
3086 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
3087 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
3089 * khtml/editing/htmlediting.cpp:
3090 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
3091 per-document tags and is just better all around for things like the document.
3092 (khtml::debugNode): Ditto.
3093 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
3094 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
3095 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
3096 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
3098 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
3099 non-HTML elements to be nested as desired.
3101 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
3102 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
3104 * khtml/html/htmlparser.cpp:
3105 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
3106 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
3107 to eliminate code that used ID_CLOSE_TAG for an array size.
3108 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
3109 that manages isindex to use deref instead of delete.
3110 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
3111 mistake of using ID_CLOSE_TAG for the array size too.
3112 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
3113 there and it would prevent custom tags from working. Added range check before using the forbidden
3114 tag array with the token ID since custom tags will use index values past the end of the array.
3115 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
3116 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
3117 createElement call is still here. Last time I left out a few form element types from this switch;
3119 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
3120 document if getTagID fails; this creates a unique per-document ID.
3122 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
3123 * khtml/misc/htmlhashes.cpp:
3124 (khtml::getTagID): Changed return type to unsigned short.
3125 (khtml::getAttrID): Ditto.
3127 * khtml/misc/htmltags.c: Regenerated.
3128 * khtml/misc/htmltags.h: Regenerated.
3130 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
3131 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
3132 Also rewrote getTagName to work with the new scheme.
3134 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
3135 * khtml/xml/dom_docimpl.cpp:
3136 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
3137 Also updated for a few tags that the parser handled but this did not.
3139 * kwq/KWQRenderTreeDebug.cpp:
3140 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
3141 the tag ID directly, which only works for standard nodes.
3142 (operator<<): Update to call getTagName.
3143 (nodePositionRelativeToRoot): Ditto.
3144 (writeSelection): Ditto.
3148 2004-12-22 Darin Adler <darin@apple.com>
3150 - rolled out my custom tag name change -- it broke amazon.com
3152 * khtml/css/cssstyleselector.cpp:
3153 * khtml/editing/htmlediting.cpp:
3154 * khtml/editing/selection.cpp:
3155 * khtml/editing/visible_position.cpp:
3156 * khtml/html/dtd.cpp:
3157 * khtml/html/htmlparser.cpp:
3158 * khtml/html/htmlparser.h:
3159 * khtml/html/htmltokenizer.cpp:
3160 * khtml/misc/htmlhashes.cpp:
3161 * khtml/misc/htmlhashes.h:
3162 * khtml/misc/htmltags.c:
3163 * khtml/misc/htmltags.h:
3164 * khtml/misc/maketags:
3165 * khtml/xml/dom_docimpl.cpp:
3166 * khtml/xml/dom_docimpl.h:
3167 * khtml/xml/dom_nodeimpl.cpp:
3168 * khtml/xml/dom_position.cpp:
3169 * kwq/KWQRenderTreeDebug.cpp:
3171 2004-12-22 David Harrison <harrison@apple.com>
3173 Reviewed by Darin Adler.
3175 * khtml/editing/selection.cpp:
3176 (khtml::Selection::validate):
3177 The selecting/deselecting bad behavior is because the Selection code that expands by words
3178 had an inaccurate test for being at the end of the document (where double-clicking needs
3179 to select the last word). Fixed that check.
3181 2004-12-22 Adele Amchan <adele@apple.com>
3185 Fix for <rdar://problem/3911650> tabs at safeway.com stop working after a while
3187 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scrollToAnchor): removed call to cancelRedirection
3188 so that we match Firefox and WinIE behavior.
3190 2004-12-22 Darin Adler <darin@apple.com>
3194 - fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
3196 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
3197 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
3199 * khtml/editing/htmlediting.cpp:
3200 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
3201 per-document tags and is just better all around for things like the document.
3202 (khtml::debugNode): Ditto.
3203 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
3204 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
3205 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
3206 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
3208 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
3209 non-HTML elements to be nested as desired.
3211 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
3212 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
3214 * khtml/html/htmlparser.cpp:
3215 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
3216 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
3217 to eliminate code that used ID_CLOSE_TAG for an array size.
3218 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
3219 that manages isindex to use deref instead of delete.
3220 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
3221 mistake of using ID_CLOSE_TAG for the array size too.
3222 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
3223 there and it would prevent custom tags from working. Added range check before using the forbidden
3224 tag array with the token ID since custom tags will use index values past the end of the array.
3225 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
3226 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
3227 createElement call is still here.
3228 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
3229 document if getTagID fails; this creates a unique per-document ID.
3231 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
3232 * khtml/misc/htmlhashes.cpp:
3233 (khtml::getTagID): Changed return type to unsigned short.
3234 (khtml::getAttrID): Ditto.
3236 * khtml/misc/htmltags.c: Regenerated.
3237 * khtml/misc/htmltags.h: Regenerated.
3239 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
3240 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
3241 Also rewrote getTagName to work with the new scheme.
3243 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
3244 * khtml/xml/dom_docimpl.cpp:
3245 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
3246 Also updated for a few tags that the parser handled but this did not.
3248 * kwq/KWQRenderTreeDebug.cpp:
3249 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
3250 the tag ID directly, which only works for standard nodes.
3251 (operator<<): Update to call getTagName.
3252 (nodePositionRelativeToRoot): Ditto.
3253 (writeSelection): Ditto.
3255 2004-12-21 David Harrison <harrison@apple.com>
3257 Reviewed by Ken Kocienda.
3259 <rdar://problem/3924934> REGRESSION: double click at end of line selects start of next line
3261 Problem was the TextIterator was not handling exitNode() from a P block properly.
3263 * khtml/editing/visible_text.cpp:
3264 (khtml::TextIterator::TextIterator):
3265 Add new param that specifies whether the iterator is for content or for searching.
3266 Search iterators do not prevent newlines at the beginning.
3267 (khtml::TextIterator::advance):
3268 Added some comments.
3269 (khtml::TextIterator::handleTextNode):
3270 Added some comments.
3271 (khtml::TextIterator::exitNode):
3272 Emit newline for P (and other) blocks with position following the block, instead of the m_lastTextNode.
3273 (khtml::TextIterator::emitCharacter):
3274 Added some comments.
3275 (khtml::TextIterator::range):
3276 Added some comments.
3277 (khtml::CharacterIterator::CharacterIterator):
3278 Specify search type TextIterator.
3279 (khtml::CharacterIterator::advance):
3280 * khtml/editing/visible_text.h:
3282 Add new TextIterator::TextIterator param that specifies whether the iterator is for content or for searching.
3283 * khtml/editing/visible_units.cpp:
3284 (khtml::nextWordBoundary):
3285 Specify search type TextIterator.
3287 2004-12-21 David Harrison <harrison@apple.com>
3289 Reviewed by Ken Kocienda.
3291 <rdar://problem/3924695> REGRESSION (Mail): double-clicking past end of line shows no selection, should select to EOL
3293 Problem was that RenderText::setSelectionState did not handle the SelectionStart case where start and end are the end of the line.
3294 Fixed by pretending the start == end-1 in that situation, as long as end > 0.
3296 * khtml/rendering/render_text.cpp:
3297 (RenderText::setSelectionState)
3299 2004-12-21 Maciej Stachowiak <mjs@apple.com>
3303 <rdar://problem/3929187> WebKit needs to restrict access to certain window operations by domain