https://bugs.webkit.org/show_bug.cgi?id=148721
Reviewed by Darin Adler.
Source/WebCore:
Test: fast/url/user-visible/rf.html
* html/URLUtils.h: Made this header file work with Objective-C.
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
* testing/Internals.cpp:
(WebCore::Internals::getCurrentMediaControlsStatusForElement):
(WebCore::Internals::userVisibleString):
* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.mm: Added.
(WebCore::Internals::userVisibleString):
LayoutTests:
* TestExpectations:
* fast/url/user-visible: Added.
* fast/url/user-visible/rf-expected.txt: Added.
* fast/url/user-visible/rf.html: Added.
* platform/mac/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189285
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-09-03 Alexey Proskuryakov <ap@apple.com>
+
+ Test Russian ".рф" domain support
+ https://bugs.webkit.org/show_bug.cgi?id=148721
+
+ Reviewed by Darin Adler.
+
+ * TestExpectations:
+ * fast/url/user-visible: Added.
+ * fast/url/user-visible/rf-expected.txt: Added.
+ * fast/url/user-visible/rf.html: Added.
+ * platform/mac/TestExpectations:
+
2015-09-03 Chris Dumez <cdumez@apple.com>
document.createEvent("eventname") should do a case-insensitive match on the event name
fast/forms/search/search-padding-cancel-results-buttons.html [ Skip ]
fast/forms/search/search-results-hidden-crash.html [ Skip ]
+# This doesn't have to be platform-specific, but it's only implemented on Mac now.
+fast/url/user-visible [ Skip ]
+
#//////////////////////////////////////////////////////////////////////////////////////////
# End platform-specific tests.
#//////////////////////////////////////////////////////////////////////////////////////////
--- /dev/null
+Test IDN behavior for .рф top level domain.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS test('http://президент.рф/') is 'http://президент.рф/'
+PASS test('http://президент.рф./') is 'http://президент.рф./'
+PASS test('http://www.президент.рф/') is 'http://www.президент.рф/'
+PASS test('http://почта.президент.рф/') is 'http://почта.президент.рф/'
+PASS test('http://0ж9.рф/') is 'http://0ж9.рф/'
+PASS test('http://туда-сюда.рф/') is 'http://туда-сюда.рф/'
+PASS test('http://прeзидент.рф/') /* spoof: Roman 'e' */ is 'http://xn--e-htbdgf6aiiy.xn--p1ai/'
+PASS test('http://caxap.рф/') /* spoof: all characters in 'caxap' are Roman */ is 'http://caxap.xn--p1ai/'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+
+description("Test IDN behavior for .рф top level domain.");
+
+function test(url)
+{
+ var domURL = new URL(url);
+ return internals.userVisibleString(domURL);
+}
+
+shouldBe("test('http://президент.рф/')", "'http://президент.рф/'");
+shouldBe("test('http://президент.рф./')", "'http://президент.рф./'");
+shouldBe("test('http://www.президент.рф/')", "'http://www.президент.рф/'");
+shouldBe("test('http://почта.президент.рф/')", "'http://почта.президент.рф/'");
+shouldBe("test('http://0ж9.рф/')", "'http://0ж9.рф/'");
+shouldBe("test('http://туда-сюда.рф/')", "'http://туда-сюда.рф/'");
+shouldBe("test('http://прeзидент.рф/') /* spoof: Roman 'e' */", "'http://xn--e-htbdgf6aiiy.xn--p1ai/'");
+shouldBe("test('http://caxap.рф/') /* spoof: all characters in 'caxap' are Roman */", "'http://caxap.xn--p1ai/'");
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
fast/forms/search/search-padding-cancel-results-buttons.html [ Pass ]
fast/forms/search/search-results-hidden-crash.html [ Pass ]
+fast/url/user-visible [ Pass ]
+
#//////////////////////////////////////////////////////////////////////////////////////////
# End platform-specific directories.
#//////////////////////////////////////////////////////////////////////////////////////////
+2015-09-03 Alexey Proskuryakov <ap@apple.com>
+
+ Test Russian ".рф" domain support
+ https://bugs.webkit.org/show_bug.cgi?id=148721
+
+ Reviewed by Darin Adler.
+
+ Test: fast/url/user-visible/rf.html
+
+ * html/URLUtils.h: Made this header file work with Objective-C.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * testing/Internals.cpp:
+ (WebCore::Internals::getCurrentMediaControlsStatusForElement):
+ (WebCore::Internals::userVisibleString):
+ * testing/Internals.h:
+ * testing/Internals.idl:
+ * testing/Internals.mm: Added.
+ (WebCore::Internals::userVisibleString):
+
2015-09-03 Chris Dumez <cdumez@apple.com>
document.createEvent("eventname") should do a case-insensitive match on the event name
E172AF70180F289500FBADB9 /* CryptoKeyUsage.h in Headers */ = {isa = PBXBuildFile; fileRef = E172AF6F180F289500FBADB9 /* CryptoKeyUsage.h */; };
E172AF8F1811BC3700FBADB9 /* JSDOMPromise.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E172AF8D1811BC3700FBADB9 /* JSDOMPromise.cpp */; };
E172AF901811BC3700FBADB9 /* JSDOMPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = E172AF8E1811BC3700FBADB9 /* JSDOMPromise.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ E179F0DA1B9774FE00ED0A27 /* Internals.mm in Sources */ = {isa = PBXBuildFile; fileRef = E179F0D91B9774FE00ED0A27 /* Internals.mm */; };
E17B491516A9B094001C8839 /* TransitionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E17B491316A9B093001C8839 /* TransitionEvent.cpp */; };
E17B491616A9B094001C8839 /* TransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E17B491416A9B093001C8839 /* TransitionEvent.h */; };
E17B492116A9B8FF001C8839 /* JSTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E17B491F16A9B8FF001C8839 /* JSTransitionEvent.h */; };
E172AF8D1811BC3700FBADB9 /* JSDOMPromise.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMPromise.cpp; sourceTree = "<group>"; };
E172AF8E1811BC3700FBADB9 /* JSDOMPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMPromise.h; sourceTree = "<group>"; };
E176580C180DF3A0005A96D1 /* OESElementIndexUint.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = OESElementIndexUint.idl; sourceTree = "<group>"; };
+ E179F0D91B9774FE00ED0A27 /* Internals.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Internals.mm; sourceTree = "<group>"; };
E17B490B16A97269001C8839 /* TransitionEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TransitionEvent.idl; sourceTree = "<group>"; };
E17B491316A9B093001C8839 /* TransitionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransitionEvent.cpp; sourceTree = "<group>"; };
E17B491416A9B093001C8839 /* TransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransitionEvent.h; sourceTree = "<group>"; };
children = (
41815C1B138319630057AAA4 /* js */,
417DA4CF13734326007C57FB /* Internals.cpp */,
+ E179F0D91B9774FE00ED0A27 /* Internals.mm */,
417DA4CE13734326007C57FB /* Internals.h */,
41813F9113818AD60057AAA4 /* Internals.idl */,
A7BF7EDC14C9175A0014489D /* InternalSettings.cpp */,
53E29E5E167A8A1900586D3D /* InternalSettingsGenerated.cpp in Sources */,
417DA71D13735DFA007C57FB /* JSInternals.cpp in Sources */,
A740B5A714C935AF00A77FA4 /* JSInternalSettings.cpp in Sources */,
+ E179F0DA1B9774FE00ED0A27 /* Internals.mm in Sources */,
53ED3FDE167A88E7006762E6 /* JSInternalSettingsGenerated.cpp in Sources */,
A740B59714C935AF00A77FA4 /* JSMallocStatistics.cpp in Sources */,
CD5393D3175E018600C07123 /* JSMemoryInfo.cpp in Sources */,
"JSCSSStyleDeclaration" => 1,
"JSDocument" => 1,
"JSDOMPath" => 1,
+ "JSDOMURL" => 1,
"JSDOMWindow" => 1,
"JSElement" => 1,
"JSFile" => 1,
if (!url.canSetPathname())
return;
- if (value[0] == '/')
+ if (value[0U] == '/')
url.setPath(value);
else
url.setPath("/" + value);
void URLUtils<T>::setSearch(const String& value)
{
URL url = href();
- String newSearch = (value[0] == '?') ? value.substring(1) : value;
+ String newSearch = (value[0U] == '?') ? value.substring(1) : value;
// Make sure that '#' in the query does not leak to the hash.
url.setQuery(newSearch.replaceWithLiteral('#', "%23"));
void URLUtils<T>::setHash(const String& value)
{
URL url = href();
- if (value[0] == '#')
+ if (value[0U] == '#')
url.setFragmentIdentifier(value.substring(1));
else
url.setFragmentIdentifier(value);
#endif
}
+#if !PLATFORM(COCOA)
+String Internals::userVisibleString(const DOMURL*)
+{
+ // Not implemented in WebCore.
+ return String();
+}
+#endif
+
}
class ClientRectList;
class DOMPath;
class DOMStringList;
+class DOMURL;
class DOMWindow;
class Document;
class Element;
String getCurrentMediaControlsStatusForElement(HTMLMediaElement*);
+ String userVisibleString(const DOMURL*);
+
private:
explicit Internals(Document*);
Document* contextDocument() const;
[RaisesException] DOMString pathStringWithShrinkWrappedRects(sequence<double> rectComponents, double radius);
DOMString getCurrentMediaControlsStatusForElement(HTMLMediaElement element);
+
+ DOMString userVisibleString(DOMURL url);
};
--- /dev/null
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Internals.h"
+
+#include "DOMURL.h"
+#include "Document.h"
+#include "Editor.h"
+#include "EditorClient.h"
+#include "Frame.h"
+
+namespace WebCore {
+
+String Internals::userVisibleString(const DOMURL* url)
+{
+ return contextDocument()->frame()->editor().client()->userVisibleString(url->href());
+}
+
+}