Fix HTMLToken::Attribute member naming and update callsites to use Vector-based String functions
https://bugs.webkit.org/show_bug.cgi?id=109638

Reviewed by Adam Barth.

Darin Adler noted in:
https://bugs.webkit.org/show_bug.cgi?id=109408#c4
that HTMLToken::Attribute (then MarkupTokenBase::Attribute)
was a struct, yet incorrectly used m_ for its public members.

This patch fixes the members to not have the m_, and since I was
touching all callers, I also updated all callers to use modern
Vector-based String creation/append functions instead of manually
calling UChar*, size_t versions.

There should be no behavior change to this patch.  Where I saw
performance/memory bugs, I noted them with FIXMEs to keep
this change simple.

* html/HTMLViewSourceDocument.cpp:
(WebCore::HTMLViewSourceDocument::processTagToken):
* html/parser/AtomicHTMLToken.h:
(WebCore::AtomicHTMLToken::publicIdentifier):
(WebCore::AtomicHTMLToken::systemIdentifier):
(WebCore::AtomicHTMLToken::AtomicHTMLToken):
(WebCore::AtomicHTMLToken::initializeAttributes):
* html/parser/CompactHTMLToken.cpp:
(WebCore::CompactHTMLToken::CompactHTMLToken):
* html/parser/HTMLMetaCharsetParser.cpp:
(WebCore::HTMLMetaCharsetParser::processMeta):
(WebCore::HTMLMetaCharsetParser::checkForMetaCharset):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::StartTagScanner::processAttributes):
(WebCore::HTMLPreloadScanner::scan):
(WebCore::HTMLPreloadScanner::processPossibleBaseTag):
(WebCore::HTMLPreloadScanner::processToken):
* html/parser/HTMLToken.h:
(Range):
(Attribute):
(WebCore::HTMLToken::clear):
(WebCore::HTMLToken::startIndex):
(WebCore::HTMLToken::endIndex):
(WebCore::HTMLToken::end):
(WebCore::HTMLToken::nameString):
(WebCore::HTMLToken::addNewAttribute):
(WebCore::HTMLToken::beginAttributeName):
(WebCore::HTMLToken::endAttributeName):
(WebCore::HTMLToken::beginAttributeValue):
(WebCore::HTMLToken::endAttributeValue):
(WebCore::HTMLToken::appendToAttributeName):
(WebCore::HTMLToken::appendToAttributeValue):
(WebCore::HTMLToken::eraseValueOfAttribute):
* html/parser/HTMLTokenizer.cpp:
(WebCore::AtomicHTMLToken::nameForAttribute):
* html/parser/HTMLViewSourceParser.cpp:
(WebCore::HTMLViewSourceParser::updateTokenizerState):
* html/parser/XSSAuditor.cpp:
(WebCore::findAttributeWithName):
(WebCore::XSSAuditor::filterParamToken):
(WebCore::XSSAuditor::eraseDangerousAttributesIfInjected):
(WebCore::XSSAuditor::eraseAttributeIfInjected):
(WebCore::XSSAuditor::decodedSnippetForAttribute):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator type safe.
https://bugs.webkit.org/show_bug.cgi?id=109561

Reviewed by Dimitri Glazkov.

Use FocusEvent rather than Event in {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator.

No new tests. No change in functionality.

* dom/FocusEvent.cpp:
(WebCore::FocusEventDispatchMediator::create):
(WebCore::FocusEventDispatchMediator::FocusEventDispatchMediator):
(WebCore::BlurEventDispatchMediator::create):
(WebCore::BlurEventDispatchMediator::BlurEventDispatchMediator):
(WebCore::FocusInEventDispatchMediator::create):
(WebCore::FocusInEventDispatchMediator::FocusInEventDispatchMediator):
(WebCore::FocusOutEventDispatchMediator::create):
(WebCore::FocusOutEventDispatchMediator::FocusOutEventDispatchMediator):
* dom/FocusEvent.h:
(FocusEventDispatchMediator):
(WebCore::FocusEventDispatchMediator::event):
(BlurEventDispatchMediator):
(WebCore::BlurEventDispatchMediator::event):
(FocusInEventDispatchMediator):
(WebCore::FocusInEventDispatchMediator::event):
(FocusOutEventDispatchMediator):
(WebCore::FocusOutEventDispatchMediator::event):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove Element::ensureAttributeData().
<http://webkit.org/b/109643>

Reviewed by Anders Carlsson.

* dom/Element.h:
* dom/Element.cpp:
(WebCore::Element::classAttributeChanged):
(WebCore::Element::shouldInvalidateDistributionWhenAttributeChanged):

    Use attributeData() instead of ensureAttributeData(), it's already guaranteed to exist in
    both these functions as they are called in response to attribute changes.

* svg/SVGElement.h:
(WebCore::SVGElement::invalidateSVGAttributes):

    Use mutableAttributeData() instead of ensureAttributeData() when invalidating animated
    SVG attributes. While I can't find any bugs caused by this, an element with property animations
    shouldn't share attribute data with other elements.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142714 268f45cc-cd09-0410-ab3c-d52691b4dbfc