Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce VirtualMethods::attribute_mutated() #7452

Merged
merged 4 commits into from Sep 2, 2015

Commits on Aug 30, 2015

  1. Replace many uses of Attr::Value() by Attr::value()

    The later only borrows the attribute, without copying its value as a string.
    nox committed Aug 30, 2015

Commits on Sep 1, 2015

  1. Remove Element::get_attributes()

    nox committed Sep 1, 2015

Commits on Sep 2, 2015

  1. Introduce VirtualMethods::attribute_mutated()

    This replaces before_remove_attr(), after_remove_attr() and after_set_attr().
    The virtual method takes the mutated attribute and an AttributeMutation value
    to disambiguate between "attribute is changed", "attribute is added" and
    "attribute is removed".
    
    In the case of "attribute is changed", the mutation value contains a reference
    to the old value of the mutated attribute, which is used to unregister outdated
    named elements when the "id" attribute is changed on an element.
    
    This greatly simplifies the handling of attributes, which in many cases don't
    have any specific behaviour whether they are removed or changed or added. It
    also fixes a few bugs where things were put in before_remove_attr() instead of
    after_remove_attr() (e.g. when removing an href attribute from a base element).
    
    A few helper functions in Element were also renamed and made private.
    nox committed Sep 2, 2015
You can’t perform that action at this time.