[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 02:23:13 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 819426831bccd762ce95731ffe14cdc4fbaf2088
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Mar 16 04:58:55 2010 +0000

    2010-03-15  Adam Bergkvist  <adam.bergkvist at ericsson.com>
    
            Reviewed by Adam Barth.
    
            According to the updated specification, a data field should always
            result in a newline character being appended to the data buffer
            regardless if the data buffer contains any data or not. However, upon
            event dispatch, the last newline will be removed. This differs from an
            older version of the specification where a newline character was
            appended before the data value only if the buffer already contained
            data. As a result, EventSource now supports receiving events with empty
            data or newline characters only. Updated test accordingly.
            https://bugs.webkit.org/show_bug.cgi?id=33210
    
            * http/tests/eventsource/eventsource-parse-event-stream-expected.txt:
            * http/tests/eventsource/eventsource-parse-event-stream.html:
            * http/tests/eventsource/resources/event-stream.php:
    2010-03-15  Adam Bergkvist  <adam.bergkvist at ericsson.com>
    
            Reviewed by Adam Barth.
    
            According to the updated specification, a data field should always
            result in a newline character being appended to the data buffer
            regardless if the data buffer contains any data or not. However, upon
            event dispatch, the last newline will be removed. This differs from an
            older version of the specification where a newline character was
            appended before the data value only if the buffer already contained
            data. As a result, EventSource now supports receiving events with empty
            data or newline characters only.
            https://bugs.webkit.org/show_bug.cgi?id=33210
    
            * page/EventSource.cpp:
            (WebCore::EventSource::parseEventStreamLine):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56035 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e3657ac..5a8dc2d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,21 @@
+2010-03-15  Adam Bergkvist  <adam.bergkvist at ericsson.com>
+
+        Reviewed by Adam Barth.
+
+        According to the updated specification, a data field should always
+        result in a newline character being appended to the data buffer
+        regardless if the data buffer contains any data or not. However, upon
+        event dispatch, the last newline will be removed. This differs from an
+        older version of the specification where a newline character was
+        appended before the data value only if the buffer already contained
+        data. As a result, EventSource now supports receiving events with empty
+        data or newline characters only. Updated test accordingly.
+        https://bugs.webkit.org/show_bug.cgi?id=33210
+
+        * http/tests/eventsource/eventsource-parse-event-stream-expected.txt:
+        * http/tests/eventsource/eventsource-parse-event-stream.html:
+        * http/tests/eventsource/resources/event-stream.php:
+
 2010-03-15  Valters Svabe  <vsvabe at gmail.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/http/tests/eventsource/eventsource-parse-event-stream-expected.txt b/LayoutTests/http/tests/eventsource/eventsource-parse-event-stream-expected.txt
index f43ceaa..9ba0c27 100644
--- a/LayoutTests/http/tests/eventsource/eventsource-parse-event-stream-expected.txt
+++ b/LayoutTests/http/tests/eventsource/eventsource-parse-event-stream-expected.txt
@@ -1,6 +1,7 @@
 Test EventSource text/event-stream parsing. Should print a series of PASS messages followed by DONE.
 
 PASS: got open event
+PASS: received event with two newlines
 PASS: received event with data "simple"
 PASS: received event with data spanning multiple lines
 PASS: received event and lastEventId is "1"
diff --git a/LayoutTests/http/tests/eventsource/eventsource-parse-event-stream.html b/LayoutTests/http/tests/eventsource/eventsource-parse-event-stream.html
index 525c267..60cb14a 100644
--- a/LayoutTests/http/tests/eventsource/eventsource-parse-event-stream.html
+++ b/LayoutTests/http/tests/eventsource/eventsource-parse-event-stream.html
@@ -12,7 +12,7 @@ if (window.layoutTestController) {
     layoutTestController.waitUntilDone();
 }
 
-var count = 0;
+var count = -1;
 var es = new EventSource("resources/event-stream.php");
 
 es.onopen = function (evt) {
@@ -24,6 +24,10 @@ es.onopen = function (evt) {
 
 es.onmessage = function (evt) {
     switch(count++) {
+        case -1:
+            if (evt.data == "\n\n")
+                log("PASS: received event with two newlines");
+            break;
         case 0:
             if (evt.data == "simple")
                 log("PASS: received event with data \"simple\"");
diff --git a/LayoutTests/http/tests/eventsource/resources/event-stream.php b/LayoutTests/http/tests/eventsource/resources/event-stream.php
index 312b29f..4e65fed 100644
--- a/LayoutTests/http/tests/eventsource/resources/event-stream.php
+++ b/LayoutTests/http/tests/eventsource/resources/event-stream.php
@@ -12,7 +12,7 @@ data : this line will be ignored since there is a space after data
 data
 data:
 data
-: no dispatch since data buffer is empty
+: dispatch event with two newlines
 
 data: simple
 
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index dcb6484..ae95a9e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-03-15  Adam Bergkvist  <adam.bergkvist at ericsson.com>
+
+        Reviewed by Adam Barth.
+
+        According to the updated specification, a data field should always
+        result in a newline character being appended to the data buffer
+        regardless if the data buffer contains any data or not. However, upon
+        event dispatch, the last newline will be removed. This differs from an
+        older version of the specification where a newline character was
+        appended before the data value only if the buffer already contained
+        data. As a result, EventSource now supports receiving events with empty
+        data or newline characters only.
+        https://bugs.webkit.org/show_bug.cgi?id=33210
+
+        * page/EventSource.cpp:
+        (WebCore::EventSource::parseEventStreamLine):
+
 2010-03-15  Valters Svabe  <vsvabe at gmail.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/page/EventSource.cpp b/WebCore/page/EventSource.cpp
index 0c79998..9ccccd7 100644
--- a/WebCore/page/EventSource.cpp
+++ b/WebCore/page/EventSource.cpp
@@ -250,8 +250,10 @@ void EventSource::parseEventStream()
 void EventSource::parseEventStreamLine(unsigned int bufPos, int fieldLength, int lineLength)
 {
     if (!lineLength) {
-        if (!m_data.isEmpty())
+        if (!m_data.isEmpty()) {
+            m_data.removeLast();
             dispatchEvent(createMessageEvent());
+        }
         if (!m_eventName.isEmpty())
             m_eventName = "";
     } else if (fieldLength) {
@@ -269,10 +271,9 @@ void EventSource::parseEventStreamLine(unsigned int bufPos, int fieldLength, int
         int valueLength = lineLength - step;
 
         if (field == "data") {
-            if (m_data.size() > 0)
-                m_data.append('\n');
             if (valueLength)
                 m_data.append(&m_receiveBuf[bufPos], valueLength);
+            m_data.append('\n');
         } else if (field == "event")
             m_eventName = valueLength ? String(&m_receiveBuf[bufPos], valueLength) : "";
         else if (field == "id")

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list