X Tutup
Skip to content

feat(DomRenderer): Adding support for document fragments in SVG foreign objects#9458

Merged
vicb merged 1 commit intoangular:masterfrom
gionkunz:feature/xhtml-ns-for-foreignobject-doc-fragments
Jun 27, 2016
Merged

feat(DomRenderer): Adding support for document fragments in SVG foreign objects#9458
vicb merged 1 commit intoangular:masterfrom
gionkunz:feature/xhtml-ns-for-foreignobject-doc-fragments

Conversation

@gionkunz
Copy link
Copy Markdown
Contributor

@gionkunz gionkunz commented Jun 22, 2016

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)
This PR solves the issue described by: #6190
Document fragments within SVG foreign objects can't be created since the renderer continues to use SVG namespace for contained elements.

<svg><foreignObject><div><p>Test</p></div></foreignObject></svg>

This does currently not work because the renderer would try to render the content of the foreignObject element using the SVG namespace.

What is the new behavior?

By added the xhtml namespace explicitly to NAMESPACE_URIS one can now write a document fragment within a foreignObject element by defining the namespace prefix:

<svg><foreignObject><xhtml:div><p>Test</p></xhtml:div></foreignObject></svg>

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

…gn objects

@vicb
Copy link
Copy Markdown
Contributor

vicb commented Jun 22, 2016

Could you please create an issue on https://github.com/angular/angular.io for this to be documented, linking this PR ?

Code LGTM, I'll merge once the issue on angular.io is created. Thanks.

inject(
[TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
tcb.overrideView(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: switch to tcb.overrideTemplate(html)

@gionkunz
Copy link
Copy Markdown
Contributor Author

I've added the issue #6190 in the PR description

@gionkunz
Copy link
Copy Markdown
Contributor Author

@vicb Using overrideTemplate would require to have an initial template property within the MyComp component meta data. It's referenced more than 100 times within this test so I'd rather create an other PR fixing that for all relevant tests. What do you think?

@vicb
Copy link
Copy Markdown
Contributor

vicb commented Jun 23, 2016

Using overrideTemplate would require to have an initial template property within the MyComp...

Yep, no problem

@vicb
Copy link
Copy Markdown
Contributor

vicb commented Jun 23, 2016

Please create an issue on angular.io as requested above

@vicb
Copy link
Copy Markdown
Contributor

vicb commented Jun 27, 2016

Thanks !

/ref angular/angular.io#1756

@vicb vicb merged commit 3644eef into angular:master Jun 27, 2016
@gionkunz
Copy link
Copy Markdown
Contributor Author

You are very welcome Sir! :-) Rock on!

ferhatb pushed a commit to angulardart/angular that referenced this pull request Aug 29, 2016
This is a Dart rewrite of Angular2 PR: angular/angular#9458

Detected while migrated svg component from AngularDart to Angular2

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130939492
ferhatb pushed a commit to angulardart/angular that referenced this pull request Aug 29, 2016
This is a Dart rewrite of Angular2 PR: angular/angular#9458

Detected while migrated svg component from AngularDart to Angular2

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130939492
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup