Bug 80169 - Create a method in Element to compare attributes with other Element
Summary: Create a method in Element to compare attributes with other Element
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Caio Marcelo de Oliveira Filho
URL:
Keywords:
Depends on:
Blocks: 75069
  Show dependency treegraph
 
Reported: 2012-03-02 10:12 PST by Caio Marcelo de Oliveira Filho
Modified: 2012-03-07 19:57 PST (History)
5 users (show)

See Also:


Attachments
Patch (7.68 KB, patch)
2012-03-02 10:18 PST, Caio Marcelo de Oliveira Filho
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Caio Marcelo de Oliveira Filho 2012-03-02 10:12:10 PST
Create a method in Element to compare attributes with other Element
Comment 1 Caio Marcelo de Oliveira Filho 2012-03-02 10:18:19 PST
Created attachment 129918 [details]
Patch
Comment 2 Ryosuke Niwa 2012-03-02 10:26:19 PST
Comment on attachment 129918 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=129918&action=review

> Source/WebCore/dom/Node.cpp:1775
> +    if (isElementNode() && !toElement(this)->hasEquivalentAttributes(toElement(other)))

Maybe we should an inline helper that takes Node* and returns false when its' not an element? That'll avoid having to cast nodes.

> Source/WebCore/editing/htmlediting.cpp:1161
> +    if (!firstElement->tagQName().matches(secondElement->tagQName()))

Can't we do firstElement->hasTagQName(secondElement->tagQName()) ? Maybe this is slower?
Comment 3 Ryosuke Niwa 2012-03-02 10:26:40 PST
This is a very nice refactoring!
Comment 4 Caio Marcelo de Oliveira Filho 2012-03-02 11:02:23 PST
Committed r109585: <http://trac.webkit.org/changeset/109585>
Comment 5 Philippe Normand 2012-03-02 11:33:02 PST
(In reply to comment #4)
> Committed r109585: <http://trac.webkit.org/changeset/109585>

Broke the GTK build :(
Comment 6 Philippe Normand 2012-03-02 11:37:48 PST
(In reply to comment #5)
> (In reply to comment #4)
> > Committed r109585: <http://trac.webkit.org/changeset/109585>
> 
> Broke the GTK build :(

Sorry it seems to be a false alarm, the 64-bit Release bot looks hosed, let's try a full clean build.