Thanks to visit codestin.com
Credit goes to github.com

Skip to content
1 change: 1 addition & 0 deletions Source/bindings/core/v8/DOMWrapperWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ DOMWrapperWorld& DOMWrapperWorld::current(v8::Isolate* isolate)
v8::Handle<v8::Context> context = isolate->GetCurrentContext();
if (context == node::g_context) {
LocalDOMWindow* window = (LocalDOMWindow*)toDOMWindow(context);
if (window == 0) return mainWorld();
context = toV8Context(window->frame(), DOMWrapperWorld::mainWorld());
if (context.IsEmpty())
return mainWorld();
Expand Down
2 changes: 1 addition & 1 deletion Source/bindings/core/v8/custom/V8WindowCustom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void V8Window::parentAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Va
LocalDOMWindow* imp = toLocalDOMWindow(V8Window::toImpl(info.Holder()));
LocalFrame* frame = imp->frame();
ASSERT(frame);
if (frame->isNwFakeTop()) {
if (frame && frame->isNwFakeTop()) {
v8SetReturnValue(info, toV8(imp, info.Holder(), info.GetIsolate()));
return;
}
Expand Down
1 change: 0 additions & 1 deletion Source/core/fileapi/File.idl
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@
[MeasureAs=FileGetLastModifiedDate] readonly attribute Date lastModifiedDate;
readonly attribute long long lastModified;
[MeasureAs=PrefixedFileRelativePath] readonly attribute DOMString webkitRelativePath;
readonly attribute DOMString path;
};
29 changes: 13 additions & 16 deletions Source/core/html/forms/FileInputType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,22 +198,19 @@ bool FileInputType::canSetValue(const String& value)

bool FileInputType::getTypeSpecificValue(String& value)
{
if (m_fileList->isEmpty()) {
value = String();
return true;
}

// HTML5 tells us that we're supposed to use this goofy value for
// file input controls. Historically, browsers revealed the real
// file path, but that's a privacy problem. Code on the web
// decided to try to parse the value by looking for backslashes
// (because that's what Windows file paths use). To be compatible
// with that code, we make up a fake path for the file.
unsigned numFiles = m_fileList->length();
value = m_fileList->item(0)->path();
for (unsigned i = 1; i < numFiles; ++i)
value.append(String(";") + m_fileList->item(i)->path());
return true;
if (m_fileList->isEmpty()) {
value = String();
return true;
}

// HTML5 tells us that we're supposed to use this goofy value for
// file input controls. Historically, browsers revealed the real
// file path, but that's a privacy problem. Code on the web
// decided to try to parse the value by looking for backslashes
// (because that's what Windows file paths use). To be compatible
// with that code, we make up a fake path for the file.
value = "C:\\fakepath\\" + m_fileList->item(0)->name();
return true;
}

void FileInputType::setValue(const String&, bool valueChanged, TextFieldEventBehavior)
Expand Down
4 changes: 3 additions & 1 deletion Source/core/loader/FrameLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,11 @@ void FrameLoader::load(const FrameLoadRequest& passedRequest)

FrameLoadType newLoadType = determineFrameLoadType(request);
NavigationPolicy policy = navigationPolicyForRequest(request);
if (shouldOpenInNewWindow(targetFrame.get(), request, policy)) {
// if (shouldOpenInNewWindow(targetFrame.get(), request, policy)) {
if (request.frameName() == "_blank")
policy = NavigationPolicyNewWindow;
//FIXME: We need to process navigation policy aslo for opening a new tab
if (policy != NavigationPolicyCurrentTab) {
WebString manifest;
client()->willHandleNavigationPolicy(request.resourceRequest(), &policy, &manifest);
if (policy == NavigationPolicyIgnore)
Expand Down
6 changes: 6 additions & 0 deletions Source/core/rendering/RenderThemeChromiumMac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,14 @@ - (NSText *)currentEditor {

@end

#if !defined(NWJS_MAS)
// Forward declare Mac SPIs.
extern "C" {
void _NSDrawCarbonThemeBezel(NSRect frame, BOOL enabled, BOOL flipped);
// Request for public API: rdar://13787640
void _NSDrawCarbonThemeListBox(NSRect frame, BOOL enabled, BOOL flipped, BOOL always_yes);
}
#endif

namespace blink {

Expand Down Expand Up @@ -700,7 +702,9 @@ static NSControlSize searchFieldControlSizeForFont(RenderStyle* style)
// background. We need WebCore to paint styled backgrounds, so we'll use
// this AppKit SPI function instead.
if (!useNSTextFieldCell) {
#if !defined(NWJS_MAS)
_NSDrawCarbonThemeBezel(r, isEnabled(o) && !isReadOnlyControl(o), YES);
#endif
return false;
}
#endif
Expand Down Expand Up @@ -781,7 +785,9 @@ static NSControlSize searchFieldControlSizeForFont(RenderStyle* style)
bool RenderThemeChromiumMac::paintTextArea(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
LocalCurrentGraphicsContext localContext(paintInfo.context, r);
#if !defined(NWJS_MAS)
_NSDrawCarbonThemeListBox(r, isEnabled(o) && !isReadOnlyControl(o), YES, YES);
#endif
return false;
}

Expand Down
16 changes: 16 additions & 0 deletions Source/platform/mac/KillRingMac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

namespace blink {

#if !defined(NWJS_MAS)
extern "C" {

// Kill ring calls. Would be better to use NSKillRing.h, but that's not available as API or SPI.
Expand All @@ -40,44 +41,59 @@
void _NSSetKillRingToYankedState();

}
#endif

static void initializeKillRingIfNeeded()
{
static bool initializedKillRing = false;
if (!initializedKillRing) {
initializedKillRing = true;
#if !defined(NWJS_MAS)
_NSInitializeKillRing();
#endif
}
}

void KillRing::append(const String& string)
{
initializeKillRingIfNeeded();
#if !defined(NWJS_MAS)
_NSAppendToKillRing(string);
#endif
}

void KillRing::prepend(const String& string)
{
initializeKillRingIfNeeded();
#if !defined(NWJS_MAS)
_NSPrependToKillRing(string);
#endif
}

String KillRing::yank()
{
initializeKillRingIfNeeded();
#if !defined(NWJS_MAS)
return _NSYankFromKillRing();
#else
return "";
#endif
}

void KillRing::startNewSequence()
{
initializeKillRingIfNeeded();
#if !defined(NWJS_MAS)
_NSNewKillRingSequence();
#endif
}

void KillRing::setToYankedState()
{
initializeKillRingIfNeeded();
#if !defined(NWJS_MAS)
_NSSetKillRingToYankedState();
#endif
}

} // namespace blink