diff --git a/DEPS b/DEPS index 330d40a6..8be2109 100644 --- a/DEPS +++ b/DEPS
@@ -39,7 +39,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'f27106983048e7db5361bcc0cacc9d39d632817d', + 'skia_revision': '44d85d1748baf6fe61641673a55509af7def1886', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other.
diff --git a/third_party/WebKit/Source/build/scripts/templates/ElementLookupTrie.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ElementLookupTrie.h.tmpl index c207cf57..3fc2c0a 100644 --- a/third_party/WebKit/Source/build/scripts/templates/ElementLookupTrie.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/ElementLookupTrie.h.tmpl
@@ -4,11 +4,12 @@ #ifndef {{namespace}}ElementLookupTrie_h #define {{namespace}}ElementLookupTrie_h +#include "core/CoreExport.h" #include "wtf/text/StringImpl.h" namespace blink { -StringImpl* lookup{{namespace}}Tag(const UChar* data, unsigned length); +CORE_EXPORT StringImpl* lookup{{namespace}}Tag(const UChar* data, unsigned length); } // namespace blink
diff --git a/third_party/WebKit/Source/core/core.gypi b/third_party/WebKit/Source/core/core.gypi index 5baa046..feb6cfc 100644 --- a/third_party/WebKit/Source/core/core.gypi +++ b/third_party/WebKit/Source/core/core.gypi
@@ -2973,6 +2973,7 @@ 'html/imports/HTMLImportsController.h', 'html/imports/LinkImport.cpp', 'html/imports/LinkImport.h', + 'html/parser/AtomicHTMLToken.cpp', 'html/parser/AtomicHTMLToken.h', 'html/parser/BackgroundHTMLInputStream.cpp', 'html/parser/BackgroundHTMLInputStream.h', @@ -3865,6 +3866,8 @@ 'html/canvas/CanvasFontCacheTest.cpp', 'html/forms/FileInputTypeTest.cpp', 'html/forms/StepRangeTest.cpp', + 'html/parser/AtomicHTMLTokenTest.cpp', + 'html/parser/CompactHTMLTokenTest.cpp', 'html/parser/HTMLEntityParserTest.cpp', 'html/parser/HTMLParserThreadTest.cpp', 'html/parser/HTMLPreloadScannerTest.cpp',
diff --git a/third_party/WebKit/Source/core/html/parser/AtomicHTMLToken.cpp b/third_party/WebKit/Source/core/html/parser/AtomicHTMLToken.cpp new file mode 100644 index 0000000..c047e35 --- /dev/null +++ b/third_party/WebKit/Source/core/html/parser/AtomicHTMLToken.cpp
@@ -0,0 +1,25 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "config.h" +#include "core/html/parser/AtomicHTMLToken.h" + +namespace blink { + +QualifiedName AtomicHTMLToken::nameForAttribute(const HTMLToken::Attribute& attribute) const +{ + return QualifiedName(nullAtom, AtomicString(attribute.name), nullAtom); +} + +bool AtomicHTMLToken::usesName() const +{ + return m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag || m_type == HTMLToken::DOCTYPE; +} + +bool AtomicHTMLToken::usesAttributes() const +{ + return m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag; +} + +}
diff --git a/third_party/WebKit/Source/core/html/parser/AtomicHTMLToken.h b/third_party/WebKit/Source/core/html/parser/AtomicHTMLToken.h index a79339b..5b7b904d 100644 --- a/third_party/WebKit/Source/core/html/parser/AtomicHTMLToken.h +++ b/third_party/WebKit/Source/core/html/parser/AtomicHTMLToken.h
@@ -36,7 +36,7 @@ namespace blink { -class AtomicHTMLToken { +class CORE_EXPORT AtomicHTMLToken { STACK_ALLOCATED(); WTF_MAKE_NONCOPYABLE(AtomicHTMLToken); public: @@ -240,7 +240,7 @@ ASSERT(attribute.valueRange.start); ASSERT(attribute.valueRange.end); - AtomicString value(attribute.value); + AtomicString value(StringImpl::create8BitIfPossible(attribute.value)); const QualifiedName& name = nameForAttribute(attribute); // FIXME: This is N^2 for the number of attributes. if (!findAttributeInVector(m_attributes, name))
diff --git a/third_party/WebKit/Source/core/html/parser/AtomicHTMLTokenTest.cpp b/third_party/WebKit/Source/core/html/parser/AtomicHTMLTokenTest.cpp new file mode 100644 index 0000000..2dcaaf3a --- /dev/null +++ b/third_party/WebKit/Source/core/html/parser/AtomicHTMLTokenTest.cpp
@@ -0,0 +1,80 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "config.h" +#include "core/html/parser/AtomicHTMLToken.h" + +#include <gtest/gtest.h> + +namespace blink { + +TEST(AtomicHTMLTokenTest, EmptyAttributeValueFromHTMLToken) +{ + HTMLToken token; + token.beginStartTag('a'); + token.addNewAttribute(); + token.beginAttributeName(3); + token.appendToAttributeName('b'); + token.endAttributeName(4); + token.addNewAttribute(); + token.beginAttributeName(5); + token.appendToAttributeName('c'); + token.endAttributeName(6); + token.beginAttributeValue(8); + token.endAttributeValue(8); + + AtomicHTMLToken atoken(token); + + const blink::Attribute* attributeB = atoken.getAttributeItem( + QualifiedName(AtomicString(), "b", AtomicString())); + ASSERT_TRUE(attributeB); + EXPECT_FALSE(attributeB->value().isNull()); + EXPECT_TRUE(attributeB->value().isEmpty()); + + const blink::Attribute* attributeC = atoken.getAttributeItem( + QualifiedName(AtomicString(), "c", AtomicString())); + ASSERT_TRUE(attributeC); + EXPECT_FALSE(attributeC->value().isNull()); + EXPECT_TRUE(attributeC->value().isEmpty()); + + const blink::Attribute* attributeD = atoken.getAttributeItem( + QualifiedName(AtomicString(), "d", AtomicString())); + EXPECT_FALSE(attributeD); +} + +TEST(AtomicHTMLTokenTest, EmptyAttributeValueFromCompactHTMLToken) +{ + HTMLToken token; + token.beginStartTag('a'); + token.addNewAttribute(); + token.beginAttributeName(3); + token.appendToAttributeName('b'); + token.endAttributeName(4); + token.addNewAttribute(); + token.beginAttributeName(5); + token.appendToAttributeName('c'); + token.endAttributeName(6); + token.beginAttributeValue(8); + token.endAttributeValue(8); + + AtomicHTMLToken atoken(CompactHTMLToken(&token, TextPosition())); + + const blink::Attribute* attributeB = atoken.getAttributeItem( + QualifiedName(AtomicString(), "b", AtomicString())); + ASSERT_TRUE(attributeB); + EXPECT_FALSE(attributeB->value().isNull()); + EXPECT_TRUE(attributeB->value().isEmpty()); + + const blink::Attribute* attributeC = atoken.getAttributeItem( + QualifiedName(AtomicString(), "c", AtomicString())); + ASSERT_TRUE(attributeC); + EXPECT_FALSE(attributeC->value().isNull()); + EXPECT_TRUE(attributeC->value().isEmpty()); + + const blink::Attribute* attributeD = atoken.getAttributeItem( + QualifiedName(AtomicString(), "d", AtomicString())); + EXPECT_FALSE(attributeD); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/html/parser/CompactHTMLToken.h b/third_party/WebKit/Source/core/html/parser/CompactHTMLToken.h index dc0c30a..34e37c1 100644 --- a/third_party/WebKit/Source/core/html/parser/CompactHTMLToken.h +++ b/third_party/WebKit/Source/core/html/parser/CompactHTMLToken.h
@@ -36,7 +36,7 @@ class QualifiedName; -class CompactHTMLToken { +class CORE_EXPORT CompactHTMLToken { ALLOW_ONLY_INLINE_ALLOCATION(); public: struct Attribute {
diff --git a/third_party/WebKit/Source/core/html/parser/CompactHTMLTokenTest.cpp b/third_party/WebKit/Source/core/html/parser/CompactHTMLTokenTest.cpp new file mode 100644 index 0000000..f35767b --- /dev/null +++ b/third_party/WebKit/Source/core/html/parser/CompactHTMLTokenTest.cpp
@@ -0,0 +1,46 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "config.h" +#include "core/html/parser/CompactHTMLToken.h" + +#include <gtest/gtest.h> + +namespace blink { + +TEST(CompactHTMLTokenTest, EmptyAttributeValueFromHTMLToken) +{ + HTMLToken token; + token.beginStartTag('a'); + token.addNewAttribute(); + token.beginAttributeName(3); + token.appendToAttributeName('b'); + token.endAttributeName(4); + token.addNewAttribute(); + token.beginAttributeName(5); + token.appendToAttributeName('c'); + token.endAttributeName(6); + token.beginAttributeValue(8); + token.endAttributeValue(8); + + CompactHTMLToken ctoken(&token, TextPosition()); + + const CompactHTMLToken::Attribute* attributeB = ctoken.getAttributeItem( + QualifiedName(AtomicString(), "b", AtomicString())); + ASSERT_TRUE(attributeB); + EXPECT_FALSE(attributeB->value.isNull()); + EXPECT_TRUE(attributeB->value.isEmpty()); + + const CompactHTMLToken::Attribute* attributeC = ctoken.getAttributeItem( + QualifiedName(AtomicString(), "c", AtomicString())); + ASSERT_TRUE(attributeC); + EXPECT_FALSE(attributeC->value.isNull()); + EXPECT_TRUE(attributeC->value.isEmpty()); + + const CompactHTMLToken::Attribute* attributeD = ctoken.getAttributeItem( + QualifiedName(AtomicString(), "d", AtomicString())); + EXPECT_FALSE(attributeD); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLTokenizer.cpp b/third_party/WebKit/Source/core/html/parser/HTMLTokenizer.cpp index 47b00b22..29d87a2 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLTokenizer.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLTokenizer.cpp
@@ -36,7 +36,6 @@ #include "core/xml/parser/MarkupTokenizerInlines.h" #include "platform/NotImplemented.h" #include "wtf/ASCIICType.h" -#include "wtf/text/AtomicString.h" #include "wtf/text/Unicode.h" // Please don't use DEFINE_STATIC_LOCAL in this file. The HTMLTokenizer is used @@ -47,23 +46,6 @@ using namespace HTMLNames; -// This has to go in a .cpp file, as the linker doesn't like it being included more than once. -// We don't have an HTMLToken.cpp though, so this is the next best place. -QualifiedName AtomicHTMLToken::nameForAttribute(const HTMLToken::Attribute& attribute) const -{ - return QualifiedName(nullAtom, AtomicString(attribute.name), nullAtom); -} - -bool AtomicHTMLToken::usesName() const -{ - return m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag || m_type == HTMLToken::DOCTYPE; -} - -bool AtomicHTMLToken::usesAttributes() const -{ - return m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag; -} - static inline UChar toLowerCase(UChar cc) { ASSERT(isASCIIUpper(cc));