summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/parser/HTMLSourceTracker.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/html/parser/HTMLSourceTracker.h')
-rw-r--r--Source/WebCore/html/parser/HTMLSourceTracker.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/WebCore/html/parser/HTMLSourceTracker.h b/Source/WebCore/html/parser/HTMLSourceTracker.h
index 7f0378b8f..3a24cf0fc 100644
--- a/Source/WebCore/html/parser/HTMLSourceTracker.h
+++ b/Source/WebCore/html/parser/HTMLSourceTracker.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2010 Adam Barth. All Rights Reserved.
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,36 +24,36 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HTMLSourceTracker_h
-#define HTMLSourceTracker_h
+#pragma once
-#include "HTMLToken.h"
#include "SegmentedString.h"
namespace WebCore {
+class HTMLToken;
class HTMLTokenizer;
class HTMLSourceTracker {
WTF_MAKE_NONCOPYABLE(HTMLSourceTracker);
public:
- HTMLSourceTracker();
+ HTMLSourceTracker() = default;
- // FIXME: Once we move "end" into HTMLTokenizer, rename "start" to
- // something that makes it obvious that this method can be called multiple
- // times.
- void start(SegmentedString&, HTMLTokenizer*, HTMLToken&);
- void end(SegmentedString&, HTMLTokenizer*, HTMLToken&);
+ void startToken(SegmentedString&, HTMLTokenizer&);
+ void endToken(SegmentedString&, HTMLTokenizer&);
- String sourceForToken(const HTMLToken&);
+ String source(const HTMLToken&);
+ String source(const HTMLToken&, unsigned attributeStart, unsigned attributeEnd);
private:
+ bool m_started { false };
+
+ unsigned m_tokenStart;
+ unsigned m_tokenEnd;
+
SegmentedString m_previousSource;
SegmentedString m_currentSource;
String m_cachedSourceForToken;
};
-}
-
-#endif
+} // namespace WebCore