+2007-03-22 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Darin
+
+ Followup for recent fix to 5079700, found by assertion added to Safari.
+
+ * page/mac/FrameMac.mm:
+ (WebCore::Frame::searchForLabelsBeforeElement):
+ Fixed another place in this method where an empty NSString was being returned instead of nil.
+ Cleaned up the style a little too.
+
2007-03-22 David Hyatt <hyatt@apple.com>
Remove unnecessary destroyFrameAtIndex call. Now that we throw away
startingTableCell = static_cast<HTMLTableCellElement*>(n);
} else if (n->hasTagName(trTag) && startingTableCell) {
NSString* result = searchForLabelsAboveCell(regExp, startingTableCell);
- if (result && [result length] > 0) {
+ if (result && [result length] > 0)
return result;
- }
searchedCellAbove = true;
} else if (n->isTextNode() && n->renderer() && n->renderer()->style()->visibility() == VISIBLE) {
// For each text chunk, run the regexp
int pos = regExp->searchRev(nodeString);
if (pos >= 0)
return nodeString.mid(pos, regExp->matchedLength()).getNSString();
- else
- lengthSearched += nodeString.length();
+
+ lengthSearched += nodeString.length();
}
}
// If we started in a cell, but bailed because we found the start of the form or the
// previous element, we still might need to search the row above us for a label.
if (startingTableCell && !searchedCellAbove) {
- return searchForLabelsAboveCell(regExp, startingTableCell);
- } else {
- return nil;
+ NSString* result = searchForLabelsAboveCell(regExp, startingTableCell);
+ if (result && [result length] > 0)
+ return result;
}
+
+ return nil;
}
NSString* Frame::matchLabelsAgainstElement(NSArray* labels, Element* element)