[Webkit-unassigned] [Bug 51601] WML Parser should treat line/column number in a consistent way

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 2 19:13:23 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=51601





--- Comment #11 from Peter Rybin <peter.rybin at gmail.com>  2011-01-02 19:13:23 PST ---
(In reply to comment #10)
> Created an attachment (id=77785)
 --> (https://bugs.webkit.org/attachment.cgi?id=77785&action=review) [details]
> Proposed Patch4
> 
> Fixed the DRT test fail.
> 
> XML Parser reports only the first parsing error even if there are many errors on the same line.
> However, the latest patch reports all errors on the same line, so I fixed the patch as follows,
> 
> bool operator==(const TextPosition& other) { return m_line == other.m_line && m_column == other.m_column; }
> bool operator!=(const TextPosition& other) { return !((*this) == other); }
> 
> => 
> 
> bool operator==(const TextPosition& other) { return m_line == other.m_line && m_column == other.m_column; }
> bool operator!=(const TextPosition& other) { return m_line != other.m_line && m_column != other.m_column; }

This change looks extremely suspicious. It alters semantics of operator "!=" quite unexpectedly.

My guess is that the original code contains wrong boolean operator by mistake (ignore the error if it is at the same COLUMN as the previous one 100 lines above?). Anyway it was committed in r7094 in year 2004 so it's hard to find out for sure.

I would propose we either:
- consider the current code as a mistake and fix test expectations (do show all errors) or
- keep the original logic in new terms:
   m_lastErrorPosition.m_line != position.m_line && m_lastErrorPosition.m_column != position.m_column
   (TextPosition may or may not retain its now-unused operator)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list