Diff
Modified: trunk/Source/WebCore/ChangeLog (155227 => 155228)
--- trunk/Source/WebCore/ChangeLog 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/ChangeLog 2013-09-07 02:08:06 UTC (rev 155228)
@@ -1,3 +1,52 @@
+2013-09-06 Ryosuke Niwa <[email protected]>
+
+ Range::ownerDocument should return Document&
+ https://bugs.webkit.org/show_bug.cgi?id=120908
+
+ Reviewed by Andreas Kling.
+
+ Return Document& in Range::ownerDocument(). Also make setDocument take Document& so that this invariant is self-evident.
+
+ * bindings/objc/DOM.mm:
+ (-[DOMRange boundingBox]):
+ (-[DOMRange renderedImageForcingBlackText:]):
+ (-[DOMRange textRects]):
+ * dom/Range.cpp:
+ (WebCore::Range::setDocument):
+ (WebCore::Range::setStart):
+ (WebCore::Range::setEnd):
+ (WebCore::Range::selectNode):
+ (WebCore::Range::selectNodeContents):
+ * dom/Range.h:
+ (WebCore::Range::ownerDocument):
+ * editing/AlternativeTextController.cpp:
+ (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
+ * editing/Editor.cpp:
+ (WebCore::Editor::avoidIntersectionWithDeleteButtonController):
+ (WebCore::isFrameInRange):
+ (WebCore::Editor::countMatchesForText):
+ * editing/EditorCommand.cpp:
+ (WebCore::unionDOMRanges):
+ * editing/TextCheckingHelper.cpp:
+ (WebCore::TextCheckingHelper::unifiedTextCheckerEnabled):
+ * editing/TextIterator.cpp:
+ (WebCore::plainText):
+ (WebCore::findPlainText):
+ * editing/htmlediting.cpp:
+ (WebCore::extendRangeToWrappingNodes):
+ * editing/markup.cpp:
+ (WebCore::createMarkup):
+ (WebCore::createFragmentFromText):
+ * page/DragController.cpp:
+ (WebCore::documentFragmentFromDragData):
+ (WebCore::DragController::concludeEditDrag):
+ * page/Page.cpp:
+ (WebCore::Page::rangeOfString):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::absoluteBoundingBoxRectForRange):
+ * testing/Internals.cpp:
+ (WebCore::Internals::addTextMatchMarker):
+
2013-09-06 Brent Fulgham <[email protected]>
[Windows] StructuredExceptionHandlerSuppressor Causes Bad Interactions with Support Libraries
Modified: trunk/Source/WebCore/bindings/objc/DOM.mm (155227 => 155228)
--- trunk/Source/WebCore/bindings/objc/DOM.mm 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/bindings/objc/DOM.mm 2013-09-07 02:08:06 UTC (rev 155228)
@@ -319,14 +319,14 @@
- (NSRect)boundingBox
{
// FIXME: The call to updateLayoutIgnorePendingStylesheets should be moved into WebCore::Range.
- core(self)->ownerDocument()->updateLayoutIgnorePendingStylesheets();
+ core(self)->ownerDocument().updateLayoutIgnorePendingStylesheets();
return core(self)->boundingBox();
}
- (NSImage *)renderedImageForcingBlackText:(BOOL)forceBlackText
{
WebCore::Range* range = core(self);
- WebCore::Frame* frame = range->ownerDocument()->frame();
+ WebCore::Frame* frame = range->ownerDocument().frame();
if (!frame)
return nil;
@@ -337,7 +337,7 @@
{
// FIXME: The call to updateLayoutIgnorePendingStylesheets should be moved into WebCore::Range.
Vector<WebCore::IntRect> rects;
- core(self)->ownerDocument()->updateLayoutIgnorePendingStylesheets();
+ core(self)->ownerDocument().updateLayoutIgnorePendingStylesheets();
core(self)->textRects(rects);
return kit(rects);
}
Modified: trunk/Source/WebCore/dom/Range.cpp (155227 => 155228)
--- trunk/Source/WebCore/dom/Range.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/dom/Range.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -116,14 +116,14 @@
#endif
}
-void Range::setDocument(Document* document)
+void Range::setDocument(Document& document)
{
- ASSERT(m_ownerDocument != document);
+ ASSERT(m_ownerDocument != &document);
if (m_ownerDocument)
m_ownerDocument->detachRange(this);
- m_ownerDocument = document;
- m_start.setToStartOfNode(document);
- m_end.setToStartOfNode(document);
+ m_ownerDocument = &document;
+ m_start.setToStartOfNode(&document);
+ m_end.setToStartOfNode(&document);
m_ownerDocument->attachRange(this);
}
@@ -224,7 +224,7 @@
bool didMoveDocument = false;
if (&refNode->document() != m_ownerDocument) {
- setDocument(&refNode->document());
+ setDocument(refNode->document());
didMoveDocument = true;
}
@@ -253,7 +253,7 @@
bool didMoveDocument = false;
if (&refNode->document() != m_ownerDocument) {
- setDocument(&refNode->document());
+ setDocument(refNode->document());
didMoveDocument = true;
}
@@ -1344,7 +1344,7 @@
}
if (m_ownerDocument != &refNode->document())
- setDocument(&refNode->document());
+ setDocument(refNode->document());
ec = 0;
setStartBefore(refNode, ec);
@@ -1389,7 +1389,7 @@
}
if (m_ownerDocument != &refNode->document())
- setDocument(&refNode->document());
+ setDocument(refNode->document());
m_start.setToStartOfNode(refNode);
m_end.setToEndOfNode(refNode);
Modified: trunk/Source/WebCore/dom/Range.h (155227 => 155228)
--- trunk/Source/WebCore/dom/Range.h 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/dom/Range.h 2013-09-07 02:08:06 UTC (rev 155228)
@@ -53,7 +53,7 @@
static PassRefPtr<Range> create(PassRefPtr<Document>, const Position&, const Position&);
~Range();
- Document* ownerDocument() const { return m_ownerDocument.get(); }
+ Document& ownerDocument() const { return *m_ownerDocument; }
Node* startContainer() const { return m_start.container(); }
int startOffset() const { return m_start.offset(); }
Node* endContainer() const { return m_end.container(); }
@@ -152,7 +152,7 @@
explicit Range(PassRefPtr<Document>);
Range(PassRefPtr<Document>, PassRefPtr<Node> startContainer, int startOffset, PassRefPtr<Node> endContainer, int endOffset);
- void setDocument(Document*);
+ void setDocument(Document&);
Node* checkNodeWOffset(Node*, int offset, ExceptionCode&) const;
void checkNodeBA(Node*, ExceptionCode&) const;
Modified: trunk/Source/WebCore/editing/AlternativeTextController.cpp (155227 => 155228)
--- trunk/Source/WebCore/editing/AlternativeTextController.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/editing/AlternativeTextController.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -397,7 +397,7 @@
void AlternativeTextController::handleAlternativeTextUIResult(const String& result)
{
Range* rangeWithAlternative = m_alternativeTextInfo.rangeWithAlternative.get();
- if (!rangeWithAlternative || m_frame.document() != rangeWithAlternative->ownerDocument())
+ if (!rangeWithAlternative || m_frame.document() != &rangeWithAlternative->ownerDocument())
return;
String currentWord = plainText(rangeWithAlternative);
Modified: trunk/Source/WebCore/editing/Editor.cpp (155227 => 155228)
--- trunk/Source/WebCore/editing/Editor.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/editing/Editor.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -110,8 +110,6 @@
if (!range || !controller)
return 0;
- Document* document = range->ownerDocument();
-
Node* startContainer = range->startContainer();
int startOffset = range->startOffset();
Node* endContainer = range->endContainer();
@@ -134,7 +132,7 @@
endOffset = element->nodeIndex();
}
- return Range::create(document, startContainer, startOffset, endContainer, endOffset);
+ return Range::create(&range->ownerDocument(), startContainer, startOffset, endContainer, endOffset);
}
VisibleSelection Editor::avoidIntersectionWithDeleteButtonController(const VisibleSelection& selection) const
@@ -2919,7 +2917,7 @@
{
bool inRange = false;
for (HTMLFrameOwnerElement* ownerElement = frame->ownerElement(); ownerElement; ownerElement = ownerElement->document().ownerElement()) {
- if (&ownerElement->document() == range->ownerDocument()) {
+ if (&ownerElement->document() == &range->ownerDocument()) {
inRange = range->intersectsNode(ownerElement, IGNORE_EXCEPTION);
break;
}
@@ -2934,7 +2932,7 @@
RefPtr<Range> searchRange;
if (range) {
- if (range->ownerDocument() == m_frame.document())
+ if (&range->ownerDocument() == m_frame.document())
searchRange = range;
else if (!isFrameInRange(&m_frame, range))
return 0;
Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (155227 => 155228)
--- trunk/Source/WebCore/editing/EditorCommand.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -270,7 +270,7 @@
Range* start = a->compareBoundaryPoints(Range::START_TO_START, b, ASSERT_NO_EXCEPTION) <= 0 ? a : b;
Range* end = a->compareBoundaryPoints(Range::END_TO_END, b, ASSERT_NO_EXCEPTION) <= 0 ? b : a;
- return Range::create(a->ownerDocument(), start->startContainer(), start->startOffset(), end->endContainer(), end->endOffset());
+ return Range::create(&a->ownerDocument(), start->startContainer(), start->startOffset(), end->endContainer(), end->endOffset());
}
// Execute command functions
Modified: trunk/Source/WebCore/editing/TextCheckingHelper.cpp (155227 => 155228)
--- trunk/Source/WebCore/editing/TextCheckingHelper.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/editing/TextCheckingHelper.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -633,14 +633,7 @@
bool TextCheckingHelper::unifiedTextCheckerEnabled() const
{
- if (!m_range)
- return false;
-
- Document* doc = m_range->ownerDocument();
- if (!doc)
- return false;
-
- return WebCore::unifiedTextCheckerEnabled(doc->frame());
+ return m_range && WebCore::unifiedTextCheckerEnabled(m_range->ownerDocument().frame());
}
void checkTextOfParagraph(TextCheckerClient* client, const UChar* text, int length,
Modified: trunk/Source/WebCore/editing/TextIterator.cpp (155227 => 155228)
--- trunk/Source/WebCore/editing/TextIterator.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/editing/TextIterator.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -2535,8 +2535,8 @@
String result = builder.toString();
- if (isDisplayString && r->ownerDocument())
- r->ownerDocument()->displayStringModifiedByEncoding(result);
+ if (isDisplayString)
+ r->ownerDocument().displayStringModifiedByEncoding(result);
return result;
}
@@ -2557,7 +2557,7 @@
if (buffer.needsMoreContext()) {
RefPtr<Range> startRange = it.range();
- RefPtr<Range> beforeStartRange = startRange->ownerDocument()->createRange();
+ RefPtr<Range> beforeStartRange = startRange->ownerDocument().createRange();
beforeStartRange->setEnd(startRange->startContainer(), startRange->startOffset(), IGNORE_EXCEPTION);
for (SimplifiedBackwardsTextIterator backwardsIterator(beforeStartRange.get()); !backwardsIterator.atEnd(); backwardsIterator.advance()) {
buffer.prependContext(backwardsIterator.characters(), backwardsIterator.length());
@@ -2594,7 +2594,7 @@
PassRefPtr<Range> findPlainText(const Range* range, const String& target, FindOptions options)
{
// CharacterIterator requires renderers to be up-to-date
- range->ownerDocument()->updateLayout();
+ range->ownerDocument().updateLayout();
// First, find the text.
size_t matchStart;
Modified: trunk/Source/WebCore/editing/htmlediting.cpp (155227 => 155228)
--- trunk/Source/WebCore/editing/htmlediting.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/editing/htmlediting.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -571,7 +571,7 @@
return range;
// Create new range with the highest editable node contained within the range
- RefPtr<Range> extendedRange = Range::create(range->ownerDocument());
+ RefPtr<Range> extendedRange = Range::create(&range->ownerDocument());
extendedRange->selectNode(highestNode, IGNORE_EXCEPTION);
return extendedRange.release();
}
Modified: trunk/Source/WebCore/editing/markup.cpp (155227 => 155228)
--- trunk/Source/WebCore/editing/markup.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/editing/markup.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -637,16 +637,13 @@
if (!range)
return emptyString();
- Document* document = range->ownerDocument();
- if (!document)
- return emptyString();
-
+ Document& document = range->ownerDocument();
const Range* updatedRange = range;
#if ENABLE(DELETION_UI)
// Disable the delete button so it's elements are not serialized into the markup,
// but make sure neither endpoint is inside the delete user interface.
- Frame* frame = document->frame();
+ Frame* frame = document.frame();
DeleteButtonControllerDisableScope deleteButtonControllerDisableScope(frame);
RefPtr<Range> updatedRangeRef;
@@ -658,7 +655,7 @@
}
#endif
- return createMarkupInternal(document, range, updatedRange, nodes, shouldAnnotate, convertBlocksToInlines, shouldResolveURLs);
+ return createMarkupInternal(&document, range, updatedRange, nodes, shouldAnnotate, convertBlocksToInlines, shouldResolveURLs);
}
PassRefPtr<DocumentFragment> createFragmentFromMarkup(Document* document, const String& markup, const String& baseURL, ParserContentPolicy parserContentPolicy)
@@ -840,8 +837,8 @@
if (!context)
return 0;
- Document* document = context->ownerDocument();
- RefPtr<DocumentFragment> fragment = document->createDocumentFragment();
+ Document& document = context->ownerDocument();
+ RefPtr<DocumentFragment> fragment = document.createDocumentFragment();
if (text.isEmpty())
return fragment.release();
@@ -851,9 +848,9 @@
string.replace('\r', '\n');
if (contextPreservesNewline(*context)) {
- fragment->appendChild(document->createTextNode(string), ASSERT_NO_EXCEPTION);
+ fragment->appendChild(document.createTextNode(string), ASSERT_NO_EXCEPTION);
if (string.endsWith('\n')) {
- RefPtr<Element> element = createBreakElement(document);
+ RefPtr<Element> element = createBreakElement(&document);
element->setAttribute(classAttr, AppleInterchangeNewline);
fragment->appendChild(element.release(), ASSERT_NO_EXCEPTION);
}
@@ -885,16 +882,16 @@
RefPtr<Element> element;
if (s.isEmpty() && i + 1 == numLines) {
// For last line, use the "magic BR" rather than a P.
- element = createBreakElement(document);
+ element = createBreakElement(&document);
element->setAttribute(classAttr, AppleInterchangeNewline);
} else if (useLineBreak) {
- element = createBreakElement(document);
+ element = createBreakElement(&document);
fillContainerFromString(fragment.get(), s);
} else {
if (useClonesOfEnclosingBlock)
element = block->cloneElementWithoutChildren();
else
- element = createDefaultParagraphElement(document);
+ element = createDefaultParagraphElement(&document);
fillContainerFromString(element.get(), s);
}
fragment->appendChild(element.release(), ASSERT_NO_EXCEPTION);
Modified: trunk/Source/WebCore/page/DragController.cpp (155227 => 155228)
--- trunk/Source/WebCore/page/DragController.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/page/DragController.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -123,15 +123,13 @@
return adoptPtr(new DragController(page, client));
}
-static PassRefPtr<DocumentFragment> documentFragmentFromDragData(DragData* dragData, Frame* frame, RefPtr<Range> context,
- bool allowPlainText, bool& chosePlainText)
+static PassRefPtr<DocumentFragment> documentFragmentFromDragData(DragData* dragData, Frame* frame, PassRefPtr<Range> context, bool allowPlainText, bool& chosePlainText)
{
ASSERT(dragData);
chosePlainText = false;
- Document* document = context->ownerDocument();
- ASSERT(document);
- if (document && dragData->containsCompatibleContent()) {
+ Document& document = context->ownerDocument();
+ if (dragData->containsCompatibleContent()) {
if (PassRefPtr<DocumentFragment> fragment = dragData->asFragment(frame, context, allowPlainText, chosePlainText))
return fragment;
@@ -139,7 +137,7 @@
String title;
String url = "" DragData::DoNotConvertFilenames, &title);
if (!url.isEmpty()) {
- RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(document);
+ RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(&document);
anchor->setHref(url);
if (title.isEmpty()) {
// Try the plain text first because the url might be normalized or escaped.
@@ -148,9 +146,9 @@
if (title.isEmpty())
title = url;
}
- RefPtr<Node> anchorText = document->createTextNode(title);
+ RefPtr<Node> anchorText = document.createTextNode(title);
anchor->appendChild(anchorText, IGNORE_EXCEPTION);
- RefPtr<DocumentFragment> fragment = document->createDocumentFragment();
+ RefPtr<DocumentFragment> fragment = document.createDocumentFragment();
fragment->appendChild(anchor, IGNORE_EXCEPTION);
return fragment.get();
}
@@ -505,7 +503,7 @@
// manually controlling drag behaviour
if (!range)
return false;
- CachedResourceLoader* cachedResourceLoader = range->ownerDocument()->cachedResourceLoader();
+ CachedResourceLoader* cachedResourceLoader = range->ownerDocument().cachedResourceLoader();
ResourceCacheValidationSuppressor validationSuppressor(cachedResourceLoader);
if (dragIsMove(innerFrame->selection(), dragData) || dragCaret.isContentRichlyEditable()) {
bool chosePlainText = false;
Modified: trunk/Source/WebCore/page/Page.cpp (155227 => 155228)
--- trunk/Source/WebCore/page/Page.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/page/Page.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -630,11 +630,11 @@
if (target.isEmpty())
return 0;
- if (referenceRange && referenceRange->ownerDocument()->page() != this)
+ if (referenceRange && referenceRange->ownerDocument().page() != this)
return 0;
bool shouldWrap = options & WrapAround;
- Frame* frame = referenceRange ? referenceRange->ownerDocument()->frame() : &mainFrame();
+ Frame* frame = referenceRange ? referenceRange->ownerDocument().frame() : &mainFrame();
Frame* startFrame = frame;
do {
if (RefPtr<Range> resultRange = frame->editor().rangeOfString(target, frame == startFrame ? referenceRange : 0, options & ~WrapAround))
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (155227 => 155228)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -1259,8 +1259,7 @@
if (!range || !range->startContainer())
return FloatRect();
- if (range->ownerDocument())
- range->ownerDocument()->updateLayout();
+ range->ownerDocument().updateLayout();
Vector<FloatQuad> quads;
range->textQuads(quads);
Modified: trunk/Source/WebCore/testing/Internals.cpp (155227 => 155228)
--- trunk/Source/WebCore/testing/Internals.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebCore/testing/Internals.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -843,8 +843,8 @@
void Internals::addTextMatchMarker(const Range* range, bool isActive)
{
- range->ownerDocument()->updateLayoutIgnorePendingStylesheets();
- range->ownerDocument()->markers().addTextMatchMarker(range, isActive);
+ range->ownerDocument().updateLayoutIgnorePendingStylesheets();
+ range->ownerDocument().markers().addTextMatchMarker(range, isActive);
}
void Internals::setScrollViewPosition(Document* document, long x, long y, ExceptionCode& ec)
Modified: trunk/Source/WebKit/blackberry/ChangeLog (155227 => 155228)
--- trunk/Source/WebKit/blackberry/ChangeLog 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2013-09-07 02:08:06 UTC (rev 155228)
@@ -1,3 +1,18 @@
+2013-09-06 Ryosuke Niwa <[email protected]>
+
+ Range::ownerDocument should return Document&
+ https://bugs.webkit.org/show_bug.cgi?id=120908
+
+ Reviewed by Andreas Kling.
+
+ * WebKitSupport/InPageSearchManager.cpp:
+ (BlackBerry::WebKit::InPageSearchManager::findNextString):
+ (BlackBerry::WebKit::InPageSearchManager::findAndMarkText):
+ (BlackBerry::WebKit::InPageSearchManager::clearTextMatches):
+ (BlackBerry::WebKit::InPageSearchManager::setActiveMatchAndMarker):
+ (BlackBerry::WebKit::InPageSearchManager::frameUnloaded):
+ (BlackBerry::WebKit::InPageSearchManager::scopeStringMatches):
+
2013-08-30 Antti Koivisto <[email protected]>
Remove code behind ENABLE(DIALOG_ELEMENT)
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InPageSearchManager.cpp (155227 => 155228)
--- trunk/Source/WebKit/blackberry/WebKitSupport/InPageSearchManager.cpp 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InPageSearchManager.cpp 2013-09-07 02:08:06 UTC (rev 155228)
@@ -135,7 +135,7 @@
startFromSelection = true;
}
- Frame* currentActiveMatchFrame = selection.isNone() && m_activeMatch ? m_activeMatch->ownerDocument()->frame() : m_webPage->focusedOrMainFrame();
+ Frame* currentActiveMatchFrame = selection.isNone() && m_activeMatch ? m_activeMatch->ownerDocument().frame() : m_webPage->focusedOrMainFrame();
if (findAndMarkText(text, searchStartingPoint.get(), currentActiveMatchFrame, findOptions, newSearch, startFromSelection))
return true;
@@ -189,7 +189,7 @@
// Not highlighting all matches, we need to add the marker here,
// because scopeStringMatches does not add any markers, it only counts the number.
// No need to unmarkAllTextMatches, it is already done from the caller because of newSearch
- m_activeMatch->ownerDocument()->markers().addTextMatchMarker(m_activeMatch.get(), true);
+ m_activeMatch->ownerDocument().markers().addTextMatchMarker(m_activeMatch.get(), true);
frame->editor().setMarkedTextMatchesAreHighlighted(true /* highlight */);
}
return true;
@@ -222,7 +222,7 @@
// When only showing single matches, the scoping effort won't highlight
// all matches but count them.
m_webPage->m_page->unmarkAllTextMatches();
- m_activeMatch->ownerDocument()->markers().addTextMatchMarker(m_activeMatch.get(), true);
+ m_activeMatch->ownerDocument().markers().addTextMatchMarker(m_activeMatch.get(), true);
frame->editor().setMarkedTextMatchesAreHighlighted(true /* highlight */);
}
@@ -235,7 +235,7 @@
{
if (selectActiveMatchOnClear && m_activeMatch.get()) {
VisibleSelection selection(m_activeMatch.get());
- m_activeMatch->ownerDocument()->frame()->selection().setSelection(selection);
+ m_activeMatch->ownerDocument().frame()->selection().setSelection(selection);
}
m_webPage->m_page->unmarkAllTextMatches();
m_activeMatch = 0;
@@ -246,16 +246,12 @@
void InPageSearchManager::setActiveMatchAndMarker(PassRefPtr<Range> range)
{
// Clear the old marker, update our range, and highlight the new range.
- if (m_activeMatch.get()) {
- if (Document* doc = m_activeMatch->ownerDocument())
- doc->markers().setMarkersActive(m_activeMatch.get(), false);
- }
+ if (m_activeMatch.get())
+ m_activeMatch->ownerDocument().markers().setMarkersActive(m_activeMatch.get(), false);
m_activeMatch = range;
- if (m_activeMatch.get()) {
- if (Document* doc = m_activeMatch->ownerDocument())
- doc->markers().setMarkersActive(m_activeMatch.get(), true);
- }
+ if (m_activeMatch.get())
+ m_activeMatch->ownerDocument().markers().setMarkersActive(m_activeMatch.get(), true);
}
void InPageSearchManager::frameUnloaded(const Frame* frame)
@@ -273,7 +269,7 @@
return;
}
- Frame* currentActiveMatchFrame = m_activeMatch->ownerDocument()->frame();
+ Frame* currentActiveMatchFrame = m_activeMatch->ownerDocument().frame();
if (currentActiveMatchFrame == frame) {
// FIXME: We need to re-scope this frame instead of cancelling all effort?
cancelPendingScopingEffort();
@@ -302,7 +298,7 @@
return;
}
- if (m_resumeScopingFromRange && scopingFrame != m_resumeScopingFromRange->ownerDocument()->frame())
+ if (m_resumeScopingFromRange && scopingFrame != m_resumeScopingFromRange->ownerDocument().frame())
m_resumeScopingFromRange = 0;
RefPtr<Range> searchRange(rangeOfContents(scopingFrame->document()));
@@ -343,7 +339,7 @@
m_activeMatchIndex = m_activeMatchCount + matchCount;
}
if (!locateActiveMatchOnly && m_highlightAllMatches)
- resultRange->ownerDocument()->markers().addTextMatchMarker(resultRange.get(), foundActiveMatch);
+ resultRange->ownerDocument().markers().addTextMatchMarker(resultRange.get(), foundActiveMatch);
searchRange->setStart(resultRange->endContainer(ec), resultRange->endOffset(ec), ec);
ShadowRoot* shadowTreeRoot = searchRange->shadowRoot();
Modified: trunk/Source/WebKit/mac/ChangeLog (155227 => 155228)
--- trunk/Source/WebKit/mac/ChangeLog 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebKit/mac/ChangeLog 2013-09-07 02:08:06 UTC (rev 155228)
@@ -1,3 +1,13 @@
+2013-09-06 Ryosuke Niwa <[email protected]>
+
+ Range::ownerDocument should return Document&
+ https://bugs.webkit.org/show_bug.cgi?id=120908
+
+ Reviewed by Andreas Kling.
+
+ * WebView/WebPDFView.mm:
+ (isFrameInRange):
+
2013-09-05 Andreas Kling <[email protected]>
ScrollView::children() should return a reference.
Modified: trunk/Source/WebKit/mac/WebView/WebPDFView.mm (155227 => 155228)
--- trunk/Source/WebKit/mac/WebView/WebPDFView.mm 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebKit/mac/WebView/WebPDFView.mm 2013-09-07 02:08:06 UTC (rev 155228)
@@ -637,7 +637,7 @@
{
BOOL inRange = NO;
for (HTMLFrameOwnerElement* ownerElement = core(frame)->ownerElement(); ownerElement; ownerElement = ownerElement->document().frame()->ownerElement()) {
- if (&ownerElement->document() == core(range)->ownerDocument()) {
+ if (&ownerElement->document() == &core(range)->ownerDocument()) {
inRange = [range intersectsNode:kit(ownerElement)];
break;
}
Modified: trunk/Source/WebKit2/ChangeLog (155227 => 155228)
--- trunk/Source/WebKit2/ChangeLog 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebKit2/ChangeLog 2013-09-07 02:08:06 UTC (rev 155228)
@@ -1,3 +1,13 @@
+2013-09-06 Ryosuke Niwa <[email protected]>
+
+ Range::ownerDocument should return Document&
+ https://bugs.webkit.org/show_bug.cgi?id=120908
+
+ Reviewed by Andreas Kling.
+
+ * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
+ (-[WKDOMRange textRects]):
+
2013-09-05 Ryuan Choi <[email protected]>
[CMAKE] Add c++0x into CXX_FLAGS as a default
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm (155227 => 155228)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm 2013-09-06 23:50:40 UTC (rev 155227)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm 2013-09-07 02:08:06 UTC (rev 155228)
@@ -142,7 +142,7 @@
- (NSArray *)textRects
{
- _impl->ownerDocument()->updateLayoutIgnorePendingStylesheets();
+ _impl->ownerDocument().updateLayoutIgnorePendingStylesheets();
Vector<WebCore::IntRect> rects;
_impl->textRects(rects);
return WebKit::toNSArray(rects);