~ubuntu-branches/ubuntu/lucid/webkit/lucid-updates

« back to all changes in this revision

Viewing changes to WebCore/dom/Element.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-01-06 21:25:06 UTC
  • mfrom: (1.2.6 upstream) (4.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100106212506-gd0czn4zrwf1j19l
* New upstream release
- adds basic Content-Encoding support, thanks to soup
  (Closes: #529271)
- fixes over-advertising content types as supported by
  the media player (Closes: #559420)
* debian/control:
- updated libsoup build requirement (>= 2.28.2)
* debian/libwebkit-1.0-2.symbols:
- updated with new symbols
* debian/copyright:
- updated information since 1.1.17
* Imported patch from https://bugs.webkit.org/show_bug.cgi?id=30623
- I am shipping this patch because I believe it is correct, it is the
  way to go, it fixes a race, and it needs testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
    ExceptionCode ec;
137
137
    setAttribute(name, value, ec);
138
138
}
 
139
    
 
140
void Element::setCStringAttribute(const QualifiedName& name, const char* cStringValue)
 
141
{
 
142
    ExceptionCode ec;
 
143
    setAttribute(name, AtomicString(cStringValue), ec);
 
144
}
139
145
 
140
146
void Element::setBooleanAttribute(const QualifiedName& name, bool b)
141
147
{
526
532
 
527
533
    document()->incDOMTreeVersion();
528
534
 
529
 
    if (localName == idAttr.localName())
 
535
    if (localName == idAttributeName().localName())
530
536
        updateId(old ? old->value() : nullAtom, value);
531
537
    
532
538
    if (old && value.isNull())
546
552
    // allocate attributemap if necessary
547
553
    Attribute* old = attributes(false)->getAttributeItem(name);
548
554
 
549
 
    if (name == idAttr)
 
555
    if (name == idAttributeName())
550
556
        updateId(old ? old->value() : nullAtom, value);
551
557
    
552
558
    if (old && value.isNull())
586
592
    } else if (attrName == aria_valuenowAttr) {
587
593
        // If the valuenow attribute changes, AX clients need to be notified.
588
594
        axObjectCache->postNotification(renderer(), AXObjectCache::AXValueChanged, true);
 
595
    } else if (attrName == aria_labelAttr || attrName == aria_labeledbyAttr || attrName == altAttr || attrName == titleAttr) {
 
596
        // If the content of an element changes due to an attribute change, notify accessibility.
 
597
        axObjectCache->contentChanged(renderer());
589
598
    }
590
599
}
591
600
    
601
610
 
602
611
    // If setting the whole map changes the id attribute, we need to call updateId.
603
612
 
604
 
    Attribute* oldId = namedAttrMap ? namedAttrMap->getAttributeItem(idAttr) : 0;
605
 
    Attribute* newId = list ? list->getAttributeItem(idAttr) : 0;
 
613
    const QualifiedName& idName = idAttributeName();
 
614
    Attribute* oldId = namedAttrMap ? namedAttrMap->getAttributeItem(idName) : 0;
 
615
    Attribute* newId = list ? list->getAttributeItem(idName) : 0;
606
616
 
607
617
    if (oldId || newId)
608
618
        updateId(oldId ? oldId->value() : nullAtom, newId ? newId->value() : nullAtom);
707
717
 
708
718
    if (hasID()) {
709
719
        if (NamedNodeMap* attrs = namedAttrMap.get()) {
710
 
            Attribute* idItem = attrs->getAttributeItem(idAttr);
 
720
            Attribute* idItem = attrs->getAttributeItem(idAttributeName());
711
721
            if (idItem && !idItem->isNull())
712
722
                updateId(nullAtom, idItem->value());
713
723
        }
718
728
{
719
729
    if (hasID()) {
720
730
        if (NamedNodeMap* attrs = namedAttrMap.get()) {
721
 
            Attribute* idItem = attrs->getAttributeItem(idAttr);
 
731
            Attribute* idItem = attrs->getAttributeItem(idAttributeName());
722
732
            if (idItem && !idItem->isNull())
723
733
                updateId(idItem->value(), nullAtom);
724
734
        }
1067
1077
        result += s;
1068
1078
    }
1069
1079
          
1070
 
    s = getAttribute(idAttr);
 
1080
    s = getAttribute(idAttributeName());
1071
1081
    if (s.length() > 0) {
1072
1082
        if (result.length() > 0)
1073
1083
            result += "; ";
1426
1436
    return document()->completeURL(deprecatedParseURL(getAttribute(name)));
1427
1437
}
1428
1438
 
 
1439
const QualifiedName& Element::rareIDAttributeName() const
 
1440
{
 
1441
    return rareData()->m_idAttributeName;
 
1442
}
 
1443
 
1429
1444
} // namespace WebCore