Skip to content

Commit

Permalink
[Win] Unreviewed build fix after r157228
Browse files Browse the repository at this point in the history
The changes in r157228 trigger a bug in VS2010. This patch works around the compiler bug
to allow this platform to build.

* dom/Range.cpp: Move implementation to header file.
* dom/Range.h: Inline the method.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::open): Add stub method (with pointer arguments) to call the real
method with references.
* page/DOMWindow.h: Declare stub method taking pointer arguments to avoid compiler bug.
* testing/Internals.cpp:
(WebCore::Internals::openDummyInspectorFrontend): Use work-around method when building under
the buggy version of Visual Studio.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Oct 10, 2013
1 parent a895a4a commit e8805c2
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 9 deletions.
17 changes: 17 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
2013-10-10 Brent Fulgham <[email protected]>

[Win] Unreviewed build fix after r157228

The changes in r157228 trigger a bug in VS2010. This patch works around the compiler bug
to allow this platform to build.

* dom/Range.cpp: Move implementation to header file.
* dom/Range.h: Inline the method.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::open): Add stub method (with pointer arguments) to call the real
method with references.
* page/DOMWindow.h: Declare stub method taking pointer arguments to avoid compiler bug.
* testing/Internals.cpp:
(WebCore::Internals::openDummyInspectorFrontend): Use work-around method when building under
the buggy version of Visual Studio.

2013-10-10 Ryosuke Niwa <[email protected]>

Make all functions of EventDispatcher static
Expand Down
8 changes: 0 additions & 8 deletions Source/WebCore/dom/Range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1697,14 +1697,6 @@ bool areRangesEqual(const Range* a, const Range* b)
return a->startPosition() == b->startPosition() && a->endPosition() == b->endPosition();
}

PassRefPtr<Range> rangeOfContents(Node& node)
{
RefPtr<Range> range = Range::create(node.document());
int exception = 0;
range->selectNodeContents(&node, exception);
return range.release();
}

int Range::maxStartOffset() const
{
if (!m_start.container())
Expand Down
8 changes: 7 additions & 1 deletion Source/WebCore/dom/Range.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,13 @@ class Range : public RefCounted<Range> {
RangeBoundaryPoint m_end;
};

PassRefPtr<Range> rangeOfContents(Node&);
inline PassRefPtr<Range> rangeOfContents(Node& node)
{
RefPtr<Range> range = Range::create(node.document());
int exception = 0;
range->selectNodeContents(&node, exception);
return range.release();
}

bool areRangesEqual(const Range*, const Range*);

Expand Down
9 changes: 9 additions & 0 deletions Source/WebCore/page/DOMWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1902,6 +1902,15 @@ PassRefPtr<Frame> DOMWindow::createWindow(const String& urlString, const AtomicS
return newFrame.release();
}

#if defined(_MSC_VER) && _MSC_VER <= 1700
// Work around a compiler bug in Visual Studio:
PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString,
DOMWindow* activeWindow, DOMWindow* firstWindow)
{
return open(urlString, frameName, windowFeaturesString, *activeWindow, *firstWindow);
}
#endif

PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString,
DOMWindow& activeWindow, DOMWindow& firstWindow)
{
Expand Down
4 changes: 4 additions & 0 deletions Source/WebCore/page/DOMWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ namespace WebCore {

PassRefPtr<DOMWindow> open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString,
DOMWindow& activeWindow, DOMWindow& firstWindow);
#if defined(_MSC_VER) && _MSC_VER <= 1700
PassRefPtr<DOMWindow> open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString,
DOMWindow* activeWindow, DOMWindow* firstWindow);
#endif

typedef void (*PrepareDialogFunction)(DOMWindow*, void* context);
void showModalDialog(const String& urlString, const String& dialogFeaturesString,
Expand Down
4 changes: 4 additions & 0 deletions Source/WebCore/testing/Internals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,11 @@ PassRefPtr<DOMWindow> Internals::openDummyInspectorFrontend(const String& url)
DOMWindow* window = page->mainFrame().document()->domWindow();
ASSERT(window);

#if defined(_MSC_VER) && _MSC_VER <= 1700
m_frontendWindow = window->open(url, "", "", window, window); // Work around bug in VS2010 and earlier
#else
m_frontendWindow = window->open(url, "", "", *window, *window);
#endif
ASSERT(m_frontendWindow);

Page* frontendPage = m_frontendWindow->document()->page();
Expand Down

0 comments on commit e8805c2

Please sign in to comment.