Title: [202498] trunk
- Revision
- 202498
- Author
- [email protected]
- Date
- 2016-06-27 11:18:37 -0700 (Mon, 27 Jun 2016)
Log Message
REGRESSION: Web Inspector: Text search broken in resources with <CR>
https://bugs.webkit.org/show_bug.cgi?id=159110
<rdar://problem/27008485>
Reviewed by Brian Burg.
Source/_javascript_Core:
* inspector/ContentSearchUtilities.cpp:
(Inspector::ContentSearchUtilities::lineEndings):
The frontend moved to only treated newlines as line endings in
the TextEditor. The backend however was looking for many
different types of line endings (\r\n, \r, \n). This caused
the line endings to ultimately differ between the frontend
and the backend, so the frontend couldn't find the lines that
the backend was claiming search results were on. Change the
backend to only look for \n line endings.
LayoutTests:
* inspector/debugger/searchInContent-linebreaks-expected.txt:
* inspector/debugger/searchInContent-linebreaks.html:
Now that the backend responds with lines that end in \n, this test changes
the number of line results. The frontend interprets this correctly.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (202497 => 202498)
--- trunk/LayoutTests/ChangeLog 2016-06-27 17:57:49 UTC (rev 202497)
+++ trunk/LayoutTests/ChangeLog 2016-06-27 18:18:37 UTC (rev 202498)
@@ -1,3 +1,16 @@
+2016-06-27 Joseph Pecoraro <[email protected]>
+
+ REGRESSION: Web Inspector: Text search broken in resources with <CR>
+ https://bugs.webkit.org/show_bug.cgi?id=159110
+ <rdar://problem/27008485>
+
+ Reviewed by Brian Burg.
+
+ * inspector/debugger/searchInContent-linebreaks-expected.txt:
+ * inspector/debugger/searchInContent-linebreaks.html:
+ Now that the backend responds with lines that end in \n, this test changes
+ the number of line results. The frontend interprets this correctly.
+
2016-06-27 Joanmarie Diggs <[email protected]>
AX: Anonymous RenderMathMLOperators are not exposed to the accessibility tree
Modified: trunk/LayoutTests/inspector/debugger/searchInContent-linebreaks-expected.txt (202497 => 202498)
--- trunk/LayoutTests/inspector/debugger/searchInContent-linebreaks-expected.txt 2016-06-27 17:57:49 UTC (rev 202497)
+++ trunk/LayoutTests/inspector/debugger/searchInContent-linebreaks-expected.txt 2016-06-27 18:18:37 UTC (rev 202498)
@@ -2,21 +2,18 @@
Scripts searched: 4
Script: mac-linebreaks.js
-Results found: 4
-Line 0: "// test one\r"
-Line 2: "// test two\r"
-Line 6: " // test three test four\r"
-Line 9: "// test no newline"
+Lines with matches: 1
+Line 0: "// test one\r// \r// test two\r\rfunction boo()\r{\r // test three test four\r}\r\r// test no newline"
Script: mixed-linebreaks.js
-Results found: 4
+Lines with matches: 4
Line 0: "// test one\n"
-Line 2: "// test two\r"
-Line 6: " // test three test four\r\n"
-Line 9: "// test no newline"
+Line 2: "// test two\r\r\n"
+Line 5: " // test three test four\r\n"
+Line 8: "// test no newline"
Script: unix-linebreaks.js
-Results found: 4
+Lines with matches: 4
Line 0: "// test one\n"
Line 2: "// test two\n"
Line 6: " // test three test four\n"
@@ -23,7 +20,7 @@
Line 9: "// test no newline"
Script: windows-linebreaks.js
-Results found: 4
+Lines with matches: 4
Line 0: "// test one\r\n"
Line 2: "// test two\r\n"
Line 6: " // test three test four\r\n"
Modified: trunk/LayoutTests/inspector/debugger/searchInContent-linebreaks.html (202497 => 202498)
--- trunk/LayoutTests/inspector/debugger/searchInContent-linebreaks.html 2016-06-27 17:57:49 UTC (rev 202497)
+++ trunk/LayoutTests/inspector/debugger/searchInContent-linebreaks.html 2016-06-27 18:18:37 UTC (rev 202498)
@@ -48,7 +48,7 @@
for (var testResult of sortedTestResults) {
var fileName = /([\w-]+\.js)$/.exec(testResult.url)[1];
ProtocolTest.log("Script: " + fileName);
- ProtocolTest.log("Results found: " + testResult.count);
+ ProtocolTest.log("Lines with matches: " + testResult.count);
for (var match of testResult.matches)
ProtocolTest.log("Line " + match.lineNumber + ": " + JSON.stringify(match.lineContent));
Modified: trunk/Source/_javascript_Core/ChangeLog (202497 => 202498)
--- trunk/Source/_javascript_Core/ChangeLog 2016-06-27 17:57:49 UTC (rev 202497)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-06-27 18:18:37 UTC (rev 202498)
@@ -1,3 +1,21 @@
+2016-06-27 Joseph Pecoraro <[email protected]>
+
+ REGRESSION: Web Inspector: Text search broken in resources with <CR>
+ https://bugs.webkit.org/show_bug.cgi?id=159110
+ <rdar://problem/27008485>
+
+ Reviewed by Brian Burg.
+
+ * inspector/ContentSearchUtilities.cpp:
+ (Inspector::ContentSearchUtilities::lineEndings):
+ The frontend moved to only treated newlines as line endings in
+ the TextEditor. The backend however was looking for many
+ different types of line endings (\r\n, \r, \n). This caused
+ the line endings to ultimately differ between the frontend
+ and the backend, so the frontend couldn't find the lines that
+ the backend was claiming search results were on. Change the
+ backend to only look for \n line endings.
+
2016-06-27 Brian Burg <[email protected]>
Web Inspector: CRASH in backend at Inspector::HeapFrontendDispatcher::garbageCollected + 552 when closing frontend/inspected page
Modified: trunk/Source/_javascript_Core/inspector/ContentSearchUtilities.cpp (202497 => 202498)
--- trunk/Source/_javascript_Core/inspector/ContentSearchUtilities.cpp 2016-06-27 17:57:49 UTC (rev 202497)
+++ trunk/Source/_javascript_Core/inspector/ContentSearchUtilities.cpp 2016-06-27 18:18:37 UTC (rev 202498)
@@ -104,12 +104,13 @@
size_t start = 0;
while (start < text.length()) {
- size_t nextStart = text.findNextLineStart(start);
- if (nextStart == notFound) {
+ size_t nextStart = text.find('\n', start);
+ if (nextStart == notFound || nextStart == (text.length() - 1)) {
result->append(text.length());
break;
}
+ nextStart += 1;
result->append(nextStart);
start = nextStart;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes