Index: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
index 1c7cf0f6b1bd990e571bc530520c1ecd66fd4eb4..9f8d01d1b3b05d186ef42053be7af4dafa0dd8b1 100644 |
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
@@ -448,6 +448,14 @@ void StripComments::process(UChar c) |
break; |
case InSingleLineComment: |
+ // Handle line-continuation character in single line comment. |
+ // Advance string to next nonspace character and eat it. |
Zhenyao Mo
2016/06/29 18:16:07
Can you also add a comment, saying that line-conti
Ken Russell (switch to Gerrit)
2016/06/30 00:04:31
This change doesn't seem to implement the behavior
qiankun
2016/06/30 15:12:47
Done.
|
+ if (c == '\\') { |
+ while (peek(temp) && WTF::isASCIISpace(temp)) |
+ advance(); |
+ advance(); |
+ } |
+ |
// The newline code at the top of this function takes care |
// of resetting our state when we get out of the |
// single-line comment. Swallow all other characters. |
@@ -5461,6 +5469,9 @@ bool WebGLRenderingContextBase::validateSize(const char* functionName, GLint x, |
bool WebGLRenderingContextBase::validateString(const char* functionName, const String& string) |
{ |
for (size_t i = 0; i < string.length(); ++i) { |
+ // line-continuation character \ is supported in WebGL 2.0. |
+ if (isWebGL2OrHigher() && string[i] == '\\') |
qiankun
2016/06/29 05:31:21
This isn't very accurate to say WebGL 2.0 here. We
Zhenyao Mo
2016/06/29 18:16:07
This is not true. See GLSL ES Spec 3.00.4 page 6,
Ken Russell (switch to Gerrit)
2016/06/30 00:04:31
This particular change (to validateString) seems w
|
+ continue; |
if (!validateCharacter(string[i])) { |
synthesizeGLError(GL_INVALID_VALUE, functionName, "string not ASCII"); |
return false; |