聚合物中的CSS封装限制及其Shadow DOM(CSS Encapsulation Limitations in Polymer and Its Shadow DOM)
问题
在使用聚合物项目时,我发现他们在Shadow DOM polyfill上的页面有一组已知的限制http://www.polymer-project.org/platform/shadow-dom.html#known-limitations 。
列表的第一个限制是:
研究
在我运行的一些简单测试中,我没有看到任何封装问题。 我有一个jsbin,我一直在测试。 http://jsbin.com/ANeCUv/10/edit 。
为了测试我从聚合物模板里面的样式标签中删除了那个css import语句。 我注意到,即使在上面标题中的样式标记中仍然调用相同的导入,该元素也变得没有样式。 这至少在这种情况下向我展示了封装阻止了jquery-ui.css为我的元素的Shadow DOM设置样式。
我决定更具体地研究这个问题,并在样式指南http://www.polymer-project.org/articles/styling-elements.html的评论中找到了一些参考文献,例如这个参考文献。
我再次使用旧版本的IE测试,并确认css从元素外部引用的样式中流失。
我理解聚合物及其polyfill的设计,是为了使新的Web技术可访问,并允许旧版本的技术支持不受支持的功能或优雅地进行故障转移。 所以我理解这个问题如何被视为Shadow DOM polyfill的限制。
除了支持旧浏览器的这个问题,我还没有找到其他封装问题。 虽然“CSS封装有限”是一个非常通用的标签,如果唯一已知的限制是与旧浏览器不兼容。
概要
除了旧版浏览器中Shadow DOM polyfill支持的不一致之外,还有CSS Encapsulation的其他已知问题?
Issue
In working with the polymer project I found that their page on their Shadow DOM polyfill had a set of known limitations http://www.polymer-project.org/platform/shadow-dom.html#known-limitations.
The first limitation on the list was :
Research
I hadn't seen any encapsulation issues on some of the simple tests I had run. I have one jsbin, I've kept around to test things. http://jsbin.com/ANeCUv/10/edit .
To test I removed that css import statement from my style tag inside of the polymer template. I noted that the element became unstyled even though the same import was still called in the style tag in the above header. This showed me at least in this case the encapsulation prevented the jquery-ui.css from styling the Shadow DOM of my element.
I decided to research the issue more specifically, and found a few references, like this one in the comments of a styling guide http://www.polymer-project.org/articles/styling-elements.html
I tested again with an older version of IE and confirmed that css was bleeding in from styles referenced outside of the element.
I understand the design of polymer and its polyfills, is to make newer web technologies accessible, and allow unsupported features in older browsers to be supported with older techniques or failover gracefully. So I understand how this issue wold be viewed as a limitation of the Shadow DOM polyfill.
Other than this issue with support for older browsers, I have not been able to find other encapsulation issues. Though the "CSS encapsulation is limited" is a very generic label if the only specific known limitation is incompatibility with older browsers.
Summary
Outside of inconsistencies in the Shadow DOM polyfill support in older browsers are their other known issues with CSS Encapsulation?
原文:https://stackoverflow.com/questions/24806213
最满意答案
您可以对UITextField使用
autocorrectionType
。yourTextField.autocorrectionType = UITextAutocorrectionTypeYes;
You can use
autocorrectionType
for UITextField.yourTextField.autocorrectionType = UITextAutocorrectionTypeYes;
相关问答
更多-
UITextField* f = [[UITextField alloc] init]; f.autocorrectionType = UITextAutocorrectionTypeNo; UITextField* f = [[UITextField alloc] init]; f.autocorrectionType = UITextAutocorrectionTypeNo;
-
通过改变3 - > 0.5,您降低了速度,但也降低了可变性(实际上,使所有速度都相同,因为Math.floor(Math.random() * 0.5)始终为零)。 您可能希望增加第一个值: var speed_rand = 0.5 + Math.random() * 2; ^ ^ min time: 0.5 sec variability: add between 0 and 2 sec By ch ...
-
你正在使用双引号(“),这会导致你的问题。 删除双引号和自动完成将很容易:) You are using double quotes (") which is causing you problem. Remove double quotes & auto-complete will work easily :)
-
样式UITextField(Styling UITextField)[2022-10-20]
基于ASKERS FEEDBACK的编辑:我没有意识到你只想在整个文本域中应用一种风格,我认为你想要对各个部分进行设计。 这对你来说更简单,不会给你带来任何麻烦:) var textFormat: TextFormat = new TextFormat("Arial", 12, 0xFF0000); myText.setTextFormat(textFormat); 请注意,这会将样式设置为TextField中的文本,而不一定是您放入的未来文本。因此,在调用setTextFormat之前,请在字段中显示 ... -
Subclass UITextField and overwrite these methods - (void)awakeFromNib{ CGRect frame = self.leftView.frame; frame.size.width = 30; frame.size.height = 30; self.leftView.frame = frame; self.leftView = [[UIImageView alloc]initWithI ...
-
Flaky Eclipse自动完成?(Flaky Eclipse Auto-complete?)[2022-09-06]
是否有某些东西触发某些元素或功能的自动完成开/关? 我刚刚检查过Helio,而且我唯一知道的就是我的头脑,到目前为止,偏好是模板。 您可以使用代码模板触发自动完成并对其进行自定义。 除此之外,我似乎找不到会触发它的php语法列表。 如果你觉得某些元素没有自动完成,那么你可以试试代码模板吗? 您可以尝试将Eclipse中的PHP版本更改为5.3吗? 当我声明类时,代码辅助对我来说只是一种痛苦,我认为它在我声明类之后会做大括号,它没有,它试图在花括号> _>之前添加接口和抽象。 Is there somethi ... -
我已经在UITextInput协议的帮助下解决了我的OP问题: - (BOOL)changeRussianCharactersInRange:(NSRange)range replacementString:(NSString *)string { if ([string isEqualToString:@"1"]) { string = @"0"; [self replaceRange:self.selectedTextRange withText: string] ...
-
UITextField自动换行(UITextField with auto wrapping)[2022-06-03]
使用UITextView要容易得多http://developer.apple.com/library/IOS/#documentation/UIKit/Reference/UITextView_Class/Reference/UITextView.html Use UITextView much easier http://developer.apple.com/library/IOS/#documentation/UIKit/Reference/UITextView_Class/Reference/UI ... -
您可以对UITextField使用autocorrectionType 。 yourTextField.autocorrectionType = UITextAutocorrectionTypeYes; You can use autocorrectionType for UITextField. yourTextField.autocorrectionType = UITextAutocorrectionTypeYes;
-
UITextField自动完成(UITextField autocomplete)[2024-04-25]
您可以通过不在表视图中显示所有1k项目来执行此操作,但是当用户开始在文本字段中键入字母时,您可以填充表格视图。 为此,您必须将所有项目放在某些数据结构或数据库中,您可以使用某些排序或查询来获取与用户输入内容相关的项目。 例如,如果用户开始从'a'键入字母,则获取具有字母a的项目并使用它们填充表格。 执行此操作的一种方法是将所有内容放在数据库和UITextField委托中 - (void)textFieldDidBeginEditing:(UITextField *)textField 启动一个NSTime ...