Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

XHTML pages with <img ng:src="..." /> fail to load in Opera #7398

@yankee42

Description

@yankee42

Steps zur reproduce

  1. Deliver the page specified as example code below with Content-Type application/xhtml+xml and place an image "red.png" next to it:
  2. See that the image red.png is loaded in Chromium and in Firefox, but not in Opera.

Possible cause

In file booleanAttrs line 392 there is a special treatment for the src property for MSIE. Enabling this special treatment for Opera as well solves the problem.

Not that the spec for the setAttribute method simply says:

If an attribute with that name is already present in the element, its value is changed to be that of the value parameter

It does not mention anything about namespaces.

Looking at the DOM tree in Opera dragonfly reveals that Opera has actually set the src-Property correctly... It just overrode the ng:src property with the expected value.

Example code

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ng="http://angularjs.org">
    <head>
        <script src="https://code.angularjs.org/1.3.0-beta.5/angular.js"></script>
        <script><![CDATA[
            angular.module('myApp', [])
                .controller('MyController', ['$scope', function ($scope) {
                }]);

            angular.element(document).ready(function() {
                angular.bootstrap(document, ['myApp']);
            });
            ]]></script>
  </head>

  <body>
        red.png: <img ng:src="{{'red.png'}}" />
    </body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions