Timeline



Nov 29, 2004:

4:07 PM Changeset in webkit [8087] by kocienda
  • 6 edits
    20 adds in trunk

Reviewed by Chris

Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
are handled correctly now, including selections that span multiple blocks, and cases
where content on the pasteboard ends in newlines (or what appear to be newlines to a
user, really block ends or BRs). I also made one small, but important change in the
copy code to annotate the markup written to the pasteboard to support these selections
ending in newlines.

New header that defines a couple of constants used in copying and pasting.

  • ForwardingHeaders/editing/html_interchange.h: Added.
  • khtml/editing/html_interchange.h: Added.

Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
as a new helper class, ReplacementFragment, which encapsulates information and functions
pertaining to a document fragment that is being inserted into a document.

  • khtml/editing/htmlediting.cpp: (khtml::ReplacementFragment::ReplacementFragment): (khtml::ReplacementFragment::~ReplacementFragment): (khtml::ReplacementFragment::firstChild): Simple accessor. (khtml::ReplacementFragment::lastChild): Ditto. (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines the starting node to use for merging into the block containing the start of the selection. (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection. (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper. (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the special annotation comment added in by the copy code. (khtml::ReplacementFragment::removeNode): Simple helper. (khtml::isComment): Simple helper. (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block. I would like to do better than this some day, but this check will hold us until I can do better. (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): (khtml::ReplaceSelectionCommand::doApply): (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
  • khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class. (khtml::ReplacementFragment::root): (khtml::ReplacementFragment::type): (khtml::ReplacementFragment::isEmpty): (khtml::ReplacementFragment::isSingleTextNode): (khtml::ReplacementFragment::isTreeFragment): (khtml::ReplacementFragment::hasMoreThanOneBlock): (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):

This smaller set of changes markup generation to add the newline annotation described in the
comment at the start of this entry.

  • khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper. (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether comment annotations are added to the markup generated.
  • khtml/xml/dom2_rangeimpl.h: Add some new declarations.
  • kwq/WebCoreBridge.mm: (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to DOM::RangeImpl::toHTML uses annotations when generating.

New tests.

  • layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
  • layout-tests/editing/pasteboard/paste-text-001.html: Added.
  • layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
  • layout-tests/editing/pasteboard/paste-text-002.html: Added.
  • layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
  • layout-tests/editing/pasteboard/paste-text-003.html: Added.
  • layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
  • layout-tests/editing/pasteboard/paste-text-004.html: Added.
  • layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
  • layout-tests/editing/pasteboard/paste-text-005.html: Added.
  • layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
  • layout-tests/editing/pasteboard/paste-text-006.html: Added.
  • layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
  • layout-tests/editing/pasteboard/paste-text-007.html: Added.
  • layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
  • layout-tests/editing/pasteboard/paste-text-008.html: Added.
  • layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
  • layout-tests/editing/pasteboard/paste-text-009.html: Added.
3:13 PM Changeset in webkit [8086] by darin
  • 4 edits in trunk/WebKit

Reviewed by John.

  • worked around bug in Panther where NSScroller calls _destinationFloatValueForScroller: on superview without first checking if it's implemented
  • WebView.subproj/WebHTMLView.m: (-[WebHTMLView _destinationFloatValueForScroller:]): Implemented. Calls floatValue on the scroller.
  • English.lproj/StringsNotToBeLocalized.txt: Update for recent changes.
2:17 PM Changeset in webkit [8085] by kocienda
  • 3 edits in trunk/WebCore

Reviewed by Harrison

Made two small changes that make it possible for comments to have DOM nodes made for them
when pasting. This relies on some earlier work I did some days ago.

  • khtml/xml/dom_nodeimpl.cpp: (NodeImpl::startMarkup): Get the string from the comment.
  • kwq/WebCoreBridge.mm: (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor rearranging. Now passes a flag when creating a contextual fragment, requesting that comments be included in the DOM.
2:17 PM Changeset in webkit [8084] by kocienda
  • 3 edits in trunk/WebCore

Reviewed by Harrison

Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
my improved paste code.

  • khtml/editing/visible_position.cpp: (khtml::blockRelationship) (khtml::visiblePositionsInDifferentBlocks) (khtml::isFirstVisiblePositionInBlock) (khtml::isFirstVisiblePositionInNode) (khtml::isLastVisiblePositionInBlock)
  • khtml/editing/visible_position.h
2:13 PM Changeset in webkit [8083] by kocienda
  • 2 edits in trunk/WebCore

Reviewed by Harrison

  • khtml/xml/dom_position.cpp: (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock specified from obeying that directive. The old code would stop at an outer block boundary in the case where that block had a block as its first child. The correct behavior is to drill into that inner block (and continue on drilling down, if possible), to find the correct position.
2:11 PM Changeset in webkit [8082] by kocienda
  • 3 edits in trunk/WebCore

Reviewed by Harrison

Small improvements to the node-display debugging helpers.

  • khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
  • khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
2:05 PM Changeset in webkit [8081] by kocienda
  • 2 edits in trunk/WebCore

Reviewed by Harrison

  • khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function may need to be adjusted when deleting text off the front part of a text node. This fixes a problem I discovered while improving the paste command, where the insertion poitn wound up in the wrong place after the delete.
2:03 PM Changeset in webkit [8080] by kocienda
  • 3 edits in trunk/WebCore

Reviewed by Harrison

Add a new helper function to insert a paragraph separator. Will be used in my
upcoming paste improvments.

  • khtml/editing/htmlediting.cpp: Added function (khtml::CompositeEditCommand::insertParagraphSeparator)
  • khtml/editing/htmlediting.h: Ditto.
Note: See TracTimeline for information about the timeline view.