+2005-01-12 David Harrison <harrison@apple.com>
+
+ Reviewed by Darin Adler.
+
+ * khtml/xml/dom_nodeimpl.cpp:
+ (NodeImpl::displayNode):
+ Add quotes around text node content.
+ (NodeBaseImpl::childNode):
+ Add nil check to return nil rather than crash when child node not found.
+ * kwq/KWQAccObject.mm:
+ (-[KWQAccObject doAXStringForTextMarkerRange:]):
+ Pass range compliant positions to TextIterator.
+
2005-01-12 David Hyatt <hyatt@apple.com>
Fix for 3951203, CSS border style incorrectly clipped on inline elements. Make sure the repaint rect set during
if (!prefix)
prefix = "";
if (isTextNode())
- fprintf(stderr, "%s%s\t%p %s\n", prefix, nodeName().string().latin1(), this, nodeValue().string().latin1());
+ fprintf(stderr, "%s%s\t%p \"%s\"\n", prefix, nodeName().string().latin1(), this, nodeValue().string().latin1());
else
fprintf(stderr, "%s%s\t%p\n", prefix, nodeName().string().latin1(), this);
}
{
unsigned long i;
NodeImpl *n = firstChild();
- for (i = 0; i < index; i++)
+ for (i = 0; n != 0 && i < index; i++)
n = n->nextSibling();
return n;
}
- (id)doAXStringForTextMarkerRange: (AXTextMarkerRangeRef) textMarkerRange
{
- VisiblePosition startVisiblePosition, endVisiblePosition;
- Position startDeepPos, endDeepPos;
- QString qString;
-
// extract the start and end VisiblePosition
- startVisiblePosition = [self visiblePositionForStartOfTextMarkerRange: textMarkerRange];
+ VisiblePosition startVisiblePosition = [self visiblePositionForStartOfTextMarkerRange: textMarkerRange];
if (startVisiblePosition.isNull())
return nil;
- endVisiblePosition = [self visiblePositionForEndOfTextMarkerRange: textMarkerRange];
+ VisiblePosition endVisiblePosition = [self visiblePositionForEndOfTextMarkerRange: textMarkerRange];
if (endVisiblePosition.isNull())
return nil;
- // use deepEquivalent because it is what the user sees
- startDeepPos = startVisiblePosition.deepEquivalent();
- endDeepPos = endVisiblePosition.deepEquivalent();
-
// get the visible text in the range
- qString = plainText(Range(startDeepPos.node(), startDeepPos.offset(), endDeepPos.node(), endDeepPos.offset()));
- if (qString == nil) return nil;
+ QString qString = plainText(makeRange(startVisiblePosition, endVisiblePosition));
// transform it to a CFString and return that
return (id)qString.getCFString();